minor changes to default preferences
This commit is contained in:
parent
0d6a0929b9
commit
593a9a545a
44 changed files with 7 additions and 139 deletions
|
|
@ -227,9 +227,6 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
case R.id.action_sleep_timer:
|
||||
new SleepTimerDialog().show(getSupportFragmentManager(), "SET_SLEEP_TIMER");
|
||||
return true;
|
||||
case R.id.action_equalizer:
|
||||
NavigationUtil.openEqualizer(this);
|
||||
return true;
|
||||
case R.id.action_shuffle_album:
|
||||
MusicPlayerRemote.openAndShuffleQueue(songs, true);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -262,9 +262,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
case R.id.action_sleep_timer:
|
||||
new SleepTimerDialog().show(getSupportFragmentManager(), "SET_SLEEP_TIMER");
|
||||
return true;
|
||||
case R.id.action_equalizer:
|
||||
NavigationUtil.openEqualizer(this);
|
||||
return true;
|
||||
case R.id.action_shuffle_artist:
|
||||
MusicPlayerRemote.openAndShuffleQueue(songs, true);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -300,26 +300,9 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
|
|||
});
|
||||
}
|
||||
|
||||
final Preference equalizer = findPreference("equalizer");
|
||||
if (!hasEqualizer()) {
|
||||
equalizer.setEnabled(false);
|
||||
equalizer.setSummary(getResources().getString(R.string.no_equalizer));
|
||||
}
|
||||
equalizer.setOnPreferenceClickListener(preference -> {
|
||||
NavigationUtil.openEqualizer(getActivity());
|
||||
return true;
|
||||
});
|
||||
|
||||
updateNowPlayingScreenSummary();
|
||||
}
|
||||
|
||||
private boolean hasEqualizer() {
|
||||
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
|
||||
PackageManager pm = getActivity().getPackageManager();
|
||||
ResolveInfo ri = pm.resolveActivity(effects, 0);
|
||||
return ri != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
switch (key) {
|
||||
|
|
|
|||
|
|
@ -54,9 +54,6 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
|
|||
case R.id.action_share:
|
||||
SongShareDialog.create(song).show(getFragmentManager(), "SHARE_SONG");
|
||||
return true;
|
||||
case R.id.action_equalizer:
|
||||
NavigationUtil.openEqualizer(getActivity());
|
||||
return true;
|
||||
case R.id.action_add_to_playlist:
|
||||
AddToPlaylistDialog.create(song).show(getFragmentManager(), "ADD_PLAYLIST");
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -61,20 +61,4 @@ public class NavigationUtil {
|
|||
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void openEqualizer(@NonNull final Activity activity) {
|
||||
final int sessionId = MusicPlayerRemote.getAudioSessionId();
|
||||
if (sessionId == AudioEffect.ERROR_BAD_VALUE) {
|
||||
Toast.makeText(activity, activity.getResources().getString(R.string.no_audio_ID), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
try {
|
||||
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
|
||||
effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, sessionId);
|
||||
effects.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC);
|
||||
activity.startActivityForResult(effects, 0);
|
||||
} catch (@NonNull final ActivityNotFoundException notFound) {
|
||||
Toast.makeText(activity, activity.getResources().getString(R.string.no_equalizer), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public final class PreferenceUtil {
|
|||
}
|
||||
|
||||
public final boolean classicNotification() {
|
||||
return mPreferences.getBoolean(CLASSIC_NOTIFICATION, false);
|
||||
return mPreferences.getBoolean(CLASSIC_NOTIFICATION, true);
|
||||
}
|
||||
|
||||
public void setColoredNotification(final boolean value) {
|
||||
|
|
@ -203,7 +203,7 @@ public final class PreferenceUtil {
|
|||
}
|
||||
|
||||
public final boolean gaplessPlayback() {
|
||||
return mPreferences.getBoolean(GAPLESS_PLAYBACK, false);
|
||||
return mPreferences.getBoolean(GAPLESS_PLAYBACK, true);
|
||||
}
|
||||
|
||||
public final boolean audioDucking() {
|
||||
|
|
@ -215,7 +215,7 @@ public final class PreferenceUtil {
|
|||
}
|
||||
|
||||
public final boolean blurredAlbumArt() {
|
||||
return mPreferences.getBoolean(BLURRED_ALBUM_ART, false);
|
||||
return mPreferences.getBoolean(BLURRED_ALBUM_ART, true);
|
||||
}
|
||||
|
||||
public final boolean ignoreMediaStoreArtwork() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue