Search in sources :

Example 11 with ActionConfig

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

the class FlingActionHandler method onDoubleLeftTap.

@Override
public void onDoubleLeftTap() {
    ActionConfig left_tap = (ActionConfig) mActionMap.get(ActionConstants.Fling.DOUBLE_LEFT_TAP_TAG);
    ActionConfig right_tap = (ActionConfig) mActionMap.get(ActionConstants.Fling.DOUBLE_RIGHT_TAP_TAG);
    fireAction(!left_tap.hasNoAction() ? left_tap : right_tap);
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig)

Example 12 with ActionConfig

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

the class FlingActionHandler method loadConfigs.

void loadConfigs() {
    mActionMap.clear();
    ArrayList<ButtonConfig> configs = Config.getConfig(mContext, ActionConstants.getDefaults(ActionConstants.FLING));
    for (Map.Entry<String, ConfigMap> entry : ActionConstants.getDefaults(ActionConstants.FLING).getActionMap().entrySet()) {
        ButtonConfig button = configs.get(entry.getValue().button);
        ActionConfig action = button.getActionConfig(entry.getValue().action);
        mActionMap.put(entry.getKey(), action);
    }
    isDoubleTapEnabled = !((ActionConfig) mActionMap.get(ActionConstants.Fling.DOUBLE_LEFT_TAP_TAG)).hasNoAction() || !((ActionConfig) mActionMap.get(ActionConstants.Fling.DOUBLE_RIGHT_TAP_TAG)).hasNoAction();
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig) ButtonConfig(com.android.internal.utils.du.Config.ButtonConfig) ConfigMap(com.android.internal.utils.du.ActionConstants.ConfigMap) HashMap(java.util.HashMap) Map(java.util.Map) ConfigMap(com.android.internal.utils.du.ActionConstants.ConfigMap)

Example 13 with ActionConfig

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

the class FlingActionHandler method onSingleLeftPress.

@Override
public void onSingleLeftPress() {
    ActionConfig left_tap = (ActionConfig) mActionMap.get(ActionConstants.Fling.SINGLE_LEFT_TAP_TAG);
    ActionConfig right_tap = (ActionConfig) mActionMap.get(ActionConstants.Fling.SINGLE_RIGHT_TAP_TAG);
    fireAction(!left_tap.hasNoAction() ? left_tap : right_tap);
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig)

Example 14 with ActionConfig

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

the class FlingActionHandler method onDoubleRightTap.

@Override
public void onDoubleRightTap() {
    ActionConfig right_tap = (ActionConfig) mActionMap.get(ActionConstants.Fling.DOUBLE_RIGHT_TAP_TAG);
    ActionConfig left_tap = (ActionConfig) mActionMap.get(ActionConstants.Fling.DOUBLE_LEFT_TAP_TAG);
    fireAction(!right_tap.hasNoAction() ? right_tap : left_tap);
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig)

Example 15 with ActionConfig

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

the class FlingActionHandler method onLongLeftPress.

@Override
public void onLongLeftPress() {
    ActionConfig left_long = (ActionConfig) mActionMap.get(ActionConstants.Fling.LONG_LEFT_PRESS_TAG);
    ActionConfig right_long = (ActionConfig) mActionMap.get(ActionConstants.Fling.LONG_RIGHT_PRESS_TAG);
    if (ActionHandler.isLockTaskOn()) {
        ActionHandler.turnOffLockTask();
    } else {
        fireAction(!left_long.hasNoAction() ? left_long : right_long);
    }
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig)

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