Add a dark theme toggle in the navigation drawer.

This commit is contained in:
Alex Ning
2020-02-02 23:16:15 +08:00
parent 7ae7827d49
commit 802a70e9c9
5 changed files with 98 additions and 30 deletions

View File

@@ -0,0 +1,9 @@
<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="#FF000000"
android:pathData="M12.7,4.91C15.25,6.24 17,8.92 17,12s-1.75,5.76 -4.3,7.09c1.46,-2 2.3,-4.46 2.3,-7.09s-0.84,-5.09 -2.3,-7.09M9,2c-1.05,0 -2.05,0.16 -3,0.46 4.06,1.27 7,5.06 7,9.54s-2.94,8.27 -7,9.54c0.95,0.3 1.95,0.46 3,0.46 5.52,0 10,-4.48 10,-10S14.52,2 9,2z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<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="#FFFFFFFF"
android:pathData="M20,8.69L20,4h-4.69L12,0.69 8.69,4L4,4v4.69L0.69,12 4,15.31L4,20h4.69L12,23.31 15.31,20L20,20v-4.69L23.31,12 20,8.69zM18,14.48L18,18h-3.52L12,20.48 9.52,18L6,18v-3.52L3.52,12 6,9.52L6,6h3.52L12,3.52 14.48,6L18,6v3.52L20.48,12 18,14.48zM12,6.5c-3.03,0 -5.5,2.47 -5.5,5.5s2.47,5.5 5.5,5.5 5.5,-2.47 5.5,-5.5 -2.47,-5.5 -5.5,-5.5zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>

View File

@@ -199,6 +199,19 @@
android:layout_height="1dp"
android:background="@color/dividerColor" />
<TextView
android:id="@+id/night_mode_toggle_text_view_main_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="16dp"
android:drawablePadding="32dp"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true" />
<TextView
android:id="@+id/settings_text_view_main_activity"
android:layout_width="match_parent"

View File

@@ -289,7 +289,7 @@
<string name="settings_notification_enable_notification_title">Enable Notifications</string>
<string name="settings_notification_interval_title">Check Notifications Interval</string>
<string name="settings_theme_title">Theme</string>
<string name="settings_theme_light__theme_summary">Light Theme</string>
<string name="settings_theme_light_theme_summary">Light Theme</string>
<string name="settings_theme_dark_theme_summary">Dark Theme</string>
<string name="settings_theme_system_default_summary">Device default</string>
<string name="settings_amoled_dark_title">Amoled Dark</string>
@@ -424,4 +424,7 @@
<string name="unsave_comment">Unsave comment</string>
<string name="exit_app">Exit?</string>
<string name="light_theme">Light Theme</string>
<string name="dark_theme">Dark Theme</string>
</resources>