Add queue lock/unlock snackbar message

This commit is contained in:
recalculated 2016-01-07 20:35:04 -06:00
parent 44f6ebbda1
commit a2104964e7
2 changed files with 12 additions and 3 deletions

View File

@ -267,10 +267,17 @@ public class QueueFragment extends Fragment {
if (!super.onOptionsItemSelected(item)) {
switch (item.getItemId()) {
case R.id.queue_lock:
boolean locked = !UserPreferences.isQueueLocked();
UserPreferences.setQueueLocked(locked);
boolean newLockState = !UserPreferences.isQueueLocked();
UserPreferences.setQueueLocked(newLockState);
getActivity().supportInvalidateOptionsMenu();
recyclerAdapter.setLocked(locked);
recyclerAdapter.setLocked(newLockState);
if (newLockState) {
Snackbar.make(getActivity().findViewById(R.id.content), R.string
.queue_locked, Snackbar.LENGTH_SHORT).show();
} else {
Snackbar.make(getActivity().findViewById(R.id.content), R.string
.queue_unlocked, Snackbar.LENGTH_SHORT).show();
}
return true;
case R.id.refresh_item:
List<Feed> feeds = ((MainActivity) getActivity()).getFeeds();

View File

@ -217,6 +217,8 @@
<!-- Queue operations -->
<string name="lock_queue">Lock Queue</string>
<string name="unlock_queue">Unlock Queue</string>
<string name="queue_locked">Queue locked</string>
<string name="queue_unlocked">Queue unlocked</string>
<string name="clear_queue_label">Clear Queue</string>
<string name="undo">Undo</string>
<string name="removed_from_queue">Item removed</string>