mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
am cb0c34a1: am 8b85eb65: am 5cb08b09: am 6fff1f92: Merge "Fix TabLayout when used in a HorizontalScrollView" into lmp-mr1-ub-dev
* commit 'cb0c34a19b62e9ea71ce02e36a69903f700fd510': Fix TabLayout when used in a HorizontalScrollView GitOrigin-RevId=292f0c7594a6ac1fc906dc0ccbf3e2bda30b00a8 PiperOrigin-RevId: 140549050
This commit is contained in:
parent
c21e7adaf9
commit
f0806600d1
@ -199,7 +199,7 @@ public class TabLayout extends HorizontalScrollView {
|
||||
private final int mTabBackgroundResId;
|
||||
|
||||
private final int mTabMinWidth;
|
||||
private int mTabMaxWidth;
|
||||
private int mTabMaxWidth = Integer.MAX_VALUE;
|
||||
private final int mRequestedTabMaxWidth;
|
||||
|
||||
private int mContentInsetStart;
|
||||
@ -740,7 +740,12 @@ public class TabLayout extends HorizontalScrollView {
|
||||
// If the request tab max width is 0, or larger than our default, use the default
|
||||
maxTabWidth = defaultTabMaxWidth;
|
||||
}
|
||||
mTabMaxWidth = maxTabWidth;
|
||||
|
||||
if (mTabMaxWidth != maxTabWidth) {
|
||||
// If the tab max width has changed, re-measure
|
||||
mTabMaxWidth = maxTabWidth;
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeTabViewAt(int position) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user