Search in sources :

Example 1 with CustomActionListAdapter

use of com.android.settings.rr.CustomActionListAdapter in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ActionFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(int dialogId) {
    Dialog dialog = null;
    switch(dialogId) {
        case DIALOG_CATEGORY:
            final DialogInterface.OnClickListener categoryClickListener = new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int item) {
                    onTargetChange(getResources().getStringArray(R.array.action_dialog_values)[item]);
                    dialog.dismiss();
                }
            };
            dialog = new AlertDialog.Builder(getActivity()).setTitle(R.string.choose_action_title).setItems(getResources().getStringArray(R.array.action_dialog_entries), categoryClickListener).setNegativeButton(getString(android.R.string.cancel), null).create();
            break;
        case DIALOG_CUSTOM_ACTIONS:
            final CustomActionListAdapter adapter = new CustomActionListAdapter(getActivity());
            if (!usesExtendedActionsList()) {
                adapter.removeAction(ActionHandler.SYSTEMUI_TASK_HOME);
                adapter.removeAction(ActionHandler.SYSTEMUI_TASK_BACK);
            }
            final DialogInterface.OnClickListener customActionClickListener = new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int item) {
                    findAndUpdatePreference(adapter.getItem(item), mHolderTag);
                    dialog.dismiss();
                }
            };
            dialog = new AlertDialog.Builder(getActivity()).setTitle(getString(R.string.action_entry_custom_action)).setAdapter(adapter, customActionClickListener).setNegativeButton(getString(android.R.string.cancel), null).create();
            break;
    }
    return dialog;
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) Dialog(android.app.Dialog) AlertDialog(android.app.AlertDialog) CustomActionListAdapter(com.android.settings.rr.CustomActionListAdapter)

Example 2 with CustomActionListAdapter

use of com.android.settings.rr.CustomActionListAdapter in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ActionPickerDialogActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPicker = new ShortcutPickHelper(this, this);
    mCustomActionListAdapter = new CustomActionListAdapter(this);
    mHasDefault = getIntent().getBooleanExtra("has_defaults", false);
    String[] excludedActions = getIntent().getStringArrayExtra("excluded_actions");
    if (excludedActions != null) {
        for (int i = 0; i < excludedActions.length; i++) {
            mCustomActionListAdapter.removeAction(excludedActions[i]);
        }
    }
    createDialog(this, DIALOG_ROOT).show();
}
Also used : CustomActionListAdapter(com.android.settings.rr.CustomActionListAdapter)

Aggregations

CustomActionListAdapter (com.android.settings.rr.CustomActionListAdapter)2 AlertDialog (android.app.AlertDialog)1 Dialog (android.app.Dialog)1 DialogInterface (android.content.DialogInterface)1