Added theme switch

This commit is contained in:
2022-08-07 14:29:07 +08:00
parent 77337d86f3
commit 3357c75c3f
51 changed files with 916 additions and 205 deletions

View File

@@ -11,11 +11,6 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.OxygenToolbox.Default">
<activity
android:name=".ui.about.LibrariesActivity"
android:exported="false"
android:label="@string/setting_open_source"
android:theme="@style/Theme.OxygenToolbox.Default" />
<activity
android:name=".SplashActivity"
android:exported="true"
@@ -23,19 +18,24 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.OxygenToolbox.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.OxygenToolbox.Default">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
android:name=".ui.about.LibrariesActivity"
android:exported="false"
android:label="@string/setting_open_source"
android:theme="@style/Theme.OxygenToolbox.Default" />
<activity
android:name=".tools.TimeScreenActivity"
android:exported="false"

View File

@@ -24,6 +24,7 @@ public class App extends Application {
SharedPreferencesUtils.init(App.this);
ResourceUtil.init(App.this);
ResourceUtil.setAppLocale(SharedPreferencesUtils.getPreferenceLocale());
ResourceUtil.loadAppTheme(activity);
loadAppUiMode();
}
@@ -70,12 +71,12 @@ public class App extends Application {
MultiLanguageUtils.attachBaseContext(this);
}
public static void loadAppUiMode() {
private void loadAppUiMode() {
switch (SharedPreferencesUtils.getPreferenceUiMode()) {
case light:
case LIGHT:
ResourceUtil.setAppUiMode(ResourceUtil.UI_MODE_LIGHT);
break;
case dark:
case DARK:
ResourceUtil.setAppUiMode(ResourceUtil.UI_MODE_DARK);
break;
default:

View File

@@ -4,21 +4,22 @@ import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import com.fatapp.oxygentoolbox.util.MultiLanguageUtils;
import com.fatapp.oxygentoolbox.util.ResourceUtil;
import com.fatapp.oxygentoolbox.util.VibratorController;
import com.google.android.material.navigation.NavigationView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.splashscreen.SplashScreen;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.fragment.NavHostFragment;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.fatapp.oxygentoolbox.util.MultiLanguageUtils;
import com.fatapp.oxygentoolbox.util.ResourceUtil;
import com.fatapp.oxygentoolbox.util.VibratorController;
import com.google.android.material.navigation.NavigationView;
import java.util.Objects;
@@ -43,6 +44,7 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@@ -58,7 +60,7 @@ public class MainActivity extends AppCompatActivity {
mainPage.setPadding(0, ResourceUtil.getStatusBarHeight(getWindow(), getApplicationContext()), 0, 0);
setSupportActionBar(toolbar);
navigationView.inflateHeaderView(R.layout.nav_header_main);
navigationView.inflateHeaderView(R.layout.app_nav_header_main);
navigationView.inflateMenu(R.menu.activity_main_drawer);
navigationView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> drawer.setDrawerLockMode(navigationView.getMenu().getItem(0).isChecked()
? DrawerLayout.LOCK_MODE_UNLOCKED

View File

@@ -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() {

View File

@@ -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));
}
}
});

View File

@@ -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;
}

View File

@@ -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 -> {
});

View File

@@ -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;
}
}

View File

@@ -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<ThemesAdapter.ViewHolder> {
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));
}
}

View File

@@ -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;
}
}
}

View File

@@ -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
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="?attr/fold_layout_background" />
</shape>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/app_on_theme"
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" />
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/app_text_theme"
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z" />
</vector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_check" android:state_selected="true" />
<item android:drawable="@android:color/transparent" android:state_selected="false" />
</selector>

View File

@@ -2,8 +2,8 @@
android:shape="rectangle">
<gradient
android:angle="270"
android:startColor="?attr/colorPrimary"
android:centerColor="?attr/colorPrimary"
android:endColor="?attr/app_background"
android:endColor="?attr/app_background_theme"
android:startColor="?attr/colorPrimary"
android:type="linear" />
</shape>

View File

@@ -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">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:theme="@style/Theme.OxygenToolbox.AppBarOverlay"
app:layout_constraintEnd_toEndOf="parent"
android:theme="@style/Theme.OxygenToolbox.AppBarOverlay">
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
@@ -30,9 +30,8 @@
android:id="@+id/libraries_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/app_bar_layout"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
</androidx.recyclerview.widget.RecyclerView>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/app_bar_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -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">
<include
@@ -18,6 +17,5 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:background="?attr/app_background"/>
android:background="?attr/app_background_theme" />
</androidx.drawerlayout.widget.DrawerLayout>

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?attr/windowSplashScreenBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="?attr/windowSplashScreenBackground">
<ImageView
android:id="@+id/imageView"
android:layout_width="288dp"
android:layout_height="288dp"
android:contentDescription="LOGO"
android:src="@drawable/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/ic_launcher"
android:contentDescription="LOGO" />
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -21,6 +21,6 @@
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
<include layout="@layout/app_content_main" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@android:color/transparent"
android:orientation="vertical"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/bottom_radius_background"
android:gravity="center_vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/basic_tools_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>

View File

@@ -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">
</com.fatapp.oxygentoolbox.layout.AutoLinefeedLayout>

View File

@@ -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" />
<ImageView
android:id="@+id/arrow_icon"

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/app_background"
android:background="?attr/app_background_theme"
tools:context=".ui.about.AboutFragment">
<androidx.appcompat.widget.AppCompatImageView
@@ -23,6 +23,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/about_icon_text_margin"
android:text="@string/app_full_name"
android:textColor="?attr/app_text_theme"
android:textSize="@dimen/default_text_size"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
@@ -35,6 +36,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/about_text_text_margin"
android:text="@string/nav_header_subtitle"
android:textColor="@color/app_secondary_text"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -45,6 +47,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/about_text_text_margin"
android:textColor="@color/app_secondary_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/app_desc" />

View File

@@ -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">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/bottom_nav_view_pager"

View File

@@ -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.HomeFragment">

View File

@@ -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">

View File

@@ -1,38 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/app_background"
android:padding="15dp"
android:background="?attr/app_background_theme"
tools:context=".ui.theme.ThemeFragment">
<LinearLayout
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/theme_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/setting_dark_mode"
android:textColor="?attr/app_text_theme"
android:textSize="@dimen/default_text_size" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/theme_dark_mode_spinner"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:entries="@array/setting_dark_theme_selects_array"
android:spinnerMode="dropdown"
android:theme="@style/ThemeSpinner" />
</LinearLayout>
</LinearLayout>
</ScrollView>
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -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"

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/theme_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/primary_color"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center_vertical"
android:padding="10dp"
android:background="@drawable/background_top_radius"
android:orientation="horizontal">
<TextView
android:id="@+id/color_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/setting_theme"
android:textColor="?attr/app_on_theme"/>
<View
android:id="@+id/check"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@drawable/selector_themes"/>
</LinearLayout>
<View
android:id="@+id/primary_dark_color"
android:layout_width="match_parent"
android:layout_height="20dp"
android:background="@drawable/background_no_radius" />
<View
android:id="@+id/primary_light_color"
android:layout_width="match_parent"
android:layout_height="20dp"
android:background="@drawable/background_no_radius" />
<View
android:id="@+id/accent_color"
android:layout_width="match_parent"
android:layout_height="20dp"
android:background="@drawable/background_bottom_radius" />
</LinearLayout>

File diff suppressed because one or more lines are too long

View File

@@ -1,24 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="default_app_theme">@color/purple_200</color>
<color name="default_app_on_theme">@color/white</color>
<color name="default_app_text_theme">@color/white</color>
<color name="default_app_background">#FF202020</color>
<color name="default_app_second_theme">@color/teal_700</color>
<color name="default_app_second_on_theme">@color/black</color>
<color name="default_fold_layout_background">#FF303030</color>
<color name="default_tools_arrow">#FF666666</color>
<color name="default_tools_button_background">@color/default_app_background</color>
<color name="default_tools_button_text">#FFFAFAFA</color>
<color name="default_tools_button_ripple">#88CCCCCC</color>
<color name="app_background">#FF202020</color>
<color name="app_on_background">#FF303030</color>
<color name="app_primary_text">#FFEEEEEE</color>
<color name="app_secondary_text">#FF757575</color>
<color name="app_ripple">#88CCCCCC</color>
<color name="app_divider">#FFADADAD</color>
</resources>

View File

@@ -25,23 +25,50 @@
<string name="setting_dark_mode">深色主题</string>
<string name="setting_base_settings">基本设置</string>
<string name="setting_language">语言</string>
<string-array name="setting_language_array">
<item>跟随系统</item>
<item>中文</item>
<item>English</item>
</string-array>
<string name="setting_launch_page">启动页</string>
<string-array name="setting_launch_page_array">
<item>工具</item>
<item>收藏</item>
</string-array>
<string name="setting_ui_mode">主题模式</string>
<string-array name="setting_ui_mode_array">
<item>跟随系统</item>
<item>亮色</item>
<item>深色</item>
</string-array>
<string name="setting_theme">主题</string>
<string-array name="setting_theme_array">
<item></item>
<item></item>
<item></item>
<item>深紫</item>
<item>靛青</item>
<item></item>
<item>亮蓝</item>
<item></item>
<item>青绿</item>
<item>绿</item>
<item>亮绿</item>
<item>酸橙</item>
<item></item>
<item>琥珀</item>
<item></item>
<item>深橙</item>
<item></item>
<item></item>
<item>蓝灰</item>
</string-array>
<string name="setting_open_source">开源许可</string>
<string name="setting_search">查找</string>
<string name="setting_about">关于</string>

View File

@@ -25,23 +25,50 @@
<string name="setting_dark_mode">深色主题</string>
<string name="setting_base_settings">基本设置</string>
<string name="setting_language">语言</string>
<string-array name="setting_language_array">
<item>跟随系统</item>
<item>中文</item>
<item>English</item>
</string-array>
<string name="setting_launch_page">启动页</string>
<string-array name="setting_launch_page_array">
<item>工具</item>
<item>收藏</item>
</string-array>
<string name="setting_ui_mode">主题模式</string>
<string-array name="setting_ui_mode_array">
<item>跟随系统</item>
<item>亮色</item>
<item>深色</item>
</string-array>
<string name="setting_theme">主题</string>
<string-array name="setting_theme_array">
<item></item>
<item></item>
<item></item>
<item>深紫</item>
<item>靛青</item>
<item></item>
<item>亮蓝</item>
<item></item>
<item>青绿</item>
<item>绿</item>
<item>亮绿</item>
<item>酸橙</item>
<item></item>
<item>琥珀</item>
<item></item>
<item>深橙</item>
<item></item>
<item></item>
<item>蓝灰</item>
</string-array>
<string name="setting_open_source">开源许可</string>
<string name="setting_search">查找</string>
<string name="setting_about">关于</string>

View File

@@ -25,23 +25,50 @@
<string name="setting_dark_mode">深色主题</string>
<string name="setting_base_settings">基本设置</string>
<string name="setting_language">语言</string>
<string-array name="setting_language_array">
<item>跟随系统</item>
<item>中文</item>
<item>English</item>
</string-array>
<string name="setting_launch_page">启动页</string>
<string-array name="setting_launch_page_array">
<item>工具</item>
<item>收藏</item>
</string-array>
<string name="setting_ui_mode">主题模式</string>
<string-array name="setting_ui_mode_array">
<item>跟随系统</item>
<item>亮色</item>
<item>深色</item>
</string-array>
<string name="setting_theme">主题</string>
<string-array name="setting_theme_array">
<item></item>
<item></item>
<item></item>
<item>深紫</item>
<item>靛青</item>
<item></item>
<item>亮蓝</item>
<item></item>
<item>青绿</item>
<item>绿</item>
<item>亮绿</item>
<item>酸橙</item>
<item></item>
<item>琥珀</item>
<item></item>
<item>深橙</item>
<item></item>
<item></item>
<item>蓝灰</item>
</string-array>
<string name="setting_open_source">开源许可</string>
<string name="setting_search">查找</string>
<string name="setting_about">关于</string>

View File

@@ -5,13 +5,19 @@
</declare-styleable>
<attr name="app_theme" format="color" />
<attr name="app_variant_theme" format="color" />
<attr name="app_on_theme" format="color" />
<attr name="app_text_theme" format="color" />
<attr name="app_background" format="color" />
<attr name="app_second_theme" format="color" />
<attr name="app_second_variant_theme" format="color" />
<attr name="app_second_on_theme" format="color" />
<attr name="app_background_theme" format="color" />
<attr name="app_on_background_theme" format="color" />
<attr name="app_text_theme" format="color" />
<attr name="app_second_text_theme" format="color" />
<attr name="app_ripple_theme" format="color" />
<attr name="app_divider_theme" format="color" />
<attr name="fold_layout_background" format="color" />
<attr name="tools_arrow" format="color" />
<attr name="tools_button_background" format="color" />

View File

@@ -1,24 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="grey_black">#FF212121</color>
<color name="white">#FFFFFFFF</color>
<color name="default_app_theme">@color/purple_500</color>
<color name="default_app_on_theme">@color/white</color>
<color name="default_app_text_theme">#FF444444</color>
<color name="default_app_background">#FFF5F5F5</color>
<color name="app_background">#FFF5F5F5</color>
<color name="app_on_background">@color/white</color>
<color name="app_primary_text">#FF212121</color>
<color name="app_secondary_text">#FF757575</color>
<color name="app_ripple">#88CCCCCC</color>
<color name="app_divider">#FFDDDDDD</color>
<color name="default_app_second_theme">@color/teal_200</color>
<color name="default_app_second_on_theme">@color/black</color>
<color name="red_primary">#FFF44336</color>
<color name="red_primary_dark">#FFD32F2F</color>
<color name="red_primary_light">#FFFFCDD2</color>
<color name="red_text_icons">@color/white</color>
<color name="red_accent">#FFFF5252</color>
<color name="default_fold_layout_background">@color/white</color>
<color name="default_tools_arrow">#FF666666</color>
<color name="default_tools_button_background">@color/default_app_background</color>
<color name="default_tools_button_text">#FF434343</color>
<color name="default_tools_button_ripple">#88CCCCCC</color>
<color name="pink_primary">#FFE91E63</color>
<color name="pink_primary_dark">#FFC3285B</color>
<color name="pink_primary_light">#FFF8BBD0</color>
<color name="pink_text_icons">@color/white</color>
<color name="pink_accent">#FFFF4081</color>
<color name="purple_primary">#FF9C27B0</color>
<color name="purple_primary_dark">#FF7B1FA2</color>
<color name="purple_primary_light">#FFE1BEE7</color>
<color name="purple_text_icons">@color/white</color>
<color name="purple_accent">#FFE040FB</color>
<color name="deep_purple_primary">#FF673AB7</color>
<color name="deep_purple_primary_dark">#FF512DAB</color>
<color name="deep_purple_primary_light">#FFD1C4E9</color>
<color name="deep_purple_text_icons">@color/white</color>
<color name="deep_purple_accent">#FF7C4DFF</color>
<color name="indigo_primary">#FF3F51B5</color>
<color name="indigo_primary_dark">#FF303F9F</color>
<color name="indigo_primary_light">#FFC5CAE9</color>
<color name="indigo_text_icons">@color/white</color>
<color name="indigo_accent">#FF536DFE</color>
<color name="blue_primary">#FF2196F3</color>
<color name="blue_primary_dark">#FF1976D2</color>
<color name="blue_primary_light">#FFBBDEFB</color>
<color name="blue_text_icons">@color/white</color>
<color name="blue_accent">#FF448AFF</color>
<color name="light_blue_primary">#FF03A9F4</color>
<color name="light_blue_primary_dark">#FF0288D1</color>
<color name="light_blue_primary_light">#FFB3E5FC</color>
<color name="light_blue_text_icons">@color/white</color>
<color name="light_blue_accent">#FF03A9F4</color>
<color name="cyan_primary">#FF00BCD4</color>
<color name="cyan_primary_dark">#FF0097A7</color>
<color name="cyan_primary_light">#FFB2EBF2</color>
<color name="cyan_text_icons">@color/white</color>
<color name="cyan_accent">#FF00BCD4</color>
<color name="teal_primary">#FF009688</color>
<color name="teal_primary_dark">#FF00796B</color>
<color name="teal_primary_light">#FFB2DFDB</color>
<color name="teal_text_icons">@color/white</color>
<color name="teal_accent">#FF009688</color>
<color name="green_primary">#FF4CAF50</color>
<color name="green_primary_dark">#FF388E3C</color>
<color name="green_primary_light">#FFC8E6C9</color>
<color name="green_text_icons">@color/white</color>
<color name="green_accent">#FF4CAF50</color>
<color name="light_green_primary">#FF8BC34A</color>
<color name="light_green_primary_dark">#FF689F38</color>
<color name="light_green_primary_light">#FFDCEDC8</color>
<color name="light_green_text_icons">@color/white</color>
<color name="light_green_accent">#FF8BC34A</color>
<color name="lime_primary">#FFCDDC39</color>
<color name="lime_primary_dark">#FFAFB42B</color>
<color name="lime_primary_light">#FFF0F4C3</color>
<color name="lime_text_icons">@color/white</color>
<color name="lime_accent">#FFCDDC39</color>
<color name="yellow_primary">#FFFFEB3B</color>
<color name="yellow_primary_dark">#FFFBC02D</color>
<color name="yellow_primary_light">#FFFFF9C4</color>
<color name="yellow_text_icons">@color/white</color>
<color name="yellow_accent">#FFFFEB3B</color>
<color name="amber_primary">#FFFFC107</color>
<color name="amber_primary_dark">#FFFFA000</color>
<color name="amber_primary_light">#FFFFECB3</color>
<color name="amber_text_icons">@color/white</color>
<color name="amber_accent">#FFFFC107</color>
<color name="orange_primary">#FFFF9800</color>
<color name="orange_primary_dark">#FFF57C00</color>
<color name="orange_primary_light">#FFFFE0B2</color>
<color name="orange_text_icons">@color/white</color>
<color name="orange_accent">#FFFF9800</color>
<color name="deep_orange_primary">#FFFF5722</color>
<color name="deep_orange_primary_dark">#FFE64A19</color>
<color name="deep_orange_primary_light">#FFFFCCBC</color>
<color name="deep_orange_text_icons">@color/white</color>
<color name="deep_orange_accent">#FFFF5722</color>
<color name="brown_primary">#FF795548</color>
<color name="brown_primary_dark">#FF5D4037</color>
<color name="brown_primary_light">#FFD7CCC8</color>
<color name="brown_text_icons">@color/white</color>
<color name="brown_accent">#FF795548</color>
<color name="grey_primary">#FF9E9E9E</color>
<color name="grey_primary_dark">#FF616161</color>
<color name="grey_primary_light">#FFF5F5F5</color>
<color name="grey_text_icons">@color/white</color>
<color name="grey_accent">#FF9E9E9E</color>
<color name="blue_grey_primary">#FF607D8B</color>
<color name="blue_grey_primary_dark">#FF455A64</color>
<color name="blue_grey_primary_light">#FFCFD8DC</color>
<color name="blue_grey_text_icons">@color/white</color>
<color name="blue_grey_accent">#FF607D8B</color>
</resources>

View File

@@ -35,6 +35,7 @@
</string-array>
<string name="setting_base_settings">Base Settings</string>
<string name="setting_language">Language</string>
<string name="setting_language_key" translatable="false">app_language</string>
<string-array name="setting_language_array">
@@ -43,11 +44,12 @@
<item>English</item>
</string-array>
<string-array name="setting_language_values">
<item>system</item>
<item>zh_CN</item>
<item>en_US</item>
<item>SYSTEM</item>
<item>ZH_CN</item>
<item>EN_US</item>
</string-array>
<string name="setting_language_default_value" translatable="false">system</string>
<string name="setting_language_default_value" translatable="false">SYSTEM</string>
<string name="setting_launch_page">Launch Page</string>
<string name="setting_launch_page_key" translatable="false">app_launch_page</string>
<string-array name="setting_launch_page_array">
@@ -55,10 +57,11 @@
<item>Favourites</item>
</string-array>
<string-array name="setting_launch_page_values">
<item>tools</item>
<item>favourites</item>
<item>TOOLS</item>
<item>FAVOURITES</item>
</string-array>
<string name="setting_launch_page_default_value" translatable="false">tools</string>
<string name="setting_launch_page_default_value" translatable="false">TOOLS</string>
<string name="setting_ui_mode">Theme Mode</string>
<string name="setting_ui_mode_key" translatable="false">app_ui_mode</string>
<string-array name="setting_ui_mode_array">
@@ -67,11 +70,37 @@
<item>Dark</item>
</string-array>
<string-array name="setting_ui_mode_values">
<item>system</item>
<item>light</item>
<item>dark</item>
<item>SYSTEM</item>
<item>LIGHT</item>
<item>DARK</item>
</string-array>
<string name="setting_ui_mode_default_value" translatable="false">system</string>
<string name="setting_ui_mode_default_value" translatable="false">SYSTEM</string>
<string name="setting_theme">Theme</string>
<string name="setting_theme_key" translatable="false">app_theme</string>
<string-array name="setting_theme_array">
<item>Red</item>
<item>Pink</item>
<item>Purple</item>
<item>Deep Purple</item>
<item>Indigo</item>
<item>Blue</item>
<item>Light Blue</item>
<item>Cyan</item>
<item>Teal</item>
<item>Green</item>
<item>Light Green</item>
<item>Lime</item>
<item>Yellow</item>
<item>Amber</item>
<item>Orange</item>
<item>Deep Orange</item>
<item>Brown</item>
<item>Grey</item>
<item>Blue Grey</item>
</string-array>
<string name="setting_theme_default_value" translatable="false">BLUE_GREY</string>
<string name="setting_open_source">Open Source License</string>
<string name="setting_search">Search</string>
<string name="setting_about">About</string>

View File

@@ -11,10 +11,10 @@
<item name="android:layout_marginBottom">5dp</item>
<item name="android:paddingStart">15dp</item>
<item name="android:paddingEnd">15dp</item>
<item name="android:background">@drawable/button_radius_shape</item>
<item name="android:background">@drawable/radius_shape</item>
<item name="android:foreground">@drawable/ripple_foreground</item>
<item name="android:stateListAnimator">@null</item>
<item name="android:textColor">@color/default_tools_button_text</item>
<item name="android:textColor">?attr/tools_button_text</item>
</style>
<style name="ToolsLinearLayout">

View File

@@ -2,35 +2,214 @@
<resources>
<!-- Base application theme. -->
<style name="Theme.OxygenToolbox.Default" parent="Theme.MaterialComponents.DayNight.Bridge">
<item name="app_theme">@color/deep_purple_primary</item>
<item name="app_variant_theme">@color/deep_purple_primary_dark</item>
<item name="app_on_theme">@color/deep_purple_text_icons</item>
<item name="app_second_theme">@color/deep_purple_accent</item>
<item name="app_second_variant_theme">@color/deep_purple_accent</item>
<item name="app_second_on_theme">@color/deep_purple_text_icons</item>
<item name="app_background_theme">@color/app_background</item>
<item name="app_on_background_theme">@color/app_on_background</item>
<item name="app_text_theme">@color/app_primary_text</item>
<item name="app_second_text_theme">@color/app_secondary_text</item>
<item name="app_ripple_theme">@color/app_ripple</item>
<item name="app_divider_theme">@color/app_divider</item>
<!-- Primary brand color. -->
<item name="colorPrimary">@color/default_app_theme</item>
<item name="colorPrimaryVariant">@color/default_app_theme</item>
<item name="colorOnPrimary">@color/default_app_on_theme</item>
<item name="colorPrimary">?attr/app_theme</item>
<item name="colorPrimaryVariant">?attr/app_theme</item>
<item name="colorOnPrimary">?attr/app_on_theme</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/default_app_second_theme</item>
<item name="colorSecondaryVariant">@color/default_app_second_theme</item>
<item name="colorOnSecondary">@color/default_app_second_on_theme</item>
<item name="colorSecondary">?attr/app_second_theme</item>
<item name="colorSecondaryVariant">?attr/app_second_variant_theme</item>
<item name="colorOnSecondary">?attr/app_on_theme</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" >?attr/colorPrimaryVariant</item>
<item name="android:statusBarColor">?attr/app_theme</item>
<!-- Customize your theme here. -->
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowDisablePreview">true</item>
<item name="app_theme">@color/default_app_theme</item>
<item name="app_on_theme">@color/default_app_on_theme</item>
<item name="app_text_theme">@color/default_app_text_theme</item>
<item name="app_background">@color/default_app_background</item>
<item name="fold_layout_background">?attr/app_on_background_theme</item>
<item name="tools_arrow">?attr/app_second_text_theme</item>
<item name="tools_button_background">?attr/app_background_theme</item>
<item name="tools_button_text">?attr/app_text_theme</item>
<item name="tools_button_ripple">?attr/app_ripple_theme</item>
</style>
<item name="app_second_theme">@color/default_app_second_theme</item>
<item name="app_second_on_theme">@color/default_app_second_on_theme</item>
<style name="Theme.OxygenToolbox.Red" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/red_primary</item>
<item name="app_variant_theme">@color/red_primary_dark</item>
<item name="app_on_theme">@color/red_text_icons</item>
<item name="app_second_theme">@color/red_accent</item>
<item name="app_second_variant_theme">@color/red_accent</item>
<item name="app_second_on_theme">@color/red_text_icons</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">@color/red_primary</item>
</style>
<item name="fold_layout_background">@color/default_fold_layout_background</item>
<item name="tools_arrow">@color/default_tools_arrow</item>
<item name="tools_button_background">@color/default_tools_button_background</item>
<item name="tools_button_text">@color/default_tools_button_text</item>
<item name="tools_button_ripple">@color/default_tools_button_ripple</item>
<style name="Theme.OxygenToolbox.Pink" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/pink_primary</item>
<item name="app_variant_theme">@color/pink_primary_dark</item>
<item name="app_on_theme">@color/pink_text_icons</item>
<item name="app_second_theme">@color/pink_accent</item>
<item name="app_second_variant_theme">@color/pink_accent</item>
<item name="app_second_on_theme">@color/pink_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Purple" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/purple_primary</item>
<item name="app_variant_theme">@color/purple_primary_dark</item>
<item name="app_on_theme">@color/purple_text_icons</item>
<item name="app_second_theme">@color/purple_accent</item>
<item name="app_second_variant_theme">@color/purple_accent</item>
<item name="app_second_on_theme">@color/purple_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.DeepPurple" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/deep_purple_primary</item>
<item name="app_variant_theme">@color/deep_purple_primary_dark</item>
<item name="app_on_theme">@color/deep_purple_text_icons</item>
<item name="app_second_theme">@color/deep_purple_accent</item>
<item name="app_second_variant_theme">@color/deep_purple_accent</item>
<item name="app_second_on_theme">@color/deep_purple_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Indigo" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/indigo_primary</item>
<item name="app_variant_theme">@color/indigo_primary_dark</item>
<item name="app_on_theme">@color/indigo_text_icons</item>
<item name="app_second_theme">@color/indigo_accent</item>
<item name="app_second_variant_theme">@color/indigo_accent</item>
<item name="app_second_on_theme">@color/indigo_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Blue" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/blue_primary</item>
<item name="app_variant_theme">@color/blue_primary_dark</item>
<item name="app_on_theme">@color/blue_text_icons</item>
<item name="app_second_theme">@color/blue_accent</item>
<item name="app_second_variant_theme">@color/blue_accent</item>
<item name="app_second_on_theme">@color/blue_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.LightBlue" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/light_blue_primary</item>
<item name="app_variant_theme">@color/light_blue_primary_dark</item>
<item name="app_on_theme">@color/light_blue_text_icons</item>
<item name="app_second_theme">@color/light_blue_accent</item>
<item name="app_second_variant_theme">@color/light_blue_accent</item>
<item name="app_second_on_theme">@color/light_blue_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Cyan" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/cyan_primary</item>
<item name="app_variant_theme">@color/cyan_primary_dark</item>
<item name="app_on_theme">@color/cyan_text_icons</item>
<item name="app_second_theme">@color/cyan_accent</item>
<item name="app_second_variant_theme">@color/cyan_accent</item>
<item name="app_second_on_theme">@color/cyan_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Teal" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/teal_primary</item>
<item name="app_variant_theme">@color/teal_primary_dark</item>
<item name="app_on_theme">@color/teal_text_icons</item>
<item name="app_second_theme">@color/teal_accent</item>
<item name="app_second_variant_theme">@color/teal_accent</item>
<item name="app_second_on_theme">@color/teal_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Green" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/green_primary</item>
<item name="app_variant_theme">@color/green_primary_dark</item>
<item name="app_on_theme">@color/green_text_icons</item>
<item name="app_second_theme">@color/green_accent</item>
<item name="app_second_variant_theme">@color/green_accent</item>
<item name="app_second_on_theme">@color/green_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.LightGreen" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/light_green_primary</item>
<item name="app_variant_theme">@color/light_green_primary_dark</item>
<item name="app_on_theme">@color/light_green_text_icons</item>
<item name="app_second_theme">@color/light_green_accent</item>
<item name="app_second_variant_theme">@color/light_green_accent</item>
<item name="app_second_on_theme">@color/light_green_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Lime" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/lime_primary</item>
<item name="app_variant_theme">@color/lime_primary_dark</item>
<item name="app_on_theme">@color/lime_text_icons</item>
<item name="app_second_theme">@color/lime_accent</item>
<item name="app_second_variant_theme">@color/lime_accent</item>
<item name="app_second_on_theme">@color/lime_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Yellow" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/yellow_primary</item>
<item name="app_variant_theme">@color/yellow_primary_dark</item>
<item name="app_on_theme">@color/yellow_text_icons</item>
<item name="app_second_theme">@color/yellow_accent</item>
<item name="app_second_variant_theme">@color/yellow_accent</item>
<item name="app_second_on_theme">@color/yellow_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Amber" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/amber_primary</item>
<item name="app_variant_theme">@color/amber_primary_dark</item>
<item name="app_on_theme">@color/amber_text_icons</item>
<item name="app_second_theme">@color/amber_accent</item>
<item name="app_second_variant_theme">@color/amber_accent</item>
<item name="app_second_on_theme">@color/amber_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Orange" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/orange_primary</item>
<item name="app_variant_theme">@color/orange_primary_dark</item>
<item name="app_on_theme">@color/orange_text_icons</item>
<item name="app_second_theme">@color/orange_accent</item>
<item name="app_second_variant_theme">@color/orange_accent</item>
<item name="app_second_on_theme">@color/orange_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.DeepOrange" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/deep_orange_primary</item>
<item name="app_variant_theme">@color/deep_orange_primary_dark</item>
<item name="app_on_theme">@color/deep_orange_text_icons</item>
<item name="app_second_theme">@color/deep_orange_accent</item>
<item name="app_second_variant_theme">@color/deep_orange_accent</item>
<item name="app_second_on_theme">@color/deep_orange_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Brown" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/brown_primary</item>
<item name="app_variant_theme">@color/brown_primary_dark</item>
<item name="app_on_theme">@color/brown_text_icons</item>
<item name="app_second_theme">@color/brown_accent</item>
<item name="app_second_variant_theme">@color/brown_accent</item>
<item name="app_second_on_theme">@color/brown_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Grey" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/grey_primary</item>
<item name="app_variant_theme">@color/grey_primary_dark</item>
<item name="app_on_theme">@color/grey_text_icons</item>
<item name="app_second_theme">@color/grey_accent</item>
<item name="app_second_variant_theme">@color/grey_accent</item>
<item name="app_second_on_theme">@color/grey_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.BlueGrey" parent="Theme.OxygenToolbox.Default">
<item name="app_theme">@color/blue_grey_primary</item>
<item name="app_variant_theme">@color/blue_grey_primary_dark</item>
<item name="app_on_theme">@color/blue_grey_text_icons</item>
<item name="app_second_theme">@color/blue_grey_accent</item>
<item name="app_second_variant_theme">@color/blue_grey_accent</item>
<item name="app_second_on_theme">@color/blue_grey_text_icons</item>
</style>
<style name="Theme.OxygenToolbox.Full" parent="Theme.OxygenToolbox.Default">
@@ -42,10 +221,10 @@
</style>
<style name="Theme.OxygenToolbox.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/default_app_background</item>
<item name="windowSplashScreenBackground">@color/app_background</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher</item>
<item name="windowSplashScreenAnimationDuration">0</item>
<item name="postSplashScreenTheme">@style/Theme.OxygenToolbox.SplashActivity</item>
<item name="postSplashScreenTheme">@style/Theme.OxygenToolbox.Default</item>
</style>
<style name="Theme.OxygenToolbox.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

View File

@@ -21,6 +21,7 @@
app:defaultValue="@string/setting_ui_mode_default_value"
app:entries="@array/setting_ui_mode_array"
app:entryValues="@array/setting_ui_mode_values"
app:icon="@drawable/ic_setting_theme_mode"
app:key="@string/setting_ui_mode_key"
app:title="@string/setting_ui_mode"
app:useSimpleSummaryProvider="true" />