From ebdaae94d1888d9e30e34dd595a9dd98fbca93ad Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Sun, 13 Sep 2020 19:21:14 +0900 Subject: [PATCH] Initial commit for updated flow of themes. (Check description) Removed DayNight theme. Added a 'white' theme for Light, and 'black' theme for Dark. Users will have to set the type of Light or Dark theme they want to use. Default is white for light, black for dark. More themes will be added later. --- app/src/main/AndroidManifest.xml | 2 +- .../activities/BaseLanguageActivity.java | 4 +- .../instagrabber/activities/MainActivity.java | 3 +- .../fragments/main/ProfileFragment.java | 2 +- .../settings/BasePreferencesFragment.java | 10 ++ .../settings/MorePreferencesFragment.java | 5 +- .../settings/SettingsPreferencesFragment.java | 60 ++++-------- .../settings/ThemePreferencesFragment.java | 94 +++++++++++++++++++ .../awais/instagrabber/utils/Constants.java | 4 +- .../instagrabber/utils/SettingsHelper.java | 9 +- .../awais/instagrabber/utils/ThemeUtils.java | 50 ++++++++++ .../java/awais/instagrabber/utils/Utils.java | 33 ------- .../main/res/drawable/ic_format_paint_24.xml | 10 ++ app/src/main/res/drawable/ic_profile.xml | 1 + app/src/main/res/drawable/ic_star_24.xml | 7 +- ...ial.xml => pref_list_divider_material.xml} | 2 +- app/src/main/res/layout/item_follow.xml | 2 +- app/src/main/res/layout/item_pref_divider.xml | 2 +- app/src/main/res/layout/item_suggestion.xml | 22 +++-- .../main/res/layout/pref_account_switcher.xml | 5 + .../main/res/navigation/more_nav_graph.xml | 10 +- app/src/main/res/values/arrays.xml | 12 +++ app/src/main/res/values/color.xml | 30 ++++++ app/src/main/res/values/strings.xml | 4 + app/src/main/res/values/styles.xml | 46 +++++++++ app/src/main/res/values/themes.xml | 57 +++++++++-- 26 files changed, 372 insertions(+), 114 deletions(-) create mode 100644 app/src/main/java/awais/instagrabber/fragments/settings/ThemePreferencesFragment.java create mode 100644 app/src/main/java/awais/instagrabber/utils/ThemeUtils.java create mode 100644 app/src/main/res/drawable/ic_format_paint_24.xml rename app/src/main/res/drawable/{preference_list_divider_material.xml => pref_list_divider_material.xml} (93%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9910d2cc..23bc499b 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ android:label="@string/app_name" android:requestLegacyExternalStorage="true" android:supportsRtl="true" - android:theme="@style/AppTheme" + android:theme="@style/AppTheme.Light.White" tools:ignore="UnusedAttribute"> NAV_TO_MENU_ID_MAP = new HashMap<>(); private static final List REMOVE_COLLAPSING_TOOLBAR_SCROLL_DESTINATIONS = Collections.singletonList(R.id.commentsViewerFragment); private static final String FIRST_FRAGMENT_GRAPH_INDEX_KEY = "firstFragmentGraphIndex"; diff --git a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java index 048400cb..28c62a76 100644 --- a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java @@ -725,7 +725,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe if (context == null) return; new AlertDialog.Builder(context) .setItems(options, profileDialogListener) - .setNeutralButton(R.string.cancel, null) + .setNegativeButton(R.string.cancel, null) .show(); }); } diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/BasePreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/BasePreferencesFragment.java index 6830cfbb..973ab464 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/BasePreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/BasePreferencesFragment.java @@ -4,10 +4,13 @@ import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; +import androidx.annotation.NonNull; +import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceManager; import androidx.preference.PreferenceScreen; +import awais.instagrabber.R; import awais.instagrabber.activities.MainActivity; import awais.instagrabber.utils.Constants; import awais.instagrabber.utils.LocaleUtils; @@ -44,4 +47,11 @@ public abstract class BasePreferencesFragment extends PreferenceFragmentCompat i shouldRecreate = false; activity.recreate(); } + + @NonNull + protected Preference getDivider(final Context context) { + final Preference divider = new Preference(context); + divider.setLayoutResource(R.layout.item_pref_divider); + return divider; + } } diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java index 2adfab73..ed3b1915 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java @@ -119,9 +119,7 @@ public class MorePreferencesFragment extends BasePreferencesFragment { }); generalCategory.addPreference(aboutPreference); - final Preference divider = new Preference(context); - divider.setLayoutResource(R.layout.item_pref_divider); - screen.addPreference(divider); + screen.addPreference(getDivider(context)); final Preference versionPreference = getPreference(R.string.version, BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")", -1, preference -> { @@ -129,6 +127,7 @@ public class MorePreferencesFragment extends BasePreferencesFragment { return true; }); screen.addPreference(versionPreference); + screen.addPreference(getDivider(context)); final Preference reminderPreference = getPreference(R.string.reminder, R.string.reminder_summary, R.drawable.ic_warning, null); reminderPreference.setSelectable(false); diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java index 5e6ba73e..7e108b17 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java @@ -4,9 +4,11 @@ import android.content.Context; import android.content.res.TypedArray; import android.view.View; +import androidx.annotation.NonNull; import androidx.appcompat.widget.AppCompatButton; import androidx.appcompat.widget.AppCompatTextView; -import androidx.fragment.app.FragmentActivity; +import androidx.navigation.NavDirections; +import androidx.navigation.fragment.NavHostFragment; import androidx.preference.ListPreference; import androidx.preference.Preference; import androidx.preference.PreferenceCategory; @@ -46,17 +48,18 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { screen.addPreference(generalCategory); generalCategory.setTitle(R.string.pref_category_general); generalCategory.setIconSpaceReserved(false); + generalCategory.addPreference(getThemePreference(context)); generalCategory.addPreference(getDefaultTabPreference()); generalCategory.addPreference(getUpdateCheckPreference()); generalCategory.addPreference(getAutoPlayVideosPreference()); generalCategory.addPreference(getAlwaysMuteVideosPreference()); - final PreferenceCategory themeCategory = new PreferenceCategory(context); - screen.addPreference(themeCategory); - themeCategory.setTitle(R.string.pref_category_theme); - themeCategory.setIconSpaceReserved(false); - themeCategory.addPreference(getThemePreference()); - themeCategory.addPreference(getAmoledThemePreference()); + // screen.addPreference(getDivider(context)); + // final PreferenceCategory themeCategory = new PreferenceCategory(context); + // screen.addPreference(themeCategory); + // themeCategory.setTitle(R.string.pref_category_theme); + // themeCategory.setIconSpaceReserved(false); + // themeCategory.addPreference(getAmoledThemePreference()); final PreferenceCategory downloadsCategory = new PreferenceCategory(context); screen.addPreference(downloadsCategory); @@ -120,10 +123,6 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { final ListPreference preference = new ListPreference(context); preference.setEnabled(isLoggedIn); preference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance()); - final FragmentActivity activity = getActivity(); - if (activity == null) { - return preference; - } final TypedArray mainNavIds = getResources().obtainTypedArray(R.array.main_nav_ids); final int length = mainNavIds.length(); final String[] values = new String[length]; @@ -152,39 +151,14 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { return preference; } - private Preference getThemePreference() { - final Context context = getContext(); - if (context == null) return null; - final ListPreference preference = new ListPreference(context); - preference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance()); - final int length = getResources().getStringArray(R.array.theme_presets).length; - final String[] values = new String[length]; - for (int i = 0; i < length; i++) { - values[i] = String.valueOf(i); - } - preference.setKey(Constants.APP_THEME); - preference.setTitle(R.string.theme_settings); - preference.setDialogTitle(R.string.theme_settings); - preference.setEntries(R.array.theme_presets); + private Preference getThemePreference(@NonNull final Context context) { + final Preference preference = new Preference(context); + preference.setTitle(R.string.pref_category_theme); + // preference.setIcon(R.drawable.ic_format_paint_24); preference.setIconSpaceReserved(false); - preference.setEntryValues(values); - preference.setOnPreferenceChangeListener((preference1, newValue) -> { - shouldRecreate(); - return true; - }); - return preference; - } - - private SwitchPreferenceCompat getAmoledThemePreference() { - final Context context = getContext(); - if (context == null) return null; - final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(context); - preference.setKey(Constants.AMOLED_THEME); - preference.setTitle(R.string.use_amoled_dark_theme); - preference.setIconSpaceReserved(false); - preference.setOnPreferenceChangeListener((preference1, newValue) -> { - final boolean isNight = Utils.isNight(context, settingsHelper.getThemeCode(true)); - if (isNight) shouldRecreate(); + preference.setOnPreferenceClickListener(preference1 -> { + final NavDirections navDirections = SettingsPreferencesFragmentDirections.actionSettingsPreferencesFragmentToThemePreferencesFragment(); + NavHostFragment.findNavController(this).navigate(navDirections); return true; }); return preference; diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/ThemePreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/ThemePreferencesFragment.java new file mode 100644 index 00000000..d4dd578a --- /dev/null +++ b/app/src/main/java/awais/instagrabber/fragments/settings/ThemePreferencesFragment.java @@ -0,0 +1,94 @@ +package awais.instagrabber.fragments.settings; + +import android.content.Context; +import android.content.res.TypedArray; + +import androidx.annotation.NonNull; +import androidx.preference.ListPreference; +import androidx.preference.Preference; +import androidx.preference.PreferenceScreen; + +import awais.instagrabber.R; +import awais.instagrabber.utils.Constants; + +public class ThemePreferencesFragment extends BasePreferencesFragment { + @Override + void setupPreferenceScreen(final PreferenceScreen screen) { + final Context context = getContext(); + if (context == null) return; + screen.addPreference(getThemePreference(context)); + screen.addPreference(getLightThemePreference(context)); + screen.addPreference(getDarkThemePreference(context)); + } + + private Preference getThemePreference(@NonNull final Context context) { + final ListPreference preference = new ListPreference(context); + preference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance()); + final int length = getResources().getStringArray(R.array.theme_presets).length; + final String[] values = new String[length]; + for (int i = 0; i < length; i++) { + values[i] = String.valueOf(i); + } + preference.setKey(Constants.APP_THEME); + preference.setTitle(R.string.theme_settings); + preference.setDialogTitle(R.string.theme_settings); + preference.setEntries(R.array.theme_presets); + preference.setIconSpaceReserved(false); + preference.setEntryValues(values); + preference.setOnPreferenceChangeListener((preference1, newValue) -> { + shouldRecreate(); + return true; + }); + return preference; + } + + private Preference getLightThemePreference(final Context context) { + final ListPreference preference = new ListPreference(context); + preference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance()); + final TypedArray lightThemeValues = getResources().obtainTypedArray(R.array.light_theme_values); + final int length = lightThemeValues.length(); + final String[] values = new String[length]; + for (int i = 0; i < length; i++) { + final int resourceId = lightThemeValues.getResourceId(i, -1); + if (resourceId < 0) continue; + values[i] = String.valueOf(resourceId); + } + lightThemeValues.recycle(); + preference.setKey(Constants.PREF_LIGHT_THEME); + preference.setTitle(R.string.light_theme_settings); + preference.setDialogTitle(R.string.light_theme_settings); + preference.setEntries(R.array.light_themes); + preference.setIconSpaceReserved(false); + preference.setEntryValues(values); + preference.setOnPreferenceChangeListener((preference1, newValue) -> { + shouldRecreate(); + return true; + }); + return preference; + } + + private Preference getDarkThemePreference(final Context context) { + final ListPreference preference = new ListPreference(context); + preference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance()); + final TypedArray darkThemeValues = getResources().obtainTypedArray(R.array.dark_theme_values); + final int length = darkThemeValues.length(); + final String[] values = new String[length]; + for (int i = 0; i < length; i++) { + final int resourceId = darkThemeValues.getResourceId(i, -1); + if (resourceId < 0) continue; + values[i] = String.valueOf(resourceId); + } + darkThemeValues.recycle(); + preference.setKey(Constants.PREF_DARK_THEME); + preference.setTitle(R.string.dark_theme_settings); + preference.setDialogTitle(R.string.dark_theme_settings); + preference.setEntries(R.array.dark_themes); + preference.setIconSpaceReserved(false); + preference.setEntryValues(values); + preference.setOnPreferenceChangeListener((preference1, newValue) -> { + shouldRecreate(); + return true; + }); + return preference; + } +} diff --git a/app/src/main/java/awais/instagrabber/utils/Constants.java b/app/src/main/java/awais/instagrabber/utils/Constants.java index 72d6cf61..59251a02 100644 --- a/app/src/main/java/awais/instagrabber/utils/Constants.java +++ b/app/src/main/java/awais/instagrabber/utils/Constants.java @@ -24,7 +24,7 @@ public final class Constants { public static final String INSTADP = "instadp"; // deprecated: public static final String STORIESIG = "storiesig"; public static final String STORY_VIEWER = "story_viewer"; - public static final String AMOLED_THEME = "amoled_theme"; + // deprecated: public static final String AMOLED_THEME = "amoled_theme"; public static final String CHECK_ACTIVITY = "check_activity"; public static final String CHECK_UPDATES = "check_updates"; // never Export @@ -79,4 +79,6 @@ public final class Constants { public static final String NOTIF_GROUP_NAME = "awais.instagrabber.InstaNotif"; public static final int ACTIVITY_NOTIFICATION_ID = 1800000000; public static final String ACTION_SHOW_ACTIVITY = "show_activity"; + public static final String PREF_DARK_THEME = "dark_theme"; + public static final String PREF_LIGHT_THEME = "light_theme"; } \ No newline at end of file diff --git a/app/src/main/java/awais/instagrabber/utils/SettingsHelper.java b/app/src/main/java/awais/instagrabber/utils/SettingsHelper.java index 27476e09..839f6d99 100755 --- a/app/src/main/java/awais/instagrabber/utils/SettingsHelper.java +++ b/app/src/main/java/awais/instagrabber/utils/SettingsHelper.java @@ -8,7 +8,6 @@ import androidx.annotation.NonNull; import androidx.annotation.StringDef; import androidx.appcompat.app.AppCompatDelegate; -import static awais.instagrabber.utils.Constants.AMOLED_THEME; import static awais.instagrabber.utils.Constants.APP_LANGUAGE; import static awais.instagrabber.utils.Constants.APP_THEME; import static awais.instagrabber.utils.Constants.AUTOLOAD_POSTS; @@ -29,6 +28,8 @@ import static awais.instagrabber.utils.Constants.FOLDER_SAVE_TO; import static awais.instagrabber.utils.Constants.INSTADP; import static awais.instagrabber.utils.Constants.MARK_AS_SEEN; import static awais.instagrabber.utils.Constants.MUTED_VIDEOS; +import static awais.instagrabber.utils.Constants.PREF_DARK_THEME; +import static awais.instagrabber.utils.Constants.PREF_LIGHT_THEME; import static awais.instagrabber.utils.Constants.PREV_INSTALL_VERSION; import static awais.instagrabber.utils.Constants.SHOW_QUICK_ACCESS_DIALOG; import static awais.instagrabber.utils.Constants.SKIPPED_VERSION; @@ -116,10 +117,10 @@ public final class SettingsHelper { public @interface StringSettings {} @StringDef({DOWNLOAD_USER_FOLDER, FOLDER_SAVE_TO, AUTOPLAY_VIDEOS, SHOW_QUICK_ACCESS_DIALOG, MUTED_VIDEOS, - AUTOLOAD_POSTS, CUSTOM_DATE_TIME_FORMAT_ENABLED, MARK_AS_SEEN, DM_MARK_AS_SEEN, INSTADP, - AMOLED_THEME, CHECK_ACTIVITY, CHECK_UPDATES}) + AUTOLOAD_POSTS, CUSTOM_DATE_TIME_FORMAT_ENABLED, MARK_AS_SEEN, DM_MARK_AS_SEEN, INSTADP, + CHECK_ACTIVITY, CHECK_UPDATES}) public @interface BooleanSettings {} - @StringDef({PREV_INSTALL_VERSION}) + @StringDef({PREV_INSTALL_VERSION, PREF_DARK_THEME, PREF_LIGHT_THEME}) public @interface IntegerSettings {} } \ No newline at end of file diff --git a/app/src/main/java/awais/instagrabber/utils/ThemeUtils.java b/app/src/main/java/awais/instagrabber/utils/ThemeUtils.java new file mode 100644 index 00000000..4962d2f2 --- /dev/null +++ b/app/src/main/java/awais/instagrabber/utils/ThemeUtils.java @@ -0,0 +1,50 @@ +package awais.instagrabber.utils; + +import android.content.Context; +import android.content.res.Configuration; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatDelegate; + +import awais.instagrabber.R; + +import static awais.instagrabber.utils.Utils.settingsHelper; + +public final class ThemeUtils { + private static final String TAG = "ThemeUtils"; + + public static void changeTheme(@NonNull final Context context) { + int themeCode = AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM; // this is fallback / default + + if (settingsHelper != null) themeCode = settingsHelper.getThemeCode(false); + + if (themeCode == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM && Build.VERSION.SDK_INT < 29) { + themeCode = AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; + } + final boolean isNight = isNight(context, themeCode); + final int themeResId = isNight ? settingsHelper.getInteger(Constants.PREF_DARK_THEME) + : settingsHelper.getInteger(Constants.PREF_LIGHT_THEME); + + final int finalThemeResId; + if (themeResId <= 0) { + // Nothing set in settings + finalThemeResId = isNight ? R.style.AppTheme_Dark_Black + : R.style.AppTheme_Light_White; + } else finalThemeResId = themeResId; + // Log.d(TAG, "changeTheme: finalThemeResId: " + finalThemeResId); + context.setTheme(finalThemeResId); + } + + public static boolean isNight(final Context context, final int themeCode) { + // check if setting is set to 'Dark' + boolean isNight = themeCode == AppCompatDelegate.MODE_NIGHT_YES; + // if not dark check if themeCode is MODE_NIGHT_FOLLOW_SYSTEM or MODE_NIGHT_AUTO_BATTERY + if (!isNight && (themeCode == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM || themeCode == AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY)) { + // check if resulting theme would be NIGHT + final int uiMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + isNight = uiMode == Configuration.UI_MODE_NIGHT_YES; + } + return isNight; + } +} diff --git a/app/src/main/java/awais/instagrabber/utils/Utils.java b/app/src/main/java/awais/instagrabber/utils/Utils.java index d6e53351..1fed5097 100755 --- a/app/src/main/java/awais/instagrabber/utils/Utils.java +++ b/app/src/main/java/awais/instagrabber/utils/Utils.java @@ -64,39 +64,6 @@ public final class Utils { return Math.round((dp * displayMetrics.densityDpi) / 160.0f); } - public static void changeTheme(final Context context) { - int themeCode = AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM; // this is fallback / default - - if (settingsHelper != null) themeCode = settingsHelper.getThemeCode(false); - - if (themeCode == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM && Build.VERSION.SDK_INT < 29) - themeCode = AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; - - boolean isAmoledEnabled = false; - if (settingsHelper != null) { - isAmoledEnabled = settingsHelper.getBoolean(Constants.AMOLED_THEME); - } - AppCompatDelegate.setDefaultNightMode(themeCode); - // use amoled theme only if enabled in settings - if (isAmoledEnabled && isNight(context, themeCode)) { - // set amoled theme - Log.d(TAG, "settings amoled theme"); - context.setTheme(R.style.Theme_Amoled); - } - } - - public static boolean isNight(final Context context, final int themeCode) { - // check if setting is set to 'Dark' - boolean isNight = themeCode == AppCompatDelegate.MODE_NIGHT_YES; - // if not dark check if themeCode is MODE_NIGHT_FOLLOW_SYSTEM or MODE_NIGHT_AUTO_BATTERY - if (!isNight && (themeCode == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM || themeCode == AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY)) { - // check if resulting theme would be NIGHT - final int uiMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; - isNight = uiMode == Configuration.UI_MODE_NIGHT_YES; - } - return isNight; - } - public static void setTooltipText(final View view, @StringRes final int tooltipTextRes) { if (view != null && tooltipTextRes != 0 && tooltipTextRes != -1) { final Context context = view.getContext(); diff --git a/app/src/main/res/drawable/ic_format_paint_24.xml b/app/src/main/res/drawable/ic_format_paint_24.xml new file mode 100644 index 00000000..670824d2 --- /dev/null +++ b/app/src/main/res/drawable/ic_format_paint_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_profile.xml b/app/src/main/res/drawable/ic_profile.xml index 568656a1..213244e7 100755 --- a/app/src/main/res/drawable/ic_profile.xml +++ b/app/src/main/res/drawable/ic_profile.xml @@ -1,6 +1,7 @@ - + diff --git a/app/src/main/res/drawable/preference_list_divider_material.xml b/app/src/main/res/drawable/pref_list_divider_material.xml similarity index 93% rename from app/src/main/res/drawable/preference_list_divider_material.xml rename to app/src/main/res/drawable/pref_list_divider_material.xml index 23eff349..22286867 100644 --- a/app/src/main/res/drawable/preference_list_divider_material.xml +++ b/app/src/main/res/drawable/pref_list_divider_material.xml @@ -11,7 +11,7 @@ limitations under the License --> - + diff --git a/app/src/main/res/layout/item_follow.xml b/app/src/main/res/layout/item_follow.xml index de7a6825..9ab8ba18 100755 --- a/app/src/main/res/layout/item_follow.xml +++ b/app/src/main/res/layout/item_follow.xml @@ -48,5 +48,5 @@ android:layout_gravity="end" android:scaleType="fitCenter" android:visibility="gone" - app:srcCompat="@drawable/ic_star" /> + app:srcCompat="@drawable/ic_star_24" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_pref_divider.xml b/app/src/main/res/layout/item_pref_divider.xml index 45ae1d2c..b0ec9b3d 100644 --- a/app/src/main/res/layout/item_pref_divider.xml +++ b/app/src/main/res/layout/item_pref_divider.xml @@ -2,4 +2,4 @@ \ No newline at end of file + android:background="@drawable/pref_list_divider_material" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_suggestion.xml b/app/src/main/res/layout/item_suggestion.xml index 92e59e86..55425bb1 100755 --- a/app/src/main/res/layout/item_suggestion.xml +++ b/app/src/main/res/layout/item_suggestion.xml @@ -4,6 +4,9 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="?selectableItemBackground" + android:clickable="true" + android:focusable="true" android:padding="8dp"> + tools:background="@mipmap/ic_launcher" /> + tools:text="full name" + tools:visibility="visible" /> + android:label="@string/action_settings"> + + + \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index d5a5ec87..36e8abbc 100755 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -117,4 +117,16 @@ @navigation/profile_nav_graph @navigation/more_nav_graph + + @string/light_white_theme + + + @style/AppTheme.Light.White + + + @string/dark_black_theme + + + @style/AppTheme.Dark.Black + diff --git a/app/src/main/res/values/color.xml b/app/src/main/res/values/color.xml index 28705129..49e42c8d 100755 --- a/app/src/main/res/values/color.xml +++ b/app/src/main/res/values/color.xml @@ -35,4 +35,34 @@ #000000 + + #FFFFFF + #000000 + + #FAFAFA + #F5F5F5 + #EEEEEE + #E0E0E0 + #BDBDBD + #9E9E9E + #757575 + #616161 + #424242 + #212121 + #32757575 + + #E3F2FD + #BBDEFB + #90CAF9 + #64B5F6 + #42A5F5 + #2196F3 + #1E88E5 + #1976D2 + #1565C0 + #0D47A1 + #82B1FF + #448AFF + #2979FF + #2962FF \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5bcfa9bb..14604d74 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -277,4 +277,8 @@ The following third-party open-source libraries are used: Reminder Please use this app responsibly. Downloaded images should only be used for purposes allowed by applicable laws. + White + Black + Light theme + Dark theme \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ae9365f2..2e156512 100755 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -45,4 +45,50 @@ ?attr/textAppearanceSubtitle1 ?attr/colorPrimary + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index d2130400..553ef905 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,19 +1,58 @@ - - + + + +