Created
May 14, 2020 20:20
-
-
Save nicoqueijo/156325c09b2200a8c685806f626987fa to your computer and use it in GitHub Desktop.
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 CurrencyRow(context: Context?, attrs: AttributeSet? = null) : | |
ConstraintLayout(context, attrs) { | |
val currencyFlag: ImageView | |
val currencyCode: TextView | |
val currencyName: TextView | |
init { | |
LayoutInflater.from(context).inflate(R.layout.row_currency, this) | |
currencyFlag = findViewById(R.id.currency_flag) | |
currencyCode = findViewById(R.id.currency_code) | |
currencyName = findViewById(R.id.currency_name) | |
} | |
fun initRow(currency: Currency) { | |
currencyFlag.setImageResource(currency.currencyFlag) | |
currencyCode.text = currency.currencyCode | |
currencyName.text = currency.currencyName | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment