From 82cee9a60795716273e38a2fcb647c11f9ea0dc0 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 11 Sep 2014 15:03:03 -0700 Subject: #397 Add rating to album cover art --- res/layout/album_cell_item.xml | 24 ++++++++++++++++++++---- src/github/daneren2005/dsub/view/AlbumCell.java | 3 +++ src/github/daneren2005/dsub/view/UpdateView.java | 17 +++++++++-------- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/res/layout/album_cell_item.xml b/res/layout/album_cell_item.xml index 5f4735fe..3dd79477 100644 --- a/res/layout/album_cell_item.xml +++ b/res/layout/album_cell_item.xml @@ -4,12 +4,28 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + android:layout_weight="1"> + + + + + 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; } } -- cgit v1.2.3