This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindingAdapter( | |
value = [ | |
"itemList", | |
"itemLayoutId", | |
"viewModel" | |
], | |
requireAll = false | |
) | |
fun RecyclerView.bindRecyclerView( | |
itemList: List<Nothing>?, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AdapterBuilder<ModelType>( | |
private val itemList: List<ModelType>, | |
private val layoutId: Int, | |
private val viewModel: ViewModel? | |
) { | |
fun build(): BaseRecyclerAdapter<ModelType> { | |
val baseAdapter = BaseRecyclerAdapter(itemList, layoutId, viewModel) | |
baseAdapter.updateData(itemList) | |
return baseAdapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun ParallaxScreen(modifier: Modifier = Modifier) { | |
val context = LocalContext.current | |
val scope = rememberCoroutineScope() | |
var data by remember { mutableStateOf<SensorData?>(null) } | |
DisposableEffect(Unit) { | |
val dataManager = SensorDataManager(context) | |
dataManager.init() |