Browse Source

- added system_autodarktheme setting which overrides system_usedarktheme

pull/529/head
Twig N 5 years ago
parent
commit
6464439455
  1. 4
      app/src/main/java/org/transdroid/core/app/settings/SystemSettings.java
  2. 2
      app/src/main/res/values/strings.xml
  3. 8
      app/src/main/res/xml/pref_system.xml

4
app/src/main/java/org/transdroid/core/app/settings/SystemSettings.java

@ -59,6 +59,10 @@ public class SystemSettings {
return prefs.getBoolean("system_checkupdates", true); return prefs.getBoolean("system_checkupdates", true);
} }
public boolean autoDarkTheme() {
return prefs.getBoolean("system_autodarktheme", true);
}
public boolean useDarkTheme() { public boolean useDarkTheme() {
return prefs.getBoolean("system_usedarktheme", false); return prefs.getBoolean("system_usedarktheme", false);
} }

2
app/src/main/res/values/strings.xml

@ -347,6 +347,8 @@
<string name="pref_dormantasinactive_info">Torrents at 0KB/s (no data transfer) will be filtered as being inactive</string> <string name="pref_dormantasinactive_info">Torrents at 0KB/s (no data transfer) will be filtered as being inactive</string>
<string name="pref_checkupdates">Check for updates</string> <string name="pref_checkupdates">Check for updates</string>
<string name="pref_checkupdates_info">Check transdroid.org for latest app version</string> <string name="pref_checkupdates_info">Check transdroid.org for latest app version</string>
<string name="pref_autodarktheme">Auto night mode</string>
<string name="pref_autodarktheme_info">Automatically choose between light or dark theme</string>
<string name="pref_usedarktheme">Use dark UI theme</string> <string name="pref_usedarktheme">Use dark UI theme</string>
<string name="pref_usedarktheme_info">Requires a restart to take effect</string> <string name="pref_usedarktheme_info">Requires a restart to take effect</string>
<string name="pref_clearsearch">Clear search history</string> <string name="pref_clearsearch">Clear search history</string>

8
app/src/main/res/xml/pref_system.xml

@ -31,8 +31,16 @@
android:entryValues="@array/pref_autorefresh_intervalvalues" android:entryValues="@array/pref_autorefresh_intervalvalues"
android:defaultValue="0" /> android:defaultValue="0" />
<CheckBoxPreference
android:key="system_autodarktheme"
android:title="@string/pref_autodarktheme"
android:summary="@string/pref_autodarktheme_info"
android:disableDependentsState="true"
android:defaultValue="true" />
<CheckBoxPreference <CheckBoxPreference
android:key="system_usedarktheme" android:key="system_usedarktheme"
android:dependency="system_autodarktheme"
android:title="@string/pref_usedarktheme" android:title="@string/pref_usedarktheme"
android:summary="@string/pref_usedarktheme_info" android:summary="@string/pref_usedarktheme_info"
android:defaultValue="false" /> android:defaultValue="false" />

Loading…
Cancel
Save