diff options
-rw-r--r-- | src/github/daneren2005/dsub/view/UpdateView.java | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/view/UpdateView.java b/src/github/daneren2005/dsub/view/UpdateView.java index 7ce27f06..ced92ad6 100644 --- a/src/github/daneren2005/dsub/view/UpdateView.java +++ b/src/github/daneren2005/dsub/view/UpdateView.java @@ -37,6 +37,14 @@ public class UpdateView extends LinearLayout { private static Handler uiHandler;
private static Runnable updateRunnable;
+ protected ImageButton starButton;
+ protected ImageView moreButton;
+
+ protected boolean exists = false;
+ protected boolean shaded = false;
+ protected boolean starred = true;
+ protected boolean isStarred = false;
+
public UpdateView(Context context) {
super(context);
@@ -45,11 +53,6 @@ public class UpdateView extends LinearLayout { ViewGroup.LayoutParams.WRAP_CONTENT));
INSTANCES.put(this, null);
- int instanceCount = INSTANCES.size();
- if (instanceCount > 50) {
- Log.w(TAG, instanceCount + " live UpdateView instances");
- }
-
startUpdater();
}
@@ -58,6 +61,15 @@ public class UpdateView extends LinearLayout { }
+ public void setObject(Object obj) {
+ setObjectImpl(obj);
+ updateBackground();
+ update();
+ }
+ protected void setObjectImpl(Object obj) {
+
+ }
+
private static synchronized void startUpdater() {
if(uiHandler != null) {
return;
@@ -128,6 +140,32 @@ public class UpdateView extends LinearLayout { }
protected void update() {
+ if(moreButton != null) {
+ 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;
+ }
+ }
+ }
+ if(starButton != null) {
+ if(isStarred) {
+ if(!starred) {
+ starButton.setVisibility(View.VISIBLE);
+ starred = true;
+ }
+ } else {
+ if(starred) {
+ starButton.setVisibility(View.GONE);
+ starred = false;
+ }
+ }
+ }
}
}
|