Settings icons are not accent color

main
h4h13 2019-07-31 00:37:48 +05:30
parent 0b025f3516
commit a4d9b7c8f7
19 changed files with 49 additions and 114 deletions

View File

@ -98,7 +98,7 @@
<activity android:name=".activities.GenreDetailsActivity" />
<activity android:name=".activities.LicenseActivity" />
<activity android:name=".activities.PurchaseActivity" />
<activity android:name=".activities.EqualizerActivity" />
<activity
android:name=".activities.SearchActivity"
android:windowSoftInputMode="stateVisible" />

View File

@ -8,6 +8,7 @@ import androidx.fragment.app.Fragment
import androidx.transition.TransitionManager
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.App.Companion.context
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsBaseActivity
import code.name.monkey.retromusic.fragments.settings.MainSettingsFragment
@ -40,9 +41,10 @@ class SettingsActivity : AbsBaseActivity(), SharedPreferences.OnSharedPreference
setSupportActionBar(toolbar)
setTitle(R.string.action_settings)
toolbar.apply {
setTitleTextColor( ThemeStore.accentColor(context))
setBackgroundColor(ThemeStore.primaryColor(context))
setNavigationOnClickListener { onBackPressed() }
ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondary(context))
ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.accentColor(context))
}
appBarLayout.setBackgroundColor(ThemeStore.primaryColor(this))

View File

@ -42,11 +42,6 @@ class OptionsSheetDialogFragment : DialogFragment(), View.OnClickListener {
R.id.actionFolders -> mainActivity.selectedFragment(R.id.action_folder)
R.id.actionLibrary -> mainActivity.selectedFragment(PreferenceUtil.getInstance().lastPage)
R.id.actionSettings -> NavigationUtil.goToSettings(mainActivity)
R.id.actionRate -> NavigationUtil.goToPlayStore(mainActivity)
R.id.actionShare -> shareApp()
R.id.actionBugReport -> prepareBugReport()
R.id.actionEqualizer -> NavigationUtil.openEqualizer(mainActivity)
}
materialDialog.dismiss()
}
@ -65,30 +60,18 @@ class OptionsSheetDialogFragment : DialogFragment(), View.OnClickListener {
private lateinit var actionSettings: View
private lateinit var actionLibrary: View
private lateinit var actionEqualizer: View
private lateinit var actionFolders: View
private lateinit var actionRate: View
private lateinit var actionShare: View
private lateinit var actionBugReport: View
private lateinit var materialDialog: MaterialDialog
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val layout = LayoutInflater.from(context).inflate(R.layout.fragment_main_options, null)
actionSettings = layout.findViewById(R.id.actionSettings)
actionLibrary = layout.findViewById(R.id.actionLibrary)
actionEqualizer = layout.findViewById(R.id.actionEqualizer)
actionFolders = layout.findViewById(R.id.actionFolders)
actionRate = layout.findViewById(R.id.actionRate)
actionShare = layout.findViewById(R.id.actionShare)
actionBugReport = layout.findViewById(R.id.actionBugReport)
actionSettings.setOnClickListener(this)
actionLibrary.setOnClickListener(this)
actionEqualizer.setOnClickListener(this)
actionFolders.setOnClickListener(this)
actionRate.setOnClickListener(this)
actionShare.setOnClickListener(this)
actionBugReport.setOnClickListener(this)
materialDialog = MaterialDialog(activity!!, BottomSheet())
.show {

View File

@ -39,8 +39,6 @@ class AudioSettings : AbsSettingsFragment() {
NavigationUtil.openEqualizer(activity!!)
true
}
}
private fun hasEqualizer(): Boolean {

View File

@ -55,7 +55,7 @@ class AlbumCoverStylePreference : ATEDialogPreference {
}
init {
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
}

View File

@ -42,7 +42,7 @@ class BlacklistPreference : ATEDialogPreference {
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
init {
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
}

View File

@ -44,7 +44,7 @@ class LibraryPreference : ATEDialogPreference {
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
init {
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
}

View File

@ -37,7 +37,7 @@ class MaterialListPreference : ListPreference {
}
private fun init(context: Context) {
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {

View File

@ -57,7 +57,7 @@ class NowPlayingScreenPreference : ATEDialogPreference {
}
init {
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
}

View File

@ -31,7 +31,6 @@ import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.activities.AboutActivity;
import code.name.monkey.retromusic.activities.AlbumDetailsActivity;
import code.name.monkey.retromusic.activities.ArtistDetailActivity;
import code.name.monkey.retromusic.activities.EqualizerActivity;
import code.name.monkey.retromusic.activities.GenreDetailsActivity;
import code.name.monkey.retromusic.activities.LicenseActivity;
import code.name.monkey.retromusic.activities.LyricsActivity;
@ -86,11 +85,7 @@ public class NavigationUtil {
}
public static void openEqualizer(@NonNull final Activity activity) {
if (PreferenceUtil.getInstance().getSelectedEqualizer().equals("system")) {
stockEqalizer(activity);
} else {
ActivityCompat.startActivity(activity, new Intent(activity, EqualizerActivity.class), null);
}
stockEqalizer(activity);
}
private static void stockEqalizer(@NonNull Activity activity) {

View File

@ -37,43 +37,4 @@
app:optionIcon="@drawable/ic_settings_white_24dp"
app:optionTitle="@string/action_settings" />
<code.name.monkey.retromusic.views.OptionMenuItemView
android:id="@+id/actionEqualizer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?rectSelector"
android:clickable="true"
android:focusable="true"
app:optionIcon="@drawable/ic_equalizer_white_24dp"
app:optionTitle="@string/equalizer" />
<code.name.monkey.retromusic.views.OptionMenuItemView
android:id="@+id/actionShare"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?rectSelector"
android:clickable="true"
android:focusable="true"
app:optionIcon="@drawable/ic_share_white_24dp"
app:optionTitle="@string/action_share" />
<code.name.monkey.retromusic.views.OptionMenuItemView
android:id="@+id/actionBugReport"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?rectSelector"
android:clickable="true"
android:focusable="true"
app:optionIcon="@drawable/ic_bug_report_white_24dp"
app:optionTitle="@string/report_bug" />
<code.name.monkey.retromusic.views.OptionMenuItemView
android:id="@+id/actionRate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?rectSelector"
android:clickable="true"
android:focusable="true"
app:optionIcon="@drawable/ic_star_white_24dp"
app:optionTitle="@string/rate_app" />
</LinearLayout>

View File

@ -630,4 +630,6 @@
<string name="reset_action">Reset</string>
<string name="library_categories">Library categories</string>
<string name="pref_summary_library_categories">Configure visibility and order of library categories.</string>
<string name="pref_header_controls">Controls</string>
<string name="pref_header_album">Album style</string>
</resources>

View File

@ -17,18 +17,8 @@
android:title="@string/pref_title_gapless_playback"
app:enableCopying="true" />
<code.name.monkey.retromusic.preferences.MaterialListPreference
android:defaultValue="system"
android:entries="@array/pref_equalizer_types_titles"
android:entryValues="@array/pref_equalizer_types_values"
android:key="choose_equalizer"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_choose_equalizer"
app:enableCopying="true"
app:icon="@drawable/ic_equalizer_white_24dp" />
<Preference
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreference
app:icon="@drawable/ic_equalizer_white_24dp"
android:key="equalizer"
android:title="@string/equalizer"
app:enableCopying="true" />

View File

@ -8,36 +8,39 @@
app:enableCopying="true"
app:icon="@drawable/ic_play_circle_filled_white_24dp" />
<code.name.monkey.retromusic.preferences.AlbumCoverStylePreference
android:key="album_cover_style_id"
android:title="@string/pref_title_album_cover_style"
app:enableCopying="true"
app:icon="@drawable/ic_image_white_24dp" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory android:title="@string/pref_header_album">
<code.name.monkey.retromusic.preferences.AlbumCoverStylePreference
android:key="album_cover_style_id"
android:title="@string/pref_title_album_cover_style"
app:enableCopying="true"
app:icon="@drawable/ic_image_white_24dp" />
<code.name.monkey.retromusic.preferences.MaterialListPreference
android:defaultValue="0"
android:entries="@array/pref_album_cover_transform_entities"
android:entryValues="@array/pref_album_cover_transform_values"
android:key="album_cover_transform"
android:title="@string/pref_title_album_cover_transform"
app:enableCopying="true" />
<code.name.monkey.retromusic.preferences.MaterialListPreference
android:defaultValue="0"
android:entries="@array/pref_album_cover_transform_entities"
android:entryValues="@array/pref_album_cover_transform_values"
android:key="album_cover_transform"
android:title="@string/pref_title_album_cover_transform"
app:enableCopying="true" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
app:defaultValue="false"
app:enableCopying="true"
app:icon="@drawable/ic_view_carousel_black_24dp"
app:key="carousel_effect"
app:summary="@string/pref_summary_carousel_effect"
app:title="@string/pref_title_toggle_carousel_effect" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
app:defaultValue="false"
app:enableCopying="true"
app:icon="@drawable/ic_view_carousel_black_24dp"
app:key="carousel_effect"
app:summary="@string/pref_summary_carousel_effect"
app:title="@string/pref_title_toggle_carousel_effect" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory android:title="@string/pref_header_controls">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
app:defaultValue="false"
app:enableCopying="true"
app:icon="@drawable/ic_play_arrow_white_32dp"
app:key="toggle_add_controls"
app:summary="@string/pref_summary_extra_controls"
app:title="@string/pref_title_extra_controls" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
app:defaultValue="false"
app:enableCopying="true"
app:icon="@drawable/ic_play_arrow_white_32dp"
app:key="toggle_add_controls"
app:summary="@string/pref_summary_extra_controls"
app:title="@string/pref_title_extra_controls" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
app:defaultValue="false"
@ -46,6 +49,7 @@
app:key="toggle_volume"
app:summary="@string/pref_summary_toggle_volume"
app:title="@string/pref_title_toggle_volume" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESeekBarPreference
android:defaultValue="12"

View File

@ -39,7 +39,7 @@ class ATEColorPreference @JvmOverloads constructor(
widgetLayoutResource = R.layout.ate_preference_color
isPersistent = false
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
override fun onBindViewHolder(holder: PreferenceViewHolder) {

View File

@ -30,7 +30,7 @@ class ATEListPreference @JvmOverloads constructor(
) : ListPreference(context, attrs, defStyleAttr, defStyleRes) {
init {
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
layoutResource = R.layout.ate_preference_custom_support
if (summary == null || summary.toString().trim { it <= ' ' }.isEmpty())
summary = "%s"

View File

@ -30,6 +30,6 @@ class ATEPreference @JvmOverloads constructor(
init {
layoutResource = R.layout.ate_preference_custom_support
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
}

View File

@ -28,7 +28,7 @@ class ATESeekBarPreference : SeekBarPreference {
}
private fun init() {
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
override fun onBindViewHolder(view: PreferenceViewHolder) {

View File

@ -33,6 +33,6 @@ class ATESwitchPreference : CheckBoxPreference {
private fun init() {
widgetLayoutResource = R.layout.ate_preference_switch_support
icon?.setColorFilter(ThemeStore.textColorSecondary(context), PorterDuff.Mode.SRC_IN)
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
}
}