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.java22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/se/leap/bitmaskclient/ProviderListFragment.java b/src/se/leap/bitmaskclient/ProviderListFragment.java
index f074e665..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,14 +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());
-//<<<<<<< HEAD
-//=======
-
+
for(int item_position = 0; item_position < listView.getCount(); item_position++) {
if(item_position != position)
content_adapter.hide(item_position);
}
-//>>>>>>> feature/token-based-auth
}
@Override
@@ -200,13 +196,18 @@ 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();
}
public void hideAllBut(int position) {
-//<<<<<<< HEAD
int real_count = content_adapter.getCount();
for(int i = 0; i < real_count;)
if(i != position) {
@@ -215,14 +216,7 @@ public class ProviderListFragment extends ListFragment {
real_count--;
} else {
i++;
- }
-//=======
-/* for(int i = 0; i < content_adapter.getCount(); i++)
- if(i != position)
- content_adapter.hide(i);
- else
- content_adapter.unHide(i);
-*///>>>>>>> feature/token-based-auth
+ }
}
public void unhideAll() {