feature: reworked date & time settings

This commit is contained in:
Josia Pietsch 2024-08-28 20:40:48 +02:00
parent 7ecab3d9ae
commit e86ed34fe5
Signed by: jrpie
GPG key ID: E70B571D66986A2D
9 changed files with 214 additions and 144 deletions

View file

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -44,33 +42,11 @@
android:text="@string/settings_launcher_section_appearance"
android:textColor="#ccc"
android:textSize="18sp"
android:layout_marginBottom="16sp"
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16sp"
android:layout_marginBottom="16sp"
android:orientation="horizontal"
android:paddingLeft="8sp">
<TextView
android:id="@+id/settings_launcher_text_time_format"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/settings_launcher_time_format"
android:textSize="16sp" />
<Spinner
android:id="@+id/settings_launcher_format_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/settings_launcher_time_format_spinner_items"
android:spinnerMode="dropdown" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -108,10 +84,133 @@
android:textAllCaps="false" />
</LinearLayout>
<LinearLayout
android:id="@+id/settings_launcher_section_date_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:orientation="horizontal">
<TextView
android:id="@+id/settings_launcher_section_date_time_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_launcher_section_date_time"
android:textColor="#ccc"
android:textSize="18sp"
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:gravity="top"
android:orientation="horizontal"
android:paddingLeft="8sp">
<TextView
android:id="@+id/settings_launcher_text_date_localized"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/settings_launcher_date_localized"
android:textSize="16sp" />
<Switch
android:id="@+id/settings_launcher_switch_date_localized"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:gravity="top"
android:orientation="horizontal"
android:paddingLeft="8sp">
<TextView
android:id="@+id/settings_launcher_text_switch_date_visible"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/settings_launcher_show_date"
android:textSize="16sp" />
<Switch
android:id="@+id/settings_launcher_switch_date_visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:gravity="top"
android:orientation="horizontal"
android:paddingLeft="8sp">
<TextView
android:id="@+id/settings_launcher_text_switch_time_visible"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/settings_launcher_show_time"
android:textSize="16sp" />
<Switch
android:id="@+id/settings_launcher_switch_time_visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:gravity="top"
android:orientation="horizontal"
android:paddingLeft="8sp">
<TextView
android:id="@+id/settings_launcher_text_switch_date_time_flip"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/settings_launcher_date_time_flip"
android:textSize="16sp" />
<Switch
android:id="@+id/settings_launcher_switch_date_time_flip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/settings_launcher_section_options"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:orientation="horizontal">
<TextView
@ -128,7 +227,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16sp"
android:layout_marginBottom="16sp"
android:gravity="top"
android:orientation="horizontal"
@ -182,6 +280,7 @@
android:id="@+id/settings_launcher_section_functions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:orientation="horizontal">
<TextView
@ -199,7 +298,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16sp"
android:layout_marginBottom="16sp"
android:gravity="top"
android:orientation="horizontal"
@ -301,4 +399,4 @@
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>

View file

@ -54,15 +54,11 @@
-->
<string name="settings_launcher_section_appearance">Erscheinung</string>
<string name="settings_launcher_time_format">Datumsformat</string>
<string-array name="settings_launcher_time_format_spinner_items">
<item>Standard</item>
<item>Invertiert</item>
<item>Uhrzeit</item>
<item>Deutsch</item>
<item>Nichts</item>
</string-array>
<string name="settings_launcher_show_time">Zeit anzeigen</string>
<string name="settings_launcher_show_date">Datum anzeigen</string>
<string name="settings_launcher_date_localized">Lokalisiertes Datumsformat verwenden</string>
<string name="settings_launcher_date_time_flip">Datum und Uhrzeit tauschen</string>
<string name="settings_launcher_section_date_time"><![CDATA[Datum & Uhrzeit]]></string>
<string name="settings_launcher_theme">Theme</string>
<string-array name="settings_launcher_theme_spinner_items">
<item>Standard</item>
@ -164,4 +160,4 @@
<string name="settings">Einstellungen</string>
<string name="ic_menu_alt">Mehr Optionen</string>
</resources>
</resources>

View file

@ -64,30 +64,7 @@
-->
<string name="settings_launcher_section_appearance">Apariencia</string>
<string name="settings_launcher_time_format">Formato de fecha</string>
<string-array name="settings_launcher_time_format_spinner_items">
<item>Normal</item>
<item>Inverso</item>
<item>Solo hora</item>
<item>Alemán</item>
<item>Nada</item>
</string-array>
<string-array name="settings_launcher_time_formats_upper">
<item>dd-MM-yyyy</item>
<item>HH:mm:ss</item>
<item>HH:mm:ss</item>
<item>HH:mm:ss</item>
<item/>
</string-array>
<string-array name="settings_launcher_time_formats_lower">
<item>HH:mm:ss</item>
<item>dd-MM-yyyy</item>
<item> </item>
<item>dd.MM.yyyy</item>
<item />
</string-array>
<string name="settings_launcher_theme">Tema</string>
<string name="settings_launcher_section_date_time">Formato de fecha</string>
<string-array name="settings_launcher_theme_spinner_items">
<item>Normal</item>
<item>Oscuro</item>

View file

@ -46,14 +46,7 @@
-
-->
<string name="settings_launcher_section_appearance">Apparence</string>
<string name="settings_launcher_time_format">Format de date</string>
<string-array name="settings_launcher_time_format_spinner_items">
<item>Défaut</item>
<item>Inversé</item>
<item>Temps</item>
<item>Allemand</item>
<item>Rien</item>
</string-array>
<string name="settings_launcher_section_date_time">Format de date</string>
<string name="settings_launcher_theme">Theme</string>
<string-array name="settings_launcher_theme_spinner_items">
<item>Défaut</item>
@ -137,4 +130,4 @@
<string name="settings_gesture_up_left_edge">Balayer vers le haut (à gauche de l\'écran)</string>
<string name="settings_gesture_up_right_edge">Balayer vers le haut (à droite de l\'écran)</string>
<string name="settings_gesture_down_right_edge">Balayer vers le bas (à droite de l\'écran)</string>
</resources>
</resources>

View file

@ -70,28 +70,6 @@
-->
<string name="settings_launcher_section_appearance">Appearance</string>
<string name="settings_launcher_time_format">Date format</string>
<string-array name="settings_launcher_time_format_spinner_items">
<item>Default</item>
<item>Inverse</item>
<item>Time only</item>
<item>German</item>
<item>Nothing</item>
</string-array>
<string-array name="settings_launcher_time_formats_upper">
<item>yyyy-MM-dd</item>
<item>HH:mm:ss</item>
<item>HH:mm:ss</item>
<item>HH:mm:ss</item>
<item/>
</string-array>
<string-array name="settings_launcher_time_formats_lower">
<item>HH:mm:ss</item>
<item>yyyy-MM-dd</item>
<item/>
<item>dd.MM.yyyy</item>
<item/>
</string-array>
<string name="settings_launcher_theme">Theme</string>
<string-array name="settings_launcher_theme_spinner_items">
@ -99,6 +77,12 @@
<item>Dark</item>
</string-array>
<string name="settings_launcher_section_date_time"><![CDATA[Date & time]]></string>
<string name="settings_launcher_show_time">Show time</string>
<string name="settings_launcher_show_date">Show date</string>
<string name="settings_launcher_date_localized">Use localized date format</string>
<string name="settings_launcher_date_time_flip">Flip date and time</string>
<string name="settings_launcher_choose_wallpaper">Choose a wallpaper</string>
<string name="settings_launcher_change_wallpaper">Change wallpaper</string>