Changed player control buttons to image buttons.

This commit is contained in:
Felix Ableitner 2013-07-02 21:45:11 +02:00
parent d7c8da91b4
commit 89de580223
15 changed files with 26 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -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>

View file

@ -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:

View file

@ -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) {