From 4975bde76feac5b8a995abc4e69ffd185551860b Mon Sep 17 00:00:00 2001 From: sk Date: Mon, 4 Sep 2023 23:33:35 +0200 Subject: [PATCH] fix tab layout horizontal paddings --- .../main/java/org/joinmastodon/android/ui/tabs/TabLayout.java | 4 +++- mastodon/src/main/res/layout/fragment_discover.xml | 3 +++ mastodon/src/main/res/layout/fragment_profile.xml | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/tabs/TabLayout.java b/mastodon/src/main/java/org/joinmastodon/android/ui/tabs/TabLayout.java index 1528f0ea4..0912b60c5 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/tabs/TabLayout.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/tabs/TabLayout.java @@ -1715,7 +1715,9 @@ public class TabLayout extends HorizontalScrollView implements CustomViewHelper{ child.getLayoutParams().height); int childWidthMeasureSpec = - MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY); + MeasureSpec.makeMeasureSpec( + getMeasuredWidth() - getPaddingLeft() - getPaddingRight(), + MeasureSpec.EXACTLY); child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } } diff --git a/mastodon/src/main/res/layout/fragment_discover.xml b/mastodon/src/main/res/layout/fragment_discover.xml index 4b4d8ae66..2b4d7c31c 100644 --- a/mastodon/src/main/res/layout/fragment_discover.xml +++ b/mastodon/src/main/res/layout/fragment_discover.xml @@ -45,6 +45,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> +