Search in sources :

Example 1 with LauncherAccessibilityDelegate

use of com.android.launcher3.accessibility.LauncherAccessibilityDelegate in project android_packages_apps_Launcher3 by crdroidandroid.

the class LauncherAccessibilityDelegate method getSupportedActions.

/**
 * Returns all the accessibility actions that can be handled by the host.
 */
public static List<LauncherAction> getSupportedActions(Launcher launcher, View host) {
    if (host == null || !(host.getTag() instanceof ItemInfo)) {
        return Collections.emptyList();
    }
    PopupContainerWithArrow container = PopupContainerWithArrow.getOpen(launcher);
    LauncherAccessibilityDelegate delegate = container != null ? container.getAccessibilityDelegate() : launcher.getAccessibilityDelegate();
    List<LauncherAction> result = new ArrayList<>();
    delegate.getSupportedActions(host, (ItemInfo) host.getTag(), result);
    return result;
}
Also used : PendingAddItemInfo(com.android.launcher3.PendingAddItemInfo) ItemInfo(com.android.launcher3.model.data.ItemInfo) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) ArrayList(java.util.ArrayList) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow)

Aggregations

PendingAddItemInfo (com.android.launcher3.PendingAddItemInfo)1 ItemInfo (com.android.launcher3.model.data.ItemInfo)1 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)1 PopupContainerWithArrow (com.android.launcher3.popup.PopupContainerWithArrow)1 ArrayList (java.util.ArrayList)1