summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/ProviderListFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/se/leap/bitmaskclient/ProviderListFragment.java')
-rw-r--r--src/se/leap/bitmaskclient/ProviderListFragment.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/se/leap/bitmaskclient/ProviderListFragment.java b/src/se/leap/bitmaskclient/ProviderListFragment.java
index 501da609..45047982 100644
--- a/src/se/leap/bitmaskclient/ProviderListFragment.java
+++ b/src/se/leap/bitmaskclient/ProviderListFragment.java
@@ -19,7 +19,6 @@
import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.ProviderListContent.ProviderItem;
import android.app.Activity;
-import android.app.DialogFragment;
import android.app.ListFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -156,6 +155,11 @@ public class ProviderListFragment extends ListFragment {
// Notify the active callbacks interface (the activity, if the
// fragment is attached to one) that an item has been selected.
mCallbacks.onItemSelected(ProviderListContent.ITEMS.get(position).name());
+
+ for(int item_position = 0; item_position < listView.getCount(); item_position++) {
+ if(item_position != position)
+ content_adapter.hide(item_position);
+ }
}
@Override
@@ -192,6 +196,12 @@ public class ProviderListFragment extends ListFragment {
mActivatedPosition = position;
}
+ public void removeLastItem() {
+ unhideAll();
+ content_adapter.remove(content_adapter.getItem(content_adapter.getCount()-1));
+ content_adapter.notifyDataSetChanged();
+ }
+
public void addItem(ProviderItem provider) {
content_adapter.add(provider);
content_adapter.notifyDataSetChanged();
@@ -206,7 +216,7 @@ public class ProviderListFragment extends ListFragment {
real_count--;
} else {
i++;
- }
+ }
}
public void unhideAll() {