diff --git a/app/src/main/java/org/mozilla/fenix/quickactionsheet/QuickActionSheet.kt b/app/src/main/java/org/mozilla/fenix/quickactionsheet/QuickActionSheet.kt index f08ea8c56..b20f9e42b 100644 --- a/app/src/main/java/org/mozilla/fenix/quickactionsheet/QuickActionSheet.kt +++ b/app/src/main/java/org/mozilla/fenix/quickactionsheet/QuickActionSheet.kt @@ -40,6 +40,18 @@ class QuickActionSheet @JvmOverloads constructor( val handle = findViewById(R.id.quick_action_sheet_handle) val linearLayout = findViewById(R.id.quick_action_sheet) val quickActionSheetBehavior = BottomSheetBehavior.from(linearLayout.parent as View) as QuickActionSheetBehavior + val accessibilityManager = context + .getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager + + if (accessibilityManager.isTouchExplorationEnabled) { + linearLayout.setOnClickListener { + quickActionSheetBehavior.state = when (quickActionSheetBehavior.state) { + BottomSheetBehavior.STATE_EXPANDED -> BottomSheetBehavior.STATE_COLLAPSED + else -> BottomSheetBehavior.STATE_EXPANDED + } + } + return + } handle.increaseTapArea(grabHandleIncreasedTapArea) handle.setOnClickListener { @@ -113,14 +125,6 @@ class QuickActionSheetBehavior( } private fun repositionQuickActionSheet(quickActionSheetContainer: NestedScrollView, toolbar: BrowserToolbar) { - val accessibilityManager = quickActionSheetContainer.context - .getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager - - state = when (accessibilityManager.isTouchExplorationEnabled) { - true -> BottomSheetBehavior.STATE_EXPANDED - false -> BottomSheetBehavior.STATE_COLLAPSED - } - quickActionSheetContainer.translationY = (toolbar.translationY + toolbar.height * -1.0).toFloat() } } diff --git a/app/src/main/res/layout/layout_quick_action_sheet.xml b/app/src/main/res/layout/layout_quick_action_sheet.xml index 6a15349c9..48d783374 100644 --- a/app/src/main/res/layout/layout_quick_action_sheet.xml +++ b/app/src/main/res/layout/layout_quick_action_sheet.xml @@ -9,6 +9,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" + android:contentDescription="@string/quick_action_sheet" android:background="?attr/toolbarColor"> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ac44cc8c..18ea1895c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -159,6 +159,10 @@ Favorite Read + + Quick action sheet + + Quick action sheet handle