diff options
author | stefan-niedermann <info@niedermann.it> | 2019-09-27 22:48:05 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2019-09-27 22:48:05 +0300 |
commit | a9f9bedf187f8a2b963ce638f8a5905efe4f7d36 (patch) | |
tree | cb3f731905a7c15a3d278efa199ea41c61ee62ed /app | |
parent | 7e775cbbcd593f153907d534de19a1f12e377460 (diff) |
#108 dark mode
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java | 2 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_brightness_2_grey600_24dp.xml | 5 | ||||
-rw-r--r-- | app/src/main/res/values/setup.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/styles.xml | 7 | ||||
-rw-r--r-- | app/src/main/res/xml/settings.xml | 6 |
6 files changed, 22 insertions, 0 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java index 1c8e7fe22..fd298d89b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java @@ -77,11 +77,13 @@ public class MainActivity extends DrawerActivity { @Override protected void onCreate(Bundle savedInstanceState) { setTheme(R.style.AppTheme_NoActionBar); + setTheme(R.style.DarkAppTheme); setContentView(R.layout.activity_main); ButterKnife.bind(this); super.onCreate(savedInstanceState); Thread.currentThread().setUncaughtExceptionHandler(new ExceptionHandler(this)); + stackAdapter = new StackAdapter(getSupportFragmentManager()); //TODO limit this call only to lower API levels like KitKat because they crash without diff --git a/app/src/main/res/drawable/ic_brightness_2_grey600_24dp.xml b/app/src/main/res/drawable/ic_brightness_2_grey600_24dp.xml new file mode 100644 index 000000000..8f6ebab70 --- /dev/null +++ b/app/src/main/res/drawable/ic_brightness_2_grey600_24dp.xml @@ -0,0 +1,5 @@ +<vector android:autoMirrored="true" android:height="24dp" + android:tint="#666666" android:viewportHeight="24.0" + android:viewportWidth="24.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#FF000000" android:pathData="M10,2c-1.82,0 -3.53,0.5 -5,1.35C7.99,5.08 10,8.3 10,12s-2.01,6.92 -5,8.65C6.47,21.5 8.18,22 10,22c5.52,0 10,-4.48 10,-10S15.52,2 10,2z"/> +</vector> diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml index 20ed7561c..c375cc994 100644 --- a/app/src/main/res/values/setup.xml +++ b/app/src/main/res/values/setup.xml @@ -4,6 +4,7 @@ <string name="shared_preference_last_account" translatable="false">it.niedermann.nextcloud.deck.last_account</string> <string name="pref_key_wifi_only" translatable="false">wifiOnly</string> + <string name="pref_key_wifi_only" translatable="false">wifiOnly</string> <!-- To be concatenated with the account id --> <string name="shared_preference_last_board_for_account_" translatable="false">it.niedermann.nextcloud.deck.last_board_for_account_</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 928d4542a..bcfa7f19a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -133,4 +133,5 @@ <string name="simple_settings">Settings</string> <string name="pref_value_wifi_and_mobile">Sync on Wi-Fi and mobile data</string> <string name="pref_value_wifi_only">Sync only on Wi-Fi</string> + <string name="pref_value_theme_light">Light</string> </resources> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index bdbb17be4..cffc67981 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -7,6 +7,13 @@ <item name="colorAccent">@color/primary</item> </style> + <!-- Base application theme. --> + <style name="DarkAppTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> + <item name="colorPrimary">@color/primary</item> + <item name="colorPrimaryDark">@color/primary</item> + <item name="colorAccent">@color/primary</item> + </style> + <style name="AppTheme.NoActionBar" parent="AppTheme"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index 59ad3d4a6..0cb12500a 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -7,4 +7,10 @@ android:key="@string/pref_key_wifi_only" android:title="@string/pref_value_wifi_only" /> + <SwitchPreference + android:defaultValue="@string/pref_value_theme_light" + android:icon="@drawable/ic_brightness_2_grey600_24dp" + android:key="@string/pref_key_dark_theme" + android:title="@string/pref_value_dark_theme" /> + </PreferenceScreen> |