From 85496f2168690a88db48b0dbd0d253660b033d6e Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Mon, 27 Oct 2014 08:15:58 +0100 Subject: [PATCH] Fixed changing between labels and no-labels servers (generally: correctly hiding items in navigation list). Fixes #143. --- .../core/gui/navigation/FilterListAdapter.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java index a021a1c6..c75e509d 100644 --- a/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java +++ b/app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java @@ -16,6 +16,7 @@ */ package org.transdroid.core.gui.navigation; +import java.util.ArrayList; import java.util.List; import org.androidannotations.annotations.EBean; @@ -23,6 +24,7 @@ import org.androidannotations.annotations.RootContext; import org.transdroid.R; import org.transdroid.core.app.settings.ServerSetting; 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.navigation.StatusType.StatusTypeFilter; @@ -63,8 +65,9 @@ public class FilterListAdapter extends MergeAdapter { this.serverItems.update(servers); } else { serverSeparator.setViewVisibility(View.GONE); - this.serverItems = null; + this.serverItems.update(new ArrayList()); } + notifyDataSetChanged(); } /** @@ -84,8 +87,9 @@ public class FilterListAdapter extends MergeAdapter { this.statusTypeItems.update(statusTypes); } else { statusTypeSeparator.setViewVisibility(View.GONE); - this.statusTypeItems = null; + this.statusTypeItems.update(new ArrayList()); } + notifyDataSetChanged(); } /** @@ -105,8 +109,9 @@ public class FilterListAdapter extends MergeAdapter { this.labelItems.update(labels); } else { labelSeperator.setViewVisibility(View.GONE); - this.labelItems = null; + this.labelItems.update(new ArrayList()); } + notifyDataSetChanged(); } }