Add "Move to top" and "Move to bottom" to the queue context menu (#1073)
* Add move-to-top and move-to-bottom items to queue context menu. * Add german translation for move-to-top/bottom menu items. * Add icon images for move-to-top/bottom menu items.
@ -94,6 +94,8 @@ public class ShowQueueFragment extends Fragment
|
||||
private final static int CTX_MENU_REMOVE = 104;
|
||||
private final static int CTX_MENU_SHOW_DETAILS = 105;
|
||||
private final static int CTX_MENU_ADD_TO_PLAYLIST = 106;
|
||||
private final static int CTX_MENU_MOVE_TO_TOP = 107;
|
||||
private final static int CTX_MENU_MOVE_TO_BOTTOM = 108;
|
||||
|
||||
/**
|
||||
* Called on long-click on a adapeter row
|
||||
@ -117,10 +119,14 @@ public class ShowQueueFragment extends Fragment
|
||||
fm.add(CTX_MENU_ENQUEUE_ARTIST, 0, R.drawable.menu_enqueue, R.string.enqueue_current_artist).setIntent(intent);
|
||||
fm.add(CTX_MENU_ENQUEUE_GENRE, 0, R.drawable.menu_enqueue, R.string.enqueue_current_genre).setIntent(intent);
|
||||
fm.add(CTX_MENU_ADD_TO_PLAYLIST, 0, R.drawable.menu_add_to_playlist, R.string.add_to_playlist).setIntent(intent);
|
||||
fm.addSpacer(0);
|
||||
fm.add(CTX_MENU_MOVE_TO_TOP, 0, R.drawable.menu_move_to_top, R.string.move_to_top).setIntent(intent);
|
||||
fm.add(CTX_MENU_MOVE_TO_BOTTOM, 0, R.drawable.menu_move_to_bottom, R.string.move_to_bottom).setIntent(intent);
|
||||
|
||||
fm.addSpacer(0);
|
||||
fm.add(CTX_MENU_SHOW_DETAILS, 0, R.drawable.menu_details, R.string.details).setIntent(intent);
|
||||
fm.add(CTX_MENU_REMOVE, 90, R.drawable.menu_remove, R.string.remove).setIntent(intent);
|
||||
|
||||
fm.show(view, x, y);
|
||||
return true;
|
||||
}
|
||||
@ -161,6 +167,12 @@ public class ShowQueueFragment extends Fragment
|
||||
PlaylistDialog dialog = PlaylistDialog.newInstance(callback, intent, null);
|
||||
dialog.show(getFragmentManager(), "PlaylistDialog");
|
||||
break;
|
||||
case CTX_MENU_MOVE_TO_TOP:
|
||||
service.moveSongPosition(pos, 0);
|
||||
break;
|
||||
case CTX_MENU_MOVE_TO_BOTTOM:
|
||||
service.moveSongPosition(pos, service.getTimelineLength() - 1);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unhandled menu id received!");
|
||||
// we could actually dispatch this to the hosting activity, but we do not need this for now.
|
||||
|
BIN
app/src/main/res/drawable-hdpi/menu_move_to_bottom.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-hdpi/menu_move_to_top.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-mdpi/menu_move_to_bottom.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-mdpi/menu_move_to_top.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/menu_move_to_bottom.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-xhdpi/menu_move_to_top.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/menu_move_to_bottom.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/menu_move_to_top.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
@ -265,6 +265,8 @@
|
||||
<string name="toggle_controls">Steuerelemente ein-/ausblenden</string>
|
||||
<string name="seek_10s_backward">10 Sekunden zurück springen</string>
|
||||
<string name="seek_10s_forward">10 Sekunden vorwärts springen</string>
|
||||
<string name="move_to_top">Nach oben schieben</string>
|
||||
<string name="move_to_bottom">Nach unten schieben</string>
|
||||
<string name="preferences_action_show_queue">Warteschlange anzeigen</string>
|
||||
<string name="preferences_action_clear_queue">Warteschlange leeren</string>
|
||||
<string name="preferences_action_enqueue_current_album">Album einreihen</string>
|
||||
|
@ -326,6 +326,8 @@ THE SOFTWARE.
|
||||
<string name="toggle_controls">Toggle controls</string>
|
||||
<string name="seek_10s_backward">Seek 10 seconds backward</string>
|
||||
<string name="seek_10s_forward">Seek 10 seconds forward</string>
|
||||
<string name="move_to_top">Move to top</string>
|
||||
<string name="move_to_bottom">Move to bottom</string>
|
||||
<string name="preferences_action_show_queue">Show queue</string>
|
||||
<string name="preferences_action_clear_queue">Clear queue</string>
|
||||
<string name="preferences_action_enqueue_current_album">Enqueue album</string>
|
||||
|