reduce height of bottom bar (#4912)

back to what it was in Tusky 27

Api 29 before / after

<img
src="https://github.com/user-attachments/assets/e624b964-8bc5-41b0-b247-b5df082d67e1"
width="280" /> <img
src="https://github.com/user-attachments/assets/7696bacd-5d2d-42b2-aff4-e6fa46e8a35d"
width="280" />


Api 35 before / after

<img
src="https://github.com/user-attachments/assets/232d96d6-1bf5-45d9-92dd-b825abb26a04"
width="280" /> <img
src="https://github.com/user-attachments/assets/8f9567dc-9f07-4560-b514-5f5230e4880a"
width="280" />
This commit is contained in:
Konrad Pozniak 2025-02-11 17:24:24 +01:00 committed by GitHub
commit 1b0e396c4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 5 deletions

View file

@ -38,6 +38,7 @@ import android.view.MenuInflater
import android.view.MenuItem
import android.view.MenuItem.SHOW_AS_ACTION_NEVER
import android.view.View
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams
import android.widget.ImageView
import androidx.activity.OnBackPressedCallback
@ -264,6 +265,16 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, MenuProvider {
insets
} else {
binding.viewPager.updatePadding(bottom = bottomBarHeight + bottomInsets)
/* BottomAppBar could handle size and insets automatically, but then it gets quite large,
so we do it like this instead */
binding.bottomNav.updateLayoutParams<ViewGroup.MarginLayoutParams> {
height = bottomBarHeight + bottomInsets
}
binding.bottomNav.updatePadding(bottom = bottomInsets)
binding.bottomTabLayout.updateLayoutParams<ViewGroup.MarginLayoutParams> {
bottomMargin = bottomInsets
}
insets.inset(0, 0, 0, bottomInsets)
}
}

View file

@ -66,15 +66,14 @@
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomNav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/bottomAppBarHeight"
android:layout_gravity="bottom"
android:backgroundTint="?attr/colorSurface"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:fabAlignmentMode="end"
app:menuAlignmentMode="auto"
app:navigationContentDescription="@string/action_open_drawer"
app:paddingBottomSystemWindowInsets="true">
app:navigationContentDescription="@string/action_open_drawer" >
<com.keylesspalace.tusky.view.AdaptiveTabLayout
android:id="@+id/bottomTabLayout"

View file

@ -84,7 +84,6 @@
<dimen name="media_description_sheet_bottom_padding">8dp</dimen>
<!-- height of an BottomAppBar according to Material Design guidelines -->
<dimen name="bottomAppBarHeight">80dp</dimen>
<dimen name="bottomAppBarHeight">64dp</dimen>
</resources>