use of com.dirtyunicorns.tweaks.preferences.PackageListAdapter.PackageItem in project android_packages_apps_DU-Tweaks by DirtyUnicorns.
the class NotificationLightSettings method onCreateDialog.
/**
* Utility classes and supporting methods
*/
@Override
public Dialog onCreateDialog(int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final Dialog dialog;
switch(id) {
case DIALOG_APPS:
final ListView list = new ListView(getActivity());
list.setAdapter(mPackageAdapter);
builder.setTitle(R.string.heads_up_blacklist_choose_app);
builder.setView(list);
dialog = builder.create();
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Add empty application definition, the user will be able to edit it later
PackageItem info = (PackageItem) parent.getItemAtPosition(position);
addCustomApplicationPref(info.packageName);
dialog.cancel();
}
});
break;
default:
dialog = null;
}
return dialog;
}
use of com.dirtyunicorns.tweaks.preferences.PackageListAdapter.PackageItem in project android_packages_apps_DU-Tweaks by DirtyUnicorns.
the class SlimRecentsBlacklist method onCreateDialog.
@Override
public Dialog onCreateDialog(int dialogId) {
switch(dialogId) {
case DIALOG_BLACKLIST_APPS:
{
Dialog dialog;
AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity());
final ListView list = new ListView(getActivity());
list.setAdapter(mPackageAdapter);
alertDialog.setTitle(R.string.profile_choose_app);
alertDialog.setView(list);
dialog = alertDialog.create();
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Add empty application definition, the user will be able to edit it later
PackageItem info = (PackageItem) parent.getItemAtPosition(position);
addCustomApplicationPref(info.packageName, mBlacklistPackages);
dialog.cancel();
}
});
return dialog;
}
}
return super.onCreateDialog(dialogId);
}
use of com.dirtyunicorns.tweaks.preferences.PackageListAdapter.PackageItem in project android_packages_apps_DU-Tweaks by DirtyUnicorns.
the class HeadsUp method onCreateDialog.
/**
* Utility classes and supporting methods
*/
@Override
public Dialog onCreateDialog(int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final Dialog dialog;
final ListView list = new ListView(getActivity());
list.setAdapter(mPackageAdapter);
builder.setTitle(R.string.heads_up_blacklist_choose_app);
builder.setView(list);
dialog = builder.create();
switch(id) {
case DIALOG_BLACKLIST_APPS:
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
PackageItem info = (PackageItem) parent.getItemAtPosition(position);
addCustomApplicationPref(info.packageName, mBlacklistPackages);
dialog.cancel();
}
});
}
return dialog;
}
Aggregations