Search in sources :

Example 16 with ActionConfig

use of com.android.internal.utils.du.Config.ActionConfig in project android_packages_apps_DUI by DirtyUnicorns.

the class FlingActionHandler method onUpLeftSwipe.

@Override
public void onUpLeftSwipe() {
    ActionConfig left_swipe = (ActionConfig) mActionMap.get(ActionConstants.Fling.FLING_LEFT_UP_TAG);
    ActionConfig right_swipe = (ActionConfig) mActionMap.get(ActionConstants.Fling.FLING_RIGHT_UP_TAG);
    fireAction(!left_swipe.hasNoAction() ? left_swipe : right_swipe);
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig)

Example 17 with ActionConfig

use of com.android.internal.utils.du.Config.ActionConfig in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ActionFragment method findAndUpdatePreference.

protected void findAndUpdatePreference(ActionConfig action, String tag) {
    for (ActionPreference pref : mPrefHolder) {
        if (pref.getTag().equals(mHolderTag)) {
            if (action == null) {
                action = pref.getDefaultActionConfig();
            }
            pref.setActionConfig(action);
            ButtonConfig button = mButtons.get(pref.getConfigMap().button);
            ActionConfig newAction = pref.getActionConfig();
            button.setActionConfig(newAction, pref.getConfigMap().action);
            mButtons = Config.replaceButtonAtPosition(mButtons, button, pref.getConfigMap());
            Config.setConfig(getActivity(), mDefaults, mButtons);
            onActionPolicyEnforced(mPrefHolder);
            break;
        }
    }
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig) ButtonConfig(com.android.internal.utils.du.Config.ButtonConfig) ActionPreference(com.android.settings.rr.Preferences.ActionPreference)

Example 18 with ActionConfig

use of com.android.internal.utils.du.Config.ActionConfig in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ActionFragment method loadAndSetConfigs.

private void loadAndSetConfigs() {
    mButtons = Config.getConfig(getActivity(), mDefaults);
    mDefaultButtons = Config.getDefaultConfig(getActivity(), mDefaults);
    for (ActionPreference pref : mPrefHolder) {
        pref.setDefaults(mDefaults);
        ButtonConfig button = mButtons.get(pref.getConfigMap().button);
        ActionConfig action = button.getActionConfig(pref.getConfigMap().action);
        pref.setActionConfig(action);
        ButtonConfig defButton = mDefaultButtons.get(pref.getConfigMap().button);
        ActionConfig defAction = defButton.getActionConfig(pref.getConfigMap().action);
        pref.setDefaultActionConfig(defAction);
    }
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig) ButtonConfig(com.android.internal.utils.du.Config.ButtonConfig) ActionPreference(com.android.settings.rr.Preferences.ActionPreference)

Example 19 with ActionConfig

use of com.android.internal.utils.du.Config.ActionConfig in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ActionPickerDialogActivity method sendResultAndFinish.

private void sendResultAndFinish(String result) {
    Intent intent = new Intent("intent_action_action_picker");
    intent.putExtra("result", Activity.RESULT_OK);
    intent.putExtra("action_string", result);
    ActionConfig actionConfig = new ActionConfig(this, result);
    intent.putExtra("action_config", actionConfig);
    sendBroadcastAsUser(intent, UserHandle.CURRENT);
    setResult(Activity.RESULT_OK, intent);
    finish();
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig) Intent(android.content.Intent)

Aggregations

ActionConfig (com.android.internal.utils.du.Config.ActionConfig)19 ButtonConfig (com.android.internal.utils.du.Config.ButtonConfig)7 Context (android.content.Context)2 Intent (android.content.Intent)2 LinearLayout (android.widget.LinearLayout)2 ActionPreference (com.android.settings.rr.Preferences.ActionPreference)2 SmartButtonView (com.android.systemui.navigation.smartbar.SmartButtonView)2 ActionPreference (com.crdroid.settings.preferences.ActionPreference)2 Point (android.graphics.Point)1 FrameLayout (android.widget.FrameLayout)1 ConfigMap (com.android.internal.utils.du.ActionConstants.ConfigMap)1 OpaLayout (com.android.systemui.navigation.OpaLayout)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1