Search in sources :

Example 1 with APP_INFO

use of com.android.launcher3.popup.SystemShortcut.APP_INFO in project android_packages_apps_Launcher3 by ArrowOS.

the class TaskbarPopupController method showForIcon.

/**
 * Shows the notifications and deep shortcuts associated with a Taskbar {@param icon}.
 * @return the container if shown or null.
 */
public PopupContainerWithArrow<TaskbarActivityContext> showForIcon(BubbleTextView icon) {
    TaskbarActivityContext context = ActivityContext.lookupContext(icon.getContext());
    if (PopupContainerWithArrow.getOpen(context) != null) {
        // There is already an items container open, so don't open this one.
        icon.clearFocus();
        return null;
    }
    ItemInfo item = (ItemInfo) icon.getTag();
    if (!PopupContainerWithArrow.canShow(icon, item)) {
        return null;
    }
    final PopupContainerWithArrow<TaskbarActivityContext> container = (PopupContainerWithArrow) context.getLayoutInflater().inflate(R.layout.popup_container, context.getDragLayer(), false);
    // TODO (b/198438631): configure for taskbar/context
    container.populateAndShow(icon, mPopupDataProvider.getShortcutCountForItem(item), mPopupDataProvider.getNotificationKeysForItem(item), // TODO (b/198438631): add support for INSTALL shortcut factory
    Stream.of(APP_INFO).map(s -> s.getShortcut(context, item)).filter(Objects::nonNull).collect(Collectors.toList()));
    container.requestFocus();
    return container;
}
Also used : PopupDataProvider(com.android.launcher3.popup.PopupDataProvider) ActivityContext(com.android.launcher3.views.ActivityContext) NonNull(androidx.annotation.NonNull) ItemInfo(com.android.launcher3.model.data.ItemInfo) HashMap(java.util.HashMap) Collectors(java.util.stream.Collectors) BubbleTextView(com.android.launcher3.BubbleTextView) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow) Objects(java.util.Objects) Stream(java.util.stream.Stream) R(com.android.launcher3.R) ComponentKey(com.android.launcher3.util.ComponentKey) SystemShortcut(com.android.launcher3.popup.SystemShortcut) ItemInfo(com.android.launcher3.model.data.ItemInfo) Objects(java.util.Objects) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow)

Example 2 with APP_INFO

use of com.android.launcher3.popup.SystemShortcut.APP_INFO in project android_packages_apps_404Launcher by P-404.

the class TaskbarPopupController method showForIcon.

/**
 * Shows the notifications and deep shortcuts associated with a Taskbar {@param icon}.
 * @return the container if shown or null.
 */
public PopupContainerWithArrow<TaskbarActivityContext> showForIcon(BubbleTextView icon) {
    TaskbarActivityContext context = ActivityContext.lookupContext(icon.getContext());
    if (PopupContainerWithArrow.getOpen(context) != null) {
        // There is already an items container open, so don't open this one.
        icon.clearFocus();
        return null;
    }
    ItemInfo item = (ItemInfo) icon.getTag();
    if (!PopupContainerWithArrow.canShow(icon, item)) {
        return null;
    }
    final PopupContainerWithArrow<TaskbarActivityContext> container = (PopupContainerWithArrow) context.getLayoutInflater().inflate(R.layout.popup_container, context.getDragLayer(), false);
    // TODO (b/198438631): configure for taskbar/context
    container.populateAndShow(icon, mPopupDataProvider.getShortcutCountForItem(item), mPopupDataProvider.getNotificationKeysForItem(item), // TODO (b/198438631): add support for INSTALL shortcut factory
    Stream.of(APP_INFO).map(s -> s.getShortcut(context, item)).filter(Objects::nonNull).collect(Collectors.toList()));
    container.requestFocus();
    return container;
}
Also used : PopupDataProvider(com.android.launcher3.popup.PopupDataProvider) ActivityContext(com.android.launcher3.views.ActivityContext) NonNull(androidx.annotation.NonNull) ItemInfo(com.android.launcher3.model.data.ItemInfo) HashMap(java.util.HashMap) Collectors(java.util.stream.Collectors) BubbleTextView(com.android.launcher3.BubbleTextView) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow) Objects(java.util.Objects) Stream(java.util.stream.Stream) R(com.android.launcher3.R) ComponentKey(com.android.launcher3.util.ComponentKey) SystemShortcut(com.android.launcher3.popup.SystemShortcut) ItemInfo(com.android.launcher3.model.data.ItemInfo) Objects(java.util.Objects) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow)

Example 3 with APP_INFO

use of com.android.launcher3.popup.SystemShortcut.APP_INFO in project android_packages_apps_Launcher3 by AOSPA.

the class TaskbarPopupController method showForIcon.

/**
 * Shows the notifications and deep shortcuts associated with a Taskbar {@param icon}.
 * @return the container if shown or null.
 */
public PopupContainerWithArrow<TaskbarActivityContext> showForIcon(BubbleTextView icon) {
    TaskbarActivityContext context = ActivityContext.lookupContext(icon.getContext());
    if (PopupContainerWithArrow.getOpen(context) != null) {
        // There is already an items container open, so don't open this one.
        icon.clearFocus();
        return null;
    }
    ItemInfo item = (ItemInfo) icon.getTag();
    if (!PopupContainerWithArrow.canShow(icon, item)) {
        return null;
    }
    final PopupContainerWithArrow<TaskbarActivityContext> container = (PopupContainerWithArrow) context.getLayoutInflater().inflate(R.layout.popup_container, context.getDragLayer(), false);
    // TODO (b/198438631): configure for taskbar/context
    container.populateAndShow(icon, mPopupDataProvider.getShortcutCountForItem(item), mPopupDataProvider.getNotificationKeysForItem(item), // TODO (b/198438631): add support for INSTALL shortcut factory
    Stream.of(APP_INFO).map(s -> s.getShortcut(context, item)).filter(Objects::nonNull).collect(Collectors.toList()));
    container.requestFocus();
    return container;
}
Also used : PopupDataProvider(com.android.launcher3.popup.PopupDataProvider) ActivityContext(com.android.launcher3.views.ActivityContext) NonNull(androidx.annotation.NonNull) ItemInfo(com.android.launcher3.model.data.ItemInfo) HashMap(java.util.HashMap) Collectors(java.util.stream.Collectors) BubbleTextView(com.android.launcher3.BubbleTextView) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow) Objects(java.util.Objects) Stream(java.util.stream.Stream) R(com.android.launcher3.R) ComponentKey(com.android.launcher3.util.ComponentKey) SystemShortcut(com.android.launcher3.popup.SystemShortcut) ItemInfo(com.android.launcher3.model.data.ItemInfo) Objects(java.util.Objects) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow)

Example 4 with APP_INFO

use of com.android.launcher3.popup.SystemShortcut.APP_INFO in project android_packages_apps_Launcher3 by ProtonAOSP.

the class TaskbarPopupController method showForIcon.

/**
 * Shows the notifications and deep shortcuts associated with a Taskbar {@param icon}.
 * @return the container if shown or null.
 */
public PopupContainerWithArrow<TaskbarActivityContext> showForIcon(BubbleTextView icon) {
    TaskbarActivityContext context = ActivityContext.lookupContext(icon.getContext());
    if (PopupContainerWithArrow.getOpen(context) != null) {
        // There is already an items container open, so don't open this one.
        icon.clearFocus();
        return null;
    }
    ItemInfo item = (ItemInfo) icon.getTag();
    if (!PopupContainerWithArrow.canShow(icon, item)) {
        return null;
    }
    final PopupContainerWithArrow<TaskbarActivityContext> container = (PopupContainerWithArrow) context.getLayoutInflater().inflate(R.layout.popup_container, context.getDragLayer(), false);
    // TODO (b/198438631): configure for taskbar/context
    container.populateAndShow(icon, mPopupDataProvider.getShortcutCountForItem(item), mPopupDataProvider.getNotificationKeysForItem(item), // TODO (b/198438631): add support for INSTALL shortcut factory
    Stream.of(APP_INFO).map(s -> s.getShortcut(context, item)).filter(Objects::nonNull).collect(Collectors.toList()));
    container.requestFocus();
    return container;
}
Also used : PopupDataProvider(com.android.launcher3.popup.PopupDataProvider) ActivityContext(com.android.launcher3.views.ActivityContext) NonNull(androidx.annotation.NonNull) ItemInfo(com.android.launcher3.model.data.ItemInfo) HashMap(java.util.HashMap) Collectors(java.util.stream.Collectors) BubbleTextView(com.android.launcher3.BubbleTextView) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow) Objects(java.util.Objects) Stream(java.util.stream.Stream) R(com.android.launcher3.R) ComponentKey(com.android.launcher3.util.ComponentKey) SystemShortcut(com.android.launcher3.popup.SystemShortcut) ItemInfo(com.android.launcher3.model.data.ItemInfo) Objects(java.util.Objects) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow)

Aggregations

NonNull (androidx.annotation.NonNull)4 BubbleTextView (com.android.launcher3.BubbleTextView)4 R (com.android.launcher3.R)4 ItemInfo (com.android.launcher3.model.data.ItemInfo)4 PopupContainerWithArrow (com.android.launcher3.popup.PopupContainerWithArrow)4 PopupDataProvider (com.android.launcher3.popup.PopupDataProvider)4 SystemShortcut (com.android.launcher3.popup.SystemShortcut)4 ComponentKey (com.android.launcher3.util.ComponentKey)4 ActivityContext (com.android.launcher3.views.ActivityContext)4 HashMap (java.util.HashMap)4 Objects (java.util.Objects)4 Collectors (java.util.stream.Collectors)4 Stream (java.util.stream.Stream)4