diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 0d01b46..0000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index d6d68b4..73cb45a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -9,7 +9,11 @@ + + + + @@ -23,10 +27,12 @@ + + @@ -53,7 +59,10 @@ + + + diff --git a/app/src/androidTest/java/com/fatapp/oxygentoolbox/Tester.java b/app/src/androidTest/java/com/fatapp/oxygentoolbox/Tester.java new file mode 100644 index 0000000..21c8321 --- /dev/null +++ b/app/src/androidTest/java/com/fatapp/oxygentoolbox/Tester.java @@ -0,0 +1,12 @@ +package com.fatapp.oxygentoolbox; + +import android.text.format.DateFormat; + +import org.junit.Test; + +public class Tester { + @Test + public void dateFormat() { + System.out.println(DateFormat.format("HH:mm:ss dd MMM E", System.currentTimeMillis())); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 040e874..7b07928 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -37,9 +37,10 @@ android:label="@string/setting_open_source" android:theme="@style/Theme.OxygenToolbox.Default" /> + android:theme="@style/Theme.OxygenToolbox.Default" + android:screenOrientation="sensorLandscape"> diff --git a/app/src/main/assets/json/BasicTools.json b/app/src/main/assets/json/BasicTools.json index d52b3ff..4dc1f75 100644 --- a/app/src/main/assets/json/BasicTools.json +++ b/app/src/main/assets/json/BasicTools.json @@ -21,7 +21,7 @@ "cn": "\u65f6\u95f4\u5c4f\u5e55", "en": "Time Screen" }, - "activity": "com.fatapp.oxygentoolbox.tools.TimeScreenActivity" + "activity": "com.fatapp.oxygentoolbox.tools.timescreen.MainActivity" }, { "text": { diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/MainActivity.java b/app/src/main/java/com/fatapp/oxygentoolbox/MainActivity.java index 9829892..6882600 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/MainActivity.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/MainActivity.java @@ -92,7 +92,7 @@ public class MainActivity extends AppCompatActivity { builder = new ShortcutInfo.Builder(this, "Time Screen") .setIntent(new Intent() .setAction("activity.timescreen") - .setClassName("com.fatapp.oxygentoolbox", "com.fatapp.oxygentoolbox.tools.TimeScreenActivity")) + .setClassName("com.fatapp.oxygentoolbox", "com.fatapp.oxygentoolbox.tools.timescreen.TimeScreenActivity")) .setShortLabel("Time Screen") .setLongLabel("Time Screen") .setIcon(Icon.createWithResource(this, R.drawable.ic_menu_home)); diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/tools/TimeScreenActivity.java b/app/src/main/java/com/fatapp/oxygentoolbox/tools/TimeScreenActivity.java deleted file mode 100644 index e458b9a..0000000 --- a/app/src/main/java/com/fatapp/oxygentoolbox/tools/TimeScreenActivity.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.fatapp.oxygentoolbox.tools; - -import android.os.Bundle; - -import androidx.appcompat.app.AppCompatActivity; - -import com.fatapp.oxygentoolbox.R; - -public class TimeScreenActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_time_screen); - } -} \ No newline at end of file diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/tools/timescreen/MainActivity.java b/app/src/main/java/com/fatapp/oxygentoolbox/tools/timescreen/MainActivity.java new file mode 100644 index 0000000..4310fa3 --- /dev/null +++ b/app/src/main/java/com/fatapp/oxygentoolbox/tools/timescreen/MainActivity.java @@ -0,0 +1,233 @@ +package com.fatapp.oxygentoolbox.tools.timescreen; + +import android.animation.ObjectAnimator; +import android.content.res.Configuration; +import android.graphics.Typeface; +import android.graphics.drawable.AnimatedVectorDrawable; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.text.format.DateFormat; +import android.view.Gravity; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextSwitcher; +import android.widget.TextView; +import android.widget.ViewSwitcher; + +import androidx.annotation.ColorInt; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.content.res.AppCompatResources; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.fatapp.oxygentoolbox.R; +import com.fatapp.oxygentoolbox.util.ResourceUtil; +import com.fatapp.oxygentoolbox.util.VariableChangeListener; +import com.fatapp.oxygentoolbox.util.VariableChangeSupport; +import com.ypz.bangscreentools.BangScreenTools; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Timer; +import java.util.TimerTask; + +public class MainActivity extends AppCompatActivity { + private int uiMode = ResourceUtil.getAppUiMode(); + private VariableChangeSupport hourTenVariableChangeSupport; + private VariableChangeSupport hourOneVariableChangeSupport; + private VariableChangeSupport minuteTenVariableChangeSupport; + private VariableChangeSupport minuteOneVariableChangeSupport; + private VariableChangeSupport secondTenVariableChangeSupport; + private VariableChangeSupport secondOneVariableChangeSupport; + private VariableChangeSupport dateVisibilityChangeSupport; + private VariableChangeSupport uiVisibilityChangeSupport; + + private ConstraintLayout constraintLayoutTimeScreen; + private ImageView imageViewMode; + private TextSwitcher textSwitcherHourTen; + private TextSwitcher textSwitcherHourOne; + private TextView textViewColonHourMinute; + private TextSwitcher textSwitcherMinuteTen; + private TextSwitcher textSwitcherMinuteOne; + private TextView textViewColonMinuteSecond; + private TextSwitcher textSwitcherSecondTen; + private TextSwitcher textSwitcherSecondOne; + private TextView textViewDate; + + private void initView() { + constraintLayoutTimeScreen = findViewById(R.id.constraint_layout_time_screen); + imageViewMode = findViewById(R.id.image_view_mode); + textSwitcherHourTen = findViewById(R.id.text_switcher_hour_ten); + textSwitcherHourOne = findViewById(R.id.text_switcher_hour_one); + textViewColonHourMinute = findViewById(R.id.text_view_colon_hour_minute); + textSwitcherMinuteTen = findViewById(R.id.text_switcher_minute_ten); + textSwitcherMinuteOne = findViewById(R.id.text_switcher_minute_one); + textViewColonMinuteSecond = findViewById(R.id.text_view_colon_minute_second); + textSwitcherSecondTen = findViewById(R.id.text_switcher_second_ten); + textSwitcherSecondOne = findViewById(R.id.text_switcher_second_one); + textViewDate = findViewById(R.id.text_view_date); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + BangScreenTools.getBangScreenTools().fullscreen(getWindow(), this); + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_tool_time_screen); + + initView(); + initTextSwitcher(); + + constraintLayoutTimeScreen.setOnClickListener(view -> uiVisibilityChangeSupport.setValue(!uiVisibilityChangeSupport.getValue())); + uiVisibilityChangeSupport = new VariableChangeSupport<>(true, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + ObjectAnimator.ofFloat(imageViewMode, View.ALPHA, (boolean) newValue ? 0.0f : 1.0f, (boolean) newValue ? 1.0f : 0.0f).start(); + } + }); + + if (uiMode >= Configuration.UI_MODE_NIGHT_YES) { + imageViewMode.setImageDrawable(AppCompatResources.getDrawable(this, R.drawable.animation_dark_to_light_mode)); + } + imageViewMode.setOnClickListener(view -> { + if (uiMode < Configuration.UI_MODE_NIGHT_YES) { + uiMode = ResourceUtil.UI_MODE_DARK; + setColors(ResourceUtil.getColor(R.color.app_show_dark_background), ResourceUtil.getColor(R.color.app_show_dark_primary_text)); + imageViewMode.setImageDrawable(AppCompatResources.getDrawable(this, R.drawable.animation_light_to_dark_mode)); + AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageViewMode.getDrawable(); + animatedVectorDrawable.start(); + } else { + uiMode = ResourceUtil.UI_MODE_LIGHT; + setColors(ResourceUtil.getColor(R.color.app_show_light_background), ResourceUtil.getColor(R.color.app_show_light_primary_text)); + imageViewMode.setImageDrawable(AppCompatResources.getDrawable(this, R.drawable.animation_dark_to_light_mode)); + AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageViewMode.getDrawable(); + animatedVectorDrawable.start(); + } + }); + + dateVisibilityChangeSupport = new VariableChangeSupport<>(true, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + ObjectAnimator.ofFloat(textViewDate, View.ALPHA, (boolean) newValue ? 0.0f : 1.0f, (boolean) newValue ? 1.0f : 0.0f).start(); + } + }); + + textViewDate.setOnClickListener(view -> dateVisibilityChangeSupport.setValue(!dateVisibilityChangeSupport.getValue())); + + TimerTask timerTask = new TimerTask() { + @Override + public void run() { + runOnUiThread(() -> { + if (ResourceUtil.getAppLocale().getLanguage().equals("zh")) { + textViewDate.setText(new SimpleDateFormat("yyyy年M月d日 EEEE", ResourceUtil.getAppLocale()).format(new Date(System.currentTimeMillis()))); + } else { + textViewDate.setText(new SimpleDateFormat("EEEE, d MMMM, yyyy", ResourceUtil.getAppLocale()).format(new Date(System.currentTimeMillis()))); + } + hourTenVariableChangeSupport.setValue(DateFormat.format("HH", System.currentTimeMillis()).toString().substring(0, 1)); + hourOneVariableChangeSupport.setValue(DateFormat.format("HH", System.currentTimeMillis()).toString().substring(1)); + minuteTenVariableChangeSupport.setValue(DateFormat.format("mm", System.currentTimeMillis()).toString().substring(0, 1)); + minuteOneVariableChangeSupport.setValue(DateFormat.format("mm", System.currentTimeMillis()).toString().substring(1)); + secondTenVariableChangeSupport.setValue(DateFormat.format("ss", System.currentTimeMillis()).toString().substring(0, 1)); + secondOneVariableChangeSupport.setValue(DateFormat.format("ss", System.currentTimeMillis()).toString().substring(1)); + }); + } + }; + + new Timer().schedule(timerTask, 0, 100L); + } + + private void initTextSwitcher() { + ViewSwitcher.ViewFactory viewFactory = () -> { + TextView textView = new TextView(getApplicationContext()); + textView.setGravity(Gravity.CENTER); + textView.setTextColor(ResourceUtil.getColor(R.color.app_show_primary_text)); + textView.setTypeface(Typeface.DEFAULT_BOLD); + textView.setTextSize(100f); + return textView; + }; + + String hourTen = DateFormat.format("HH", System.currentTimeMillis()).toString().substring(0, 1); + textSwitcherHourTen.setFactory(viewFactory); + textSwitcherHourTen.setCurrentText(hourTen); + hourTenVariableChangeSupport = new VariableChangeSupport<>(hourTen, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + textSwitcherHourTen.setText((CharSequence) newValue); + } + }); + + String hourOne = DateFormat.format("HH", System.currentTimeMillis()).toString().substring(1); + textSwitcherHourOne.setFactory(viewFactory); + textSwitcherHourOne.setCurrentText(hourOne); + hourOneVariableChangeSupport = new VariableChangeSupport<>(hourOne, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + textSwitcherHourOne.setText((CharSequence) newValue); + } + }); + + String minuteTen = DateFormat.format("mm", System.currentTimeMillis()).toString().substring(0, 1); + textSwitcherMinuteTen.setFactory(viewFactory); + textSwitcherMinuteTen.setCurrentText(minuteTen); + minuteTenVariableChangeSupport = new VariableChangeSupport<>(minuteTen, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + textSwitcherMinuteTen.setText((CharSequence) newValue); + } + }); + + String minuteOne = DateFormat.format("mm", System.currentTimeMillis()).toString().substring(1); + textSwitcherMinuteOne.setFactory(viewFactory); + textSwitcherMinuteOne.setCurrentText(minuteOne); + minuteOneVariableChangeSupport = new VariableChangeSupport<>(minuteOne, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + textSwitcherMinuteOne.setText((CharSequence) newValue); + } + }); + + String secondTen = DateFormat.format("ss", System.currentTimeMillis()).toString().substring(0, 1); + textSwitcherSecondTen.setFactory(viewFactory); + textSwitcherSecondTen.setCurrentText(secondTen); + secondTenVariableChangeSupport = new VariableChangeSupport<>(secondTen, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + textSwitcherSecondTen.setText((CharSequence) newValue); + } + }); + + String secondOne = DateFormat.format("ss", System.currentTimeMillis()).toString().substring(1); + textSwitcherSecondOne.setFactory(viewFactory); + textSwitcherSecondOne.setCurrentText(secondOne); + secondOneVariableChangeSupport = new VariableChangeSupport<>(secondOne, new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + textSwitcherSecondOne.setText((CharSequence) newValue); + } + }); + } + + private void setColors(@ColorInt int backgroundColor, @ColorInt int primaryTextColor) { + ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofArgb(constraintLayoutTimeScreen, "backgroundColor", ((ColorDrawable) constraintLayoutTimeScreen.getBackground()).getColor(), backgroundColor); + backgroundColorAnimator.setDuration(500L); + backgroundColorAnimator.start(); + ((TextView) textSwitcherHourTen.getChildAt(0)).setTextColor(primaryTextColor); + ((TextView) textSwitcherHourTen.getChildAt(1)).setTextColor(primaryTextColor); + ((TextView) textSwitcherHourOne.getChildAt(0)).setTextColor(primaryTextColor); + ((TextView) textSwitcherHourOne.getChildAt(1)).setTextColor(primaryTextColor); + textViewColonHourMinute.setTextColor(primaryTextColor); + ((TextView) textSwitcherMinuteTen.getChildAt(0)).setTextColor(primaryTextColor); + ((TextView) textSwitcherMinuteTen.getChildAt(1)).setTextColor(primaryTextColor); + ((TextView) textSwitcherMinuteOne.getChildAt(0)).setTextColor(primaryTextColor); + ((TextView) textSwitcherMinuteOne.getChildAt(1)).setTextColor(primaryTextColor); + textViewColonMinuteSecond.setTextColor(primaryTextColor); + ((TextView) textSwitcherSecondTen.getChildAt(0)).setTextColor(primaryTextColor); + ((TextView) textSwitcherSecondTen.getChildAt(1)).setTextColor(primaryTextColor); + ((TextView) textSwitcherSecondOne.getChildAt(0)).setTextColor(primaryTextColor); + ((TextView) textSwitcherSecondOne.getChildAt(1)).setTextColor(primaryTextColor); + } + + @Override + public void onWindowFocusChanged(boolean hasFocus) { + BangScreenTools.getBangScreenTools().windowChangeFullscreen(getWindow()); + super.onWindowFocusChanged(hasFocus); + } +} \ No newline at end of file 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 df30ea0..b4e4394 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 @@ -14,6 +14,7 @@ import androidx.viewpager2.widget.ViewPager2; import com.fatapp.oxygentoolbox.R; import com.fatapp.oxygentoolbox.ui.home.fav.FavFragment; import com.fatapp.oxygentoolbox.ui.home.tools.ToolsFragment; +import com.fatapp.oxygentoolbox.util.ResourceUtil; import com.fatapp.oxygentoolbox.util.SharedPreferencesUtils; import com.google.android.material.bottomnavigation.BottomNavigationView; @@ -56,7 +57,7 @@ public class HomeFragment extends Fragment { } }); - bottomNavViewPager.setCurrentItem(SharedPreferencesUtils.getPreferenceLaunchPage() == SharedPreferencesUtils.LaunchPage.TOOLS ? 0 : 1, false); + bottomNavViewPager.setCurrentItem(SharedPreferencesUtils.getPreferenceLaunchPage() == ResourceUtil.LaunchPage.TOOLS ? 0 : 1, false); return root; } 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 index 0655de9..0fc5a8a 100644 --- 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 @@ -95,14 +95,14 @@ public class ThemesAdapter extends RecyclerView.Adapter { - SharedPreferencesUtils.setPreferenceTheme(SharedPreferencesUtils.Theme.values()[position]); + SharedPreferencesUtils.setPreferenceTheme(ResourceUtil.Theme.values()[position]); ResourceUtil.restartActivity(activity, activity.getClass()); }); } @Override public int getItemCount() { - return SharedPreferencesUtils.Theme.values().length; + return ResourceUtil.Theme.values().length; } public static class ViewHolder extends RecyclerView.ViewHolder { 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 4be8b4b..eab53b9 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/util/ResourceUtil.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/util/ResourceUtil.java @@ -272,4 +272,19 @@ public final class ResourceUtil { break; } } + + @SuppressWarnings("unused") + public enum LaunchPage { + TOOLS, FAVOURITES + } + + @SuppressWarnings("unused") + public enum UiMode { + 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/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java b/app/src/main/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java index e9fa7fd..82addd3 100644 --- a/app/src/main/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java +++ b/app/src/main/java/com/fatapp/oxygentoolbox/util/SharedPreferencesUtils.java @@ -37,36 +37,21 @@ public class SharedPreferencesUtils { return new Locale(language, country); } - public static LaunchPage getPreferenceLaunchPage() { - return LaunchPage.valueOf(preferences.getString(ResourceUtil.getString(R.string.setting_launch_page_key), ResourceUtil.getString(R.string.setting_launch_page_default_value))); + public static ResourceUtil.LaunchPage getPreferenceLaunchPage() { + return ResourceUtil.LaunchPage.valueOf(preferences.getString(ResourceUtil.getString(R.string.setting_launch_page_key), ResourceUtil.getString(R.string.setting_launch_page_default_value))); } - public static UiMode getPreferenceUiMode() { - return UiMode.valueOf(preferences.getString(ResourceUtil.getString(R.string.setting_ui_mode_key), ResourceUtil.getString(R.string.setting_ui_mode_default_value))); + public static ResourceUtil.UiMode getPreferenceUiMode() { + return ResourceUtil.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 ResourceUtil.Theme getPreferenceTheme() { + return ResourceUtil.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) { + public static void setPreferenceTheme(ResourceUtil.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 - } - - @SuppressWarnings("unused") - public enum UiMode { - 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/java/com/fatapp/oxygentoolbox/util/VariableChangeListener.java b/app/src/main/java/com/fatapp/oxygentoolbox/util/VariableChangeListener.java new file mode 100644 index 0000000..f2c1403 --- /dev/null +++ b/app/src/main/java/com/fatapp/oxygentoolbox/util/VariableChangeListener.java @@ -0,0 +1,5 @@ +package com.fatapp.oxygentoolbox.util; + +public interface VariableChangeListener { + void onChange(T newValue, T oldValue); +} diff --git a/app/src/main/java/com/fatapp/oxygentoolbox/util/VariableChangeSupport.java b/app/src/main/java/com/fatapp/oxygentoolbox/util/VariableChangeSupport.java new file mode 100644 index 0000000..4bdb3a0 --- /dev/null +++ b/app/src/main/java/com/fatapp/oxygentoolbox/util/VariableChangeSupport.java @@ -0,0 +1,41 @@ +package com.fatapp.oxygentoolbox.util; + +import java.util.Objects; + +public class VariableChangeSupport { + private T value; + private VariableChangeListener onChangeListener; + + public VariableChangeSupport() { + } + + public VariableChangeSupport(T value) { + this.value = value; + } + + public VariableChangeSupport(VariableChangeListener onChangeListener) { + this.onChangeListener = onChangeListener; + } + + public VariableChangeSupport(T value, VariableChangeListener onChangeListener) { + this.value = value; + this.onChangeListener = onChangeListener; + } + + public void setValue(T value) { + if (!Objects.equals(this.value, value)) { + if (onChangeListener != null) { + onChangeListener.onChange(value, this.value); + } + this.value = value; + } + } + + public T getValue() { + return value; + } + + public void setOnChangeListener(VariableChangeListener onChangeListener) { + this.onChangeListener = onChangeListener; + } +} diff --git a/app/src/main/res/anim/text_from_top_in.xml b/app/src/main/res/anim/text_from_top_in.xml new file mode 100644 index 0000000..ad162a9 --- /dev/null +++ b/app/src/main/res/anim/text_from_top_in.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/text_to_down_out.xml b/app/src/main/res/anim/text_to_down_out.xml new file mode 100644 index 0000000..e2d5bb4 --- /dev/null +++ b/app/src/main/res/anim/text_to_down_out.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/animation_dark_to_light_mode.xml b/app/src/main/res/drawable/animation_dark_to_light_mode.xml new file mode 100644 index 0000000..aa68ed6 --- /dev/null +++ b/app/src/main/res/drawable/animation_dark_to_light_mode.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/animation_down_to_right_arrow.xml b/app/src/main/res/drawable/animation_down_to_right_arrow.xml index f0ac3e1..52cb77b 100644 --- a/app/src/main/res/drawable/animation_down_to_right_arrow.xml +++ b/app/src/main/res/drawable/animation_down_to_right_arrow.xml @@ -1,5 +1,4 @@ - + android:pathData="M 1008.02 276.637 C 983.509 254.352 945.634 256.617 923.35 278.864 L 513.35 720.056 L 103.351 278.826 C 81.067 254.315 43.18 254.315 18.668 276.599 C -5.843 298.883 -5.843 336.758 16.441 361.269 L 468.782 849.245 C 479.918 860.393 495.52 869.264 513.35 869.264 C 528.941 869.264 546.77 862.583 557.906 849.245 L 1010.247 361.269 C 1032.531 336.758 1032.531 298.883 1008.02 276.599 Z M 1008.02 276.637" + android:strokeWidth="1" /> + android:valueType="pathType" /> diff --git a/app/src/main/res/drawable/animation_light_to_dark_mode.xml b/app/src/main/res/drawable/animation_light_to_dark_mode.xml new file mode 100644 index 0000000..503e983 --- /dev/null +++ b/app/src/main/res/drawable/animation_light_to_dark_mode.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_dark_mode.xml b/app/src/main/res/drawable/ic_dark_mode.xml new file mode 100644 index 0000000..8d18990 --- /dev/null +++ b/app/src/main/res/drawable/ic_dark_mode.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_light_mode.xml b/app/src/main/res/drawable/ic_light_mode.xml new file mode 100644 index 0000000..56493bb --- /dev/null +++ b/app/src/main/res/drawable/ic_light_mode.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/activity_time_screen.xml b/app/src/main/res/layout/activity_time_screen.xml deleted file mode 100644 index 50701bf..0000000 --- a/app/src/main/res/layout/activity_time_screen.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_tool_time_screen.xml b/app/src/main/res/layout/activity_tool_time_screen.xml new file mode 100644 index 0000000..0cca69a --- /dev/null +++ b/app/src/main/res/layout/activity_tool_time_screen.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fold_layout_head.xml b/app/src/main/res/layout/fold_layout_head.xml index 8b1d30d..c2c1342 100644 --- a/app/src/main/res/layout/fold_layout_head.xml +++ b/app/src/main/res/layout/fold_layout_head.xml @@ -3,16 +3,15 @@ android:id="@+id/fold_layout_head_layout" android:layout_width="match_parent" android:layout_height="40dp" - android:layout_marginStart="10dp" + android:layout_marginHorizontal="10dp" android:layout_marginTop="10dp" - android:layout_marginEnd="10dp" android:gravity="center_vertical"> \ 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 e48ee80..541589a 100644 --- a/app/src/main/res/raw/dependencies.json +++ b/app/src/main/res/raw/dependencies.json @@ -1,57 +1 @@ -{ - "metadata": { - "generated": "2022-08-08T12:41:55.112Z" - }, - "libraries": [ - { - "uniqueId": "com.google.code.gson:gson", - "funding": [], - "developers": [ - { - "name": "Google" - } - ], - "artifactVersion": "2.9.0", - "description": "A Java serialization/deserialization library to convert Java Objects into JSON and back.", - "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" - ] - }, - { - "uniqueId": "com.github.KilleTom:BangScreenToolsMaster", - "funding": [], - "developers": [ - { - "name": "\u6613\u5e9e\u5b99" - } - ], - "artifactVersion": "v1.0.0", - "description": "Android \u5218\u6d77\u5c4f\u9002\u914d\u5de5\u5177\u5e93\u3001\u5218\u6d77\u5c4f\u5e55\u591a\u6837\u5f0f\u9002\u914d\u3001\u5218\u6d77\u5c4f\u9002\u914d\u3001Android \u5218\u6d77\u5c4f\u9002\u914d\u5de5\u5177\u7c7b", - "scm": { - "connection": "scm:git://github.com/KilleTom/BangScreenToolsMaster.git", - "url": "git://github.com/KilleTom/BangScreenToolsMaster.git", - "developerConnection": "scm:git://github.com/KilleTom/BangScreenToolsMaster.git" - }, - "name": "KilleTom/BangScreenToolsMaster", - "website": "https://github.com/KilleTom/BangScreenToolsMaster", - "licenses": [] - } - ], - "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-10T09:43:22.247Z"},"libraries":[{"uniqueId":"com.google.code.gson:gson","funding":[],"developers":[{"name":"Google"}],"artifactVersion":"2.9.0","description":"A Java serialization/deserialization library to convert Java Objects into JSON and back.","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"]},{"uniqueId":"com.github.KilleTom:BangScreenToolsMaster","funding":[],"developers":[{"name":"\u6613\u5e9e\u5b99"}],"artifactVersion":"v1.0.0","description":"Android \u5218\u6d77\u5c4f\u9002\u914d\u5de5\u5177\u5e93\u3001\u5218\u6d77\u5c4f\u5e55\u591a\u6837\u5f0f\u9002\u914d\u3001\u5218\u6d77\u5c4f\u9002\u914d\u3001Android \u5218\u6d77\u5c4f\u9002\u914d\u5de5\u5177\u7c7b","scm":{"connection":"scm:git://github.com/KilleTom/BangScreenToolsMaster.git","url":"git://github.com/KilleTom/BangScreenToolsMaster.git","developerConnection":"scm:git://github.com/KilleTom/BangScreenToolsMaster.git"},"name":"KilleTom/BangScreenToolsMaster","website":"https://github.com/KilleTom/BangScreenToolsMaster","licenses":[]}],"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 d2ebf23..7a51058 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -4,6 +4,15 @@ #FF303030 #FFEEEEEE #FF757575 + @color/white + #FF757575 + #FF757575 + @color/black + #FFEEEEEE + #FF757575 + @color/app_show_dark_background + @color/app_show_dark_primary_text + @color/app_show_dark_secondary_text #88CCCCCC #FFADADAD \ No newline at end of file diff --git a/app/src/main/res/values-v27/themes.xml b/app/src/main/res/values-v27/themes.xml new file mode 100644 index 0000000..557b5de --- /dev/null +++ b/app/src/main/res/values-v27/themes.xml @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 508bda0..cf1249b 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -16,6 +16,9 @@ + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f693833..279e967 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -8,6 +8,15 @@ @color/white #FF212121 #FF757575 + @color/white + #FF757575 + #FF757575 + @color/black + #FFEEEEEE + #FF757575 + @color/app_show_light_background + @color/app_show_light_primary_text + @color/app_show_light_secondary_text #88CCCCCC #FFDDDDDD diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c18c0ac..693def7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -106,4 +106,7 @@ About About OxygenToolbox app_about + + : + Change Mode \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4f746a2..ef26d6e 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -13,19 +13,4 @@ @null ?attr/tools_button_text - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 6dab71a..706f4bc 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -13,6 +13,9 @@ @color/app_on_background @color/app_primary_text @color/app_secondary_text + @color/app_show_background + @color/app_show_primary_text + @color/app_show_secondary_text @color/app_ripple @color/app_divider diff --git a/app/src/test/java/com/fatapp/oxygentoolbox/ExampleUnitTest.java b/app/src/test/java/com/fatapp/oxygentoolbox/ExampleUnitTest.java index 32acab0..d0dd663 100644 --- a/app/src/test/java/com/fatapp/oxygentoolbox/ExampleUnitTest.java +++ b/app/src/test/java/com/fatapp/oxygentoolbox/ExampleUnitTest.java @@ -1,8 +1,11 @@ package com.fatapp.oxygentoolbox; -import org.junit.Test; +import static org.junit.Assert.assertEquals; -import static org.junit.Assert.*; +import com.fatapp.oxygentoolbox.util.VariableChangeListener; +import com.fatapp.oxygentoolbox.util.VariableChangeSupport; + +import org.junit.Test; /** * Example local unit test, which will execute on the development machine (host). @@ -14,4 +17,21 @@ public class ExampleUnitTest { public void addition_isCorrect() { assertEquals(4, 2 + 2); } + + @Test + public void variableChangeTest() { + VariableChangeSupport stringVariableChangeSupport = new VariableChangeSupport<>("Hello", new VariableChangeListener() { + @Override + public void onChange(T newValue, T oldValue) { + System.out.println("newValue = " + newValue); + System.out.println("oldValue = " + oldValue); + } + }); + + stringVariableChangeSupport.setValue("Hello"); + stringVariableChangeSupport.setValue("Hi"); + stringVariableChangeSupport.setValue("Hi"); + stringVariableChangeSupport.setValue("HI"); + stringVariableChangeSupport.setValue("HI"); + } } \ No newline at end of file