From 4fa8a0b25d9cd56ef92ed6300a05e47a05ac51e2 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 15 Jan 2014 07:48:58 -0800 Subject: #249 Hide star button if stars are hidden in settings --- .../dsub/fragments/DownloadFragment.java | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java index de721f7d..f345334f 100644 --- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java +++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java @@ -178,17 +178,21 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe toggleListButton =rootView.findViewById(R.id.download_toggle_list); starButton = (ImageButton)rootView.findViewById(R.id.download_star); - starButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - DownloadFile currentDownload = getDownloadService().getCurrentPlaying(); - if (currentDownload != null) { - MusicDirectory.Entry currentSong = currentDownload.getSong(); - toggleStarred(currentSong); - starButton.setImageResource(currentSong.isStarred() ? android.R.drawable.btn_star_big_on : android.R.drawable.btn_star_big_off); + if(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_MENU_STAR, true)) { + starButton.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + DownloadFile currentDownload = getDownloadService().getCurrentPlaying(); + if (currentDownload != null) { + MusicDirectory.Entry currentSong = currentDownload.getSong(); + toggleStarred(currentSong); + starButton.setImageResource(currentSong.isStarred() ? android.R.drawable.btn_star_big_on : android.R.drawable.btn_star_big_off); + } } - } - }); + }); + } else { + starButton.setVisibility(View.GONE); + } View.OnTouchListener touchListener = new View.OnTouchListener() { @Override -- cgit v1.2.3