diff options
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/view/AlbumCell.java | 3 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/view/UpdateView.java | 17 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/github/daneren2005/dsub/view/AlbumCell.java b/src/github/daneren2005/dsub/view/AlbumCell.java index e50aad32..0ad6861b 100644 --- a/src/github/daneren2005/dsub/view/AlbumCell.java +++ b/src/github/daneren2005/dsub/view/AlbumCell.java @@ -20,6 +20,7 @@ import android.view.LayoutInflater; import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
+import android.widget.RatingBar;
import android.widget.TextView;
import java.io.File;
@@ -50,6 +51,8 @@ public class AlbumCell extends UpdateView { titleView = (TextView) findViewById(R.id.album_title);
artistView = (TextView) findViewById(R.id.album_artist);
+ ratingBar = (RatingBar) findViewById(R.id.album_rating);
+ ratingBar.setFocusable(false);
starButton = (ImageButton) findViewById(R.id.album_star);
starButton.setFocusable(false);
moreButton = (ImageView) findViewById(R.id.album_more);
diff --git a/src/github/daneren2005/dsub/view/UpdateView.java b/src/github/daneren2005/dsub/view/UpdateView.java index 87d065b8..8ca3f29a 100644 --- a/src/github/daneren2005/dsub/view/UpdateView.java +++ b/src/github/daneren2005/dsub/view/UpdateView.java @@ -30,6 +30,8 @@ import android.widget.AbsListView; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.RatingBar;
+
import java.util.ArrayList;
import java.util.List;
import java.util.WeakHashMap;
@@ -49,6 +51,7 @@ public class UpdateView extends LinearLayout { private static int activeActivities = 0;
protected Context context;
+ protected RatingBar ratingBar;
protected ImageButton starButton;
protected ImageView moreButton;
@@ -263,16 +266,14 @@ public class UpdateView extends LinearLayout { }
}
- if(isRated != rating) {
- // Color the entire row based on rating
- if(isRated < 3 && isRated > 0) {
- this.setBackgroundColor(Color.RED);
- // Use darker colors the lower the rating goes
- this.getBackground().setAlpha(10 * (3 - isRated));
- } else {
- this.setBackgroundColor(0x00000000);
+ if(ratingBar != null && isRated != rating) {
+ if(isRated > 0 && rating == 0) {
+ ratingBar.setVisibility(View.VISIBLE);
+ } else if(isRated == 0 && rating > 0) {
+ ratingBar.setVisibility(View.GONE);
}
+ ratingBar.setRating(isRated);
rating = isRated;
}
}
|