From 7c71caff96e5d3753e6b2f891a8cc6dee5c40199 Mon Sep 17 00:00:00 2001 From: Michael Rapp <michael.rapp90@googlemail.com> Date: Mon, 13 May 2019 22:36:43 +0200 Subject: [PATCH] Add the theme attributes preferenceActivityToolbarStyle and preferenceActivityInvertedToolbarStyle. --- RELEASE_NOTES.md | 1 + library/src/main/res/layout/preference_activity_phone.xml | 1 + library/src/main/res/layout/preference_activity_tablet.xml | 2 ++ library/src/main/res/layout/toolbar_large.xml | 2 ++ library/src/main/res/values/attrs.xml | 2 ++ 5 files changed, 8 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8f12ffe..b38ca31 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -5,6 +5,7 @@ A minor release, which introduces the following changes: - Added the theme attribute `categoryPreferenceStyle`. +- Added the theme attribute `preferenceActivityToolbarStyle` and `preferenceActivityInvertedToolbarStyle`. ## Version 7.0.2 (Feb. 23th 2019) diff --git a/library/src/main/res/layout/preference_activity_phone.xml b/library/src/main/res/layout/preference_activity_phone.xml index 0d379ff..e9bdba0 100644 --- a/library/src/main/res/layout/preference_activity_phone.xml +++ b/library/src/main/res/layout/preference_activity_phone.xml @@ -29,6 +29,7 @@ License. <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" + style="?attr/preferenceActivityToolbarStyle" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" diff --git a/library/src/main/res/layout/preference_activity_tablet.xml b/library/src/main/res/layout/preference_activity_tablet.xml index c8bcf49..9f1d742 100644 --- a/library/src/main/res/layout/preference_activity_tablet.xml +++ b/library/src/main/res/layout/preference_activity_tablet.xml @@ -28,6 +28,7 @@ License. <de.mrapp.android.preference.activity.view.ToolbarLarge android:id="@+id/large_toolbar" + style="?attr/preferenceActivityToolbarStyle" android:layout_width="match_parent" android:layout_height="@dimen/toolbar_large_height" android:theme="?attr/toolbarTheme" @@ -75,6 +76,7 @@ License. <androidx.appcompat.widget.Toolbar android:id="@+id/bread_crumb_toolbar" + style="?attr/preferenceActivityInvertedToolbarStyle" android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height" android:background="@drawable/breadcrumb_background" diff --git a/library/src/main/res/layout/toolbar_large.xml b/library/src/main/res/layout/toolbar_large.xml index 6c66f4d..08efe4b 100644 --- a/library/src/main/res/layout/toolbar_large.xml +++ b/library/src/main/res/layout/toolbar_large.xml @@ -23,6 +23,7 @@ License. <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" + style="?attr/preferenceActivityToolbarStyle" android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height" android:layout_alignParentTop="true" @@ -32,6 +33,7 @@ License. <androidx.appcompat.widget.Toolbar android:id="@+id/navigation_toolbar" + style="?attr/preferenceActivityToolbarStyle" android:layout_width="@dimen/navigation_width" android:layout_height="@dimen/toolbar_height" android:layout_alignParentBottom="true" diff --git a/library/src/main/res/values/attrs.xml b/library/src/main/res/values/attrs.xml index 75289bf..d0e17e4 100644 --- a/library/src/main/res/values/attrs.xml +++ b/library/src/main/res/values/attrs.xml @@ -18,8 +18,10 @@ License. <!-- PreferenceActivity --> <attr name="toolbarTheme" format="reference"/> <attr name="toolbarPopupTheme" format="reference"/> + <attr name="preferenceActivityToolbarStyle" format="reference"/> <attr name="invertedToolbarTheme" format="reference"/> <attr name="invertedToolbarPopupTheme" format="reference"/> + <attr name="preferenceActivityInvertedToolbarStyle" format="reference"/> <attr name="useSplitScreen" format="boolean"/> <attr name="navigationWidth" format="dimension"/> <attr name="hideNavigation" format="boolean"/>