MoneyTextView icon indicating copy to clipboard operation
MoneyTextView copied to clipboard

Data binding not supported.

Open maxAman opened this issue 6 years ago • 1 comments

when I am trying to set , app:amount="@{data.totals.subTotal}" then the issue occurs. Please do something

maxAman avatar Jan 22 '18 08:01 maxAman

I think this is not issue. You can custom binding adapter:

object MoneyTextViewBindingAdapter {

    @JvmStatic
    @BindingAdapter(value = ["moneyTextViewValue", "moneyTextViewSymbol"], requireAll = false)
    fun moneyTextViewValue(sender: MoneyTextView, value: Float?, symbol: String?) {
        sender.setAmount(value ?: 0.0f, symbol ?: "")
    }
}

And in layout xml file, use your custom binding adapter instead of library attribute amount:

<org.fabiomsr.moneytextview.MoneyTextView
    moneyTextViewSymbol="@{ presenter.defaultCurrency.symbol_native }"
    moneyTextViewValue="@{ safeUnbox(viewModel.thisMonthExpensed) }"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

dphans avatar Dec 21 '19 06:12 dphans