From f632dc5f46943c6a258d5f1cd85c6c6d923c4a3a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 18 Jun 2015 17:26:39 -0700 Subject: Go back to back icon for Now Playing fragment --- .../dsub/activity/SubsonicFragmentActivity.java | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'app/src') 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}; -- cgit v1.2.3