Skip to content

Commit 95025c6

Browse files
Material Design Teamimhappi
authored andcommitted
[BottomSheet] Remove disruptive announcement "Drag handle double tapped"for BottomSheetDragHandleView.
PiperOrigin-RevId: 708956357
1 parent a7ff8c9 commit 95025c6

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

lib/java/com/google/android/material/bottomsheet/BottomSheetDragHandleView.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import androidx.coordinatorlayout.widget.CoordinatorLayout;
3636
import androidx.core.view.AccessibilityDelegateCompat;
3737
import androidx.core.view.ViewCompat;
38-
import androidx.core.view.accessibility.AccessibilityEventCompat;
3938
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat;
4039
import com.google.android.material.bottomsheet.BottomSheetBehavior.BottomSheetCallback;
4140

@@ -63,8 +62,6 @@ public class BottomSheetDragHandleView extends AppCompatImageView
6362
getResources().getString(R.string.bottomsheet_action_expand);
6463
private final String clickToCollapseActionLabel =
6564
getResources().getString(R.string.bottomsheet_action_collapse);
66-
private final String clickFeedback =
67-
getResources().getString(R.string.bottomsheet_drag_handle_clicked);
6865

6966
private final BottomSheetCallback bottomSheetCallback =
7067
new BottomSheetCallback() {
@@ -185,7 +182,6 @@ private boolean expandOrCollapseBottomSheetIfPossible() {
185182
if (!interactable) {
186183
return false;
187184
}
188-
announceAccessibilityEvent(clickFeedback);
189185
boolean canHalfExpand =
190186
!bottomSheetBehavior.isFitToContents()
191187
&& !bottomSheetBehavior.shouldSkipHalfExpandedStateWhenDragging();
@@ -209,16 +205,6 @@ private boolean expandOrCollapseBottomSheetIfPossible() {
209205
return true;
210206
}
211207

212-
private void announceAccessibilityEvent(String announcement) {
213-
if (accessibilityManager == null) {
214-
return;
215-
}
216-
AccessibilityEvent announce =
217-
AccessibilityEvent.obtain(AccessibilityEventCompat.TYPE_ANNOUNCEMENT);
218-
announce.getText().add(announcement);
219-
accessibilityManager.sendAccessibilityEvent(announce);
220-
}
221-
222208
/**
223209
* Finds the first ancestor associated with a {@link BottomSheetBehavior}. If none is found,
224210
* returns {@code null}.

lib/java/com/google/android/material/bottomsheet/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
<string description="The content description of bottom sheet drag handles [CHAR LIMIT=NONE]" name="bottomsheet_drag_handle_content_description">Drag handle</string>
2424
<string description="A description of an accessibility action to expand the bottom sheet [CHAR LIMIT=NONE]" name="bottomsheet_action_expand">Expand the bottom sheet</string>
2525
<string description="A description of an accessibility action to collapse the bottom sheet [CHAR LIMIT=NONE]" name="bottomsheet_action_collapse">Collapse the bottom sheet</string>
26-
<string description="An accessibility feedback when the bottom sheet drag handle is clicked [CHAR LIMIT=NONE]" name="bottomsheet_drag_handle_clicked">Drag handle double-tapped</string>
2726
</resources>

0 commit comments

Comments
 (0)