Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
fix tab layout horizontal paddings
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Sep 4, 2023
1 parent ebbd56e commit 4975bde
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,9 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
child.getLayoutParams().height);

int childWidthMeasureSpec =
MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY);
MeasureSpec.makeMeasureSpec(
getMeasuredWidth() - getPaddingLeft() - getPaddingRight(),
MeasureSpec.EXACTLY);
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
}
}
Expand Down
3 changes: 3 additions & 0 deletions mastodon/src/main/res/layout/fragment_discover.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<org.joinmastodon.android.ui.tabs.TabLayout
android:id="@+id/tabbar"
android:layout_width="match_parent"
Expand All @@ -56,6 +57,8 @@
app:tabIndicatorFullWidth="false"
app:tabMinWidth="90dp"
app:tabMode="scrollable"
android:clipToPadding="false"
android:paddingHorizontal="4dp"
android:background="?colorM3Surface"/>

<View
Expand Down
3 changes: 2 additions & 1 deletion mastodon/src/main/res/layout/fragment_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,12 @@
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/bg_onboarding_panel"
android:clipToPadding="false"
android:paddingHorizontal="4dp"
app:tabGravity="start"
app:tabIndicator="@drawable/tab_indicator_m3"
app:tabIndicatorAnimationMode="elastic"
app:tabIndicatorColor="?colorM3Primary"
android:paddingHorizontal="4dp"
app:tabIndicatorFullWidth="false"
app:tabMinWidth="0dp"
app:tabMode="scrollable" />
Expand Down

0 comments on commit 4975bde

Please sign in to comment.