Implement theme-choosing using a Spinner

This commit is contained in:
Finn M Glas 2020-08-18 21:01:32 +02:00
parent badbba535b
commit 70114fc9d3
No known key found for this signature in database
GPG key ID: 902A30146014DFBF
3 changed files with 77 additions and 73 deletions

View file

@ -85,10 +85,24 @@
android:id="@+id/settings_launcher_theme_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/settings_launcher_time_formats"
android:entries="@array/settings_themes"
android:spinnerMode="dropdown" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16sp"
android:orientation="horizontal">
<Button
android:id="@+id/settings_theme_custom_button_select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Choose a wallpaper"
android:textAllCaps="false" />
</LinearLayout>
<LinearLayout
android:id="@+id/settings_launcher_section_options"
android:layout_width="match_parent"
@ -141,43 +155,4 @@
</LinearLayout>
<androidx.cardview.widget.CardView
android:id="@+id/settings_theme_dark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
app:layout_constraintTop_toBottomOf="@+id/settings_launcher_switch_screen_timeout"
tools:layout_editor_absoluteX="32dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/settings_theme_dark_button_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dark"
android:textAllCaps="false"
app:layout_constraintStart_toEndOf="@+id/settings_theme_finn_button_select" />
<Button
android:id="@+id/settings_theme_finn_button_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Default"
android:textAllCaps="false"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/settings_theme_custom_button_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wallpaper"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

View file

@ -48,6 +48,13 @@
<string name="settings_select_theme">Select</string>
<string name="settings_select_image">Change Image</string>
<string name="settings_theme_examples">Examples</string>
<string-array name="settings_themes">
<item>Default</item>
<item>Dark</item>
<item>Custom</item>
</string-array>
<string name="settings_launcher_disable_timeout">Keep screen on</string>
<string name="settings_launcher_time_format">Date format</string>