Code review
This commit is contained in:
parent
c35d854776
commit
1deacfbb34
|
@ -167,16 +167,12 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||||
if (isEncrypted) {
|
if (isEncrypted) {
|
||||||
composerEditText.setHint(R.string.room_message_placeholder_encrypted)
|
composerEditText.setHint(R.string.room_message_placeholder_encrypted)
|
||||||
composerShieldImageView.isVisible = true
|
composerShieldImageView.isVisible = true
|
||||||
val shield = when (roomEncryptionTrustLevel) {
|
val shieldRes = when (roomEncryptionTrustLevel) {
|
||||||
RoomEncryptionTrustLevel.Trusted -> {
|
RoomEncryptionTrustLevel.Trusted -> R.drawable.ic_shield_trusted
|
||||||
ContextCompat.getDrawable(context, R.drawable.ic_shield_trusted)
|
RoomEncryptionTrustLevel.Warning -> R.drawable.ic_shield_warning
|
||||||
}
|
else -> R.drawable.ic_shield_black
|
||||||
RoomEncryptionTrustLevel.Warning -> {
|
|
||||||
ContextCompat.getDrawable(context, R.drawable.ic_shield_warning)
|
|
||||||
}
|
|
||||||
else -> ContextCompat.getDrawable(context, R.drawable.ic_shield_black)
|
|
||||||
}
|
}
|
||||||
composerShieldImageView.setImageDrawable(shield)
|
composerShieldImageView.setImageDrawable(ContextCompat.getDrawable(context, shieldRes))
|
||||||
} else {
|
} else {
|
||||||
composerEditText.setHint(R.string.room_message_placeholder_not_encrypted)
|
composerEditText.setHint(R.string.room_message_placeholder_not_encrypted)
|
||||||
composerShieldImageView.isVisible = false
|
composerShieldImageView.isVisible = false
|
||||||
|
|
Loading…
Reference in New Issue