Add a clear playlist option. Fixes #2
This commit is contained in:
parent
a086c082f5
commit
7a33b529e0
4 changed files with 21 additions and 1 deletions
|
@ -188,6 +188,9 @@ public class MainActivity extends ActionBarActivity {
|
|||
case R.id.refreshdev:
|
||||
mServerFragment.triggerSearch();
|
||||
return true;
|
||||
case R.id.clearplaylist:
|
||||
mRouteFragment.clearPlaylist();
|
||||
return true;
|
||||
case R.id.about:
|
||||
Intent a = new Intent(this, AboutActivity.class);
|
||||
startActivity(a);
|
||||
|
|
|
@ -624,6 +624,17 @@ public class RouteFragment extends MediaRouteDiscoveryFragment implements
|
|||
mMediaRouterPlayService.append(playlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the current playlist and stops playback
|
||||
*/
|
||||
public void clearPlaylist()
|
||||
{
|
||||
mMediaRouterPlayService.stop();
|
||||
changePlayPauseState(false);
|
||||
mPlaylistAdapter.clear();
|
||||
mMediaRouterPlayService.setPlaylist(new ArrayList<Item>());
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a time string in the format mm:ss from a time value in seconds.
|
||||
*
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
<item
|
||||
android:id="@+id/refreshdev"
|
||||
android:title="@string/refresh_title" />
|
||||
<item
|
||||
android:id="@+id/clearplaylist"
|
||||
android:title="@string/clear_list_title" />
|
||||
<item
|
||||
android:id="@+id/about"
|
||||
android:title="@string/about_title" />
|
||||
|
|
|
@ -46,10 +46,13 @@
|
|||
<!-- Title for the Refresh Devices Action-->
|
||||
<string name="refresh_title">Refresh Devices</string>
|
||||
|
||||
<!-- Title for the Clear Playlist Action-->
|
||||
<string name="clear_list_title">Clear Playlist</string>
|
||||
|
||||
<!-- Title for the About Menu-->
|
||||
<string name="about_title">About</string>
|
||||
|
||||
<!-- Title for the About Menu-->
|
||||
<!-- Text for the About Box-->
|
||||
<string name="about_text">ControlDLNA - a UPnP media control point
|
||||
\nOriginal version:
|
||||
\nCopyright (c) 2013, Felix Ableitner, All rights reserved.
|
||||
|
|
Reference in a new issue