Can Korkmaz
08/03/2022, 2:33 PMInside fragment::
transferWithdrawViewModel.asset.observe {
amountInput.setMaxNumberOfDecimalDigits(it.precision.toInt()) **this line
}
AndroidView(
modifier = modifier,
factory = { ctx ->
// Creates custom view
CurrencyEditText(ctx, null).apply {
Adam Powell
08/03/2022, 2:53 PMval asset by transferWithdrawViewModel.observeAsState()
AndroidView(
// ...
factory = { context ->
CurrencyEditText(context)
}
) { view ->
// update block - this observes `asset` and runs when it changes
view.setMaxNumberOfDecimalDigits(asset.precision.toInt())
}
Can Korkmaz
08/03/2022, 3:00 PM