diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-07-11 10:11:45 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-07-11 10:11:45 -0700 |
commit | ae22717cc4e0deedac71e91d3566a9302727e62b (patch) | |
tree | 3157f85bd1c6c1c3923aea75fd77698d6624cce8 /app | |
parent | 46b2eafe0a11c93a4907eb0057fdb06c79751986 (diff) | |
download | dsub-ae22717cc4e0deedac71e91d3566a9302727e62b.tar.gz dsub-ae22717cc4e0deedac71e91d3566a9302727e62b.tar.bz2 dsub-ae22717cc4e0deedac71e91d3566a9302727e62b.zip |
Tint stars according to theme
Diffstat (limited to 'app')
10 files changed, 29 insertions, 19 deletions
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<MusicDirectory.Entry, Boolean> { 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<T> extends LinearLayout { @@ -240,6 +240,9 @@ public abstract class UpdateView<T> 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 @@ <ImageButton android:id="@+id/album_star" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/Star.Small" + android:layout_height="@dimen/Star.Small" + android:scaleType="fitCenter" android:layout_gravity="right|center_vertical" - android:src="@drawable/ic_stat_star" android:background="@android:color/transparent" android:focusable="false" android:visibility="gone"/> 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 @@ <ImageButton android:id="@+id/album_star" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/Star.Small" + android:layout_height="@dimen/Star.Small" + android:scaleType="fitCenter" android:layout_gravity="right|center_vertical" - android:src="@drawable/ic_stat_star" android:background="@android:color/transparent" android:focusable="false" android:visibility="gone"/> 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 @@ <ImageButton android:id="@+id/item_star" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/Star.Small" + android:layout_height="@dimen/Star.Small" + android:scaleType="fitCenter" android:layout_gravity="right|center_vertical" - android:src="@drawable/ic_stat_star" android:background="@android:color/transparent" android:focusable="false" android:visibility="gone"/> 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 @@ <ImageButton android:id="@+id/item_star" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/Star.Small" + android:layout_height="@dimen/Star.Small" + android:scaleType="fitCenter" android:layout_gravity="right|center_vertical" - android:src="@drawable/ic_stat_star" android:background="@android:color/transparent" android:focusable="false" android:visibility="gone"/> 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 @@ <ImageButton android:id="@+id/song_star" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/Star.Small" + android:layout_height="@dimen/Star.Small" + android:scaleType="fitCenter" android:layout_gravity="right|center_vertical" - android:src="@drawable/ic_stat_star" android:background="@null" android:focusable="false" android:visibility="gone"/> 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 @@ <ImageButton android:id="@+id/item_star" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="@dimen/Star.Small" + android:layout_height="@dimen/Star.Small" + android:scaleType="fitCenter" android:layout_gravity="right|center_vertical" - android:src="@drawable/ic_stat_star" android:background="@android:color/transparent" android:focusable="false" android:visibility="gone"/> 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 @@ <dimen name="AlbumArt.Header">120dip</dimen> <dimen name="BottomBar.Text.Major">13sp</dimen> <dimen name="BottomBar.Text.Minor">12sp</dimen> + <dimen name="Star.Small">20dp</dimen> </resources>
\ No newline at end of file |