Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f98810df authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Hide option to change theme and action bar color

parent 0b1a4483
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -22,17 +22,20 @@
            app:title="@string/preferences_theme"
            app:entries="@array/pref_theme_entries"
            app:entryValues="@array/pref_theme_values"
            app:defaultValue="light" />
            app:defaultValue="light"
            app:isPreferenceVisible="false"/>
        <SwitchPreference
            app:defaultValue="false"
            app:key="pref_pure_black_night_mode"
            app:title="@string/preferences_pure_black_night_mode" />
            app:title="@string/preferences_pure_black_night_mode"
            app:isPreferenceVisible="false"/>
        <Preference
            app:key="pref_color"
            app:title="@string/preferences_color"
            app:entries="@array/pref_color_entries"
            app:entryValues="@array/pref_color_values"
            app:defaultValue="teal" />
            app:defaultValue="teal"
            app:isPreferenceVisible="false"/>
        <ListPreference
            app:key="preferences_default_start"
            app:defaultValue="-2"
+6 −3
Original line number Diff line number Diff line
@@ -22,17 +22,20 @@ xmlns:app="http://schemas.android.com/apk/res-auto">
        app:title="@string/preferences_theme"
        app:entries="@array/pref_theme_entries"
        app:entryValues="@array/pref_theme_values"
        app:defaultValue="system" />
        app:defaultValue="system"
        app:isPreferenceVisible="false"/>
    <SwitchPreference
        app:defaultValue="false"
        app:key="pref_pure_black_night_mode"
        app:title="@string/preferences_pure_black_night_mode" />
        app:title="@string/preferences_pure_black_night_mode"
        app:isPreferenceVisible="false"/>
    <Preference
        app:key="pref_color"
        app:title="@string/preferences_color"
        app:entries="@array/pref_color_entries"
        app:entryValues="@array/pref_color_values"
        app:defaultValue="teal" />
        app:defaultValue="teal"
        app:isPreferenceVisible="false"/>
    <ListPreference
        app:key="preferences_default_start"
        app:defaultValue="-2"
+6 −3
Original line number Diff line number Diff line
@@ -22,17 +22,20 @@
            app:title="@string/preferences_theme"
            app:entries="@array/pref_theme_entries"
            app:entryValues="@array/pref_theme_values"
            app:defaultValue="light" />
            app:defaultValue="light"
            app:isPreferenceVisible="false"/>
        <SwitchPreference
            app:key="pref_pure_black_night_mode"
            app:defaultValue="false"
            app:title="@string/preferences_pure_black_night_mode" />
            app:title="@string/preferences_pure_black_night_mode"
            app:isPreferenceVisible="false"/>
        <Preference
            app:key="pref_color"
            app:title="@string/preferences_color"
            app:entries="@array/pref_color_entries"
            app:entryValues="@array/pref_color_values"
            app:defaultValue="teal" />
            app:defaultValue="teal"
            app:isPreferenceVisible="false"/>
        <ListPreference
            app:key="preferences_default_start"
            app:defaultValue="-2"
+11 −1
Original line number Diff line number Diff line
@@ -47,7 +47,17 @@ public class DynamicTheme {
    }

    private static String getTheme(Context context) {
        return Utils.getSharedPreference(context, THEME_PREF, systemThemeAvailable() ? SYSTEM : LIGHT);
        /**
         * Migrate the user preferences to system default mode.
         * It makes sure we don't unnecessarily access a wrong resource as we have disabled the option to switch themes.
         */
        final String themePreference = Utils.getSharedPreference(context, THEME_PREF, SYSTEM);
        if (themePreference.equalsIgnoreCase(BLACK)
                || themePreference.equalsIgnoreCase(DARK) || themePreference.equalsIgnoreCase(LIGHT)) {
            Utils.setSharedPreference(context, THEME_PREF, SYSTEM);
        }
        return themePreference;

    }

    private static int getSelectedTheme(Activity activity) {