Added daynight theme
This commit is contained in:
parent
e652611fc8
commit
bb5449c9d7
5 changed files with 113 additions and 13 deletions
|
@ -21,16 +21,15 @@ import android.content.SharedPreferences.Editor;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
import androidx.annotation.LayoutRes;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.StyleRes;
|
|
||||||
import androidx.viewpager.widget.ViewPager;
|
|
||||||
|
|
||||||
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
|
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import androidx.annotation.LayoutRes;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.StyleRes;
|
||||||
|
import androidx.viewpager.widget.ViewPager;
|
||||||
import code.name.monkey.retromusic.App;
|
import code.name.monkey.retromusic.App;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.activities.MainActivity;
|
import code.name.monkey.retromusic.activities.MainActivity;
|
||||||
|
@ -151,23 +150,24 @@ public final class PreferenceUtil {
|
||||||
return R.style.Theme_RetroMusic_Black;
|
return R.style.Theme_RetroMusic_Black;
|
||||||
case "black":
|
case "black":
|
||||||
return R.style.Theme_RetroMusic_Black;
|
return R.style.Theme_RetroMusic_Black;
|
||||||
|
case "daynight":
|
||||||
|
return R.style.Theme_RetroMusic_DayNight;
|
||||||
case "dark":
|
case "dark":
|
||||||
default:
|
default:
|
||||||
return R.style.Theme_RetroMusic;
|
return R.style.Theme_RetroMusic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getSleepTimerFinishMusic() {
|
||||||
|
return mPreferences.getBoolean(SLEEP_TIMER_FINISH_SONG, false);
|
||||||
|
}
|
||||||
|
|
||||||
public void setSleepTimerFinishMusic(final boolean value) {
|
public void setSleepTimerFinishMusic(final boolean value) {
|
||||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
editor.putBoolean(SLEEP_TIMER_FINISH_SONG, value);
|
editor.putBoolean(SLEEP_TIMER_FINISH_SONG, value);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getSleepTimerFinishMusic() {
|
|
||||||
return mPreferences.getBoolean(SLEEP_TIMER_FINISH_SONG, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getUserBio() {
|
public String getUserBio() {
|
||||||
return mPreferences.getString(USER_BIO, "");
|
return mPreferences.getString(USER_BIO, "");
|
||||||
}
|
}
|
||||||
|
|
51
app/src/main/res/values-night/styles-parents.xml
Normal file
51
app/src/main/res/values-night/styles-parents.xml
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="Theme.RetroMusic.DayNight" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<item name="md_corner_radius">12dp</item>
|
||||||
|
<item name="md_font_title">@font/circular</item>
|
||||||
|
<item name="md_font_body">@font/circular</item>
|
||||||
|
<item name="md_font_button">@font/circular</item>
|
||||||
|
<item name="md_color_button_text">@color/md_white_1000</item>
|
||||||
|
|
||||||
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
|
<item name="windowActionBarOverlay">true</item>
|
||||||
|
|
||||||
|
|
||||||
|
<item name="roundSelector">@drawable/round_selector_dark</item>
|
||||||
|
<item name="rectSelector">@drawable/rect_selector_dark</item>
|
||||||
|
<item name="rectSelectorStrong">@drawable/rect_selector_strong_dark</item>
|
||||||
|
|
||||||
|
<item name="cardBackgroundColor">@color/md_grey_800</item>
|
||||||
|
|
||||||
|
<item name="defaultFooterColor">@color/md_grey_800</item>
|
||||||
|
|
||||||
|
<item name="dividerColor">@color/md_grey_800</item>
|
||||||
|
<item name="iconColor">@color/ate_secondary_text_dark</item>
|
||||||
|
|
||||||
|
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat</item>
|
||||||
|
|
||||||
|
<!-- just in case-->
|
||||||
|
<item name="android:windowBackground">@color/md_grey_900</item>
|
||||||
|
<item name="colorAccent">@android:color/white</item>
|
||||||
|
|
||||||
|
<item name="colorPrimary">@android:color/black</item>
|
||||||
|
<item name="android:colorPrimary">@android:color/black</item>
|
||||||
|
|
||||||
|
<!-- necessary to find the overflow button later in the layout-->
|
||||||
|
<item name="android:actionOverflowButtonStyle">@style/Widget.ActionButton.Overflow</item>
|
||||||
|
|
||||||
|
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||||
|
|
||||||
|
<item name="bottomSheetDialogTheme">@style/BottomSheetDialog</item>
|
||||||
|
|
||||||
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
|
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
||||||
|
<item name="android:windowEnterTransition">@transition/grid_exit</item>
|
||||||
|
|
||||||
|
<item name="android:windowSharedElementEnterTransition">@transition/grid_exit</item>
|
||||||
|
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
|
||||||
|
<item name="android:fontFamily">@font/circular</item>
|
||||||
|
<item name="android:textColorPrimary">@color/md_white_1000</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
|
@ -45,6 +45,7 @@
|
||||||
<item>@string/dark_theme_name</item>
|
<item>@string/dark_theme_name</item>
|
||||||
<item>@string/black_theme_name</item>
|
<item>@string/black_theme_name</item>
|
||||||
<item>@string/color_theme_name</item>
|
<item>@string/color_theme_name</item>
|
||||||
|
<item>@string/day_night_theme_name</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="pref_grid_style_list_titles">
|
<string-array name="pref_grid_style_list_titles">
|
||||||
|
@ -97,6 +98,7 @@
|
||||||
<item>dark</item>
|
<item>dark</item>
|
||||||
<item>black</item>
|
<item>black</item>
|
||||||
<item>color</item>
|
<item>color</item>
|
||||||
|
<item>daynight</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<array name="pref_auto_download_images_values">
|
<array name="pref_auto_download_images_values">
|
||||||
|
|
|
@ -124,6 +124,7 @@
|
||||||
|
|
||||||
<string name="color">Color</string>
|
<string name="color">Color</string>
|
||||||
<string name="color_theme_name">Color</string>
|
<string name="color_theme_name">Color</string>
|
||||||
|
<string name="day_night_theme_name">Day Night(alpha)</string>
|
||||||
|
|
||||||
<string name="colors">Colors</string>
|
<string name="colors">Colors</string>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,55 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
|
<style name="Theme.RetroMusic.DayNight" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
|
||||||
|
|
||||||
|
<item name="md_corner_radius">12dp</item>
|
||||||
|
<item name="md_font_title">@font/circular</item>
|
||||||
|
<item name="md_font_body">@font/circular</item>
|
||||||
|
<item name="md_font_button">@font/circular</item>
|
||||||
|
<item name="md_color_button_text">@color/md_black_1000</item>
|
||||||
|
|
||||||
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
|
<item name="windowActionBarOverlay">true</item>
|
||||||
|
|
||||||
|
|
||||||
|
<item name="roundSelector">@drawable/round_selector</item>
|
||||||
|
<item name="rectSelector">@drawable/rect_selector</item>
|
||||||
|
<item name="rectSelectorStrong">@drawable/rect_selector_strong</item>
|
||||||
|
|
||||||
|
<item name="cardBackgroundColor">@color/md_white_1000</item>
|
||||||
|
|
||||||
|
<item name="defaultFooterColor">@color/md_grey_500</item>
|
||||||
|
|
||||||
|
<item name="dividerColor">@color/md_grey_200</item>
|
||||||
|
<item name="iconColor">@color/ate_secondary_text_light</item>
|
||||||
|
|
||||||
|
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
|
||||||
|
|
||||||
|
<!-- just in case-->
|
||||||
|
<item name="android:windowBackground">@color/md_white_1000</item>
|
||||||
|
<item name="colorAccent">@android:color/black</item>
|
||||||
|
<item name="colorPrimary">@color/md_white_1000</item>
|
||||||
|
|
||||||
|
<!-- necessary to find the overflow button later in the layout-->
|
||||||
|
<item name="android:actionOverflowButtonStyle">@style/Widget.ActionButton.Overflow</item>
|
||||||
|
|
||||||
|
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||||
|
|
||||||
|
<item name="bottomSheetDialogTheme">@style/BottomSheetDialog</item>
|
||||||
|
|
||||||
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
|
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
||||||
|
<item name="android:windowEnterTransition">@transition/grid_exit</item>
|
||||||
|
|
||||||
|
<item name="android:windowSharedElementEnterTransition">@transition/grid_exit</item>
|
||||||
|
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
|
||||||
|
<item name="android:fontFamily">@font/circular</item>
|
||||||
|
|
||||||
|
<item name="android:textColorPrimary">@color/md_grey_900</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar">
|
<style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar">
|
||||||
|
|
||||||
<item name="md_corner_radius">12dp</item>
|
<item name="md_corner_radius">12dp</item>
|
||||||
|
@ -61,11 +110,8 @@
|
||||||
<style name="Theme.RetroMusic.Base.Black" parent="@style/Theme.RetroMusic.Base">
|
<style name="Theme.RetroMusic.Base.Black" parent="@style/Theme.RetroMusic.Base">
|
||||||
|
|
||||||
<item name="dividerColor">#18FFFFFF</item>
|
<item name="dividerColor">#18FFFFFF</item>
|
||||||
|
|
||||||
<item name="defaultFooterColor">@color/md_grey_800</item>
|
<item name="defaultFooterColor">@color/md_grey_800</item>
|
||||||
|
|
||||||
<item name="cardBackgroundColor">@color/md_grey_900</item>
|
<item name="cardBackgroundColor">@color/md_grey_900</item>
|
||||||
|
|
||||||
<item name="md_background_color">@color/md_grey_900</item>
|
<item name="md_background_color">@color/md_grey_900</item>
|
||||||
|
|
||||||
<item name="android:windowBackground">@color/md_black_1000</item>
|
<item name="android:windowBackground">@color/md_black_1000</item>
|
||||||
|
|
Loading…
Reference in a new issue