Add preference activity.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
5
app/src/main/res/drawable/ic_baseline_add_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_add_24.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@color/colorPrimary" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/ic_baseline_undo_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_undo_24.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:tint="#FFFFFF" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@color/colorPrimary" android:pathData="M12.5,8c-2.65,0 -5.05,0.99 -6.9,2.6L2,7v9h9l-3.62,-3.62c1.39,-1.16 3.16,-1.88 5.12,-1.88 3.54,0 6.55,2.31 7.6,5.5l2.37,-0.78C21.08,11.03 17.15,8 12.5,8z"/>
|
||||
</vector>
|
||||
29
app/src/main/res/layout/settings_activity.xml
Normal file
29
app/src/main/res/layout/settings_activity.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -4,26 +4,21 @@
|
||||
tools:context="me.zobrist.tichucounter.MainActivity">
|
||||
<item
|
||||
android:id="@+id/action_undo"
|
||||
android:icon="@android:drawable/ic_menu_revert"
|
||||
android:icon="@drawable/ic_baseline_undo_24"
|
||||
android:orderInCategory="5"
|
||||
android:title="@string/undo" />
|
||||
android:title="@string/undo"
|
||||
app:showAsAction="ifRoom"/>
|
||||
<item
|
||||
android:id="@+id/action_clear"
|
||||
android:icon="@drawable/ic_baseline_add_24"
|
||||
android:checkable="false"
|
||||
android:orderInCategory="10"
|
||||
android:title="@string/clear"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:checkable="false"
|
||||
android:orderInCategory="10"
|
||||
android:title="@string/settings"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_theme"
|
||||
android:orderInCategory="15"
|
||||
android:title="@string/choose_theme_text" />
|
||||
<item
|
||||
android:id="@+id/action_language"
|
||||
android:orderInCategory="16"
|
||||
android:title="@string/choose_language_text" />
|
||||
<item
|
||||
android:id="@+id/action_screenOn"
|
||||
android:checkable="true"
|
||||
android:orderInCategory="20"
|
||||
android:title="@string/keep_screen_on" />
|
||||
</menu>
|
||||
@@ -14,4 +14,5 @@
|
||||
<string name="german">Detusch</string>
|
||||
<string name="light">Hell</string>
|
||||
<string name="dark">Dunkel</string>
|
||||
<string name="settings">Einstellungen</string>
|
||||
</resources>
|
||||
25
app/src/main/res/values/arrays.xml
Normal file
25
app/src/main/res/values/arrays.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<resources>
|
||||
<!-- Theme Preference -->
|
||||
<string-array name="theme_entries">
|
||||
<item>@string/dark</item>
|
||||
<item>@string/light</item>
|
||||
<item>@string/android_default_text</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="theme_values">
|
||||
<item>dark</item>
|
||||
<item>light</item>
|
||||
<item>default</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Language Preference -->
|
||||
<string-array name="language_entries">
|
||||
<item>@string/german</item>
|
||||
<item>@string/english</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="language_values">
|
||||
<item>german</item>
|
||||
<item>english</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -18,4 +18,21 @@
|
||||
<string name="german">German</string>
|
||||
<string name="light">Light</string>
|
||||
<string name="dark">Dark</string>
|
||||
<string name="title_activity_settings">SettingsActivity</string>
|
||||
|
||||
<!-- Preference Titles -->
|
||||
<string name="messages_header">Messages</string>
|
||||
<string name="sync_header">Sync</string>
|
||||
|
||||
<!-- Messages Preferences -->
|
||||
<string name="signature_title">Your signature</string>
|
||||
<string name="reply_title">Theme</string>
|
||||
|
||||
<!-- Sync Preferences -->
|
||||
<string name="sync_title">Sync email periodically</string>
|
||||
<string name="attachment_title">Download incoming attachments</string>
|
||||
<string name="attachment_summary_on">Automatically download attachments for incoming emails
|
||||
</string>
|
||||
<string name="attachment_summary_off">Only download attachments when manually requested</string>
|
||||
<string name="settings">Settings</string>
|
||||
</resources>
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
|
||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
@@ -9,7 +9,7 @@
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowActionBar">true</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
|
||||
27
app/src/main/res/xml/root_preferences.xml
Normal file
27
app/src/main/res/xml/root_preferences.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory app:title="@string/messages_header">
|
||||
|
||||
<ListPreference
|
||||
app:defaultValue="default"
|
||||
app:entries="@array/theme_entries"
|
||||
app:entryValues="@array/theme_values"
|
||||
app:key="theme"
|
||||
app:title="@string/choose_theme_text"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
|
||||
<ListPreference
|
||||
app:defaultValue="reply"
|
||||
app:entries="@array/language_entries"
|
||||
app:entryValues="@array/language_values"
|
||||
app:key="language"
|
||||
app:title="@string/choose_language_text"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
app:key="screen"
|
||||
app:title="@string/keep_screen_on" />
|
||||
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user