use of dev.ukanth.ufirewall.Api.PackageInfoData 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 = 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 dev.ukanth.ufirewall.Api.PackageInfoData in project afwall by ukanth.
the class MainActivity method selectAllWifi.
private void selectAllWifi(boolean flag) {
if (this.listview == null) {
this.listview = this.findViewById(R.id.listview);
}
ListAdapter adapter = listview.getAdapter();
int count = adapter.getCount(), item;
if (adapter != null) {
for (item = 0; item < count; item++) {
PackageInfoData data = (PackageInfoData) adapter.getItem(item);
if (data.uid != Api.SPECIAL_UID_ANY) {
data.selected_wifi = flag;
// addToQueue(data);
}
setDirty(true);
}
((BaseAdapter) adapter).notifyDataSetChanged();
}
}
use of dev.ukanth.ufirewall.Api.PackageInfoData in project afwall by ukanth.
the class MainActivity method selectAll3G.
private void selectAll3G(boolean flag) {
if (this.listview == null) {
this.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 dev.ukanth.ufirewall.Api.PackageInfoData in project afwall by ukanth.
the class MainActivity method clearAll.
private void clearAll() {
if (this.listview == null) {
this.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_tether = false;
data.selected_lan = false;
data.selected_tor = false;
// addToQueue(data);
setDirty(true);
}
((BaseAdapter) adapter).notifyDataSetChanged();
}
}
use of dev.ukanth.ufirewall.Api.PackageInfoData in project afwall by ukanth.
the class MainActivity method selectAllTor.
private void selectAllTor(boolean flag) {
if (this.listview == null) {
this.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_tor = flag;
// addToQueue(data);
}
setDirty(true);
}
((BaseAdapter) adapter).notifyDataSetChanged();
}
}
Aggregations