hello everyone, im new to kotlin and android dev i...
# anko
p
hello everyone, im new to kotlin and android dev in general Im trying to pass some information to a view while creating it and figured it out this approach, but it seems akward, is ok to do things in this way?
CheckBalanceView("myval").setContentView(this)
Copy code
class CheckBalanceView(balance: String) : AnkoComponent<CheckBalanceActivity> {
    val balance = balance
    override fun createView(ui: AnkoContext<CheckBalanceActivity>): View =
            with(ui) {
                verticalLayout {
                    lparams(width = matchParent, height = matchParent)

                    textView {
                        id = R.id.balanceAmountTextView
                        text = balance
                    }.lparams(width = matchParent, height = wrapContent)
                }
            }
}