diff --git a/demo/src/main/java/com/devbrackets/android/playlistcoredemo/ui/activity/AudioPlayerActivity.java b/demo/src/main/java/com/devbrackets/android/playlistcoredemo/ui/activity/AudioPlayerActivity.java
index d51040e..c41da23 100644
--- a/demo/src/main/java/com/devbrackets/android/playlistcoredemo/ui/activity/AudioPlayerActivity.java
+++ b/demo/src/main/java/com/devbrackets/android/playlistcoredemo/ui/activity/AudioPlayerActivity.java
@@ -61,6 +61,7 @@ public class AudioPlayerActivity extends AppCompatActivity implements PlaylistLi
private ImageButton previousButton;
private ImageButton playPauseButton;
+ private ImageButton stopButton;
private ImageButton nextButton;
private MediaRouteButton castButton;
@@ -235,6 +236,7 @@ private void updatePlayPauseImage(boolean isPlaying) {
*/
public void loadCompleted() {
playPauseButton.setVisibility(View.VISIBLE);
+ stopButton.setVisibility(View.VISIBLE);
previousButton.setVisibility(View.VISIBLE);
nextButton.setVisibility(View.VISIBLE );
@@ -247,6 +249,7 @@ public void loadCompleted() {
*/
public void restartLoading() {
playPauseButton.setVisibility(View.INVISIBLE);
+ stopButton.setVisibility(View.INVISIBLE);
previousButton.setVisibility(View.INVISIBLE);
nextButton.setVisibility(View.INVISIBLE );
@@ -308,6 +311,7 @@ private void retrieveViews() {
previousButton = findViewById(R.id.audio_player_previous);
playPauseButton = findViewById(R.id.audio_player_play_pause);
+ stopButton = findViewById(R.id.audio_player_stop);
nextButton = findViewById(R.id.audio_player_next);
castButton = findViewById(R.id.media_route_button);
@@ -335,6 +339,13 @@ public void onClick(View v) {
}
});
+ stopButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ playlistManager.invokeStop();
+ }
+ });
+
nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/demo/src/main/res/drawable/ic_stop_black_24dp.xml b/demo/src/main/res/drawable/ic_stop_black_24dp.xml
new file mode 100644
index 0000000..bb8bff4
--- /dev/null
+++ b/demo/src/main/res/drawable/ic_stop_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/demo/src/main/res/layout/audio_player_activity.xml b/demo/src/main/res/layout/audio_player_activity.xml
index dcd08bc..73db883 100644
--- a/demo/src/main/res/layout/audio_player_activity.xml
+++ b/demo/src/main/res/layout/audio_player_activity.xml
@@ -163,6 +163,19 @@
android:layout_width="44dp"
android:layout_height="match_parent"/>
+
+
+
+