[Feature] Added option to switch to Manrope
This commit is contained in:
parent
83fca0a829
commit
dfa3129239
17 changed files with 56 additions and 6 deletions
|
@ -157,3 +157,4 @@ const val SNOWFALL = "snowfall"
|
||||||
const val LYRICS_TYPE = "lyrics_type"
|
const val LYRICS_TYPE = "lyrics_type"
|
||||||
const val PLAYBACK_SPEED = "playback_speed"
|
const val PLAYBACK_SPEED = "playback_speed"
|
||||||
const val PLAYBACK_PITCH = "playback_pitch"
|
const val PLAYBACK_PITCH = "playback_pitch"
|
||||||
|
const val CUSTOM_FONT = "custom_font"
|
||||||
|
|
|
@ -147,7 +147,7 @@ class MainActivity : AbsCastActivity(), OnSharedPreferenceChangeListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
||||||
if (key == GENERAL_THEME || key == MATERIAL_YOU || key == BLACK_THEME || key == ADAPTIVE_COLOR_APP || key == USER_NAME || key == TOGGLE_FULL_SCREEN || key == TOGGLE_VOLUME || key == ROUND_CORNERS || key == CAROUSEL_EFFECT || key == NOW_PLAYING_SCREEN_ID || key == TOGGLE_GENRE || key == BANNER_IMAGE_PATH || key == PROFILE_IMAGE_PATH || key == CIRCULAR_ALBUM_ART || key == KEEP_SCREEN_ON || key == TOGGLE_SEPARATE_LINE || key == TOGGLE_HOME_BANNER || key == TOGGLE_ADD_CONTROLS || key == ALBUM_COVER_STYLE || key == HOME_ARTIST_GRID_STYLE || key == ALBUM_COVER_TRANSFORM || key == DESATURATED_COLOR || key == EXTRA_SONG_INFO || key == TAB_TEXT_MODE || key == LANGUAGE_NAME || key == LIBRARY_CATEGORIES) {
|
if (key == GENERAL_THEME || key == MATERIAL_YOU || key == BLACK_THEME || key == ADAPTIVE_COLOR_APP || key == USER_NAME || key == TOGGLE_FULL_SCREEN || key == TOGGLE_VOLUME || key == ROUND_CORNERS || key == CAROUSEL_EFFECT || key == NOW_PLAYING_SCREEN_ID || key == TOGGLE_GENRE || key == BANNER_IMAGE_PATH || key == PROFILE_IMAGE_PATH || key == CIRCULAR_ALBUM_ART || key == KEEP_SCREEN_ON || key == TOGGLE_SEPARATE_LINE || key == TOGGLE_HOME_BANNER || key == TOGGLE_ADD_CONTROLS || key == ALBUM_COVER_STYLE || key == HOME_ARTIST_GRID_STYLE || key == ALBUM_COVER_TRANSFORM || key == DESATURATED_COLOR || key == EXTRA_SONG_INFO || key == TAB_TEXT_MODE || key == LANGUAGE_NAME || key == LIBRARY_CATEGORIES || key == CUSTOM_FONT) {
|
||||||
postRecreate()
|
postRecreate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,9 @@ abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable {
|
||||||
com.google.android.material.R.style.ThemeOverlay_Material3_DynamicColors_DayNight
|
com.google.android.material.R.style.ThemeOverlay_Material3_DynamicColors_DayNight
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (PreferenceUtil.isCustomFont) {
|
||||||
|
setTheme(R.style.FontThemeOverlay)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||||
|
|
|
@ -115,8 +115,10 @@ fun SeekBar.addAccentColor() {
|
||||||
|
|
||||||
fun Slider.accent() {
|
fun Slider.accent() {
|
||||||
if (materialYou) return
|
if (materialYou) return
|
||||||
trackActiveTintList = context.accentColor().colorStateList
|
val accentColor = context.accentColor()
|
||||||
trackInactiveTintList = context.accentColorVariant().colorStateList
|
thumbTintList = accentColor.colorStateList
|
||||||
|
trackActiveTintList = accentColor.colorStateList
|
||||||
|
trackInactiveTintList = ColorUtil.withAlpha(accentColor, 0.1F).colorStateList
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Button.accentTextColor() {
|
fun Button.accentTextColor() {
|
||||||
|
|
|
@ -121,6 +121,11 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
||||||
restartActivity()
|
restartActivity()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
val customFont: ATESwitchPreference? = findPreference(CUSTOM_FONT)
|
||||||
|
customFont?.setOnPreferenceChangeListener { _, _ ->
|
||||||
|
restartActivity()
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
|
|
@ -665,6 +665,9 @@ object PreferenceUtil {
|
||||||
val materialYou
|
val materialYou
|
||||||
get() = sharedPreferences.getBoolean(MATERIAL_YOU, VersionUtils.hasS())
|
get() = sharedPreferences.getBoolean(MATERIAL_YOU, VersionUtils.hasS())
|
||||||
|
|
||||||
|
val isCustomFont
|
||||||
|
get() = sharedPreferences.getBoolean(CUSTOM_FONT, false)
|
||||||
|
|
||||||
val isSnowFalling
|
val isSnowFalling
|
||||||
get() = sharedPreferences.getBoolean(SNOWFALL, false)
|
get() = sharedPreferences.getBoolean(SNOWFALL, false)
|
||||||
|
|
||||||
|
|
24
app/src/main/res/font/manrope.xml
Normal file
24
app/src/main/res/font/manrope.xml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<font
|
||||||
|
android:font="@font/manrope_extralight"
|
||||||
|
android:fontWeight="200" />
|
||||||
|
<font
|
||||||
|
android:font="@font/manrope_light"
|
||||||
|
android:fontWeight="300" />
|
||||||
|
<font
|
||||||
|
android:font="@font/manrope_regular"
|
||||||
|
android:fontWeight="400" />
|
||||||
|
<font
|
||||||
|
android:font="@font/manrope_medium"
|
||||||
|
android:fontWeight="500" />
|
||||||
|
<font
|
||||||
|
android:font="@font/manrope_semibold"
|
||||||
|
android:fontWeight="600" />
|
||||||
|
<font
|
||||||
|
android:font="@font/manrope_bold"
|
||||||
|
android:fontWeight="700" />
|
||||||
|
<font
|
||||||
|
android:font="@font/manrope_extrabold"
|
||||||
|
android:fontWeight="800" />
|
||||||
|
</font-family>
|
BIN
app/src/main/res/font/manrope_bold.ttf
Normal file
BIN
app/src/main/res/font/manrope_bold.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/manrope_extrabold.ttf
Normal file
BIN
app/src/main/res/font/manrope_extrabold.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/manrope_extralight.ttf
Normal file
BIN
app/src/main/res/font/manrope_extralight.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/manrope_light.ttf
Normal file
BIN
app/src/main/res/font/manrope_light.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/manrope_medium.ttf
Normal file
BIN
app/src/main/res/font/manrope_medium.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/manrope_regular.ttf
Normal file
BIN
app/src/main/res/font/manrope_regular.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/manrope_semibold.ttf
Normal file
BIN
app/src/main/res/font/manrope_semibold.ttf
Normal file
Binary file not shown.
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="about_album_label">About %s</string>
|
<string name="about_album_label">About %s</string>
|
||||||
<string name="about_settings_summary">Team, social links</string>
|
<string name="about_settings_summary">Team, social links</string>
|
||||||
|
@ -290,6 +291,9 @@
|
||||||
<string name="pinterest_page">Pinterest</string>
|
<string name="pinterest_page">Pinterest</string>
|
||||||
<string name="pinterest_page_summary">Follow Pinterest page for Retro Music design inspiration</string>
|
<string name="pinterest_page_summary">Follow Pinterest page for Retro Music design inspiration</string>
|
||||||
<string name="plain">Plain</string>
|
<string name="plain">Plain</string>
|
||||||
|
<string name="playback_pitch">Pitch</string>
|
||||||
|
<string name="playback_settings">Playback Settings</string>
|
||||||
|
<string name="playback_speed">Playback Speed</string>
|
||||||
<string name="playing_notification_description">The playing notification provides actions for play/pause etc.</string>
|
<string name="playing_notification_description">The playing notification provides actions for play/pause etc.</string>
|
||||||
<string name="playing_notification_name">Playing notification</string>
|
<string name="playing_notification_name">Playing notification</string>
|
||||||
<string name="playlist_is_empty">Playlist is empty</string>
|
<string name="playlist_is_empty">Playlist is empty</string>
|
||||||
|
@ -360,6 +364,7 @@
|
||||||
<string name="pref_title_colored_app">Adaptive color</string>
|
<string name="pref_title_colored_app">Adaptive color</string>
|
||||||
<string name="pref_title_colored_notification">Colored notification</string>
|
<string name="pref_title_colored_notification">Colored notification</string>
|
||||||
<string name="pref_title_cross_fade">Crossfade (Beta)</string>
|
<string name="pref_title_cross_fade">Crossfade (Beta)</string>
|
||||||
|
<string name="pref_title_custom_font">Use Custom font</string>
|
||||||
<string name="pref_title_desaturated_color">Desaturated color</string>
|
<string name="pref_title_desaturated_color">Desaturated color</string>
|
||||||
<string name="pref_title_expand_now_playing_panel">Show now playing screen</string>
|
<string name="pref_title_expand_now_playing_panel">Show now playing screen</string>
|
||||||
<string name="pref_title_extra_controls">Extra controls</string>
|
<string name="pref_title_extra_controls">Extra controls</string>
|
||||||
|
@ -526,7 +531,4 @@
|
||||||
<string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string>
|
<string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string>
|
||||||
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
|
<string name="you_will_be_forwarded_to_the_issue_tracker_website">You will be forwarded to the issue tracker website.</string>
|
||||||
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
|
<string name="your_account_data_is_only_used_for_authentication">Your account data is only used for authentication.</string>
|
||||||
<string name="playback_speed">Playback Speed</string>
|
|
||||||
<string name="playback_pitch">Pitch</string>
|
|
||||||
<string name="playback_settings">Playback Settings</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -246,4 +246,8 @@
|
||||||
<item name="android:windowFrame">@null</item>
|
<item name="android:windowFrame">@null</item>
|
||||||
<item name="background">@color/transparent</item>
|
<item name="background">@color/transparent</item>
|
||||||
</style>
|
</style>
|
||||||
|
<style name="FontThemeOverlay">
|
||||||
|
<item name="fontFamily">@font/manrope</item>
|
||||||
|
<item name="android:fontFamily">@font/manrope</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -30,6 +30,12 @@
|
||||||
android:title="@string/pref_title_md3"
|
android:title="@string/pref_title_md3"
|
||||||
app:isPreferenceVisible="@bool/md3_available" />
|
app:isPreferenceVisible="@bool/md3_available" />
|
||||||
|
|
||||||
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="custom_font"
|
||||||
|
android:layout="@layout/list_item_view_switch_no_title"
|
||||||
|
android:title="@string/pref_title_custom_font" />
|
||||||
|
|
||||||
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
|
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue