Add accent customization

Add the ability to customize the accent.
This commit is contained in:
OxygenCobalt
2020-11-28 20:25:41 -07:00
parent 2dc7ba3420
commit a5f59858bd
15 changed files with 272 additions and 19 deletions
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/colorPrimary"
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z" />
</vector>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/background">
<path
android:fillColor="@android:color/white"
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
</vector>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<size
android:width="48dp"
android:height="48dp" />
<solid
android:color="@android:color/white" />
</shape>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/margin_mid_small">
<ImageButton
android:id="@+id/accent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/margin_medium"
android:scaleType="fitCenter"
android:background="@drawable/ui_circular_button"
android:src="@drawable/ic_check"
tools:backgroundTint="?attr/colorPrimary"
tools:ignore="contentDescription" />
</FrameLayout>
</layout>
+1
View File
@@ -5,6 +5,7 @@
<item>@string/label_settings_theme_light</item>
<item>@string/label_settings_theme_dark</item>
</array>
<array name="theme_values">
<item>AUTO</item>
<item>LIGHT</item>
+1
View File
@@ -34,6 +34,7 @@
<string name="label_settings_theme_light">Light</string>
<string name="label_settings_theme_dark">Dark</string>
<string name="label_settings_theme_choose">Choose theme</string>
<string name="label_settings_accent">Accent</string>
<!-- Debug Namespace | Debug labels -->
<string name="debug_state_saved">State saved</string>
+7
View File
@@ -13,6 +13,12 @@
<item name="colorControlNormal">@color/control_color</item>
<item name="alertDialogTheme">@style/Theme.CustomDialog</item>
<item name="indicatorFastScrollerStyle">@style/FastScrollTheme</item>
<item name="md_divider_color">@android:color/transparent</item>
<item name="md_background_color">@color/background</item>
<item name="md_corner_radius">0dp</item>
<item name="md_color_button_text">@color/control_color</item>
<item name="md_font_title">@font/inter_black</item>
</style>
<!-- Hack to fix the weird icon/underline with LibraryFragment's SearchView -->
@@ -56,6 +62,7 @@
<item name="android:windowTitleStyle">@style/TextAppearance.Dialog.Title</item>
<item name="colorPrimary">@color/control_color</item>
<item name="colorSecondary">@color/control_color</item>
<item name="dialogCornerRadius">0dp</item>
</style>
<style name="TextAppearance.Dialog.Title" parent="@android:style/TextAppearance.Material.Title">
+7
View File
@@ -11,5 +11,12 @@
android:entries="@array/theme_entries"
android:entryValues="@array/theme_values"
app:useSimpleSummaryProvider="true" />
<Preference
app:key="KEY_ACCENT"
android:title="@string/label_settings_accent"
android:icon="@drawable/ic_accent"
app:summary="@string/label_settings_accent"
app:enableCopying="true" />
</PreferenceCategory>
</PreferenceScreen>