Search in sources :

Example 66 with ItemInfo

use of com.android.launcher3.ItemInfo in project android_packages_apps_Launcher3 by AOSPA.

the class PopupDataProvider method getDotInfoForItem.

@Nullable
public DotInfo getDotInfoForItem(@NonNull ItemInfo info) {
    if (!ShortcutUtil.supportsShortcuts(info)) {
        return null;
    }
    DotInfo dotInfo = mPackageUserToDotInfos.get(PackageUserKey.fromItemInfo(info));
    if (dotInfo == null) {
        return null;
    }
    List<NotificationKeyData> notifications = getNotificationsForItem(info, dotInfo.getNotificationKeys());
    if (notifications.isEmpty()) {
        return null;
    }
    return dotInfo;
}
Also used : DotInfo(com.android.launcher3.dot.DotInfo) NotificationKeyData(com.android.launcher3.notification.NotificationKeyData) Nullable(androidx.annotation.Nullable)

Example 67 with ItemInfo

use of com.android.launcher3.ItemInfo in project android_packages_apps_Launcher3 by AOSPA.

the class PopupContainerWithArrow method updateNotificationHeader.

private void updateNotificationHeader() {
    ItemInfoWithIcon itemInfo = (ItemInfoWithIcon) mOriginalIcon.getTag();
    DotInfo dotInfo = mActivityContext.getDotInfoForItem(itemInfo);
    if (mNotificationContainer != null && dotInfo != null) {
        mNotificationContainer.updateHeader(dotInfo.getNotificationCount());
    }
}
Also used : DotInfo(com.android.launcher3.dot.DotInfo) ItemInfoWithIcon(com.android.launcher3.model.data.ItemInfoWithIcon)

Example 68 with ItemInfo

use of com.android.launcher3.ItemInfo in project android_packages_apps_Launcher3 by AOSPA.

the class ItemLongClickListener method beginDrag.

public static void beginDrag(View v, Launcher launcher, ItemInfo info, DragOptions dragOptions) {
    if (info.container >= 0) {
        Folder folder = Folder.getOpen(launcher);
        if (folder != null) {
            if (!folder.getIconsInReadingOrder().contains(v)) {
                folder.close(true);
            } else {
                folder.startDrag(v, dragOptions);
                return;
            }
        }
    }
    CellLayout.CellInfo longClickCellInfo = new CellLayout.CellInfo(v, info);
    launcher.getWorkspace().startDrag(longClickCellInfo, dragOptions);
}
Also used : CellLayout(com.android.launcher3.CellLayout) Folder(com.android.launcher3.folder.Folder)

Example 69 with ItemInfo

use of com.android.launcher3.ItemInfo in project android_packages_apps_Launcher3 by AOSPA.

the class HotseatEduController method moveHotseatItems.

void moveHotseatItems() {
    mHotseat.removeAllViewsInLayout();
    if (!mNewItems.isEmpty()) {
        int lastPage = mNewItems.get(mNewItems.size() - 1).screenId;
        ArrayList<ItemInfo> animated = new ArrayList<>();
        ArrayList<ItemInfo> nonAnimated = new ArrayList<>();
        for (ItemInfo info : mNewItems) {
            if (info.screenId == lastPage) {
                animated.add(info);
            } else {
                nonAnimated.add(info);
            }
        }
        mLauncher.bindAppsAdded(mNewScreens, nonAnimated, animated);
    }
}
Also used : ItemInfo(com.android.launcher3.model.data.ItemInfo) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) ArrayList(java.util.ArrayList)

Example 70 with ItemInfo

use of com.android.launcher3.ItemInfo in project android_packages_apps_Launcher3 by AOSPA.

the class HotseatPredictionController method pinPrediction.

/**
 * Pins a predicted app icon into place.
 */
public void pinPrediction(ItemInfo info) {
    PredictedAppIcon icon = (PredictedAppIcon) mHotseat.getChildAt(mHotseat.getCellXFromOrder(info.rank), mHotseat.getCellYFromOrder(info.rank));
    if (icon == null) {
        return;
    }
    WorkspaceItemInfo workspaceItemInfo = new WorkspaceItemInfo((WorkspaceItemInfo) info);
    mLauncher.getModelWriter().addItemToDatabase(workspaceItemInfo, LauncherSettings.Favorites.CONTAINER_HOTSEAT, workspaceItemInfo.screenId, workspaceItemInfo.cellX, workspaceItemInfo.cellY);
    ObjectAnimator.ofFloat(icon, SCALE_PROPERTY, 1, 0.8f, 1).start();
    icon.pin(workspaceItemInfo);
    mLauncher.getStatsLogManager().logger().withItemInfo(workspaceItemInfo).log(LAUNCHER_HOTSEAT_PREDICTION_PINNED);
}
Also used : PredictedAppIcon(com.android.launcher3.uioverrides.PredictedAppIcon) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo)

Aggregations

ItemInfo (com.android.launcher3.model.data.ItemInfo)457 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)373 View (android.view.View)199 ArrayList (java.util.ArrayList)169 Point (android.graphics.Point)159 FolderInfo (com.android.launcher3.model.data.FolderInfo)113 SuppressLint (android.annotation.SuppressLint)110 LauncherAppWidgetInfo (com.android.launcher3.model.data.LauncherAppWidgetInfo)100 DragView (com.android.launcher3.dragndrop.DragView)98 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)98 AppWidgetHostView (android.appwidget.AppWidgetHostView)94 PendingAppWidgetHostView (com.android.launcher3.widget.PendingAppWidgetHostView)94 BubbleTextView (com.android.launcher3.BubbleTextView)85 Context (android.content.Context)82 List (java.util.List)80 AppInfo (com.android.launcher3.model.data.AppInfo)79 Intent (android.content.Intent)78 Rect (android.graphics.Rect)76 DraggableView (com.android.launcher3.dragndrop.DraggableView)73 ComponentName (android.content.ComponentName)72