mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
a11y
This commit is contained in:
parent
f378d46c9a
commit
624541af1c
4 changed files with 5 additions and 12 deletions
|
@ -24,7 +24,6 @@ import android.view.ViewGroup
|
|||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.text.toSpannable
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.transition.ChangeBounds
|
||||
import androidx.transition.Fade
|
||||
import androidx.transition.Transition
|
||||
|
@ -143,16 +142,10 @@ class TextComposerView @JvmOverloads constructor(
|
|||
fun setRoomEncrypted(isEncrypted: Boolean, roomEncryptionTrustLevel: RoomEncryptionTrustLevel?) {
|
||||
if (isEncrypted) {
|
||||
views.composerEditText.setHint(R.string.room_message_placeholder)
|
||||
views.composerShieldImageView.isVisible = true
|
||||
val shieldRes = when (roomEncryptionTrustLevel) {
|
||||
RoomEncryptionTrustLevel.Trusted -> R.drawable.ic_shield_trusted
|
||||
RoomEncryptionTrustLevel.Warning -> R.drawable.ic_shield_warning
|
||||
else -> R.drawable.ic_shield_black
|
||||
}
|
||||
views.composerShieldImageView.setImageResource(shieldRes)
|
||||
views.composerShieldImageView.render(roomEncryptionTrustLevel)
|
||||
} else {
|
||||
views.composerEditText.setHint(R.string.room_message_placeholder)
|
||||
views.composerShieldImageView.isVisible = false
|
||||
views.composerShieldImageView.render(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
android:src="@drawable/ic_attachment"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<ImageView
|
||||
<im.vector.app.core.ui.views.ShieldImageView
|
||||
android:id="@+id/composerShieldImageView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
app:layout_constraintTop_toTopOf="@id/sendButton"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<ImageView
|
||||
<im.vector.app.core.ui.views.ShieldImageView
|
||||
android:id="@+id/composerShieldImageView"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
app:layout_constraintTop_toTopOf="@+id/sendButton"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<ImageView
|
||||
<im.vector.app.core.ui.views.ShieldImageView
|
||||
android:id="@+id/composerShieldImageView"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
|
|
Loading…
Reference in a new issue