[Ally] Fixing lobby view component focus (#1053)

This commit is contained in:
Mohtasim 2024-07-25 13:27:26 -07:00 коммит произвёл GitHub
Родитель 143969c99f
Коммит b69ce746a2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 17 добавлений и 17 удалений

Просмотреть файл

@ -8,11 +8,9 @@ import android.util.AttributeSet
import android.view.View
import android.widget.ImageButton
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.ViewCompat
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.azure.android.communication.ui.calling.implementation.R
import com.azure.android.communication.ui.calling.utilities.isAndroidTV
import com.microsoft.fluentui.widget.Button
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
@ -54,16 +52,6 @@ internal class LobbyHeaderView : ConstraintLayout {
viewLifecycleOwner.lifecycleScope.launch {
lobbyHeaderViewModel.getDisplayLobbyHeaderFlow().collect {
lobbyHeaderView.visibility = if (it) View.VISIBLE else View.GONE
// If we are on television, set the focus to the participants button
if (it && isAndroidTV(context)) {
headerLayout.requestFocus()
}
if (it) {
ViewCompat.setImportantForAccessibility(headerLayout, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS)
} else {
ViewCompat.setImportantForAccessibility(headerLayout, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES)
}
}
}
}

Просмотреть файл

@ -2,20 +2,22 @@
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
-->
<com.azure.android.communication.ui.calling.presentation.fragment.calling.lobby.LobbyHeaderView xmlns:android="http://schemas.android.com/apk/res/android"
<com.azure.android.communication.ui.calling.presentation.fragment.calling.lobby.LobbyHeaderView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/azure_communication_ui_calling_lobby_header"
android:importantForAccessibility="yes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:accessibilityTraversalAfter="@id/azure_communication_ui_call_floating_header"
android:alpha="0.8"
android:background="@drawable/azure_communication_ui_calling_corner_radius_rectangle_6dp_floating_header"
android:focusable="true"
android:importantForAccessibility="yes"
android:visibility="gone"
android:focusable="true"
android:focusableInTouchMode="true"
android:accessibilityTraversalAfter="@id/azure_communication_ui_call_floating_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/azure_communication_ui_call_floating_header"
@ -29,7 +31,9 @@
android:layout_marginBottom="12dp"
android:layout_marginStart="12dp"
android:contentDescription="@string/azure_communication_ui_calling_lobby_header_icon_content_description"
android:importantForAccessibility="no"
android:importantForAccessibility="yes"
android:focusable="true"
android:focusableInTouchMode="true"
app:srcCompat="@drawable/azure_communication_ui_calling_ic_fluent_lobby_header_24"
app:tint="@color/azure_communication_ui_calling_color_white"
app:layout_constraintBottom_toBottomOf="parent"
@ -46,6 +50,9 @@
android:fontFamily="sans-serif-medium"
app:layout_constraintHorizontal_bias="0.0"
android:text="@string/azure_communication_ui_calling_lobby_header_text"
android:importantForAccessibility="yes"
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/azure_communication_ui_calling_color_white"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
@ -63,12 +70,14 @@
android:layout_marginEnd="12dp"
android:backgroundTint="@color/azure_communication_ui_calling_primary_selector"
android:focusable="true"
android:importantForAccessibility="yes"
android:gravity="center"
android:text="@string/azure_communication_ui_calling_lobby_header_view_participant_button"
android:alpha="1"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/azure_communication_ui_calling_color_white"
android:focusableInTouchMode="true"
app:backgroundTint="@color/azure_communication_ui_calling_primary_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/azure_communication_ui_calling_lobby_close_button"
@ -83,6 +92,9 @@
android:layout_marginEnd="12dp"
android:backgroundTint="@color/azure_communication_ui_calling_color_button_background_transparent"
android:contentDescription="@string/azure_communication_ui_calling_lobby_header_close_description"
android:importantForAccessibility="yes"
android:focusable="true"
android:focusableInTouchMode="true"
app:srcCompat="@drawable/azure_communication_ui_calling_leave_confirm_dismiss_header_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"