OSDN Git Service

cleanups and tweaks. setIcon on ListItem
authorKoushik Dutta <koushd@gmail.com>
Mon, 14 Jan 2013 07:59:15 +0000 (23:59 -0800)
committerKoushik Dutta <koushd@gmail.com>
Mon, 14 Jan 2013 07:59:15 +0000 (23:59 -0800)
Widgets/lint.xml [new file with mode: 0644]
Widgets/res/layout/activity_base_fragment.xml
Widgets/src/com/koushikdutta/widgets/ActivityBase.java
Widgets/src/com/koushikdutta/widgets/ListItem.java

diff --git a/Widgets/lint.xml b/Widgets/lint.xml
new file mode 100644 (file)
index 0000000..7edd00c
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+    <issue id="NewApi" severity="ignore" />
+</lint>
\ No newline at end of file
index c42cebb..f5eb1e3 100644 (file)
@@ -19,6 +19,7 @@
         android:paddingRight="10dp" />
 
     <TextView
+        android:textAppearance="@android:style/TextAppearance.DeviceDefault"
         xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/empty"
         android:layout_width="fill_parent"
@@ -27,6 +28,7 @@
         android:gravity="center"
         android:layout_weight="1"
         android:orientation="vertical"
+        android:padding="10dp"
         android:visibility="gone" />
 
     <LinearLayout
index f2f70f9..06c9d42 100644 (file)
@@ -63,4 +63,15 @@ public class ActivityBase extends FragmentActivity implements ActivityBaseFragme
     public void setEmpty(int res) {
         getFragment().setEmpty(res);
     }
+
+    public boolean isDestroyed() {
+        return mDestroyed;
+    }
+    
+    private boolean mDestroyed = false;
+    @Override
+    protected void onDestroy() {
+        mDestroyed = true;
+        super.onDestroy();
+    }
 }
index df79343..0ef1ed7 100644 (file)
@@ -14,7 +14,13 @@ public class ListItem {
     private ActivityBaseFragment Context;
     private boolean Enabled = true;
 
-    public int Icon;
+    private int Icon;
+    
+    public ListItem setIcon(int icon) {
+        Icon = icon;
+        Context.mAdapter.notifyDataSetChanged();
+        return this;
+    }
     
     public ListItem setEnabled(boolean enabled) {
         Enabled = enabled;