[Tabs] Show tooltip with tab text or content description (if tab is icon only) when long press.

PiperOrigin-RevId: 342411547
This commit is contained in:
connieshi 2020-11-14 06:42:22 -05:00 committed by Connie Shi
parent a12519d009
commit fd3639092e

View File

@ -2876,7 +2876,7 @@ public class TabLayout extends HorizontalScrollView {
}
final CharSequence contentDesc = tab != null ? tab.contentDesc : null;
TooltipCompat.setTooltipText(this, hasText ? null : contentDesc);
TooltipCompat.setTooltipText(this, hasText ? text : contentDesc);
}
private void tryUpdateBadgeDrawableBounds(@NonNull View anchor) {