Skip to content

Commit

Permalink
Simplify and fix color of star icon
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingOwl authored and paroj committed Apr 14, 2024
1 parent c8c4729 commit 49d38f4
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1443,11 +1443,7 @@ public void onMetadataUpdate(Entry song, int fieldChange) {
if(song != null && song.isStarred()) {
starButton.setImageDrawable(DrawableTint.getTintedDrawable(context, R.drawable.ic_toggle_star));
} else {
if(context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
starButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.star_outline));
} else {
starButton.setImageResource(R.drawable.ic_toggle_star_outline_dark);
}
starButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.star));
}

int badRating, goodRating, bookmark;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ public void onClick(View v) {
if(directory.isStarred()) {
starButton.setImageDrawable(DrawableTint.getTintedDrawable(context, R.drawable.ic_toggle_star));
} else {
starButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.star_outline));
starButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.star));
}
starButton.setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -1312,10 +1312,9 @@ public void onClick(View v) {
@Override
public void starChange(boolean starred) {
if (directory.isStarred()) {
starButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.star_outline));
starButton.setImageDrawable(DrawableTint.getTintedDrawable(context, R.drawable.ic_toggle_star));
} else {
starButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.star_outline));
starButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.star));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ protected void addCustomActions(Entry currentSong, PlaybackStateCompat.Builder b

PlaybackStateCompat.CustomAction star = new PlaybackStateCompat.CustomAction.Builder(CUSTOM_ACTION_STAR,
downloadService.getString(R.string.common_star),
currentSong.isStarred() ? R.drawable.ic_toggle_star : R.drawable.ic_toggle_star_outline)
currentSong.isStarred() ? R.drawable.ic_toggle_star_selected : R.drawable.ic_toggle_star)
.setExtras(showOnWearExtras).build();

builder.addCustomAction(thumbsDown).addCustomAction(star).addCustomAction(thumbsUp);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_toggle_star.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<vector android:height="24dp" android:tint="#FFFFFF"
<vector android:height="24dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/darkElement" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_toggle_star_outline.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/ic_toggle_star_outline_dark.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<vector android:alpha="0.5" android:height="24dp"
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/select_album_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/BasicButton"
android:src="@android:drawable/star_big_off"
android:src="?attr/star"
android:tint="?attr/element_color"
android:layout_gravity="center_vertical"/>

<ImageView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<attr name="rating_good" format="reference"/>
<attr name="rating_combined" format="reference"/>
<attr name="radio" format="reference"/>
<attr name="star_outline" format="reference"/>
<attr name="star" format="reference"/>
<attr name="download" format="reference"/>
<attr name="playback_speed" format="reference"/>
<attr name="drawerItemsIcons" format="reference"/>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<item name="rating_good">@drawable/ic_action_rating_good</item>
<item name="rating_combined">@drawable/ic_action_rating_combined</item>
<item name="radio">@drawable/actionbar_radio</item>
<item name="star_outline">@drawable/ic_toggle_star_outline_light</item>
<item name="star">@drawable/ic_toggle_star</item>
<item name="download">@drawable/actionbar_download</item>
<item name="playback_speed">@drawable/ic_action_playback_speed</item>
<item name="drawerHome">@drawable/main_offline</item>
Expand Down Expand Up @@ -118,7 +118,7 @@
<item name="rating_good">@drawable/ic_action_rating_good</item>
<item name="rating_combined">@drawable/ic_action_rating_combined</item>
<item name="radio">@drawable/actionbar_radio</item>
<item name="star_outline">@drawable/ic_toggle_star_outline_dark</item>
<item name="star">@drawable/ic_toggle_star</item>
<item name="download">@drawable/actionbar_download</item>
<item name="playback_speed">@drawable/ic_action_playback_speed</item>
<item name="drawerHome">@drawable/main_offline</item>
Expand Down

0 comments on commit 49d38f4

Please sign in to comment.