diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-06-18 17:26:39 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-06-18 17:26:39 -0700 |
commit | f632dc5f46943c6a258d5f1cd85c6c6d923c4a3a (patch) | |
tree | 10ab1ccbd9e9e54539fe4095e3bcc481ee13cb56 /app/src/main | |
parent | 4c24853c6ad9f08004e8981a7187dd3ae1a794db (diff) | |
download | dsub-f632dc5f46943c6a258d5f1cd85c6c6d923c4a3a.tar.gz dsub-f632dc5f46943c6a258d5f1cd85c6c6d923c4a3a.tar.bz2 dsub-f632dc5f46943c6a258d5f1cd85c6c6d923c4a3a.zip |
Go back to back icon for Now Playing fragment
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index 08930ae7..db7559b3 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -227,7 +227,6 @@ public class SubsonicFragmentActivity extends SubsonicActivity { drawerToggle.setDrawerIndicatorEnabled(false); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setHomeAsUpIndicator(coverArtView.getDrawable()); } @Override @@ -603,20 +602,15 @@ public class SubsonicFragmentActivity extends SubsonicActivity { artistView.setText(R.string.main_artist); } - if(coverArtView != null && coverArtView.getHeight() != 0) { - SilentBackgroundTask task = getImageLoader().loadImage(coverArtView, song, false, coverArtView.getHeight(), false); - if (slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) { - if (task == null) { - getSupportActionBar().setHomeAsUpIndicator(coverArtView.getDrawable()); - } else { - task.setOnCompletionListener(new Runnable() { - @Override - public void run() { - getSupportActionBar().setHomeAsUpIndicator(coverArtView.getDrawable()); - } - }); - } + if(coverArtView != null) { + int height = coverArtView.getHeight(); + if(height <= 0) { + int[] attrs = new int[] {R.attr.actionBarSize}; + TypedArray typedArray = this.obtainStyledAttributes(attrs); + height = typedArray.getDimensionPixelSize(0, 0); + typedArray.recycle(); } + getImageLoader().loadImage(coverArtView, song, false, height, false); } int[] attrs = new int[] {(state == PlayerState.STARTED) ? R.attr.media_button_pause : R.attr.media_button_start}; |