From ae22717cc4e0deedac71e91d3566a9302727e62b Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 11 Jul 2015 10:11:45 -0700 Subject: Tint stars according to theme --- .../java/github/daneren2005/dsub/activity/SubsonicActivity.java | 2 ++ app/src/main/java/github/daneren2005/dsub/view/SongView.java | 4 ++++ app/src/main/java/github/daneren2005/dsub/view/UpdateView.java | 5 ++++- app/src/main/res/layout/album_cell_item.xml | 6 +++--- app/src/main/res/layout/album_list_item.xml | 6 +++--- app/src/main/res/layout/basic_list_item.xml | 6 +++--- app/src/main/res/layout/complex_list_item.xml | 6 +++--- app/src/main/res/layout/song_list_item.xml | 6 +++--- app/src/main/res/layout/user_list_item.xml | 6 +++--- app/src/main/res/values/dimens.xml | 1 + 10 files changed, 29 insertions(+), 19 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java index f7e7251c..33d978bf 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -67,6 +67,7 @@ import github.daneren2005.dsub.fragments.SubsonicFragment; import github.daneren2005.dsub.service.DownloadService; import github.daneren2005.dsub.service.HeadphoneListenerService; import github.daneren2005.dsub.util.Constants; +import github.daneren2005.dsub.util.DrawableTint; import github.daneren2005.dsub.util.ImageLoader; import github.daneren2005.dsub.util.SilentBackgroundTask; import github.daneren2005.dsub.util.Util; @@ -197,6 +198,7 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte if (theme != null && !theme.equals(Util.getTheme(this)) || fullScreen != Util.getPreferences(this).getBoolean(Constants.PREFERENCES_KEY_FULL_SCREEN, false)) { restart(); overridePendingTransition(R.anim.fade_in, R.anim.fade_out); + DrawableTint.wipeTintCache(); } populateTabs(); diff --git a/app/src/main/java/github/daneren2005/dsub/view/SongView.java b/app/src/main/java/github/daneren2005/dsub/view/SongView.java index e789c5de..41cba046 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/SongView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/SongView.java @@ -29,6 +29,7 @@ import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.domain.PodcastEpisode; import github.daneren2005.dsub.service.DownloadService; import github.daneren2005.dsub.service.DownloadFile; +import github.daneren2005.dsub.util.DrawableTint; import github.daneren2005.dsub.util.Util; import java.io.File; @@ -198,6 +199,9 @@ public class SongView extends UpdateView2 { if(item.isStarred()) { if(!starred) { + if(starButton.getDrawable() == null) { + starButton.setImageDrawable(DrawableTint.getTintedDrawable(context, R.drawable.ic_toggle_star, R.attr.colorPrimary)); + } starButton.setVisibility(View.VISIBLE); starred = true; } diff --git a/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java b/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java index 5043e7bc..37290240 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/UpdateView.java @@ -27,7 +27,6 @@ import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; -import android.widget.Checkable; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; @@ -39,6 +38,7 @@ import java.util.WeakHashMap; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.R; +import github.daneren2005.dsub.util.DrawableTint; import github.daneren2005.dsub.util.SilentBackgroundTask; public abstract class UpdateView extends LinearLayout { @@ -240,6 +240,9 @@ public abstract class UpdateView extends LinearLayout { if(starButton != null) { if(isStarred) { if(!starred) { + if(starButton.getDrawable() == null) { + starButton.setImageDrawable(DrawableTint.getTintedDrawable(context, R.drawable.ic_toggle_star, R.attr.colorPrimary)); + } starButton.setVisibility(View.VISIBLE); starred = true; } diff --git a/app/src/main/res/layout/album_cell_item.xml b/app/src/main/res/layout/album_cell_item.xml index fe634c13..244c6f1f 100644 --- a/app/src/main/res/layout/album_cell_item.xml +++ b/app/src/main/res/layout/album_cell_item.xml @@ -67,10 +67,10 @@ diff --git a/app/src/main/res/layout/album_list_item.xml b/app/src/main/res/layout/album_list_item.xml index 150cbd8f..ba892365 100644 --- a/app/src/main/res/layout/album_list_item.xml +++ b/app/src/main/res/layout/album_list_item.xml @@ -59,10 +59,10 @@ diff --git a/app/src/main/res/layout/basic_list_item.xml b/app/src/main/res/layout/basic_list_item.xml index 04fdfe06..ea1df8e8 100644 --- a/app/src/main/res/layout/basic_list_item.xml +++ b/app/src/main/res/layout/basic_list_item.xml @@ -20,10 +20,10 @@ diff --git a/app/src/main/res/layout/complex_list_item.xml b/app/src/main/res/layout/complex_list_item.xml index 2aec9451..143f9af9 100644 --- a/app/src/main/res/layout/complex_list_item.xml +++ b/app/src/main/res/layout/complex_list_item.xml @@ -33,10 +33,10 @@ diff --git a/app/src/main/res/layout/song_list_item.xml b/app/src/main/res/layout/song_list_item.xml index 419f9524..7b4933e0 100644 --- a/app/src/main/res/layout/song_list_item.xml +++ b/app/src/main/res/layout/song_list_item.xml @@ -52,10 +52,10 @@ diff --git a/app/src/main/res/layout/user_list_item.xml b/app/src/main/res/layout/user_list_item.xml index aa198578..c2e708c8 100644 --- a/app/src/main/res/layout/user_list_item.xml +++ b/app/src/main/res/layout/user_list_item.xml @@ -27,10 +27,10 @@ diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 9759e1c2..a9e59202 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -6,4 +6,5 @@ 120dip 13sp 12sp + 20dp \ No newline at end of file -- cgit v1.2.3