aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-07-31 16:42:42 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-07-31 16:42:42 -0700
commitd5a225d1818555e1247ae903ae13a016d15a6710 (patch)
tree366430582734d4f8db385ae1bc462a6f2c9f211e
parentf927ff8c8e7269839888c2c4671846af67392843 (diff)
downloaddsub-d5a225d1818555e1247ae903ae13a016d15a6710.tar.gz
dsub-d5a225d1818555e1247ae903ae13a016d15a6710.tar.bz2
dsub-d5a225d1818555e1247ae903ae13a016d15a6710.zip
Use UpdateView abstraction
-rw-r--r--src/github/daneren2005/dsub/view/ArtistEntryView.java46
1 files changed, 6 insertions, 40 deletions
diff --git a/src/github/daneren2005/dsub/view/ArtistEntryView.java b/src/github/daneren2005/dsub/view/ArtistEntryView.java
index 0a9af86e..77592c03 100644
--- a/src/github/daneren2005/dsub/view/ArtistEntryView.java
+++ b/src/github/daneren2005/dsub/view/ArtistEntryView.java
@@ -44,12 +44,6 @@ public class ArtistEntryView 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 ArtistEntryView(Context context) {
super(context);
@@ -65,44 +59,16 @@ public class ArtistEntryView extends UpdateView {
}
});
}
-
- public void setArtist(MusicDirectory.Entry artist) {
- this.artist = artist;
- titleView.setText(artist.getTitle());
+
+ protected void setObjectImpl(Object obj) {
+ this.artist = (MusicDirectory.Entry) obj;
+ titleView.setText(artist.getTitle());
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();
}
}