DeviceParts: use OmniPreferenceTheme for material switch style
Change-Id: I1fa890b7874fe038b0b367cc76752a075297e67f
diff --git a/DeviceParts/Android.bp b/DeviceParts/Android.bp
index 2bed802..ee53db2 100644
--- a/DeviceParts/Android.bp
+++ b/DeviceParts/Android.bp
@@ -10,6 +10,7 @@
"androidx.preference_preference",
"com.google.android.material_material",
"OmniLib",
+ "OmniPreferenceTheme",
],
srcs: [
diff --git a/DeviceParts/res/layout/settings_activity.xml b/DeviceParts/res/layout/settings_activity.xml
index aa6001a..c0139ac 100644
--- a/DeviceParts/res/layout/settings_activity.xml
+++ b/DeviceParts/res/layout/settings_activity.xml
@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/windowBackground">
+ android:fitsSystemWindows="true" >
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
@@ -15,8 +15,7 @@
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- android:background="@color/windowBackground"/>
+ android:layout_height="?attr/actionBarSize"/>
</com.google.android.material.appbar.AppBarLayout>
@@ -24,6 +23,8 @@
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_marginStart="@dimen/fragment_side_margin"
+ android:layout_marginEnd="@dimen/fragment_side_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/DeviceParts/res/values-night/colors.xml b/DeviceParts/res/values-night/colors.xml
index 0f0d113..2d656f0 100644
--- a/DeviceParts/res/values-night/colors.xml
+++ b/DeviceParts/res/values-night/colors.xml
@@ -15,5 +15,4 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<color name="colorPrimary">@android:color/system_accent1_100</color>
- <color name="windowBackground">@android:color/system_neutral1_900</color>
-</resources>
\ No newline at end of file
+</resources>
diff --git a/DeviceParts/res/values/colors.xml b/DeviceParts/res/values/colors.xml
index 5ab4682..9736292 100644
--- a/DeviceParts/res/values/colors.xml
+++ b/DeviceParts/res/values/colors.xml
@@ -12,5 +12,4 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<color name="colorPrimary">@android:color/system_accent1_600</color>
- <color name="windowBackground">@android:color/system_neutral1_50</color>
</resources>
diff --git a/DeviceParts/res/values/dimens.xml b/DeviceParts/res/values/dimens.xml
new file mode 100644
index 0000000..7ba469a
--- /dev/null
+++ b/DeviceParts/res/values/dimens.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="fragment_side_margin">10dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/DeviceParts/res/values/styles.xml b/DeviceParts/res/values/styles.xml
index 9edf85e..6b8a4e7 100644
--- a/DeviceParts/res/values/styles.xml
+++ b/DeviceParts/res/values/styles.xml
@@ -21,6 +21,9 @@
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
<item name="android:windowLightNavigationBar">?attr/isLightTheme</item>
- <item name="android:windowBackground">@color/windowBackground</item>
+ <item name="preferenceTheme">@style/Omni.PreferenceTheme</item>
+ <item name="android:switchStyle">@style/Omni.SwitchStyle</item>
+ <item name="android:textAppearanceListItem">@style/Omni.PreferenceTitle</item>
+ <item name="dialogCornerRadius">8dp</item>
</style>
</resources>