preference for clock color (cf. #12, #75)

This commit is contained in:
Josia Pietsch 2024-12-06 00:51:50 +01:00
parent 3c59ad4c41
commit a9f3196f8e
Signed by: jrpie
GPG key ID: E70B571D66986A2D
8 changed files with 270 additions and 2 deletions

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/AlertDialogCustom"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp">
<EditText
android:inputType="textNoSuggestions"
android:singleLine="true"
android:hint="@string/dialog_select_color_color_hex"
android:autofillHints="color"
android:id="@+id/dialog_select_color_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center|center_horizontal"
android:padding="5dp"
android:textSize="20sp"
tools:text="#ffbb00" />
<Space
android:layout_width="match_parent"
android:layout_height="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dialog_select_color_red" />
<SeekBar
android:id="@+id/dialog_select_color_seekbar_red"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="255" />
<Space
android:layout_width="match_parent"
android:layout_height="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dialog_select_color_green" />
<SeekBar
android:id="@+id/dialog_select_color_seekbar_green"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="255" />
<Space
android:layout_width="match_parent"
android:layout_height="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dialog_select_color_blue" />
<SeekBar
android:id="@+id/dialog_select_color_seekbar_blue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="255" />
<Space
android:layout_width="match_parent"
android:layout_height="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dialog_select_color_alpha" />
<SeekBar
android:id="@+id/dialog_select_color_seekbar_alpha"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="255" />
</LinearLayout>

View file

@ -7,4 +7,6 @@
<item name="android:enforceNavigationBarContrast">false</item>
<!--<item name="android:windowDrawsSystemBarBackgrounds">true</item>-->
</style>
</resources>

View file

@ -119,6 +119,7 @@
-
-->
<string name="settings_clock_font_key" translatable="false">clock.font</string>
<string name="settings_clock_color_key" translatable="false">clock.color</string>
<string name="settings_clock_time_visible_key" translatable="false">clock.time_visible</string>
<string name="settings_clock_show_seconds_key" translatable="false">clock.show_seconds</string>
<string name="settings_clock_date_visible_key" translatable="false">clock.date_visible</string>

View file

@ -112,6 +112,7 @@
<string name="settings_theme_monochrome_icons">Monochrome app icons</string>
<string name="settings_launcher_section_date_time"><![CDATA[Date & time]]></string>
<string name="settings_clock_color">Color</string>
<string name="settings_clock_time_visible">Show time</string>
<string name="settings_clock_date_visible">Show date</string>
<string name="settings_clock_localized">Use localized date format</string>
@ -289,4 +290,12 @@
<string name="dialog_rename_cancel">Cancel</string>
<string name="dialog_rename_ok">Ok</string>
<string name="dialog_rename_title">Rename %1$s</string>
<string name="dialog_select_color_red">Red</string>
<string name="dialog_select_color_alpha">Alpha</string>
<string name="dialog_select_color_blue">Blue</string>
<string name="dialog_select_color_green">Green</string>
<string name="dialog_select_color_ok">Ok</string>
<string name="dialog_select_color_cancel">Cancel</string>
<string name="dialog_select_color_color_hex">Color</string>
<string name="dialog_choose_color_title">Choose color</string>
</resources>

View file

@ -59,6 +59,10 @@
android:entries="@array/settings_theme_font_items"
android:summary="%s"
android:defaultValue="HACK"/>
<de.jrpie.android.launcher.preferences.ColorPreference
android:key="@string/settings_clock_color_key"
android:title="@string/settings_clock_color"
/>
<SwitchPreference
android:key="@string/settings_clock_localized_key"
android:defaultValue="false"