implement bindControlButtons()
This commit is contained in:
parent
1a6774ca2f
commit
2c6bf316e1
@ -162,12 +162,6 @@ public class FullPlaybackActivity extends PlaybackActivity
|
||||
mCoverView = coverView;
|
||||
|
||||
mSlidingView = findViewById(R.id.sliding_view);
|
||||
View previousButton = findViewById(R.id.previous);
|
||||
previousButton.setOnClickListener(this);
|
||||
mPlayPauseButton = (ImageButton)findViewById(R.id.play_pause);
|
||||
mPlayPauseButton.setOnClickListener(this);
|
||||
View nextButton = findViewById(R.id.next);
|
||||
nextButton.setOnClickListener(this);
|
||||
|
||||
TableLayout table = (TableLayout)findViewById(R.id.info_table);
|
||||
if (table != null) {
|
||||
@ -195,12 +189,7 @@ public class FullPlaybackActivity extends PlaybackActivity
|
||||
mFormatView = (TextView)findViewById(R.id.format);
|
||||
mReplayGainView = (TextView)findViewById(R.id.replaygain);
|
||||
|
||||
mShuffleButton = (ImageButton)findViewById(R.id.shuffle);
|
||||
mShuffleButton.setOnClickListener(this);
|
||||
registerForContextMenu(mShuffleButton);
|
||||
mEndButton = (ImageButton)findViewById(R.id.end_action);
|
||||
mEndButton.setOnClickListener(this);
|
||||
registerForContextMenu(mEndButton);
|
||||
bindControlButtons();
|
||||
|
||||
setControlsVisible(settings.getBoolean(PrefKeys.VISIBLE_CONTROLS, PrefDefaults.VISIBLE_CONTROLS));
|
||||
setExtraInfoVisible(settings.getBoolean(PrefKeys.VISIBLE_EXTRA_INFO, PrefDefaults.VISIBLE_EXTRA_INFO));
|
||||
|
@ -200,6 +200,7 @@ public class LibraryActivity
|
||||
}
|
||||
|
||||
loadAlbumIntent(getIntent());
|
||||
bindControlButtons();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,19 +46,7 @@ public class MiniPlaybackActivity extends PlaybackActivity {
|
||||
mCoverView.setOnClickListener(this);
|
||||
mCoverView.setup(mLooper, this, CoverBitmap.STYLE_OVERLAPPING_BOX);
|
||||
|
||||
View previousButton = findViewById(R.id.previous);
|
||||
previousButton.setOnClickListener(this);
|
||||
mPlayPauseButton = (ImageButton)findViewById(R.id.play_pause);
|
||||
mPlayPauseButton.setOnClickListener(this);
|
||||
View nextButton = findViewById(R.id.next);
|
||||
nextButton.setOnClickListener(this);
|
||||
|
||||
mShuffleButton = (ImageButton)findViewById(R.id.shuffle);
|
||||
mShuffleButton.setOnClickListener(this);
|
||||
registerForContextMenu(mShuffleButton);
|
||||
mEndButton = (ImageButton)findViewById(R.id.end_action);
|
||||
mEndButton.setOnClickListener(this);
|
||||
registerForContextMenu(mEndButton);
|
||||
bindControlButtons();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -305,6 +305,25 @@ public abstract class PlaybackActivity extends Activity
|
||||
return fs_start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up onClick listeners for our common control buttons bar
|
||||
*/
|
||||
protected void bindControlButtons() {
|
||||
View previousButton = findViewById(R.id.previous);
|
||||
previousButton.setOnClickListener(this);
|
||||
mPlayPauseButton = (ImageButton)findViewById(R.id.play_pause);
|
||||
mPlayPauseButton.setOnClickListener(this);
|
||||
View nextButton = findViewById(R.id.next);
|
||||
nextButton.setOnClickListener(this);
|
||||
|
||||
mShuffleButton = (ImageButton)findViewById(R.id.shuffle);
|
||||
mShuffleButton.setOnClickListener(this);
|
||||
registerForContextMenu(mShuffleButton);
|
||||
mEndButton = (ImageButton)findViewById(R.id.end_action);
|
||||
mEndButton.setOnClickListener(this);
|
||||
registerForContextMenu(mEndButton);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by PlaybackService to update the current song.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user