[fenix] Fixes https://github.com/mozilla-mobile/fenix/issues/1186: Made quick actions sheet's handle larger.

It now takes up the entire horizontal space and all the vertical space
until the buttons. This gives a bigger touch target both for typical
users and TalkBack users when they use explore-by-touch.

Also changed content description. The content description should not
include semantic names like "handle". The screen reader already knows
it's a button and describes it as such. Same thing with "sheet".
pull/600/head
Eitan Isaacson 5 years ago committed by Sawyer Blatz
parent 267661fc73
commit 8d2e3993e7

@ -17,7 +17,6 @@ import org.mozilla.fenix.R
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.view.accessibility.AccessibilityManager import android.view.accessibility.AccessibilityManager
import androidx.interpolator.view.animation.FastOutSlowInInterpolator import androidx.interpolator.view.animation.FastOutSlowInInterpolator
import org.mozilla.fenix.ext.increaseTapArea
import org.mozilla.fenix.utils.Settings import org.mozilla.fenix.utils.Settings
class QuickActionSheet @JvmOverloads constructor( class QuickActionSheet @JvmOverloads constructor(
@ -53,7 +52,6 @@ class QuickActionSheet @JvmOverloads constructor(
return return
} }
handle.increaseTapArea(grabHandleIncreasedTapArea)
handle.setOnClickListener { handle.setOnClickListener {
bounceSheet(quickActionSheetBehavior) bounceSheet(quickActionSheetBehavior)
} }
@ -90,7 +88,6 @@ class QuickActionSheet @JvmOverloads constructor(
} }
companion object { companion object {
const val grabHandleIncreasedTapArea = 50
const val demoBounceAnimationLength = 600L const val demoBounceAnimationLength = 600L
const val bounceAnimationLength = 400L const val bounceAnimationLength = 400L
const val demoBounceAnimationPeekHeightMultiplier = 4.5f const val demoBounceAnimationPeekHeightMultiplier = 4.5f

@ -2,10 +2,11 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<shape <inset xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:insetBottom="10dp">
xmlns:android="http://schemas.android.com/apk/res/android"> <shape android:shape="rectangle">
<corners android:radius="2dp"/> <corners android:radius="2dp"/>
<size android:height="2dp" android:width="24dp" /> <size android:height="2dp" android:width="24dp" />
<solid android:color="#2915141A" /> <solid android:color="#5215141A" />
</shape> </shape>
</inset>

@ -14,12 +14,10 @@
<androidx.appcompat.widget.AppCompatImageButton <androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/quick_action_sheet_handle" android:id="@+id/quick_action_sheet_handle"
android:layout_marginBottom="10dp" android:layout_width="match_parent"
android:layout_width="24dp" android:layout_height="12dp"
android:layout_height="2dp"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/quick_action_sheet_handle" android:contentDescription="@string/quick_action_sheet_handle"
android:background="?attr/quickActionPullTabColor" android:background="@null"
android:src="@drawable/ic_drawer_pull_tab"/> android:src="@drawable/ic_drawer_pull_tab"/>
<LinearLayout <LinearLayout

@ -176,7 +176,7 @@
<!-- Content description (not visible, for screen readers etc.): Quick action sheet--> <!-- Content description (not visible, for screen readers etc.): Quick action sheet-->
<string name="quick_action_sheet">Quick action sheet</string> <string name="quick_action_sheet">Quick action sheet</string>
<!-- Content description (not visible, for screen readers etc.): Quick action sheet handle --> <!-- Content description (not visible, for screen readers etc.): Quick action sheet handle -->
<string name="quick_action_sheet_handle">Quick action sheet handle</string> <string name="quick_action_sheet_handle">Quick actions</string>
<!-- Library --> <!-- Library -->
<!-- Option in Library to open Sessions page --> <!-- Option in Library to open Sessions page -->

Loading…
Cancel
Save