aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-05 19:05:42 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-05 19:05:42 -0700
commit703e6ac05d45851aeab085a18ca1c87d84d2b7a9 (patch)
tree7d8d7df19aae466a4049a1646e2c434bfc4709df /src
parentf7c8deece0172a7613baddabf3961b03fdc81526 (diff)
downloaddsub-703e6ac05d45851aeab085a18ca1c87d84d2b7a9.tar.gz
dsub-703e6ac05d45851aeab085a18ca1c87d84d2b7a9.tar.bz2
dsub-703e6ac05d45851aeab085a18ca1c87d84d2b7a9.zip
Remove green highlight, apply red highlighting to down rated albums too
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/view/AlbumCell.java1
-rw-r--r--src/github/daneren2005/dsub/view/AlbumView.java1
-rw-r--r--src/github/daneren2005/dsub/view/SongView.java7
-rw-r--r--src/github/daneren2005/dsub/view/UpdateView.java16
4 files changed, 19 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/view/AlbumCell.java b/src/github/daneren2005/dsub/view/AlbumCell.java
index 522834d1..e50aad32 100644
--- a/src/github/daneren2005/dsub/view/AlbumCell.java
+++ b/src/github/daneren2005/dsub/view/AlbumCell.java
@@ -92,5 +92,6 @@ public class AlbumCell extends UpdateView {
exists = file.exists();
isStarred = album.isStarred();
+ isRated = album.getRating();
}
}
diff --git a/src/github/daneren2005/dsub/view/AlbumView.java b/src/github/daneren2005/dsub/view/AlbumView.java
index e28eeadd..c499763f 100644
--- a/src/github/daneren2005/dsub/view/AlbumView.java
+++ b/src/github/daneren2005/dsub/view/AlbumView.java
@@ -92,5 +92,6 @@ public class AlbumView extends UpdateView {
exists = file.exists();
isStarred = album.isStarred();
+ isRated = album.getRating();
}
}
diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java
index 8d986090..73efc9b9 100644
--- a/src/github/daneren2005/dsub/view/SongView.java
+++ b/src/github/daneren2005/dsub/view/SongView.java
@@ -66,8 +66,6 @@ public class SongView extends UpdateView implements Checkable {
private boolean loaded = false;
private boolean isBookmarked = false;
private boolean bookmarked = false;
- private int isRated = 0;
- private int rating = 0;
public SongView(Context context) {
super(context);
@@ -260,10 +258,7 @@ public class SongView extends UpdateView implements Checkable {
if(isRated != rating) {
// Color the entire row based on rating
- if(isRated > 3) {
- this.setBackgroundColor(Color.GREEN);
- this.getBackground().setAlpha(5 * (isRated - 3));
- } else if(isRated < 3 && isRated > 0) {
+ if(isRated < 3 && isRated > 0) {
this.setBackgroundColor(Color.RED);
// Use darker colors the lower the rating goes
this.getBackground().setAlpha(10 * (3 - isRated));
diff --git a/src/github/daneren2005/dsub/view/UpdateView.java b/src/github/daneren2005/dsub/view/UpdateView.java
index 5f34a765..87d065b8 100644
--- a/src/github/daneren2005/dsub/view/UpdateView.java
+++ b/src/github/daneren2005/dsub/view/UpdateView.java
@@ -20,6 +20,7 @@ package github.daneren2005.dsub.view;
import android.content.Context;
import android.content.res.TypedArray;
+import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
@@ -56,6 +57,8 @@ public class UpdateView extends LinearLayout {
protected boolean shaded = false;
protected boolean starred = false;
protected boolean isStarred = false;
+ protected int isRated = 0;
+ protected int rating = 0;
protected SilentBackgroundTask<Void> imageTask = null;
protected final boolean autoUpdate;
@@ -259,5 +262,18 @@ 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);
+ }
+
+ rating = isRated;
+ }
}
}