Skip to content

Commit b200a3b

Browse files
wcshihunterstich
authored andcommitted
Hardcode classname used to set accessibility item type to avoid being proguarded.
PiperOrigin-RevId: 281120646
1 parent 2eb666a commit b200a3b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/java/com/google/android/material/tabs/TabLayout.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
import androidx.core.view.PointerIconCompat;
6565
import androidx.core.view.ViewCompat;
6666
import androidx.core.widget.TextViewCompat;
67-
import androidx.appcompat.app.ActionBar;
6867
import androidx.appcompat.content.res.AppCompatResources;
6968
import androidx.appcompat.widget.TooltipCompat;
7069
import android.text.Layout;
@@ -198,6 +197,8 @@ public class TabLayout extends HorizontalScrollView {
198197

199198
private static final Pools.Pool<Tab> tabPool = new Pools.SynchronizedPool<>(16);
200199

200+
private static final String ACCESSIBILITY_CLASS_NAME = "androidx.appcompat.app.ActionBar.Tab";
201+
201202
/**
202203
* Scrollable tabs display a subset of tabs at any given moment, and can contain longer tab labels
203204
* and a larger number of tabs. They are best used for browsing contexts in touch interfaces when
@@ -2341,15 +2342,15 @@ public void setSelected(final boolean selected) {
23412342
public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
23422343
super.onInitializeAccessibilityEvent(event);
23432344
// This view masquerades as an action bar tab.
2344-
event.setClassName(ActionBar.Tab.class.getName());
2345+
event.setClassName(ACCESSIBILITY_CLASS_NAME);
23452346
}
23462347

23472348
@TargetApi(14)
23482349
@Override
23492350
public void onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
23502351
super.onInitializeAccessibilityNodeInfo(info);
23512352
// This view masquerades as an action bar tab.
2352-
info.setClassName(ActionBar.Tab.class.getName());
2353+
info.setClassName(ACCESSIBILITY_CLASS_NAME);
23532354
if (badgeDrawable != null && badgeDrawable.isVisible()) {
23542355
CharSequence customContentDescription = getContentDescription();
23552356
info.setContentDescription(

0 commit comments

Comments
 (0)