use of com.android.launcher3.accessibility.LauncherAccessibilityDelegate.LauncherAction 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;
}
use of com.android.launcher3.accessibility.LauncherAccessibilityDelegate.LauncherAction in project android_packages_apps_Launcher3 by AOSPA.
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;
}
use of com.android.launcher3.accessibility.LauncherAccessibilityDelegate.LauncherAction in project android_packages_apps_Launcher3 by ArrowOS.
the class LauncherAccessibilityDelegate method onInitializeAccessibilityNodeInfo.
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(host, info);
if (host.getTag() instanceof ItemInfo) {
ItemInfo item = (ItemInfo) host.getTag();
List<LauncherAction> actions = new ArrayList<>();
getSupportedActions(host, item, actions);
actions.forEach(la -> info.addAction(la.accessibilityAction));
if (!itemSupportsLongClick(host, item)) {
info.setLongClickable(false);
info.removeAction(AccessibilityAction.ACTION_LONG_CLICK);
}
}
}
use of com.android.launcher3.accessibility.LauncherAccessibilityDelegate.LauncherAction in project android_packages_apps_Launcher3 by ArrowOS.
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;
}
use of com.android.launcher3.accessibility.LauncherAccessibilityDelegate.LauncherAction in project android_packages_apps_Launcher3 by ProtonAOSP.
the class LauncherAccessibilityDelegate method onInitializeAccessibilityNodeInfo.
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(host, info);
if (host.getTag() instanceof ItemInfo) {
ItemInfo item = (ItemInfo) host.getTag();
List<LauncherAction> actions = new ArrayList<>();
getSupportedActions(host, item, actions);
actions.forEach(la -> info.addAction(la.accessibilityAction));
if (!itemSupportsLongClick(host, item)) {
info.setLongClickable(false);
info.removeAction(AccessibilityAction.ACTION_LONG_CLICK);
}
}
}
Aggregations