Skip to content

Commit

Permalink
added more themes in styles and array
Browse files Browse the repository at this point in the history
  • Loading branch information
U-METAL103\103 authored and U-METAL103\103 committed Apr 3, 2024
1 parent 124c05a commit 51ae9d1
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme_Unified);
}

if (_appSettings.getAppAccentName().contains("black_white")) {
setTheme(R.style.BlackWhite);
}

if (_appSettings.getAppAccentName().contains("white_black")) {
setTheme(R.style.WhiteBlack);
}

if (_appSettings.getAppAccentName().contains("black_aqua")) {
setTheme(R.style.BlackAqua);
}
Expand All @@ -158,6 +166,13 @@ protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.BlackGreen);
}

if (_appSettings.getAppAccentName().contains("sepia")) {
setTheme(R.style.Sepia);
}

if (_appSettings.getAppAccentName().contains("nord")) {
setTheme(R.style.Nord);
}

StoragePermissionActivity.requestPermissions(this);
AppSettings.clearDebugLog();
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/java/net/gsantner/markor/activity/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ protected void onCreate(final Bundle savedInstanceState) {
setTheme(R.style.AppTheme_Unified);
}

if (_appSettings.getAppAccentName().contains("black_white")) {
setTheme(R.style.BlackWhite);
}

if (_appSettings.getAppAccentName().contains("white_black")) {
setTheme(R.style.WhiteBlack);
}

if (_appSettings.getAppAccentName().contains("black_aqua")) {
setTheme(R.style.BlackAqua);
}
Expand All @@ -85,6 +93,14 @@ protected void onCreate(final Bundle savedInstanceState) {
setTheme(R.style.BlackGreen);
}

if (_appSettings.getAppAccentName().contains("sepia")) {
setTheme(R.style.Sepia);
}

if (_appSettings.getAppAccentName().contains("nord")) {
setTheme(R.style.Nord);
}

IS_DEBUG_ENABLED |= BuildConfig.IS_TEST_BUILD;
_cu = new MarkorContextUtils(this);
setContentView(R.layout.main__activity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ protected void onPreCreate(@Nullable Bundle savedInstanceState) {
setTheme(R.style.AppTheme_Unified);
}

if (_appSettings.getAppAccentName().contains("black_white")) {
setTheme(R.style.BlackWhite);
}

if (_appSettings.getAppAccentName().contains("white_black")) {
setTheme(R.style.WhiteBlack);
}

if (_appSettings.getAppAccentName().contains("black_aqua")) {
setTheme(R.style.BlackAqua);
}
Expand All @@ -36,8 +44,13 @@ protected void onPreCreate(@Nullable Bundle savedInstanceState) {
setTheme(R.style.BlackGreen);
}

Log.d("elys-markor", "accent: "+_appSettings.getAppAccentName());
if (_appSettings.getAppAccentName().contains("sepia")) {
setTheme(R.style.Sepia);
}

if (_appSettings.getAppAccentName().contains("nord")) {
setTheme(R.style.Nord);
}

_appSettings.applyAppTheme();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@

<string-array name="pref_arrdisp__app_accent" translatable="false">
<item translatable="false">Default</item>
<item translatable="false">Blue</item>
<item translatable="false">Black and White</item>
<item translatable="false">White and Black</item>
<item translatable="false">Black and Aqua</item>
<item translatable="false">Black and Green</item>
<item translatable="false">White</item>
<item translatable="false">Black</item>
<item translatable="false">Sepia</item>
<item translatable="false">Nord</item>
</string-array>

<string-array name="pref_arrkeys__app_accent" translatable="false">
<item translatable="false">default</item>
<item translatable="false">blue</item>
<item translatable="false">black_white</item>
<item translatable="false">white_black</item>
<item translatable="false">black_aqua</item>
<item translatable="false">black_green</item>
<item translatable="false">white</item>
<item translatable="false">black</item>
<item translatable="false">sepia</item>
<item translatable="false">nord</item>
</string-array>

<string-array name="pref_arrdisp__editor_basic_color_schemes" translatable="false">
Expand Down
82 changes: 81 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,46 @@
<item name="android:windowBackground">#EEEEEE</item>
</style>

<style name="BlackWhite" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="android:windowActionModeOverlay">true</item>
<item name="windowActionModeOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:actionButtonStyle">@style/LessSpaceActionButtonStyle</item>
<item name="preferenceTheme">@style/AppTheme.PreferenceTheme</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="android:actionModeBackground">@color/black</item>
<item name="actionModeBackground">@color/black</item>
<item name="colorPrimary">@color/black</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorAccent">@color/white</item>
<item name="colorPrimaryContainer">@color/white</item>
<item name="colorOnPrimaryContainer">@color/black</item>
<item name="android:windowBackground">@color/black</item>
</style>

<style name="WhiteBlack" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="android:windowActionModeOverlay">true</item>
<item name="windowActionModeOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:actionButtonStyle">@style/LessSpaceActionButtonStyle</item>
<item name="preferenceTheme">@style/AppTheme.PreferenceTheme</item>
<item name="colorPrimaryDark">@color/white</item>
<item name="android:actionModeBackground">@color/white</item>
<item name="actionModeBackground">@color/white</item>
<item name="colorPrimary">@color/white</item>
<item name="colorOnPrimary">@color/black</item>
<item name="colorAccent">@color/black</item>
<item name="colorPrimaryContainer">@color/black</item>
<item name="colorOnPrimaryContainer">@color/white</item>
<item name="android:windowBackground">@color/white</item>
</style>

<style name="BlackAqua" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="android:windowActionModeOverlay">true</item>
<item name="windowActionModeOverlay">true</item>
Expand Down Expand Up @@ -69,7 +109,47 @@
<item name="colorOnPrimaryContainer">@color/black</item>
<item name="android:windowBackground">@color/black</item>
</style>


<style name="Sepia" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="android:windowActionModeOverlay">true</item>
<item name="windowActionModeOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:actionButtonStyle">@style/LessSpaceActionButtonStyle</item>
<item name="preferenceTheme">@style/AppTheme.PreferenceTheme</item>
<item name="colorPrimaryDark">@color/sepia_bg_light__fg_dark</item>
<item name="android:actionModeBackground">@color/sepia_fg_light__bg_dark</item>
<item name="actionModeBackground">@color/sepia_fg_light__bg_dark</item>
<item name="colorPrimary">@color/sepia_fg_light__bg_dark</item>
<item name="colorOnPrimary">@color/sepia_bg_light__fg_dark</item>
<item name="colorAccent">@color/sepia_bg_light__fg_dark</item>
<item name="colorPrimaryContainer">@color/sepia_fg_light__bg_dark</item>
<item name="colorOnPrimaryContainer">@color/sepia_fg_light__bg_dark</item>
<item name="android:windowBackground">@color/sepia_fg_light__bg_dark</item>
</style>

<style name="Nord" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="android:windowActionModeOverlay">true</item>
<item name="windowActionModeOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:actionButtonStyle">@style/LessSpaceActionButtonStyle</item>
<item name="preferenceTheme">@style/AppTheme.PreferenceTheme</item>
<item name="colorPrimaryDark">@color/nord_bg_dark</item>
<item name="android:actionModeBackground">@color/nord_bg_dark</item>
<item name="actionModeBackground">@color/nord_bg_dark</item>
<item name="colorPrimary">@color/nord_bg_dark</item>
<item name="colorOnPrimary">@color/nord_fg_dark</item>
<item name="colorAccent">@color/nord_fg_dark</item>
<item name="colorPrimaryContainer">@color/nord_fg_dark</item>
<item name="colorOnPrimaryContainer">@color/nord_bg_dark</item>
<item name="android:windowBackground">@color/nord_bg_dark</item>
</style>

<style name="AppTheme.PreferenceTheme" parent="PreferenceThemeOverlay.v14.Material">
<item name="preferenceCategoryStyle">@style/AppTheme.PreferenceTheme.CategoryStyle</item>
</style>
Expand Down

0 comments on commit 51ae9d1

Please sign in to comment.