aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/view/SongView.java24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java
index 3354b58b..f795cbce 100644
--- a/src/github/daneren2005/dsub/view/SongView.java
+++ b/src/github/daneren2005/dsub/view/SongView.java
@@ -78,6 +78,7 @@ public class SongView extends UpdateView implements Checkable {
durationTextView = (TextView) findViewById(R.id.song_duration);
statusTextView = (TextView) findViewById(R.id.song_status);
statusImageView = (ImageView) findViewById(R.id.song_status_icon);
+ ratingBar = (RatingBar) findViewById(R.id.song_rating);
starButton = (ImageButton) findViewById(R.id.song_star);
starButton.setFocusable(false);
bookmarkButton = (ImageButton) findViewById(R.id.song_bookmark);
@@ -147,6 +148,7 @@ public class SongView extends UpdateView implements Checkable {
checkedTextView.setVisibility(checkable && !song.isVideo() ? View.VISIBLE : View.GONE);
this.setBackgroundColor(0x00000000);
+ ratingBar.setVisibility(View.GONE);
rating = 0;
revision = -1;
@@ -264,12 +266,24 @@ public class SongView extends UpdateView implements Checkable {
}
if(isRated != rating) {
- // Color the entire row based on rating
- if(isRated < 3 && isRated > 0) {
+ if(isRated > 1) {
+ if(rating <= 1) {
+ ratingBar.setVisibility(View.VISIBLE);
+ }
+
+ ratingBar.setNumStars(isRated);
+ ratingBar.setRating(isRated);
+ } else if(isRated <= 1) {
+ if(rating > 1) {
+ ratingBar.setVisibility(View.GONE);
+ }
+ }
+
+ // Still highlight red if a 1-star
+ if(isRated == 1) {
this.setBackgroundColor(Color.RED);
- // Use darker colors the lower the rating goes
- this.getBackground().setAlpha(10 * (3 - isRated));
- } else {
+ this.getBackground().setAlpha(20);
+ } else if(rating == 1) {
this.setBackgroundColor(0x00000000);
}