Changed player control buttons to image buttons.
BIN
res/drawable-hdpi/ic_media_next.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
res/drawable-hdpi/ic_media_pause.png
Normal file
After Width: | Height: | Size: 599 B |
BIN
res/drawable-hdpi/ic_media_play.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
res/drawable-hdpi/ic_media_previous.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
res/drawable-mdpi/ic_media_next.png
Normal file
After Width: | Height: | Size: 843 B |
BIN
res/drawable-mdpi/ic_media_pause.png
Normal file
After Width: | Height: | Size: 540 B |
BIN
res/drawable-mdpi/ic_media_play.png
Normal file
After Width: | Height: | Size: 897 B |
BIN
res/drawable-mdpi/ic_media_previous.png
Normal file
After Width: | Height: | Size: 837 B |
BIN
res/drawable-xhdpi/ic_media_next.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
res/drawable-xhdpi/ic_media_pause.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
res/drawable-xhdpi/ic_media_play.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
res/drawable-xhdpi/ic_media_previous.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
|
@ -26,24 +26,26 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center" >
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/previous"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/previous" />
|
||||
android:contentDescription="@string/previous" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/playpause"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/play" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/next" />
|
||||
android:contentDescription="@string/next" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ import android.widget.AbsListView;
|
|||
import android.widget.AbsListView.OnScrollListener;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||
|
@ -98,7 +98,7 @@ public class RendererFragment extends Fragment implements
|
|||
|
||||
private View mControls;
|
||||
private SeekBar mProgressBar;
|
||||
private Button mPlayPause;
|
||||
private ImageButton mPlayPause;
|
||||
|
||||
private boolean mPlaying = false;
|
||||
|
||||
|
@ -174,9 +174,13 @@ public class RendererFragment extends Fragment implements
|
|||
mControls = getView().findViewById(R.id.controls);
|
||||
mProgressBar = (SeekBar) getView().findViewById(R.id.progressBar);
|
||||
mProgressBar.setOnSeekBarChangeListener(this);
|
||||
mPlayPause = (Button) getView().findViewById(R.id.playpause);
|
||||
ImageButton previous = (ImageButton) getView().findViewById(R.id.previous);
|
||||
previous.setImageResource(R.drawable.ic_media_previous);
|
||||
ImageButton next = (ImageButton) getView().findViewById(R.id.next);
|
||||
next.setImageResource(R.drawable.ic_media_next);
|
||||
mPlayPause = (ImageButton) getView().findViewById(R.id.playpause);
|
||||
mPlayPause.setOnClickListener(this);
|
||||
mPlayPause.setText(R.string.play);
|
||||
mPlayPause.setImageResource(R.drawable.ic_media_play);
|
||||
getView().findViewById(R.id.previous).setOnClickListener(this);
|
||||
getView().findViewById(R.id.next).setOnClickListener(this);
|
||||
|
||||
|
@ -328,7 +332,9 @@ public class RendererFragment extends Fragment implements
|
|||
AVTransportVariable.TransportState.class)
|
||||
.getValue()) {
|
||||
case PLAYING:
|
||||
mPlayPause.setText(R.string.pause);
|
||||
mPlayPause.setImageResource(R.drawable.ic_media_pause);
|
||||
mPlayPause.setContentDescription(getResources().
|
||||
getString(R.string.pause));
|
||||
mPlaying = true;
|
||||
pollTimePosition();
|
||||
enableTrackHighlight();
|
||||
|
@ -336,7 +342,9 @@ public class RendererFragment extends Fragment implements
|
|||
case STOPPED:
|
||||
// fallthrough
|
||||
case PAUSED_PLAYBACK:
|
||||
mPlayPause.setText(R.string.play);
|
||||
mPlayPause.setImageResource(R.drawable.ic_media_play);
|
||||
mPlayPause.setContentDescription(getResources().
|
||||
getString(R.string.play));
|
||||
mPlaying = false;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -226,6 +226,9 @@ public class PlayService extends Service {
|
|||
* Sends 'play' signal to current renderer.
|
||||
*/
|
||||
public void play() {
|
||||
if (mPlaylist.size() == 0)
|
||||
return;
|
||||
|
||||
updateNotification();
|
||||
mUpnpService.getControlPoint().execute(
|
||||
new Play(mAvTransportService) {
|
||||
|
|