- Update to Api 35 - Update all dependencies that were blocked because they require Api 35 - fix some deprecation warnings - implement the now required edge-to-edge mode Edge-to-edge mode means that we now draw under the status bar and the navigation bar and need to make sure we don't overlap with them. Previously the system would do that for us, and we would only provide the color we want the bars in. For the edge-to-edge mode there are two Apis that are important: - `fitsSystemWindows` - some Widgets, mostly from the Material library, automatically handle system insets if you set this attribute on them to true - `ViewCompat.setOnApplyWindowInsetsListener` - this allows you to manually handle the various insets. By returning new insets from the callback it is possible to tell the system which ones are handled and which ones should be taken care of by another view. In most places edge-to-edge was straightforward to implement, except in `ComposeActivity`, `AccountActivity` and `MainActivity` which required a more custom approach, and a hacky solution to make landscape mode work in `BaseActivity`. There is also the `ViewCompat.setWindowInsetsAnimationCallback` Api which allows animating with moving insets. I used that in `LoginActivity` and `ComposeActivity` to animate the Views together with the keyboard. On Android Versions below 15 (Api <= 34) Tusky will look almost the same as before. I think the only exception is the main bottom bar, which is now slighty larger. We customized it to be smaller than the default, but in edge-to-edge mode the height needs to be `wrap_content` or it won't handle insets correctly. Screenshots: <img src="https://github.com/user-attachments/assets/2a1bf5d9-79fb-48eb-affc-1cbb1164d5f0" width="280"/> <img src="https://github.com/user-attachments/assets/9edccdf2-c0e9-4881-a6df-bd0872934f28" width="280"/> <img src="https://github.com/user-attachments/assets/2916a271-f53e-4d38-a83a-69083eb3053f" width="280"/>
77 lines
3.1 KiB
XML
77 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<include
|
|
android:id="@+id/includedToolbar"
|
|
layout="@layout/toolbar_basic" />
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/currentTabsRecyclerView"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
|
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
|
|
|
<View
|
|
android:id="@+id/scrim"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="?attr/scrimBackground"
|
|
android:visibility="invisible" />
|
|
|
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
android:id="@+id/actionButton"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="bottom|end"
|
|
android:layout_margin="@dimen/fabMargin"
|
|
android:contentDescription="@string/action_add_tab"
|
|
app:srcCompat="@drawable/ic_plus_24dp"
|
|
app:tint="?attr/colorOnPrimary" />
|
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:id="@+id/sheet"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="bottom|end"
|
|
android:layout_margin="@dimen/fabMargin"
|
|
android:visibility="invisible"
|
|
app:strokeWidth="0dp"
|
|
app:cardBackgroundColor="?attr/colorSurface"
|
|
app:cardElevation="2dp">
|
|
|
|
<LinearLayout
|
|
android:layout_width="240dp"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical">
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/addTabRecyclerView"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:overScrollMode="never" />
|
|
|
|
<TextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="48dp"
|
|
android:layout_gravity="bottom"
|
|
android:background="?attr/colorPrimary"
|
|
android:drawablePadding="12dp"
|
|
android:ellipsize="end"
|
|
android:gravity="center_vertical"
|
|
android:lines="1"
|
|
android:paddingStart="8dp"
|
|
android:paddingEnd="8dp"
|
|
android:text="@string/action_add_tab"
|
|
android:textColor="?attr/colorOnPrimary"
|
|
android:textSize="?attr/status_text_large"
|
|
app:drawableStartCompat="@drawable/ic_plus_24dp"
|
|
app:drawableTint="?attr/colorOnPrimary" />
|
|
</LinearLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|