mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 19:36:08 +03:00
Call: a11y
This commit is contained in:
parent
16f32da647
commit
c15cc34bfd
4 changed files with 29 additions and 3 deletions
|
@ -39,8 +39,10 @@ class CallControlsView @JvmOverloads constructor(
|
|||
|
||||
@BindView(R.id.ringingControls)
|
||||
lateinit var ringingControls: ViewGroup
|
||||
|
||||
@BindView(R.id.iv_icr_accept_call)
|
||||
lateinit var ringingControlAccept: ImageView
|
||||
|
||||
@BindView(R.id.iv_icr_end_call)
|
||||
lateinit var ringingControlDecline: ImageView
|
||||
|
||||
|
@ -96,8 +98,20 @@ class CallControlsView @JvmOverloads constructor(
|
|||
|
||||
fun updateForState(state: VectorCallViewState) {
|
||||
val callState = state.callState.invoke()
|
||||
muteIcon.setImageResource(if (state.isAudioMuted) R.drawable.ic_microphone_off else R.drawable.ic_microphone_on)
|
||||
videoToggleIcon.setImageResource(if (state.isVideoEnabled) R.drawable.ic_video else R.drawable.ic_video_off)
|
||||
if (state.isAudioMuted) {
|
||||
muteIcon.setImageResource(R.drawable.ic_microphone_off)
|
||||
muteIcon.contentDescription = resources.getString(R.string.a11y_unmute_microphone)
|
||||
} else {
|
||||
muteIcon.setImageResource(R.drawable.ic_microphone_on)
|
||||
muteIcon.contentDescription = resources.getString(R.string.a11y_mute_microphone)
|
||||
}
|
||||
if (state.isVideoEnabled) {
|
||||
videoToggleIcon.setImageResource(R.drawable.ic_video)
|
||||
videoToggleIcon.contentDescription = resources.getString(R.string.a11y_stop_camera)
|
||||
} else {
|
||||
videoToggleIcon.setImageResource(R.drawable.ic_video_off)
|
||||
videoToggleIcon.contentDescription = resources.getString(R.string.a11y_start_camera)
|
||||
}
|
||||
|
||||
when (callState) {
|
||||
is CallState.Idle,
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
android:layout_width="128dp"
|
||||
android:layout_height="128dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/avatar"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
tools:background="@color/password_strength_bar_ok"
|
||||
tools:visibility="visible">
|
||||
|
||||
<!-- TODO a11y -->
|
||||
<ImageView
|
||||
android:id="@+id/iv_icr_accept_call"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:background="@drawable/oval_positive"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/call_notification_answer"
|
||||
android:focusable="true"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_call"
|
||||
|
@ -32,6 +32,7 @@
|
|||
android:layout_height="64dp"
|
||||
android:background="@drawable/oval_destructive"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/call_notification_reject"
|
||||
android:focusable="true"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_call_end"
|
||||
|
@ -63,6 +64,7 @@
|
|||
android:layout_height="44dp"
|
||||
android:background="@drawable/oval_positive"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/a11y_open_chat"
|
||||
android:focusable="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/ic_home_bottom_chat"
|
||||
|
@ -81,6 +83,7 @@
|
|||
android:src="@drawable/ic_microphone_off"
|
||||
android:tint="?attr/riotx_text_primary"
|
||||
app:backgroundTint="?attr/riotx_background"
|
||||
tools:contentDescription="@string/a11y_mute_microphone"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:src="@drawable/ic_microphone_on" />
|
||||
|
||||
|
@ -90,6 +93,7 @@
|
|||
android:layout_height="64dp"
|
||||
android:background="@drawable/oval_destructive"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/call_notification_hangup"
|
||||
android:focusable="true"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_call_end"
|
||||
|
@ -107,6 +111,7 @@
|
|||
android:src="@drawable/ic_call_videocam_off_default"
|
||||
android:tint="?attr/riotx_text_primary"
|
||||
app:backgroundTint="?attr/riotx_background"
|
||||
tools:contentDescription="@string/a11y_stop_camera"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<ImageView
|
||||
|
@ -115,6 +120,7 @@
|
|||
android:layout_height="44dp"
|
||||
android:background="@drawable/oval_positive"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/settings"
|
||||
android:focusable="true"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_more_vertical"
|
||||
|
|
|
@ -2471,5 +2471,10 @@ Not all features in Riot are implemented in RiotX yet. Main missing (and coming
|
|||
<string name="identity_server_set_alternative_notice_no_default">Enter the URL of an identity server</string>
|
||||
<string name="identity_server_set_alternative_submit">Submit</string>
|
||||
<string name="power_level_edit_title">Set role</string>
|
||||
<string name="a11y_open_chat">Open chat</string>
|
||||
<string name="a11y_mute_microphone">Mute the microphone</string>
|
||||
<string name="a11y_unmute_microphone">Unmute the microphone</string>
|
||||
<string name="a11y_stop_camera">Stop the camera</string>
|
||||
<string name="a11y_start_camera">Start the camera</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue