From d5a225d1818555e1247ae903ae13a016d15a6710 Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Wed, 31 Jul 2013 16:42:42 -0700 Subject: Use UpdateView abstraction --- .../daneren2005/dsub/view/ArtistEntryView.java | 46 +++------------------- 1 file 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(); } } -- cgit v1.2.3