From 960657878ef3ab2573bff284cbf1cbd9ce3407d3 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Sun, 2 Jun 2019 15:40:33 +0530 Subject: [PATCH] Improved settings screen --- .../preferences/MaterialListPreference.kt | 22 ++++- .../res/drawable/ic_blur_on_white_24dp.xml | 24 +++++ .../res/drawable/ic_color_lens_white_24dp.xml | 36 ++++++++ .../res/drawable/ic_colorize_white_24dp.xml | 25 +++++ .../drawable/ic_home_selected_white_24dp.xml | 3 +- .../main/res/drawable/ic_home_white_24dp.xml | 2 +- .../main/res/drawable/ic_rounded_corner.xml | 4 +- app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/pref_advanced.xml | 10 +- app/src/main/res/xml/pref_audio.xml | 27 +++--- app/src/main/res/xml/pref_blacklist.xml | 2 +- app/src/main/res/xml/pref_extras.xml | 15 --- app/src/main/res/xml/pref_general.xml | 16 ++-- app/src/main/res/xml/pref_images.xml | 4 +- app/src/main/res/xml/pref_lockscreen.xml | 12 +-- app/src/main/res/xml/pref_notification.xml | 8 +- .../main/res/xml/pref_now_playing_screen.xml | 19 ++-- app/src/main/res/xml/pref_playlists.xml | 5 +- app/src/main/res/xml/pref_ui.xml | 92 ++++++++++--------- app/src/main/res/xml/pref_window.xml | 14 ++- .../prefs/supportv7/ATEColorPreference.kt | 10 +- .../prefs/supportv7/ATESwitchPreference.kt | 3 + .../res/layout/ate_preference_category.xml | 2 +- .../layout/ate_preference_custom_support.xml | 2 +- 24 files changed, 229 insertions(+), 129 deletions(-) create mode 100644 app/src/main/res/drawable/ic_blur_on_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_color_lens_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_colorize_white_24dp.xml delete mode 100644 app/src/main/res/xml/pref_extras.xml diff --git a/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt b/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt index 31956372..5d95bb23 100644 --- a/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt +++ b/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt @@ -17,10 +17,12 @@ package code.name.monkey.retromusic.preferences import android.app.Dialog import android.content.Context import android.content.res.TypedArray +import android.graphics.PorterDuff import android.os.Bundle import android.util.AttributeSet import androidx.preference.ListPreference import androidx.preference.PreferenceDialogFragmentCompat +import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.retromusic.R import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.bottomsheets.BottomSheet @@ -30,13 +32,25 @@ import com.afollestad.materialdialogs.list.listItemsSingleChoice class MaterialListPreference : ListPreference { private val mLayoutRes = R.layout.ate_preference_list - constructor(context: Context) : super(context) + constructor(context: Context) : super(context) { + init(context) + } - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) + private fun init(context: Context) { + icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN) + } - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { + init(context) + } - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) + constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { + init(context) + } + + constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) { + init(context) + } override fun getDialogLayoutResource(): Int { return mLayoutRes diff --git a/app/src/main/res/drawable/ic_blur_on_white_24dp.xml b/app/src/main/res/drawable/ic_blur_on_white_24dp.xml new file mode 100644 index 00000000..d7123060 --- /dev/null +++ b/app/src/main/res/drawable/ic_blur_on_white_24dp.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_color_lens_white_24dp.xml b/app/src/main/res/drawable/ic_color_lens_white_24dp.xml new file mode 100644 index 00000000..31e47f8f --- /dev/null +++ b/app/src/main/res/drawable/ic_color_lens_white_24dp.xml @@ -0,0 +1,36 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_colorize_white_24dp.xml b/app/src/main/res/drawable/ic_colorize_white_24dp.xml new file mode 100644 index 00000000..a2c2b5b6 --- /dev/null +++ b/app/src/main/res/drawable/ic_colorize_white_24dp.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_home_selected_white_24dp.xml b/app/src/main/res/drawable/ic_home_selected_white_24dp.xml index 832b5788..6f6136f0 100644 --- a/app/src/main/res/drawable/ic_home_selected_white_24dp.xml +++ b/app/src/main/res/drawable/ic_home_selected_white_24dp.xml @@ -4,8 +4,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + android:pathData="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_home_white_24dp.xml b/app/src/main/res/drawable/ic_home_white_24dp.xml index b78bab9d..76f069b7 100644 --- a/app/src/main/res/drawable/ic_home_white_24dp.xml +++ b/app/src/main/res/drawable/ic_home_white_24dp.xml @@ -6,5 +6,5 @@ android:viewportHeight="24"> + android:pathData="M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_rounded_corner.xml b/app/src/main/res/drawable/ic_rounded_corner.xml index 5c2c2437..aa36e0ce 100644 --- a/app/src/main/res/drawable/ic_rounded_corner.xml +++ b/app/src/main/res/drawable/ic_rounded_corner.xml @@ -2,8 +2,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 96f6d738..b60d8f5a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -621,4 +621,5 @@ Gradient image Stack + diff --git a/app/src/main/res/xml/pref_advanced.xml b/app/src/main/res/xml/pref_advanced.xml index 333163cd..15fa727b 100755 --- a/app/src/main/res/xml/pref_advanced.xml +++ b/app/src/main/res/xml/pref_advanced.xml @@ -9,7 +9,6 @@ android:max="60" android:title="@string/pref_filter_song_title" app:enableCopying="true" - app:iconSpaceReserved="false" app:showSeekBarValue="true" /> @@ -18,23 +17,20 @@ android:key="pause_on_zero_volume" android:summary="@string/pref_keep_pause_on_zero_volume_summary" android:title="@string/pref_keep_pause_on_zero_volume_title" - app:enableCopying="true" - app:iconSpaceReserved="false" /> + app:enableCopying="true" /> + app:enableCopying="true" /> + app:enableCopying="true" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_audio.xml b/app/src/main/res/xml/pref_audio.xml index 6595edac..aea22b25 100755 --- a/app/src/main/res/xml/pref_audio.xml +++ b/app/src/main/res/xml/pref_audio.xml @@ -5,45 +5,48 @@ + android:title="@string/pref_title_audio_ducking" + app:enableCopying="true" + app:icon="@drawable/ic_volume_down_white_24dp" /> + android:title="@string/pref_title_gapless_playback" + app:enableCopying="true" /> + android:title="@string/pref_title_choose_equalizer" + app:enableCopying="true" + app:icon="@drawable/ic_equalizer_white_24dp" /> - + android:title="@string/equalizer" + app:enableCopying="true" /> + app:enableCopying="true" + app:icon="@drawable/ic_play_arrow_white_24dp" /> + app:enableCopying="true" + app:icon="@drawable/ic_shuffle_white_24dp" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_blacklist.xml b/app/src/main/res/xml/pref_blacklist.xml index 865ce948..6d9f82b7 100644 --- a/app/src/main/res/xml/pref_blacklist.xml +++ b/app/src/main/res/xml/pref_blacklist.xml @@ -7,7 +7,7 @@ android:key="blacklist" android:summary="@string/pref_summary_blacklist" android:title="@string/pref_title_blacklist" - app:iconSpaceReserved="false" /> + app:enableCopying="true" /> diff --git a/app/src/main/res/xml/pref_extras.xml b/app/src/main/res/xml/pref_extras.xml deleted file mode 100644 index 50612d1d..00000000 --- a/app/src/main/res/xml/pref_extras.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index 373f5475..e0d667c9 100755 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -10,7 +10,8 @@ android:negativeButtonText="@null" android:positiveButtonText="@null" android:title="@string/pref_title_general_theme" - app:iconSpaceReserved="false" /> + app:enableCopying="true" + app:icon="@drawable/ic_color_lens_white_24dp" /> @@ -19,35 +20,36 @@ android:persistent="false" android:summary="@string/primary_color_desc" android:title="@string/primary_color" - app:iconSpaceReserved="false" - app:isPreferenceVisible="false" /> + app:enableCopying="true" + app:icon="@drawable/ic_colorize_white_24dp" /> + app:enableCopying="true" + app:icon="@drawable/ic_colorize_white_24dp" /> + app:enableCopying="true" /> + app:enableCopying="true" /> + app:enableCopying="true" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_images.xml b/app/src/main/res/xml/pref_images.xml index fdd4ae37..cf1cc90e 100755 --- a/app/src/main/res/xml/pref_images.xml +++ b/app/src/main/res/xml/pref_images.xml @@ -3,15 +3,15 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> + android:title="@string/pref_title_album_art_on_lockscreen" + app:enableCopying="true" /> + android:title="@string/pref_title_blurred_album_art" + app:enableCopying="true" /> + android:title="@string/pref_title_lock_screen" + app:enableCopying="true" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_notification.xml b/app/src/main/res/xml/pref_notification.xml index 64e24946..fa74f91f 100755 --- a/app/src/main/res/xml/pref_notification.xml +++ b/app/src/main/res/xml/pref_notification.xml @@ -4,15 +4,15 @@ + android:title="@string/pref_title_colored_notification" + app:enableCopying="true" /> + android:title="@string/pref_title_classic_notification" + app:enableCopying="true" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_now_playing_screen.xml b/app/src/main/res/xml/pref_now_playing_screen.xml index 3f9ad320..6bc3d7a2 100644 --- a/app/src/main/res/xml/pref_now_playing_screen.xml +++ b/app/src/main/res/xml/pref_now_playing_screen.xml @@ -5,12 +5,13 @@ + app:enableCopying="true" + app:icon="@drawable/ic_play_circle_filled_white_24dp" /> + app:enableCopying="true" /> + app:enableCopying="true" /> @@ -30,14 +32,16 @@ @@ -48,7 +52,8 @@ android:max="25" android:summary="@string/pref_blur_amount_summary" android:title="@string/pref_blur_amount_title" - app:iconSpaceReserved="false" + app:enableCopying="true" + app:icon="@drawable/ic_blur_on_white_24dp" app:showSeekBarValue="true" /> \ No newline at end of file diff --git a/app/src/main/res/xml/pref_playlists.xml b/app/src/main/res/xml/pref_playlists.xml index 84979a45..b94c67ce 100644 --- a/app/src/main/res/xml/pref_playlists.xml +++ b/app/src/main/res/xml/pref_playlists.xml @@ -8,10 +8,11 @@ android:entries="@array/pref_playlists_last_added_interval_titles" android:entryValues="@array/pref_playlists_last_added_interval_values" android:key="last_added_interval" - app:iconSpaceReserved="false" android:negativeButtonText="@null" android:positiveButtonText="@null" - android:title="@string/pref_title_last_added_interval" /> + android:title="@string/pref_title_last_added_interval" + app:enableCopying="true" + app:icon="@drawable/ic_playlist_add_white_24dp" /> diff --git a/app/src/main/res/xml/pref_ui.xml b/app/src/main/res/xml/pref_ui.xml index 2cdb7322..57764763 100644 --- a/app/src/main/res/xml/pref_ui.xml +++ b/app/src/main/res/xml/pref_ui.xml @@ -1,53 +1,57 @@ + + - - - + - + - - - + + + \ No newline at end of file diff --git a/app/src/main/res/xml/pref_window.xml b/app/src/main/res/xml/pref_window.xml index 7f743ade..5b955dc9 100644 --- a/app/src/main/res/xml/pref_window.xml +++ b/app/src/main/res/xml/pref_window.xml @@ -1,19 +1,17 @@ - + + app:enableCopying="true" + app:icon="@drawable/ic_rounded_corner" /> - \ No newline at end of file diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEColorPreference.kt b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEColorPreference.kt index c30a6816..3909961b 100755 --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEColorPreference.kt +++ b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEColorPreference.kt @@ -1,12 +1,13 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7 import android.content.Context -import androidx.preference.Preference -import androidx.preference.PreferenceViewHolder +import android.graphics.PorterDuff import android.util.AttributeSet import android.view.View - +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder import code.name.monkey.appthemehelper.R +import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.common.prefs.BorderCircleView /** @@ -35,6 +36,9 @@ class ATEColorPreference(context: Context, attrs: AttributeSet?, defStyleAttr: I layoutResource = R.layout.ate_preference_custom_support widgetLayoutResource = R.layout.ate_preference_color isPersistent = false + + + icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN) } override fun onBindViewHolder(holder: PreferenceViewHolder) { diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESwitchPreference.kt b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESwitchPreference.kt index 589d1cae..eda097f1 100755 --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESwitchPreference.kt +++ b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESwitchPreference.kt @@ -2,10 +2,12 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7 import android.annotation.TargetApi import android.content.Context +import android.graphics.PorterDuff import android.os.Build import android.util.AttributeSet import androidx.preference.CheckBoxPreference import code.name.monkey.appthemehelper.R +import code.name.monkey.appthemehelper.ThemeStore /** * @author Aidan Follestad (afollestad) @@ -31,5 +33,6 @@ class ATESwitchPreference : CheckBoxPreference { private fun init() { widgetLayoutResource = R.layout.ate_preference_switch_support + icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN) } } \ No newline at end of file diff --git a/appthemehelper/src/main/res/layout/ate_preference_category.xml b/appthemehelper/src/main/res/layout/ate_preference_category.xml index 5b55b1a6..4a1d894a 100755 --- a/appthemehelper/src/main/res/layout/ate_preference_category.xml +++ b/appthemehelper/src/main/res/layout/ate_preference_category.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" - android:paddingStart="16dp" + android:paddingStart="72dp" android:paddingLeft="16dp" android:paddingTop="16dp" android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" diff --git a/appthemehelper/src/main/res/layout/ate_preference_custom_support.xml b/appthemehelper/src/main/res/layout/ate_preference_custom_support.xml index e53f3a08..0bd3d0e2 100755 --- a/appthemehelper/src/main/res/layout/ate_preference_custom_support.xml +++ b/appthemehelper/src/main/res/layout/ate_preference_custom_support.xml @@ -25,7 +25,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="start|center_vertical" - android:layout_marginStart="@dimen/ate_preference_inset" + android:layout_marginStart="32dp" android:layout_marginLeft="@dimen/ate_preference_inset" android:layout_marginTop="12dip" android:layout_marginEnd="6dip"