minor code style update

This commit is contained in:
Tibor Kaputa 2022-05-21 22:24:18 +02:00 committed by GitHub
parent 6a18f86ac7
commit 02e9040cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -521,12 +521,13 @@ class EditContactActivity : ContactActivity() {
val toggleIcon = contact_numbers_holder.getChildAt(i).default_toggle_icon val toggleIcon = contact_numbers_holder.getChildAt(i).default_toggle_icon
val isPrimary = toggleIcon.tag == 1 val isPrimary = toggleIcon.tag == 1
val drawable = if (isPrimary) { val drawableId = if (isPrimary) {
ContextCompat.getDrawable(this@EditContactActivity, R.drawable.ic_star_vector) R.drawable.ic_star_vector
} else { } else {
ContextCompat.getDrawable(this@EditContactActivity, R.drawable.ic_star_outline_vector) R.drawable.ic_star_outline_vector
} }
val drawable = ContextCompat.getDrawable(this@EditContactActivity, drawableId)
drawable?.apply { drawable?.apply {
mutate() mutate()
setTint(getProperTextColor()) setTint(getProperTextColor())
@ -1230,9 +1231,7 @@ class EditContactActivity : ContactActivity() {
numberHolder.contact_number.requestFocus() numberHolder.contact_number.requestFocus()
showKeyboard(numberHolder.contact_number) showKeyboard(numberHolder.contact_number)
} }
numberHolder.default_toggle_icon.apply { numberHolder.default_toggle_icon.tag = 0
tag = 0
}
initNumberHolders() initNumberHolders()
} }