summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/ProviderListFragment.java
diff options
context:
space:
mode:
authorcyBerta <richy@cyborgsociety.org>2013-12-20 18:37:13 +0100
committercyBerta <richy@cyborgsociety.org>2013-12-20 18:37:13 +0100
commit8bc035e5785b8a14c26cdb6ab409242b66554992 (patch)
tree3abe8236fe9789b0aebcf50b4cf3c7ebfe0605e1 /src/se/leap/bitmaskclient/ProviderListFragment.java
parenta651099981ddc9ed5c17a25b2bb618b161cec048 (diff)
parent3f5d756fa1a37dba00c400ca2a6197af5af1071e (diff)
Merge branch 'develop' of ssh://leap.se:22/bitmask_android into develop
Diffstat (limited to 'src/se/leap/bitmaskclient/ProviderListFragment.java')
-rw-r--r--src/se/leap/bitmaskclient/ProviderListFragment.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/se/leap/bitmaskclient/ProviderListFragment.java b/src/se/leap/bitmaskclient/ProviderListFragment.java
index 84d46a11..501da609 100644
--- a/src/se/leap/bitmaskclient/ProviderListFragment.java
+++ b/src/se/leap/bitmaskclient/ProviderListFragment.java
@@ -155,12 +155,7 @@ 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).id);
-
- for(int item_position = 0; item_position < listView.getCount(); item_position++) {
- if(item_position != position)
- content_adapter.hide(item_position);
- }
+ mCallbacks.onItemSelected(ProviderListContent.ITEMS.get(position).name());
}
@Override
@@ -172,6 +167,9 @@ public class ProviderListFragment extends ListFragment {
}
}
+ public void notifyAdapter() {
+ content_adapter.notifyDataSetChanged();
+ }
/**
* Turns on activate-on-click mode. When this mode is on, list items will be
* given the 'activated' state when touched.
@@ -196,10 +194,19 @@ public class ProviderListFragment extends ListFragment {
public void addItem(ProviderItem provider) {
content_adapter.add(provider);
+ content_adapter.notifyDataSetChanged();
}
- public void hide(int position) {
- content_adapter.hide(position);
+ public void hideAllBut(int position) {
+ int real_count = content_adapter.getCount();
+ for(int i = 0; i < real_count;)
+ if(i != position) {
+ content_adapter.hide(i);
+ position--;
+ real_count--;
+ } else {
+ i++;
+ }
}
public void unhideAll() {