Minor Bugfixes and playing queue actions

This commit is contained in:
Karim Abou Zeid 2015-03-16 18:58:24 +01:00
commit f7bc62a2df
17 changed files with 138 additions and 44 deletions

View file

@ -6,6 +6,7 @@ import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.util.Pair;
import android.support.v7.graphics.Palette;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.Toolbar;
@ -259,6 +260,9 @@ public class AlbumDetailActivity extends AbsFabActivity {
case android.R.id.home:
super.onBackPressed();
return true;
case R.id.action_playing_queue:
NavigationUtil.openPlayingQueueDialog(this);
return true;
case R.id.action_settings:
return true;
case R.id.action_current_playing:
@ -270,7 +274,9 @@ public class AlbumDetailActivity extends AbsFabActivity {
startActivity(intent);
return true;
case R.id.action_go_to_artist:
NavigationUtil.goToArtist(this, album.artistId, null);
Pair[] artistPairs = null;
artistPairs = getSharedViewsWithFab(artistPairs);
NavigationUtil.goToArtist(this, album.artistId, artistPairs);
return true;
}
return super.onOptionsItemSelected(item);

View file

@ -312,6 +312,9 @@ public class ArtistDetailActivity extends AbsFabActivity {
case android.R.id.home:
super.onBackPressed();
return true;
case R.id.action_playing_queue:
NavigationUtil.openPlayingQueueDialog(this);
return true;
case R.id.action_biography:
if(biography != null){
getBiographyDialog().show();

View file

@ -240,12 +240,7 @@ public class MainActivity extends AbsFabActivity
NavigationUtil.openCurrentPlayingIfPossible(this, getSharedViewsWithFab(null));
return true;
case R.id.action_playing_queue:
final MaterialDialog materialDialog = PlayingQueueDialogHelper.getDialog(this);
if (materialDialog != null) {
materialDialog.show();
} else {
Toast.makeText(this, getResources().getString(R.string.nothing_playing), Toast.LENGTH_SHORT).show();
}
NavigationUtil.openPlayingQueueDialog(this);
return true;
}
return super.onOptionsItemSelected(item);

View file

@ -392,12 +392,7 @@ public class MusicControllerActivity extends AbsFabActivity {
super.onBackPressed();
return true;
case R.id.action_playing_queue:
final MaterialDialog materialDialog = PlayingQueueDialogHelper.getDialog(this);
if (materialDialog != null) {
materialDialog.show();
} else {
Toast.makeText(this, getResources().getString(R.string.nothing_playing), Toast.LENGTH_SHORT).show();
}
NavigationUtil.openPlayingQueueDialog(this);
return true;
case R.id.action_tag_editor:
Intent intent = new Intent(this, SongTagEditorActivity.class);
@ -410,10 +405,10 @@ public class MusicControllerActivity extends AbsFabActivity {
SongDetailDialogHelper.getDialog(this, songFile).show();
return true;
case R.id.action_go_to_album:
NavigationUtil.goToAlbum(this, song.albumId, null);
NavigationUtil.goToAlbum(this, song.albumId, getSharedViewsWithFab(null));
return true;
case R.id.action_go_to_artist:
NavigationUtil.goToAlbum(this, song.artistId, null);
NavigationUtil.goToArtist(this, song.artistId, getSharedViewsWithFab(null));
return true;
}

View file

@ -2,6 +2,7 @@ package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
import android.app.Fragment;
import android.os.Build;
import android.view.ViewConfiguration;
import com.kabouzeid.gramophone.App;
import com.kabouzeid.gramophone.R;