diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-01-15 07:48:58 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-01-15 07:48:58 -0800 |
commit | 4fa8a0b25d9cd56ef92ed6300a05e47a05ac51e2 (patch) | |
tree | 8cb6a475f553a077de3c54f38e766ae1a03f4807 /src/github/daneren2005 | |
parent | b344e977dc7ee76ed46a46f5cecdb9823f511bde (diff) | |
download | dsub-4fa8a0b25d9cd56ef92ed6300a05e47a05ac51e2.tar.gz dsub-4fa8a0b25d9cd56ef92ed6300a05e47a05ac51e2.tar.bz2 dsub-4fa8a0b25d9cd56ef92ed6300a05e47a05ac51e2.zip |
#249 Hide star button if stars are hidden in settings
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/DownloadFragment.java | 24 |
1 files 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
|