File tree 2 files changed +5
-2
lines changed
lib/java/com/google/android/material/snackbar
tests/javatests/com/google/android/material/snackbar
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -388,8 +388,6 @@ protected BaseTransientBottomBar(
388
388
389
389
view .setAccessibilityLiveRegion (View .ACCESSIBILITY_LIVE_REGION_POLITE );
390
390
view .setImportantForAccessibility (View .IMPORTANT_FOR_ACCESSIBILITY_YES );
391
- ViewCompat .setAccessibilityPaneTitle (
392
- view , getContext ().getString (R .string .snackbar_accessibility_pane_title ));
393
391
394
392
// Make sure that we fit system windows and have a listener to apply any insets
395
393
view .setFitsSystemWindows (true );
@@ -831,6 +829,10 @@ void onLayoutChange() {
831
829
}
832
830
833
831
private void showViewImpl () {
832
+ if (ViewCompat .getAccessibilityPaneTitle (view ) == null ) {
833
+ ViewCompat .setAccessibilityPaneTitle (
834
+ view , getContext ().getString (R .string .snackbar_accessibility_pane_title ));
835
+ }
834
836
if (shouldAnimate ()) {
835
837
// If animations are enabled, animate it in
836
838
animateViewIn ();
Original file line number Diff line number Diff line change @@ -405,6 +405,7 @@ public void testAccessibilityPaneTitle() throws Throwable {
405
405
final Snackbar snackbar =
406
406
Snackbar .make (coordinatorLayout , MESSAGE_TEXT , Snackbar .LENGTH_INDEFINITE )
407
407
.setAction (ACTION_TEXT , mock (View .OnClickListener .class ));
408
+ SnackbarUtils .showTransientBottomBarAndWaitUntilFullyShown (snackbar );
408
409
assertEquals (
409
410
snackbar .getContext ().getString (R .string .snackbar_accessibility_pane_title ),
410
411
ViewCompat .getAccessibilityPaneTitle (snackbar .getView ()).toString ());
You can’t perform that action at this time.
0 commit comments