aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-07-31 16:37:27 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-07-31 16:37:27 -0700
commit95263ff8f6cf6eab56696362ffcdbfe8e20eec8b (patch)
treef129a8b87806d6b71cfa1e594de0f4dcff5f9e89 /src
parent52f99c62d2048c881eaf33b4bb9ffccfc2c021cb (diff)
downloaddsub-95263ff8f6cf6eab56696362ffcdbfe8e20eec8b.tar.gz
dsub-95263ff8f6cf6eab56696362ffcdbfe8e20eec8b.tar.bz2
dsub-95263ff8f6cf6eab56696362ffcdbfe8e20eec8b.zip
Use UpdateView abstraction
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/view/ArtistView.java46
1 files changed, 6 insertions, 40 deletions
diff --git a/src/github/daneren2005/dsub/view/ArtistView.java b/src/github/daneren2005/dsub/view/ArtistView.java
index 249c1ae2..81c11abb 100644
--- a/src/github/daneren2005/dsub/view/ArtistView.java
+++ b/src/github/daneren2005/dsub/view/ArtistView.java
@@ -43,12 +43,6 @@ public class ArtistView extends UpdateView {
private File file;
private TextView titleView;
- private ImageButton starButton;
- private ImageView moreButton;
-
- private boolean exists = false;
- private boolean shaded = false;
- private boolean starred = true;
public ArtistView(Context context) {
super(context);
@@ -64,44 +58,16 @@ public class ArtistView extends UpdateView {
}
});
}
-
- public void setArtist(Artist artist) {
- this.artist = artist;
- titleView.setText(artist.getName());
+
+ protected void setObjectImpl(Object obj) {
+ this.artist = (Artist) obj;
+ titleView.setText(artist.getName());
file = FileUtil.getArtistDirectory(context, artist);
- updateBackground();
- update();
}
@Override
protected void updateBackground() {
- exists = file.exists();
- }
-
- @Override
- protected void update() {
- if(artist.isStarred()) {
- if(!starred) {
- starButton.setVisibility(View.VISIBLE);
- starred = true;
- }
- } else {
- if(starred) {
- starButton.setVisibility(View.GONE);
- starred = false;
- }
- }
-
- if(exists) {
- if(!shaded) {
- moreButton.setImageResource(R.drawable.list_item_more_shaded);
- shaded = true;
- }
- } else {
- if(shaded) {
- moreButton.setImageResource(R.drawable.list_item_more);
- shaded = false;
- }
- }
+ exists = file.exists();
+ isStarred = artist.isStarred();
}
}