From 3357c75c3f209e3396400a5d6cc47bf8d0167f42 Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Sun, 7 Aug 2022 14:29:07 +0800 Subject: [PATCH] Added theme switch --- .idea/deploymentTargetDropDown.xml | 4 +- .idea/misc.xml | 17 +- app/src/main/AndroidManifest.xml | 28 +-- .../java/com/fatapp/oxygentoolbox/App.java | 7 +- .../fatapp/oxygentoolbox/MainActivity.java | 20 +- .../fatapp/oxygentoolbox/SplashActivity.java | 1 - .../oxygentoolbox/layout/FoldLayout.java | 8 +- .../oxygentoolbox/ui/home/HomeFragment.java | 2 +- .../ui/home/tools/ToolsFragment.java | 4 +- .../oxygentoolbox/ui/theme/ThemeFragment.java | 8 + .../ui/theme/util/ThemesAdapter.java | 163 +++++++++++++ .../oxygentoolbox/util/ResourceUtil.java | 93 +++++++- .../util/SharedPreferencesUtils.java | 19 +- ...round.xml => background_bottom_radius.xml} | 0 .../res/drawable/background_no_radius.xml | 4 + ...d.xml => background_top_bottom_radius.xml} | 0 ...ckground.xml => background_top_radius.xml} | 0 app/src/main/res/drawable/ic_check.xml | 10 + .../res/drawable/ic_setting_theme_mode.xml | 10 + ...tton_radius_shape.xml => radius_shape.xml} | 0 app/src/main/res/drawable/selector_themes.xml | 5 + app/src/main/res/drawable/side_nav_bar.xml | 4 +- .../main/res/layout/activity_libraries.xml | 15 +- app/src/main/res/layout/activity_main.xml | 6 +- app/src/main/res/layout/activity_splash.xml | 10 +- app/src/main/res/layout/app_bar_main.xml | 2 +- ...{content_main.xml => app_content_main.xml} | 0 ...eader_main.xml => app_nav_header_main.xml} | 0 app/src/main/res/layout/basic_tool_list.xml | 24 -- app/src/main/res/layout/fold_layout_body.xml | 2 +- ...tool_button.xml => fold_layout_button.xml} | 0 app/src/main/res/layout/fold_layout_head.xml | 3 +- app/src/main/res/layout/fragment_about.xml | 5 +- app/src/main/res/layout/fragment_home.xml | 2 +- app/src/main/res/layout/fragment_home_fav.xml | 2 +- .../main/res/layout/fragment_home_tools.xml | 2 +- app/src/main/res/layout/fragment_theme.xml | 40 +--- app/src/main/res/layout/item_libraries.xml | 15 +- app/src/main/res/layout/item_themes.xml | 50 ++++ app/src/main/res/raw/dependencies.json | 2 +- app/src/main/res/values-night/colors.xml | 27 +-- app/src/main/res/values-zh-rCN/strings.xml | 27 +++ app/src/main/res/values-zh-rHK/strings.xml | 27 +++ app/src/main/res/values-zh-rTW/strings.xml | 27 +++ app/src/main/res/values/attrs.xml | 12 +- app/src/main/res/values/colors.xml | 135 +++++++++-- app/src/main/res/values/strings.xml | 51 +++- app/src/main/res/values/styles.xml | 4 +- app/src/main/res/values/themes.xml | 219 ++++++++++++++++-- app/src/main/res/xml/fragment_setting.xml | 1 + build.gradle | 4 +- 51 files changed, 916 insertions(+), 205 deletions(-) create mode 100644 app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/util/ThemesAdapter.java rename app/src/main/res/drawable/{bottom_radius_background.xml => background_bottom_radius.xml} (100%) create mode 100644 app/src/main/res/drawable/background_no_radius.xml rename app/src/main/res/drawable/{top_bottom_radius_background.xml => background_top_bottom_radius.xml} (100%) rename app/src/main/res/drawable/{top_radius_background.xml => background_top_radius.xml} (100%) create mode 100644 app/src/main/res/drawable/ic_check.xml create mode 100644 app/src/main/res/drawable/ic_setting_theme_mode.xml rename app/src/main/res/drawable/{button_radius_shape.xml => radius_shape.xml} (100%) create mode 100644 app/src/main/res/drawable/selector_themes.xml rename app/src/main/res/layout/{content_main.xml => app_content_main.xml} (100%) rename app/src/main/res/layout/{nav_header_main.xml => app_nav_header_main.xml} (100%) delete mode 100644 app/src/main/res/layout/basic_tool_list.xml rename app/src/main/res/layout/{tool_button.xml => fold_layout_button.xml} (100%) create mode 100644 app/src/main/res/layout/item_themes.xml diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 8ee39bf..14922df 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -7,12 +7,12 @@ - + - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 9a31dbe..41b83d3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -10,11 +10,16 @@ + + + + + @@ -29,9 +34,12 @@ + + + @@ -42,11 +50,11 @@ - + - + - + @@ -57,8 +65,9 @@ - + + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2b28126..040e874 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,11 +11,6 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.OxygenToolbox.Default"> - + + + + + + + - - - - - - + android:name=".ui.about.LibrariesActivity" + android:exported="false" + android:label="@string/setting_open_source" + android:theme="@style/Theme.OxygenToolbox.Default" /> drawer.setDrawerLockMode(navigationView.getMenu().getItem(0).isChecked() ? DrawerLayout.LOCK_MODE_UNLOCKED diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/SplashActivity.java b/app/src/main/java/com/fatapp/oxygentoolbox/SplashActivity.java index 293dbea..a9e1392 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/SplashActivity.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/SplashActivity.java @@ -14,7 +14,6 @@ public class SplashActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { // Handle the splash screen transition. SplashScreen splashScreen = SplashScreen.installSplashScreen(this); - super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); new Thread() { diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/layout/FoldLayout.java b/app/src/main/java/com/fatapp/oxygentoolbox/layout/FoldLayout.java index a5402f8..c255f55 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/layout/FoldLayout.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/layout/FoldLayout.java @@ -103,13 +103,13 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener { isShow = true; layoutParams.height = contentHeight; LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout); - linearLayout.setBackground(AppCompatResources.getDrawable(getContext(), R.drawable.top_radius_background)); + linearLayout.setBackground(AppCompatResources.getDrawable(getContext(), R.drawable.background_top_radius)); ImageView imageView = defaultView.findViewById(R.id.arrow_icon); imageView.setImageDrawable(AppCompatResources.getDrawable(getContext(), R.drawable.down_to_right_arrow)); } else { layoutParams.height = 0; LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout); - linearLayout.setBackground(AppCompatResources.getDrawable(getContext(), R.drawable.top_bottom_radius_background)); + linearLayout.setBackground(AppCompatResources.getDrawable(getContext(), R.drawable.background_top_bottom_radius)); ImageView imageView = defaultView.findViewById(R.id.arrow_icon); imageView.setImageDrawable(AppCompatResources.getDrawable(getContext(), R.drawable.right_to_down_arrow)); } @@ -125,7 +125,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener { public void onAnimationStart(Animator animation) { super.onAnimationStart(animation); LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout); - linearLayout.setBackground(getContext().getDrawable(R.drawable.top_radius_background)); + linearLayout.setBackground(getContext().getDrawable(R.drawable.background_top_radius)); } }); @@ -141,7 +141,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener { super.onAnimationEnd(animation); if (!isShow) { LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout); - linearLayout.setBackground(getContext().getDrawable(R.drawable.top_bottom_radius_background)); + linearLayout.setBackground(getContext().getDrawable(R.drawable.background_top_bottom_radius)); } } }); diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/HomeFragment.java b/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/HomeFragment.java index 80b45ff..df30ea0 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/HomeFragment.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/HomeFragment.java @@ -56,7 +56,7 @@ public class HomeFragment extends Fragment { } }); - bottomNavViewPager.setCurrentItem(SharedPreferencesUtils.getPreferenceLaunchPage() == SharedPreferencesUtils.LaunchPage.tools ? 0 : 1, false); + bottomNavViewPager.setCurrentItem(SharedPreferencesUtils.getPreferenceLaunchPage() == SharedPreferencesUtils.LaunchPage.TOOLS ? 0 : 1, false); return root; } diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/tools/ToolsFragment.java b/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/tools/ToolsFragment.java index 0aa185d..25e5c90 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/tools/ToolsFragment.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/ui/home/tools/ToolsFragment.java @@ -68,7 +68,7 @@ public class ToolsFragment extends Fragment { ViewGroup autoLinefeedLayout = foldLayoutBodyLayout.findViewById(R.id.auto_linefeed_layout); for (ToolsList.Button button : tool.getButtonList()) { - View toolButtonLayout = getLayoutInflater().inflate(R.layout.tool_button, null); + View toolButtonLayout = getLayoutInflater().inflate(R.layout.fold_layout_button, null); Button toolButton = toolButtonLayout.findViewById(R.id.tool_button); toolButton.setText(button.getText()); @@ -112,7 +112,7 @@ public class ToolsFragment extends Fragment { } for (int i = 0; i < 10; i++) { - View toolButton = getLayoutInflater().inflate(R.layout.tool_button, null); + View toolButton = getLayoutInflater().inflate(R.layout.fold_layout_button, null); ((Button) toolButton.findViewById(R.id.tool_button)).setText("Button"); toolButton.findViewById(R.id.tool_button).setOnClickListener(v -> { }); diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/ThemeFragment.java b/app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/ThemeFragment.java index 6fad9ae..8e5dca6 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/ThemeFragment.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/ThemeFragment.java @@ -8,8 +8,11 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import com.fatapp.oxygentoolbox.R; +import com.fatapp.oxygentoolbox.ui.theme.util.ThemesAdapter; public class ThemeFragment extends Fragment { @@ -18,6 +21,11 @@ public class ThemeFragment extends Fragment { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { themeViewModel = new ViewModelProvider(this).get(ThemeViewModel.class); View root = inflater.inflate(R.layout.fragment_theme, container, false); + + RecyclerView themeRecyclerView = root.findViewById(R.id.theme_recycler_view); + themeRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + themeRecyclerView.setAdapter(new ThemesAdapter(getActivity())); + return root; } } \ No newline at end of file diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/util/ThemesAdapter.java b/app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/util/ThemesAdapter.java new file mode 100644 index 0000000..0655de9 --- /dev/null +++ b/app/src/main/java/com/fatapp/oxygentoolbox/ui/theme/util/ThemesAdapter.java @@ -0,0 +1,163 @@ +package com.fatapp.oxygentoolbox.ui.theme.util; + +import android.app.Activity; +import android.graphics.drawable.GradientDrawable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.fatapp.oxygentoolbox.R; +import com.fatapp.oxygentoolbox.util.ResourceUtil; +import com.fatapp.oxygentoolbox.util.SharedPreferencesUtils; + +public class ThemesAdapter extends RecyclerView.Adapter { + private final Activity activity; + + public ThemesAdapter(Activity activity) { + this.activity = activity; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_themes, parent, false); + return new ViewHolder(inflate); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + holder.getColorName().setText(ResourceUtil.getStringArray(R.array.setting_theme_array)[position]); + holder.getCheck().setSelected(position == SharedPreferencesUtils.getPreferenceTheme().ordinal()); + switch (position) { + case 0: + setColor(holder, R.color.red_primary, R.color.red_primary_dark, R.color.red_primary_light, R.color.red_accent); + break; + case 1: + setColor(holder, R.color.pink_primary, R.color.pink_primary_dark, R.color.pink_primary_light, R.color.pink_accent); + break; + case 2: + setColor(holder, R.color.purple_primary, R.color.purple_primary_dark, R.color.purple_primary_light, R.color.purple_accent); + break; + case 3: + setColor(holder, R.color.deep_purple_primary, R.color.deep_purple_primary_dark, R.color.deep_purple_primary_light, R.color.deep_purple_accent); + break; + case 4: + setColor(holder, R.color.indigo_primary, R.color.indigo_primary_dark, R.color.indigo_primary_light, R.color.indigo_accent); + break; + case 5: + setColor(holder, R.color.blue_primary, R.color.blue_primary_dark, R.color.blue_primary_light, R.color.blue_accent); + break; + case 6: + setColor(holder, R.color.light_blue_primary, R.color.light_blue_primary_dark, R.color.light_blue_primary_light, R.color.light_blue_accent); + break; + case 7: + setColor(holder, R.color.cyan_primary, R.color.cyan_primary_dark, R.color.cyan_primary_light, R.color.cyan_accent); + break; + case 8: + setColor(holder, R.color.teal_primary, R.color.teal_primary_dark, R.color.teal_primary_light, R.color.teal_accent); + break; + case 9: + setColor(holder, R.color.green_primary, R.color.green_primary_dark, R.color.green_primary_light, R.color.green_accent); + break; + case 10: + setColor(holder, R.color.light_green_primary, R.color.light_green_primary_dark, R.color.light_green_primary_light, R.color.light_green_accent); + break; + case 11: + setColor(holder, R.color.lime_primary, R.color.lime_primary_dark, R.color.lime_primary_light, R.color.lime_accent); + break; + case 12: + setColor(holder, R.color.yellow_primary, R.color.yellow_primary_dark, R.color.yellow_primary_light, R.color.yellow_accent); + break; + case 13: + setColor(holder, R.color.amber_primary, R.color.amber_primary_dark, R.color.amber_primary_light, R.color.amber_accent); + break; + case 14: + setColor(holder, R.color.orange_primary, R.color.orange_primary_dark, R.color.orange_primary_light, R.color.orange_accent); + break; + case 15: + setColor(holder, R.color.deep_orange_primary, R.color.deep_orange_primary_dark, R.color.deep_orange_primary_light, R.color.deep_orange_accent); + break; + case 16: + setColor(holder, R.color.brown_primary, R.color.brown_primary_dark, R.color.brown_primary_light, R.color.brown_accent); + break; + case 17: + setColor(holder, R.color.grey_primary, R.color.grey_primary_dark, R.color.grey_primary_light, R.color.grey_accent); + break; + case 18: + setColor(holder, R.color.blue_grey_primary, R.color.blue_grey_primary_dark, R.color.blue_grey_primary_light, R.color.blue_grey_accent); + break; + } + + holder.getThemeLayout().setOnClickListener(view -> { + SharedPreferencesUtils.setPreferenceTheme(SharedPreferencesUtils.Theme.values()[position]); + ResourceUtil.restartActivity(activity, activity.getClass()); + }); + } + + @Override + public int getItemCount() { + return SharedPreferencesUtils.Theme.values().length; + } + + public static class ViewHolder extends RecyclerView.ViewHolder { + private final LinearLayout themeLayout; + private final TextView colorName; + private final View check; + private final View primaryColor; + private final View primaryDarkColor; + private final View primaryLightColor; + private final View accentColor; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + themeLayout = itemView.findViewById(R.id.theme_layout); + colorName = itemView.findViewById(R.id.color_name); + check = itemView.findViewById(R.id.check); + primaryColor = itemView.findViewById(R.id.primary_color); + primaryDarkColor = itemView.findViewById(R.id.primary_dark_color); + primaryLightColor = itemView.findViewById(R.id.primary_light_color); + accentColor = itemView.findViewById(R.id.accent_color); + } + + public LinearLayout getThemeLayout() { + return themeLayout; + } + + public TextView getColorName() { + return colorName; + } + + public View getCheck() { + return check; + } + + public View getPrimaryColor() { + return primaryColor; + } + + public View getPrimaryDarkColor() { + return primaryDarkColor; + } + + public View getPrimaryLightColor() { + return primaryLightColor; + } + + public View getAccentColor() { + return accentColor; + } + } + + private void setColor(@NonNull ViewHolder holder, @ColorRes int primary, @ColorRes int primaryDark, @ColorRes int primaryLight, @ColorRes int accent) { + ((GradientDrawable) holder.getPrimaryColor().getBackground()).setColor(ResourceUtil.getColor(primary)); + ((GradientDrawable) holder.getPrimaryDarkColor().getBackground()).setColor(ResourceUtil.getColor(primaryDark)); + ((GradientDrawable) holder.getPrimaryLightColor().getBackground()).setColor(ResourceUtil.getColor(primaryLight)); + ((GradientDrawable) holder.getAccentColor().getBackground()).setColor(ResourceUtil.getColor(accent)); + } +} diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/util/ResourceUtil.java b/app/src/main/java/com/fatapp/oxygentoolbox/util/ResourceUtil.java index 38f184c..4be8b4b 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/util/ResourceUtil.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/util/ResourceUtil.java @@ -16,14 +16,18 @@ import android.os.LocaleList; import android.util.DisplayMetrics; import android.view.Window; +import androidx.annotation.ArrayRes; import androidx.annotation.AttrRes; import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; import androidx.annotation.NonNull; +import androidx.annotation.StringRes; import androidx.annotation.StyleRes; import androidx.appcompat.view.ContextThemeWrapper; import androidx.core.os.ConfigurationCompat; import androidx.core.os.LocaleListCompat; +import com.fatapp.oxygentoolbox.R; import com.google.android.material.color.MaterialColors; import java.util.Locale; @@ -59,11 +63,15 @@ public final class ResourceUtil { return sApp.getResources().getDisplayMetrics(); } - public static String getString(int resId) { + public static String getString(@StringRes int resId) { return sApp.getResources().getString(resId); } - public static int getColor(int resId) { + public static String[] getStringArray(@ArrayRes int redId) { + return sApp.getResources().getStringArray(redId); + } + + public static int getColor(@ColorRes int resId) { return sApp.getResources().getColor(resId); } @@ -183,4 +191,85 @@ public final class ResourceUtil { return -1; } } + + public static void loadAppTheme(Activity activity) { + switch (SharedPreferencesUtils.getPreferenceTheme()) { + case RED: + activity.setTheme(R.style.Theme_OxygenToolbox_Red); + activity.getWindow().setStatusBarColor(getColor(R.color.red_primary)); + break; + case PINK: + activity.setTheme(R.style.Theme_OxygenToolbox_Pink); + activity.getWindow().setStatusBarColor(getColor(R.color.pink_primary)); + break; + case PURPLE: + activity.setTheme(R.style.Theme_OxygenToolbox_Purple); + activity.getWindow().setStatusBarColor(getColor(R.color.purple_primary)); + break; + case DEEP_PURPLE: + activity.setTheme(R.style.Theme_OxygenToolbox_DeepPurple); + activity.getWindow().setStatusBarColor(getColor(R.color.deep_purple_primary)); + break; + case INDIGO: + activity.setTheme(R.style.Theme_OxygenToolbox_Indigo); + activity.getWindow().setStatusBarColor(getColor(R.color.indigo_primary)); + break; + case BLUE: + activity.setTheme(R.style.Theme_OxygenToolbox_Blue); + activity.getWindow().setStatusBarColor(getColor(R.color.blue_primary)); + break; + case LIGHT_BLUE: + activity.setTheme(R.style.Theme_OxygenToolbox_LightBlue); + activity.getWindow().setStatusBarColor(getColor(R.color.light_blue_primary)); + break; + case CYAN: + activity.setTheme(R.style.Theme_OxygenToolbox_Cyan); + activity.getWindow().setStatusBarColor(getColor(R.color.cyan_primary)); + break; + case TEAL: + activity.setTheme(R.style.Theme_OxygenToolbox_Teal); + activity.getWindow().setStatusBarColor(getColor(R.color.teal_primary)); + break; + case GREEN: + activity.setTheme(R.style.Theme_OxygenToolbox_Green); + activity.getWindow().setStatusBarColor(getColor(R.color.green_primary)); + break; + case LIGHT_GREEN: + activity.setTheme(R.style.Theme_OxygenToolbox_LightGreen); + activity.getWindow().setStatusBarColor(getColor(R.color.light_green_primary)); + break; + case LIME: + activity.setTheme(R.style.Theme_OxygenToolbox_Lime); + activity.getWindow().setStatusBarColor(getColor(R.color.lime_primary)); + break; + case YELLOW: + activity.setTheme(R.style.Theme_OxygenToolbox_Yellow); + activity.getWindow().setStatusBarColor(getColor(R.color.yellow_primary)); + break; + case AMBER: + activity.setTheme(R.style.Theme_OxygenToolbox_Amber); + activity.getWindow().setStatusBarColor(getColor(R.color.amber_primary)); + break; + case ORANGE: + activity.setTheme(R.style.Theme_OxygenToolbox_Orange); + activity.getWindow().setStatusBarColor(getColor(R.color.orange_primary)); + break; + case DEEP_ORANGE: + activity.setTheme(R.style.Theme_OxygenToolbox_DeepOrange); + activity.getWindow().setStatusBarColor(getColor(R.color.deep_orange_primary)); + break; + case BROWN: + activity.setTheme(R.style.Theme_OxygenToolbox_Brown); + activity.getWindow().setStatusBarColor(getColor(R.color.brown_primary)); + break; + case GREY: + activity.setTheme(R.style.Theme_OxygenToolbox_Grey); + activity.getWindow().setStatusBarColor(getColor(R.color.grey_primary)); + break; + case BLUE_GREY: + activity.setTheme(R.style.Theme_OxygenToolbox_BlueGrey); + activity.getWindow().setStatusBarColor(getColor(R.color.blue_grey_primary)); + break; + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java b/app/src/main/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java index f5ff92d..e9fa7fd 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java @@ -45,13 +45,28 @@ public class SharedPreferencesUtils { return UiMode.valueOf(preferences.getString(ResourceUtil.getString(R.string.setting_ui_mode_key), ResourceUtil.getString(R.string.setting_ui_mode_default_value))); } + public static Theme getPreferenceTheme() { + return Theme.valueOf(preferences.getString(ResourceUtil.getString(R.string.setting_theme_key), ResourceUtil.getString(R.string.setting_theme_default_value))); + } + + public static void setPreferenceTheme(Theme theme) { + SharedPreferences.Editor editor = preferences.edit(); + editor.putString(ResourceUtil.getString(R.string.setting_theme_key), theme.toString()); + editor.apply(); + } + @SuppressWarnings("unused") public enum LaunchPage { - tools, favourites + TOOLS, FAVOURITES } @SuppressWarnings("unused") public enum UiMode { - system, light, dark + SYSTEM, LIGHT, DARK + } + + @SuppressWarnings("unused") + public enum Theme { + RED, PINK, PURPLE, DEEP_PURPLE, INDIGO, BLUE, LIGHT_BLUE, CYAN, TEAL, GREEN, LIGHT_GREEN, LIME, YELLOW, AMBER, ORANGE, DEEP_ORANGE, BROWN, GREY, BLUE_GREY } } \ No newline at end of file diff --git a/app/src/main/res/drawable/bottom_radius_background.xml b/app/src/main/res/drawable/background_bottom_radius.xml similarity index 100% rename from app/src/main/res/drawable/bottom_radius_background.xml rename to app/src/main/res/drawable/background_bottom_radius.xml diff --git a/app/src/main/res/drawable/background_no_radius.xml b/app/src/main/res/drawable/background_no_radius.xml new file mode 100644 index 0000000..1b5a057 --- /dev/null +++ b/app/src/main/res/drawable/background_no_radius.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/top_bottom_radius_background.xml b/app/src/main/res/drawable/background_top_bottom_radius.xml similarity index 100% rename from app/src/main/res/drawable/top_bottom_radius_background.xml rename to app/src/main/res/drawable/background_top_bottom_radius.xml diff --git a/app/src/main/res/drawable/top_radius_background.xml b/app/src/main/res/drawable/background_top_radius.xml similarity index 100% rename from app/src/main/res/drawable/top_radius_background.xml rename to app/src/main/res/drawable/background_top_radius.xml diff --git a/app/src/main/res/drawable/ic_check.xml b/app/src/main/res/drawable/ic_check.xml new file mode 100644 index 0000000..2201551 --- /dev/null +++ b/app/src/main/res/drawable/ic_check.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_setting_theme_mode.xml b/app/src/main/res/drawable/ic_setting_theme_mode.xml new file mode 100644 index 0000000..152e19c --- /dev/null +++ b/app/src/main/res/drawable/ic_setting_theme_mode.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/button_radius_shape.xml b/app/src/main/res/drawable/radius_shape.xml similarity index 100% rename from app/src/main/res/drawable/button_radius_shape.xml rename to app/src/main/res/drawable/radius_shape.xml diff --git a/app/src/main/res/drawable/selector_themes.xml b/app/src/main/res/drawable/selector_themes.xml new file mode 100644 index 0000000..540de23 --- /dev/null +++ b/app/src/main/res/drawable/selector_themes.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml index d4f9832..5dee14c 100644 --- a/app/src/main/res/drawable/side_nav_bar.xml +++ b/app/src/main/res/drawable/side_nav_bar.xml @@ -2,8 +2,8 @@ android:shape="rectangle"> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_libraries.xml b/app/src/main/res/layout/activity_libraries.xml index a046c64..dbd87a1 100644 --- a/app/src/main/res/layout/activity_libraries.xml +++ b/app/src/main/res/layout/activity_libraries.xml @@ -4,18 +4,18 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/libraries_page" android:layout_width="match_parent" - android:background="?attr/app_background" android:layout_height="match_parent" + android:background="?attr/app_background_theme" tools:context=".ui.about.LibrariesActivity"> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/app_bar_layout" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index bab13e8..cb84b13 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -4,8 +4,7 @@ android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="false" - android:background="?attr/app_background" + android:background="?attr/app_background_theme" tools:openDrawer="start"> + android:background="?attr/app_background_theme" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml index ac58358..f172fd8 100644 --- a/app/src/main/res/layout/activity_splash.xml +++ b/app/src/main/res/layout/activity_splash.xml @@ -1,19 +1,19 @@ + android:layout_height="match_parent" + android:background="?attr/windowSplashScreenBackground"> + app:layout_constraintTop_toTopOf="parent" /> \ No newline at end of file diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index 8a61836..1849960 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -21,6 +21,6 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/app_content_main.xml similarity index 100% rename from app/src/main/res/layout/content_main.xml rename to app/src/main/res/layout/app_content_main.xml diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/app_nav_header_main.xml similarity index 100% rename from app/src/main/res/layout/nav_header_main.xml rename to app/src/main/res/layout/app_nav_header_main.xml diff --git a/app/src/main/res/layout/basic_tool_list.xml b/app/src/main/res/layout/basic_tool_list.xml deleted file mode 100644 index b25def7..0000000 --- a/app/src/main/res/layout/basic_tool_list.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fold_layout_body.xml b/app/src/main/res/layout/fold_layout_body.xml index 260ab0e..e0784f5 100644 --- a/app/src/main/res/layout/fold_layout_body.xml +++ b/app/src/main/res/layout/fold_layout_body.xml @@ -15,7 +15,7 @@ android:layout_marginRight="10dp" android:paddingHorizontal="5dp" android:paddingBottom="2dp" - android:background="@drawable/bottom_radius_background" + android:background="@drawable/background_bottom_radius" android:gravity="center_vertical"> diff --git a/app/src/main/res/layout/tool_button.xml b/app/src/main/res/layout/fold_layout_button.xml similarity index 100% rename from app/src/main/res/layout/tool_button.xml rename to app/src/main/res/layout/fold_layout_button.xml diff --git a/app/src/main/res/layout/fold_layout_head.xml b/app/src/main/res/layout/fold_layout_head.xml index faa1579..89f0fe9 100644 --- a/app/src/main/res/layout/fold_layout_head.xml +++ b/app/src/main/res/layout/fold_layout_head.xml @@ -25,7 +25,8 @@ android:layout_weight="6" android:gravity="center_vertical" android:textColor="?attr/app_text_theme" - android:textSize="18sp" /> + android:textSize="18sp" + android:textStyle="bold" /> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 2444f47..4975d07 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/app_background"> + android:background="?attr/app_background_theme"> diff --git a/app/src/main/res/layout/fragment_home_tools.xml b/app/src/main/res/layout/fragment_home_tools.xml index 4963e38..aadf3f3 100644 --- a/app/src/main/res/layout/fragment_home_tools.xml +++ b/app/src/main/res/layout/fragment_home_tools.xml @@ -4,7 +4,7 @@ android:id="@+id/fragment_home_tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/app_background" + android:background="?attr/app_background_theme" android:orientation="vertical" tools:context=".ui.home.tools.ToolsFragment"> diff --git a/app/src/main/res/layout/fragment_theme.xml b/app/src/main/res/layout/fragment_theme.xml index 4f3015c..5878da2 100644 --- a/app/src/main/res/layout/fragment_theme.xml +++ b/app/src/main/res/layout/fragment_theme.xml @@ -1,38 +1,16 @@ - - - - - - - - - - - \ No newline at end of file + android:layout_height="match_parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + \ No newline at end of file diff --git a/app/src/main/res/layout/item_libraries.xml b/app/src/main/res/layout/item_libraries.xml index 199a96a..3424495 100644 --- a/app/src/main/res/layout/item_libraries.xml +++ b/app/src/main/res/layout/item_libraries.xml @@ -8,6 +8,7 @@ android:layout_marginTop="@dimen/library_item_card_margin_vertical" android:layout_marginEnd="@dimen/library_item_card_margin_horizontal" android:layout_marginBottom="@dimen/library_item_card_margin_vertical" + android:background="?attr/app_on_background_theme" android:clickable="true" android:focusable="true"> @@ -29,6 +30,8 @@ android:paddingEnd="@dimen/library_item_card_inner_padding" android:paddingRight="@dimen/library_item_card_inner_padding" android:textAppearance="?textAppearanceHeadline5" + android:textColor="?attr/app_text_theme" + android:textStyle="bold" app:layout_constraintBottom_toTopOf="@+id/library_creator" app:layout_constraintEnd_toStartOf="@+id/library_version" app:layout_constraintHorizontal_weight="1" @@ -47,6 +50,7 @@ android:paddingEnd="@dimen/library_item_card_inner_padding" android:paddingRight="@dimen/library_item_card_inner_padding" android:textAppearance="?textAppearanceSubtitle1" + android:textColor="?attr/app_second_text_theme" app:layout_constraintBottom_toTopOf="@+id/library_description_divider" app:layout_constraintEnd_toStartOf="@+id/library_version" app:layout_constraintStart_toStartOf="parent" @@ -62,6 +66,7 @@ android:paddingTop="@dimen/library_item_card_inner_padding" android:paddingEnd="@dimen/library_item_card_inner_padding" android:textAppearance="?textAppearanceBody2" + android:textColor="?attr/app_second_text_theme" app:layout_constrainedWidth="true" app:layout_constraintBottom_toBottomOf="@id/library_name" app:layout_constraintEnd_toEndOf="parent" @@ -73,9 +78,9 @@ android:id="@+id/library_description_divider" android:layout_width="0dp" android:layout_height="1dp" - android:layout_marginVertical="@dimen/library_item_card_divider_padding_vertical" android:layout_marginHorizontal="@dimen/library_item_card_divider_padding_horizontal" - android:background="?attr/app_background" + android:layout_marginVertical="@dimen/library_item_card_divider_padding_vertical" + android:background="?attr/app_divider_theme" app:layout_constraintBottom_toTopOf="@id/library_description" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -89,6 +94,7 @@ android:layout_marginRight="@dimen/library_item_card_inner_padding" android:maxLines="20" android:textAppearance="?textAppearanceBody2" + android:textColor="?attr/app_text_theme" app:layout_constraintBottom_toTopOf="@id/library_bottom_divider" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -99,9 +105,9 @@ android:id="@+id/library_bottom_divider" android:layout_width="0dp" android:layout_height="1dp" - android:layout_marginVertical="@dimen/library_item_card_divider_padding_vertical" android:layout_marginHorizontal="@dimen/library_item_card_divider_padding_horizontal" - android:background="?attr/app_background" + android:layout_marginVertical="@dimen/library_item_card_divider_padding_vertical" + android:background="?attr/app_divider_theme" app:layout_constraintBottom_toTopOf="@id/library_license" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -119,6 +125,7 @@ android:paddingRight="@dimen/library_item_card_inner_padding" android:paddingBottom="@dimen/library_item_card_inner_padding" android:textAppearance="?textAppearanceBody1" + android:textColor="?attr/app_text_theme" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/item_themes.xml b/app/src/main/res/layout/item_themes.xml new file mode 100644 index 0000000..cb60ff6 --- /dev/null +++ b/app/src/main/res/layout/item_themes.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/raw/dependencies.json b/app/src/main/res/raw/dependencies.json index dc901ce..bc8e7cf 100644 --- a/app/src/main/res/raw/dependencies.json +++ b/app/src/main/res/raw/dependencies.json @@ -1 +1 @@ -{"metadata":{"generated":"2022-07-16T18:14:05.968Z"},"libraries":[{"uniqueId":"com.google.code.gson:gson","funding":[],"developers":[],"artifactVersion":"2.9.0","description":"Gson JSON library","scm":{"connection":"scm:git:https://github.com/google/gson.git","url":"https://github.com/google/gson/","developerConnection":"scm:git:git@github.com:google/gson.git"},"name":"Gson","website":"https://github.com/google/gson","licenses":["Apache-2.0"]}],"licenses":{"Apache-2.0":{"content":"Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.","hash":"Apache-2.0","internalHash":"Apache-2.0","url":"https://spdx.org/licenses/Apache-2.0.html","spdxId":"Apache-2.0","name":"Apache License 2.0"}}} \ No newline at end of file +{"metadata":{"generated":"2022-08-05T11:15:53.502Z"},"libraries":[{"uniqueId":"com.google.code.gson:gson","funding":[],"developers":[],"artifactVersion":"2.9.0","description":"Gson JSON library","scm":{"connection":"scm:git:https://github.com/google/gson.git","url":"https://github.com/google/gson/","developerConnection":"scm:git:git@github.com:google/gson.git"},"name":"Gson","website":"https://github.com/google/gson","licenses":["Apache-2.0"]}],"licenses":{"Apache-2.0":{"content":"Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.","hash":"Apache-2.0","internalHash":"Apache-2.0","url":"https://spdx.org/licenses/Apache-2.0.html","spdxId":"Apache-2.0","name":"Apache License 2.0"}}} \ No newline at end of file diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 4a87726..d2ebf23 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -1,24 +1,9 @@ - #FFBB86FC - #FF6200EE - #FF3700B3 - #FF03DAC5 - #FF018786 - #FF000000 - #FFFFFFFF - - @color/purple_200 - @color/white - @color/white - #FF202020 - - @color/teal_700 - @color/black - - #FF303030 - #FF666666 - @color/default_app_background - #FFFAFAFA - #88CCCCCC + #FF202020 + #FF303030 + #FFEEEEEE + #FF757575 + #88CCCCCC + #FFADADAD \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 8a476d5..28c8a7d 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -25,23 +25,50 @@ 深色主题 基本设置 + 语言 跟随系统 中文 English + 启动页 工具 收藏 + 主题模式 跟随系统 亮色 深色 + + 主题 + + + + + 深紫 + 靛青 + + 亮蓝 + + 青绿 + 绿 + 亮绿 + 酸橙 + + 琥珀 + + 深橙 + + + 蓝灰 + + 开源许可 查找 关于 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 8a476d5..28c8a7d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -25,23 +25,50 @@ 深色主题 基本设置 + 语言 跟随系统 中文 English + 启动页 工具 收藏 + 主题模式 跟随系统 亮色 深色 + + 主题 + + + + + 深紫 + 靛青 + + 亮蓝 + + 青绿 + 绿 + 亮绿 + 酸橙 + + 琥珀 + + 深橙 + + + 蓝灰 + + 开源许可 查找 关于 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 8a476d5..28c8a7d 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -25,23 +25,50 @@ 深色主题 基本设置 + 语言 跟随系统 中文 English + 启动页 工具 收藏 + 主题模式 跟随系统 亮色 深色 + + 主题 + + + + + 深紫 + 靛青 + + 亮蓝 + + 青绿 + 绿 + 亮绿 + 酸橙 + + 琥珀 + + 深橙 + + + 蓝灰 + + 开源许可 查找 关于 diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index cddb866..65c235d 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -5,13 +5,19 @@ + - - - + + + + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 6afadc5..f693833 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,24 +1,127 @@ - #FFBB86FC - #FF6200EE - #FF3700B3 - #FF03DAC5 - #FF018786 #FF000000 + #FF212121 #FFFFFFFF - @color/purple_500 - @color/white - #FF444444 - #FFF5F5F5 + #FFF5F5F5 + @color/white + #FF212121 + #FF757575 + #88CCCCCC + #FFDDDDDD - @color/teal_200 - @color/black + #FFF44336 + #FFD32F2F + #FFFFCDD2 + @color/white + #FFFF5252 - @color/white - #FF666666 - @color/default_app_background - #FF434343 - #88CCCCCC + #FFE91E63 + #FFC3285B + #FFF8BBD0 + @color/white + #FFFF4081 + + #FF9C27B0 + #FF7B1FA2 + #FFE1BEE7 + @color/white + #FFE040FB + + #FF673AB7 + #FF512DAB + #FFD1C4E9 + @color/white + #FF7C4DFF + + #FF3F51B5 + #FF303F9F + #FFC5CAE9 + @color/white + #FF536DFE + + #FF2196F3 + #FF1976D2 + #FFBBDEFB + @color/white + #FF448AFF + + #FF03A9F4 + #FF0288D1 + #FFB3E5FC + @color/white + #FF03A9F4 + + #FF00BCD4 + #FF0097A7 + #FFB2EBF2 + @color/white + #FF00BCD4 + + #FF009688 + #FF00796B + #FFB2DFDB + @color/white + #FF009688 + + #FF4CAF50 + #FF388E3C + #FFC8E6C9 + @color/white + #FF4CAF50 + + #FF8BC34A + #FF689F38 + #FFDCEDC8 + @color/white + #FF8BC34A + + #FFCDDC39 + #FFAFB42B + #FFF0F4C3 + @color/white + #FFCDDC39 + + #FFFFEB3B + #FFFBC02D + #FFFFF9C4 + @color/white + #FFFFEB3B + + #FFFFC107 + #FFFFA000 + #FFFFECB3 + @color/white + #FFFFC107 + + #FFFF9800 + #FFF57C00 + #FFFFE0B2 + @color/white + #FFFF9800 + + #FFFF5722 + #FFE64A19 + #FFFFCCBC + @color/white + #FFFF5722 + + #FF795548 + #FF5D4037 + #FFD7CCC8 + @color/white + #FF795548 + + #FF9E9E9E + #FF616161 + #FFF5F5F5 + @color/white + #FF9E9E9E + + #FF607D8B + #FF455A64 + #FFCFD8DC + @color/white + #FF607D8B \ 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 37cded0..311c83b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -35,6 +35,7 @@ Base Settings + Language app_language @@ -43,11 +44,12 @@ English - system - zh_CN - en_US + SYSTEM + ZH_CN + EN_US - system + SYSTEM + Launch Page app_launch_page @@ -55,10 +57,11 @@ Favourites - tools - favourites + TOOLS + FAVOURITES - tools + TOOLS + Theme Mode app_ui_mode @@ -67,11 +70,37 @@ Dark - system - light - dark + SYSTEM + LIGHT + DARK - system + SYSTEM + + Theme + app_theme + + Red + Pink + Purple + Deep Purple + Indigo + Blue + Light Blue + Cyan + Teal + Green + Light Green + Lime + Yellow + Amber + Orange + Deep Orange + Brown + Grey + Blue Grey + + BLUE_GREY + Open Source License Search About diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 29103d2..3d0a7a9 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -11,10 +11,10 @@ 5dp 15dp 15dp - @drawable/button_radius_shape + @drawable/radius_shape @drawable/ripple_foreground @null - @color/default_tools_button_text + ?attr/tools_button_text - @color/default_app_second_theme - @color/default_app_second_on_theme + - @color/default_fold_layout_background - @color/default_tools_arrow - @color/default_tools_button_background - @color/default_tools_button_text - @color/default_tools_button_ripple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +