Skip to content

Instantly share code, notes, and snippets.

@yusufcakmak
Created November 18, 2016 19:52
Show Gist options
  • Save yusufcakmak/6a97ec8c0a9f8b088a9e7662c2b75e75 to your computer and use it in GitHub Desktop.
Save yusufcakmak/6a97ec8c0a9f8b088a9e7662c2b75e75 to your computer and use it in GitHub Desktop.
private void updatePlayPauseButton() {
if (!isVisible() || !isAttachedToWindow) {
return;
}
boolean playing = player != null && player.getPlayWhenReady();
String contentDescription = getResources().getString(
playing ? com.google.android.exoplayer2.R.string.exo_controls_pause_description : com.google.android.exoplayer2.R.string.exo_controls_play_description);
playButton.setContentDescription(contentDescription);
playButton.setImageResource(
playing ? R.drawable.pausecontrol : R.drawable.playcontrol);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment