Browse Source

Fixed changing between labels and no-labels servers (generally: correctly hiding items in navigation list). Fixes #143.

pull/177/head
Eric Kok 10 years ago
parent
commit
85496f2168
  1. 11
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java

11
app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java

@ -16,6 +16,7 @@
*/ */
package org.transdroid.core.gui.navigation; package org.transdroid.core.gui.navigation;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.androidannotations.annotations.EBean; import org.androidannotations.annotations.EBean;
@ -23,6 +24,7 @@ import org.androidannotations.annotations.RootContext;
import org.transdroid.R; import org.transdroid.R;
import org.transdroid.core.app.settings.ServerSetting; import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.gui.lists.MergeAdapter; import org.transdroid.core.gui.lists.MergeAdapter;
import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.lists.ViewHolderAdapter; import org.transdroid.core.gui.lists.ViewHolderAdapter;
import org.transdroid.core.gui.navigation.StatusType.StatusTypeFilter; import org.transdroid.core.gui.navigation.StatusType.StatusTypeFilter;
@ -63,8 +65,9 @@ public class FilterListAdapter extends MergeAdapter {
this.serverItems.update(servers); this.serverItems.update(servers);
} else { } else {
serverSeparator.setViewVisibility(View.GONE); serverSeparator.setViewVisibility(View.GONE);
this.serverItems = null; this.serverItems.update(new ArrayList<SimpleListItem>());
} }
notifyDataSetChanged();
} }
/** /**
@ -84,8 +87,9 @@ public class FilterListAdapter extends MergeAdapter {
this.statusTypeItems.update(statusTypes); this.statusTypeItems.update(statusTypes);
} else { } else {
statusTypeSeparator.setViewVisibility(View.GONE); statusTypeSeparator.setViewVisibility(View.GONE);
this.statusTypeItems = null; this.statusTypeItems.update(new ArrayList<SimpleListItem>());
} }
notifyDataSetChanged();
} }
/** /**
@ -105,8 +109,9 @@ public class FilterListAdapter extends MergeAdapter {
this.labelItems.update(labels); this.labelItems.update(labels);
} else { } else {
labelSeperator.setViewVisibility(View.GONE); labelSeperator.setViewVisibility(View.GONE);
this.labelItems = null; this.labelItems.update(new ArrayList<SimpleListItem>());
} }
notifyDataSetChanged();
} }
} }

Loading…
Cancel
Save