Commit ee1ef229 authored by Adrien Maglo's avatar Adrien Maglo
Browse files

Audio player: remove the stop button and perform stop on long click of the play-pause button

parent 409588da
......@@ -187,18 +187,6 @@
android:scaleType="fitXY"
android:src="@drawable/ic_pause" />
<ImageButton
android:id="@+id/stop"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:background="#00000000"
android:contentDescription="@string/stop"
android:focusable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_stop" />
<ImageButton
android:id="@+id/next"
android:layout_width="50dp"
......
......@@ -74,7 +74,6 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
private TextView mLength;
private ImageButton mPlayPause;
private ImageButton mHeaderPlayPause;
private ImageButton mStop;
private ImageButton mNext;
private ImageButton mPrevious;
private ImageButton mShuffle;
......@@ -121,7 +120,6 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
mLength = (TextView) v.findViewById(R.id.length);
mPlayPause = (ImageButton) v.findViewById(R.id.play_pause);
mHeaderPlayPause = (ImageButton) v.findViewById(R.id.header_play_pause);
mStop = (ImageButton) v.findViewById(R.id.stop);
mNext = (ImageButton) v.findViewById(R.id.next);
mPrevious = (ImageButton) v.findViewById(R.id.previous);
mShuffle = (ImageButton) v.findViewById(R.id.shuffle);
......@@ -156,16 +154,17 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
onPlayPauseClick(v);
}
});
mHeaderPlayPause.setOnClickListener(new View.OnClickListener() {
mPlayPause.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public void onClick(View v) {
onPlayPauseClick(v);
public boolean onLongClick(View v) {
onStopClick(v);
return true;
}
});
mStop.setOnClickListener(new View.OnClickListener() {
mHeaderPlayPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onStopClick(v);
onPlayPauseClick(v);
}
});
mNext.setOnClickListener(new View.OnClickListener() {
......
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