OSDN Git Service

fixes
authorKoushik Dutta <koushd@gmail.com>
Thu, 31 Jan 2013 22:09:19 +0000 (14:09 -0800)
committerKoushik Dutta <koushd@gmail.com>
Thu, 31 Jan 2013 22:09:19 +0000 (14:09 -0800)
.gitignore
Widgets/src/com/koushikdutta/widgets/ActivityBaseFragment.java
Widgets/src/com/koushikdutta/widgets/SeparatedListAdapter.java

index 1746e32..e8609a5 100644 (file)
@@ -1,2 +1,3 @@
 bin
 obj
+local.properties
index 4763184..e48746e 100644 (file)
@@ -37,11 +37,13 @@ public class ActivityBaseFragment extends Fragment {
             if (!super.isEnabled(position))
                 return false;
             ListItem item = (ListItem) getItem(position);
+            if (item == null)
+                return false;
             return item.getEnabled();
         }
     }
     
-    public static class ListItemAdapter extends ArrayAdapter<ListItem> {
+    public class ListItemAdapter extends ArrayAdapter<ListItem> {
         public ListItemAdapter(Context context) {
             super(context, 0);
         }
@@ -80,6 +82,7 @@ public class ActivityBaseFragment extends Fragment {
         public void setSort(Comparator<ListItem> sorter) {
             this.sorter = sorter;
             notifyDataSetChanged();
+            mAdapter.notifyDataSetChanged();
         }
         
         public Comparator<ListItem> getSort() {
index ab50106..7a8d75d 100644 (file)
@@ -27,16 +27,19 @@ public class SeparatedListAdapter<T extends Adapter> extends BaseAdapter {
     public void addSection(String section, T adapter) {
         this.headers.add(section);
         this.sections.put(section, adapter);
+        notifyDataSetChanged();
     }
 
     public void addSection(int index, String section, T adapter) {
         this.headers.insert(section, index);
         this.sections.put(section, adapter);
+        notifyDataSetChanged();
     }
     
     public void removeSection(String section) {
         this.headers.remove(section);
         this.sections.remove(section);
+        notifyDataSetChanged();
     }
     
     public T getSection(String section) {