Commit 235c28c6 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Add stop feature to audio player

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent d7c493ab
......@@ -147,6 +147,16 @@
android:layout_marginRight="10dip"
android:id="@+id/play_pause"
android:onClick="onPlayPauseClick" />
<ImageButton
android:id="@+id/stop"
android:layout_width="70dip"
android:layout_height="70dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:background="@drawable/ic_stop"
android:onClick="onStopClick" />
<ImageButton
android:background="@drawable/ic_forward"
android:layout_height="70dip"
......
......@@ -21,6 +21,7 @@ public class AudioPlayerActivity extends Activity implements AudioPlayer {
private TextView mTime;
private TextView mLength;
private ImageButton mPlayPause;
private ImageButton mStop;
private ImageButton mNext;
private ImageButton mPrevious;
private ImageButton mShuffle;
......@@ -43,6 +44,7 @@ public class AudioPlayerActivity extends Activity implements AudioPlayer {
mTime = (TextView) findViewById(R.id.time);
mLength = (TextView) findViewById(R.id.length);
mPlayPause = (ImageButton) findViewById(R.id.play_pause);
mStop = (ImageButton) findViewById(R.id.stop);
mNext = (ImageButton) findViewById(R.id.next);
mPrevious = (ImageButton) findViewById(R.id.previous);
mShuffle = (ImageButton) findViewById(R.id.shuffle);
......@@ -151,6 +153,11 @@ public class AudioPlayerActivity extends Activity implements AudioPlayer {
mAudioController.play();
}
}
public void onStopClick(View view) {
mAudioController.stop();
finish();
}
public void onNextClick(View view) {
mAudioController.next();
......
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