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;
}
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());
}
}
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);
}
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);
}
}
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);
}
Aggregations