diff options
author | ByteHamster <info@bytehamster.com> | 2022-08-04 23:09:38 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-09-18 18:57:43 +0200 |
commit | ac8114342c4beb90745cfc5bd9235ca219a36b29 (patch) | |
tree | 51997df3f5131e8ab5be1dbebe4f953990cca865 /ui/common | |
parent | a12854a96b6233540dc54bb417eaa48e1759b131 (diff) | |
download | AntennaPod-ac8114342c4beb90745cfc5bd9235ca219a36b29.zip |
Migrate Toolbars to Material3
Diffstat (limited to 'ui/common')
-rw-r--r-- | ui/common/src/main/java/de/danoeh/antennapod/ui/common/PagedToolbarFragment.java | 6 | ||||
-rw-r--r-- | ui/common/src/main/res/layout/pager_fragment.xml | 46 |
2 files changed, 29 insertions, 23 deletions
diff --git a/ui/common/src/main/java/de/danoeh/antennapod/ui/common/PagedToolbarFragment.java b/ui/common/src/main/java/de/danoeh/antennapod/ui/common/PagedToolbarFragment.java index cbdd789db..3d82cb32c 100644 --- a/ui/common/src/main/java/de/danoeh/antennapod/ui/common/PagedToolbarFragment.java +++ b/ui/common/src/main/java/de/danoeh/antennapod/ui/common/PagedToolbarFragment.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.ui.common; import androidx.annotation.NonNull; -import androidx.appcompat.widget.Toolbar; +import com.google.android.material.appbar.MaterialToolbar; import androidx.fragment.app.Fragment; import androidx.viewpager2.widget.ViewPager2; @@ -10,7 +10,7 @@ import androidx.viewpager2.widget.ViewPager2; * All items share the same general menu items and are just allowed to show/hide them. */ public abstract class PagedToolbarFragment extends Fragment { - private Toolbar toolbar; + private MaterialToolbar toolbar; private ViewPager2 viewPager; /** @@ -24,7 +24,7 @@ public abstract class PagedToolbarFragment extends Fragment { } } - protected void setupPagedToolbar(Toolbar toolbar, ViewPager2 viewPager) { + protected void setupPagedToolbar(MaterialToolbar toolbar, ViewPager2 viewPager) { this.toolbar = toolbar; this.viewPager = viewPager; diff --git a/ui/common/src/main/res/layout/pager_fragment.xml b/ui/common/src/main/res/layout/pager_fragment.xml index ea007892a..3987b871d 100644 --- a/ui/common/src/main/res/layout/pager_fragment.xml +++ b/ui/common/src/main/res/layout/pager_fragment.xml @@ -1,31 +1,37 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" + 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" + android:orientation="vertical"> + + <com.google.android.material.appbar.AppBarLayout + android:id="@+id/appbar" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="wrap_content" + android:fitsSystemWindows="true"> - <androidx.appcompat.widget.Toolbar + <com.google.android.material.appbar.MaterialToolbar + android:id="@+id/toolbar" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="?attr/actionBarSize" - android:theme="?attr/actionBarTheme" - app:navigationIcon="?homeAsUpIndicator" - android:id="@+id/toolbar"/> + android:layout_height="?attr/actionBarSize" + app:navigationIcon="?homeAsUpIndicator" /> + + </com.google.android.material.appbar.AppBarLayout> <com.google.android.material.tabs.TabLayout - android:id="@+id/sliding_tabs" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="?android:attr/windowBackground" - app:tabBackground="?attr/selectableItemBackground" - app:tabMode="fixed" - app:tabGravity="fill"/> + android:id="@+id/sliding_tabs" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?android:attr/windowBackground" + app:tabBackground="?attr/selectableItemBackground" + app:tabMode="fixed" + app:tabGravity="fill" /> <androidx.viewpager2.widget.ViewPager2 - android:id="@+id/viewpager" - android:layout_width="match_parent" - android:layout_height="match_parent"/> + android:id="@+id/viewpager" + android:layout_width="match_parent" + android:layout_height="match_parent" /> </LinearLayout> |