use of android.widget.BaseAdapter in project afwall by ukanth.
the class MainActivity method clearAll.
private void clearAll() {
if (this.listview == null) {
this.listview = (ListView) this.findViewById(R.id.listview);
}
ListAdapter adapter = listview.getAdapter();
if (adapter != null) {
int count = adapter.getCount(), item;
for (item = 0; item < count; item++) {
PackageInfoData data = (PackageInfoData) adapter.getItem(item);
data.selected_wifi = false;
data.selected_3g = false;
data.selected_roam = false;
data.selected_vpn = false;
data.selected_lan = false;
// addToQueue(data);
setDirty(true);
}
((BaseAdapter) adapter).notifyDataSetChanged();
}
}
use of android.widget.BaseAdapter in project afwall by ukanth.
the class MainActivity method selectAll3G.
private void selectAll3G(boolean flag) {
if (this.listview == null) {
this.listview = (ListView) this.findViewById(R.id.listview);
}
ListAdapter adapter = listview.getAdapter();
if (adapter != null) {
int count = adapter.getCount(), item;
for (item = 0; item < count; item++) {
PackageInfoData data = (PackageInfoData) adapter.getItem(item);
if (data.uid != Api.SPECIAL_UID_ANY) {
data.selected_3g = flag;
// addToQueue(data);
}
// addToQueue(data);
setDirty(true);
}
((BaseAdapter) adapter).notifyDataSetChanged();
}
}
use of android.widget.BaseAdapter in project afwall by ukanth.
the class MainActivity method selectAllVPN.
/**
* Cache any batch event by user
*
* @param
*/
/*public static void addToQueue(@NonNull PackageInfoData data) {
*/
/*if (queue == null) {
queue = new HashSet<>();
}
//add or update based on new data
queue.add(data);
getFab().setBackgroundTintList(ColorStateList.valueOf(Color.RED));*/
/*
}*/
private void selectAllVPN(boolean flag) {
if (this.listview == null) {
this.listview = (ListView) this.findViewById(R.id.listview);
}
ListAdapter adapter = listview.getAdapter();
if (adapter != null) {
int count = adapter.getCount(), item;
for (item = 0; item < count; item++) {
PackageInfoData data = (PackageInfoData) adapter.getItem(item);
if (data.uid != Api.SPECIAL_UID_ANY) {
data.selected_vpn = flag;
// addToQueue(data);
}
setDirty(true);
}
((BaseAdapter) adapter).notifyDataSetChanged();
}
}
use of android.widget.BaseAdapter in project AutoLoadListView by ZhaoKaiQiang.
the class ZSwipeItem method isEnabledInAdapterView.
/**
* if working in {@link android.widget.AdapterView}, we should response
* {@link android.widget.Adapter} isEnable(int position).
*
* @return true when item is enabled, else disabled.
*/
private boolean isEnabledInAdapterView() {
@SuppressWarnings("rawtypes") AdapterView adapterView = getAdapterView();
boolean enable = true;
if (adapterView != null) {
Adapter adapter = adapterView.getAdapter();
if (adapter != null) {
int p = adapterView.getPositionForView(ZSwipeItem.this);
if (adapter instanceof BaseAdapter) {
enable = ((BaseAdapter) adapter).isEnabled(p);
} else if (adapter instanceof ListAdapter) {
enable = ((ListAdapter) adapter).isEnabled(p);
}
}
}
return enable;
}
use of android.widget.BaseAdapter in project chefly_android by chef-ly.
the class ListViewFragment method onLoadFinished.
// LoaderManager callback method
@Override
public void onLoadFinished(Loader<RecipeList> loader, RecipeList data) {
Log.d(TAG + "/" + title, "Loader - OnLoadFinish");
for (RecipeInformation recipe : data) {
list.add(recipe);
}
((BaseAdapter) listView.getAdapter()).notifyDataSetChanged();
isLoading.set(false);
Log.d(TAG, "Getting more recipes from server --- Done");
}
Aggregations