File tree 1 file changed +7
-2
lines changed
lib/java/com/google/android/material/button
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -387,13 +387,17 @@ public void setSingleSelection(boolean singleSelection) {
387
387
}
388
388
389
389
private void updateChildrenA11yClassName () {
390
+ String className = getChildrenA11yClassName ();
390
391
for (int i = 0 ; i < getChildCount (); i ++) {
391
- String className =
392
- singleSelection ? RadioButton .class .getName () : ToggleButton .class .getName ();
393
392
getChildButton (i ).setA11yClassName (className );
394
393
}
395
394
}
396
395
396
+ @ NonNull
397
+ private String getChildrenA11yClassName () {
398
+ return singleSelection ? RadioButton .class .getName () : ToggleButton .class .getName ();
399
+ }
400
+
397
401
/**
398
402
* Sets whether we prevent all child buttons from being deselected.
399
403
*
@@ -517,6 +521,7 @@ private void setupButtonChild(@NonNull MaterialButton buttonChild) {
517
521
buttonChild .setMaxLines (1 );
518
522
buttonChild .setEllipsize (TruncateAt .END );
519
523
buttonChild .setCheckable (true );
524
+ buttonChild .setA11yClassName (getChildrenA11yClassName ());
520
525
521
526
// Enables surface layer drawing for semi-opaque strokes
522
527
buttonChild .setShouldDrawSurfaceColorStroke (true );
You can’t perform that action at this time.
0 commit comments