Commit e24e7856 authored by Geoffrey Métais's avatar Geoffrey Métais

Code cleaning

parent 57804c35
......@@ -120,7 +120,7 @@ public class AudioPlayerContainerActivity extends BaseActivity implements Playba
mBottomSheetBehavior = BottomSheetBehavior.from(mAudioPlayerContainer);
mBottomSheetBehavior.setPeekHeight(getResources().getDimensionPixelSize(R.dimen.player_peek_height));
mBottomSheetBehavior.setBottomSheetCallback(mAudioPlayerBottomSheetCallback);
mAudioPlayer.showAudioPlayerTips();
showTipViewIfNeeded(R.id.audio_player_tips, AudioPlayer.PREF_AUDIOPLAYER_TIPS_SHOWN);
}
@Override
......
......@@ -106,7 +106,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
// Tips
private static final String PREF_PLAYLIST_TIPS_SHOWN = "playlist_tips_shown";
private static final String PREF_AUDIOPLAYER_TIPS_SHOWN = "audioplayer_tips_shown";
public static final String PREF_AUDIOPLAYER_TIPS_SHOWN = "audioplayer_tips_shown";
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
......@@ -162,11 +162,6 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
}
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
......@@ -418,7 +413,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
if (mService.hasNext())
mService.next();
else
Snackbar.make(getView(), R.string.lastsong, Snackbar.LENGTH_SHORT).show();
Snackbar.make(mBinding.getRoot(), R.string.lastsong, Snackbar.LENGTH_SHORT).show();
}
public void onPreviousClick(View view) {
......@@ -427,7 +422,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
if (mService.hasPrevious() || mService.isSeekable())
mService.previous(false);
else
Snackbar.make(getView(), R.string.firstsong, Snackbar.LENGTH_SHORT).show();
Snackbar.make(mBinding.getRoot(), R.string.firstsong, Snackbar.LENGTH_SHORT).show();
}
public void onRepeatClick(View view) {
......@@ -752,12 +747,6 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
activity.showTipViewIfNeeded(R.id.audio_playlist_tips, PREF_PLAYLIST_TIPS_SHOWN);
}
public void showAudioPlayerTips() {
AudioPlayerContainerActivity activity = (AudioPlayerContainerActivity)getActivity();
if (activity != null)
activity.showTipViewIfNeeded(R.id.audio_player_tips, PREF_AUDIOPLAYER_TIPS_SHOWN);
}
public void onStateChanged(int newState) {
mPlayerState = newState;
switch (newState) {
......@@ -777,15 +766,6 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
}
}
/*
* Override this method to prefent NPE on mFragmentManager reference.
*/
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
if (getFragmentManager() != null)
super.setUserVisibleHint(isVisibleToUser);
}
static final int UPDATE = 0;
private Handler mHandler = new Handler() {
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment