Search in sources :

Example 41 with CellLayout

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

the class Launcher method getFirstMatchForAppClose.

/**
 * Similar to {@link #getFirstMatch} but optimized to finding a suitable view for the app close
 * animation.
 *
 * @param preferredItemId The id of the preferred item to match to if it exists.
 * @param packageName The package name of the app to match.
 * @param user The user of the app to match.
 */
public View getFirstMatchForAppClose(int preferredItemId, String packageName, UserHandle user) {
    final ItemInfoMatcher preferredItem = (info, cn) -> info != null && info.id == preferredItemId;
    final ItemInfoMatcher packageAndUserAndApp = (info, cn) -> info != null && info.itemType == ITEM_TYPE_APPLICATION && info.user.equals(user) && info.getTargetComponent() != null && TextUtils.equals(info.getTargetComponent().getPackageName(), packageName);
    if (isInState(LauncherState.ALL_APPS)) {
        return getFirstMatch(Collections.singletonList(mAppsView.getActiveRecyclerView()), preferredItem, packageAndUserAndApp);
    } else {
        List<ViewGroup> containers = new ArrayList<>(mWorkspace.getPanelCount() + 1);
        containers.add(mWorkspace.getHotseat().getShortcutsAndWidgets());
        mWorkspace.forEachVisiblePage(page -> containers.add(((CellLayout) page).getShortcutsAndWidgets()));
        // Order: Preferred item by itself or in folder, then by matching package/user
        if (ADAPTIVE_ICON_WINDOW_ANIM.get()) {
            return getFirstMatch(containers, preferredItem, forFolderMatch(preferredItem), packageAndUserAndApp, forFolderMatch(packageAndUserAndApp));
        } else {
            // FolderAdaptiveIcon as the background.
            return getFirstMatch(containers, preferredItem, packageAndUserAndApp);
        }
    }
}
Also used : Bundle(android.os.Bundle) BitmapRenderer(com.android.launcher3.icons.BitmapRenderer) NonNull(androidx.annotation.NonNull) PendingAddWidgetInfo(com.android.launcher3.widget.PendingAddWidgetInfo) AccessibilityManagerCompat(com.android.launcher3.compat.AccessibilityManagerCompat) CONFIG_ORIENTATION(android.content.pm.ActivityInfo.CONFIG_ORIENTATION) NO_OFFSET(com.android.launcher3.LauncherState.NO_OFFSET) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) LauncherAtom(com.android.launcher3.logger.LauncherAtom) Log(android.util.Log) ALPHA_INDEX_LAUNCHER_LOAD(com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_LAUNCHER_LOAD) IntentFilter(android.content.IntentFilter) UserCache(com.android.launcher3.pm.UserCache) ActivityTracker(com.android.launcher3.util.ActivityTracker) Stream(java.util.stream.Stream) LayoutParams(android.view.WindowManager.LayoutParams) AbstractFloatingView.getTopOpenViewWithType(com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType) ItemInfoMatcher(com.android.launcher3.util.ItemInfoMatcher) QsbContainerView(com.android.launcher3.qsb.QsbContainerView) TextKeyListener(android.text.method.TextKeyListener) TYPE_REBIND_SAFE(com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE) ModelUtils(com.android.launcher3.model.ModelUtils) ViewGroupFocusHelper(com.android.launcher3.keyboard.ViewGroupFocusHelper) ITEM_TYPE_APPLICATION(com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) SystemClock(android.os.SystemClock) SystemUiController(com.android.launcher3.util.SystemUiController) Supplier(java.util.function.Supplier) LAUNCHER_ALLAPPS_EXIT(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_EXIT) PendingRequestArgs(com.android.launcher3.util.PendingRequestArgs) Toast(android.widget.Toast) TYPE_ALL(com.android.launcher3.AbstractFloatingView.TYPE_ALL) Menu(android.view.Menu) ItemInfoMatcher.forFolderMatch(com.android.launcher3.util.ItemInfoMatcher.forFolderMatch) LauncherAction(com.android.launcher3.accessibility.LauncherAccessibilityDelegate.LauncherAction) IntArray(com.android.launcher3.util.IntArray) Parcelable(android.os.Parcelable) InstanceId(com.android.launcher3.logging.InstanceId) DragController(com.android.launcher3.dragndrop.DragController) LAUNCHER_ALLAPPS_ENTRY_WITH_DEVICE_SEARCH(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_ENTRY_WITH_DEVICE_SEARCH) FLAG_DRAG_AND_DROP(com.android.launcher3.model.ItemInstallQueue.FLAG_DRAG_AND_DROP) CallSuper(androidx.annotation.CallSuper) ItemClickHandler(com.android.launcher3.touch.ItemClickHandler) IntSet(com.android.launcher3.util.IntSet) LauncherAppWidgetHost(com.android.launcher3.widget.LauncherAppWidgetHost) FolderGridOrganizer(com.android.launcher3.folder.FolderGridOrganizer) SharedPreferences(android.content.SharedPreferences) FLAG_CLOSE_POPUPS(com.android.launcher3.LauncherState.FLAG_CLOSE_POPUPS) TestLogging(com.android.launcher3.testing.TestLogging) ComponentKey(com.android.launcher3.util.ComponentKey) RunnableList(com.android.launcher3.util.RunnableList) DotInfo(com.android.launcher3.dot.DotInfo) Rect(android.graphics.Rect) Trace(android.os.Trace) PackageManager(android.content.pm.PackageManager) LAUNCHER_STATE_BACKGROUND(com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND) Animator(android.animation.Animator) IconCache(com.android.launcher3.icons.IconCache) OptionsPopupView(com.android.launcher3.views.OptionsPopupView) SPRING_LOADED(com.android.launcher3.LauncherState.SPRING_LOADED) LauncherAccessibilityDelegate.getSupportedActions(com.android.launcher3.accessibility.LauncherAccessibilityDelegate.getSupportedActions) RotationHelper(com.android.launcher3.states.RotationHelper) OverlayPlugin(com.android.systemui.plugins.OverlayPlugin) FLAG_ACTIVITY_PAUSED(com.android.launcher3.model.ItemInstallQueue.FLAG_ACTIVITY_PAUSED) FolderInfo(com.android.launcher3.model.data.FolderInfo) RectF(android.graphics.RectF) AllAppsSwipeController(com.android.launcher3.touch.AllAppsSwipeController) LauncherExterns(com.android.systemui.plugins.shared.LauncherExterns) Collection(java.util.Collection) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) MultiValueAlpha(com.android.launcher3.util.MultiValueAlpha) DragOptions(com.android.launcher3.dragndrop.DragOptions) ALL_APPS(com.android.launcher3.LauncherState.ALL_APPS) WIDGETS(com.android.launcher3.popup.SystemShortcut.WIDGETS) ActivityNotFoundException(android.content.ActivityNotFoundException) Notification(android.app.Notification) ModelWriter(com.android.launcher3.model.ModelWriter) CONFIG_SCREEN_SIZE(android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE) AppInfo(com.android.launcher3.model.data.AppInfo) ActivityResultInfo(com.android.launcher3.util.ActivityResultInfo) LauncherOverlay(com.android.systemui.plugins.shared.LauncherOverlayManager.LauncherOverlay) ItemInfo(com.android.launcher3.model.data.ItemInfo) CustomWidgetManager(com.android.launcher3.widget.custom.CustomWidgetManager) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow) HashSet(java.util.HashSet) Build(android.os.Build) ADAPTIVE_ICON_WINDOW_ANIM(com.android.launcher3.config.FeatureFlags.ADAPTIVE_ICON_WINDOW_ANIM) LayoutInflater(android.view.LayoutInflater) SafeCloseable(com.android.launcher3.util.SafeCloseable) OnboardingPrefs(com.android.launcher3.util.OnboardingPrefs) PendingAddShortcutInfo(com.android.launcher3.widget.PendingAddShortcutInfo) Bitmap(android.graphics.Bitmap) OvershootInterpolator(android.view.animation.OvershootInterpolator) IMPORTANT_FOR_ACCESSIBILITY_NO(android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO) DragView(com.android.launcher3.dragndrop.DragView) TraceHelper(com.android.launcher3.util.TraceHelper) LAUNCHER_ONRESUME(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ONRESUME) AllAppsTransitionController(com.android.launcher3.allapps.AllAppsTransitionController) LauncherDragController(com.android.launcher3.dragndrop.LauncherDragController) ViewOnDrawExecutor(com.android.launcher3.util.ViewOnDrawExecutor) TestProtocol(com.android.launcher3.testing.TestProtocol) ImageView(android.widget.ImageView) AnimatorListeners(com.android.launcher3.anim.AnimatorListeners) TYPE_WINDOW_STATE_CHANGED(android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) Process(android.os.Process) LAUNCHER_ALLAPPS_ENTRY(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_ENTRY) AccessibilityEvent(android.view.accessibility.AccessibilityEvent) TargetApi(android.annotation.TargetApi) WidgetsModel(com.android.launcher3.model.WidgetsModel) PrintWriter(java.io.PrintWriter) KeyboardShortcutInfo(android.view.KeyboardShortcutInfo) AllAppsStore(com.android.launcher3.allapps.AllAppsStore) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) LauncherAccessibilityDelegate(com.android.launcher3.accessibility.LauncherAccessibilityDelegate) StringRes(androidx.annotation.StringRes) Nullable(androidx.annotation.Nullable) ItemInstallQueue(com.android.launcher3.model.ItemInstallQueue) TYPE_FOLDER(com.android.launcher3.AbstractFloatingView.TYPE_FOLDER) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) DiscoveryBounce(com.android.launcher3.allapps.DiscoveryBounce) NORMAL(com.android.launcher3.LauncherState.NORMAL) PackageManagerHelper(com.android.launcher3.util.PackageManagerHelper) ArrowPopup(com.android.launcher3.popup.ArrowPopup) WidgetsFullSheet(com.android.launcher3.widget.picker.WidgetsFullSheet) FileLog(com.android.launcher3.logging.FileLog) FloatingSurfaceView(com.android.launcher3.views.FloatingSurfaceView) FLAG_NON_INTERACTIVE(com.android.launcher3.LauncherState.FLAG_NON_INTERACTIVE) ArrayList(java.util.ArrayList) FLAG_MULTI_PAGE(com.android.launcher3.LauncherState.FLAG_MULTI_PAGE) IntentSender(android.content.IntentSender) REQUEST_NONE(com.android.launcher3.states.RotationHelper.REQUEST_NONE) AppWidgetHostView(android.appwidget.AppWidgetHostView) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) UserHandle(android.os.UserHandle) DragObject(com.android.launcher3.DropTarget.DragObject) SystemShortcut(com.android.launcher3.popup.SystemShortcut) PluginListener(com.android.systemui.plugins.PluginListener) PopupDataProvider(com.android.launcher3.popup.PopupDataProvider) ActivityContext(com.android.launcher3.views.ActivityContext) LauncherAppWidgetInfo(com.android.launcher3.model.data.LauncherAppWidgetInfo) StateManager(com.android.launcher3.statemanager.StateManager) TextUtils(android.text.TextUtils) FeatureFlags(com.android.launcher3.config.FeatureFlags) AppWidgetManager(android.appwidget.AppWidgetManager) ComponentCallbacks2(android.content.ComponentCallbacks2) TouchController(com.android.launcher3.util.TouchController) WidgetsListBaseEntry(com.android.launcher3.widget.model.WidgetsListBaseEntry) Configuration(android.content.res.Configuration) AlphaProperty(com.android.launcher3.util.MultiValueAlpha.AlphaProperty) LAUNCHER_ONSTOP(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ONSTOP) LauncherOverlayCallbacks(com.android.systemui.plugins.shared.LauncherOverlayManager.LauncherOverlayCallbacks) INSTALL(com.android.launcher3.popup.SystemShortcut.INSTALL) ValueAnimator(android.animation.ValueAnimator) Callbacks(com.android.launcher3.model.BgDataModel.Callbacks) SPRING_LOADED_EXIT_DELAY(com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY) PendingIntent(android.app.PendingIntent) KeyboardShortcutGroup(android.view.KeyboardShortcutGroup) NotificationChannel(android.app.NotificationChannel) View(android.view.View) NO_SCALE(com.android.launcher3.LauncherState.NO_SCALE) NotificationManager(android.app.NotificationManager) PinRequestHelper(com.android.launcher3.pm.PinRequestHelper) Predicate(java.util.function.Predicate) ObjectAnimator(android.animation.ObjectAnimator) CancellationSignal(android.os.CancellationSignal) BroadcastReceiver(android.content.BroadcastReceiver) PluginManagerWrapper(com.android.launcher3.uioverrides.plugins.PluginManagerWrapper) ViewGroup(android.view.ViewGroup) SparseArray(android.util.SparseArray) List(java.util.List) Utilities.postAsyncCallback(com.android.launcher3.Utilities.postAsyncCallback) LAUNCHER_STATE_HOME(com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME) NotificationListener(com.android.launcher3.notification.NotificationListener) REQUEST_LOCK(com.android.launcher3.states.RotationHelper.REQUEST_LOCK) LauncherAppWidgetProviderInfo(com.android.launcher3.widget.LauncherAppWidgetProviderInfo) LAUNCHER_WIDGET_RECONFIGURED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGET_RECONFIGURED) CONFIG_UI_MODE(android.content.pm.ActivityInfo.CONFIG_UI_MODE) AllAppsContainerView(com.android.launcher3.allapps.AllAppsContainerView) Themes(com.android.launcher3.util.Themes) Context(android.content.Context) KeyEvent(android.view.KeyEvent) WidgetAddFlowHandler(com.android.launcher3.widget.WidgetAddFlowHandler) TYPE_SNACKBAR(com.android.launcher3.AbstractFloatingView.TYPE_SNACKBAR) FolderIcon(com.android.launcher3.folder.FolderIcon) Intent(android.content.Intent) HashMap(java.util.HashMap) UiThreadHelper(com.android.launcher3.util.UiThreadHelper) InstanceIdSequence(com.android.launcher3.logging.InstanceIdSequence) MotionEvent(android.view.MotionEvent) AnimatorSet(android.animation.AnimatorSet) DragLayer(com.android.launcher3.dragndrop.DragLayer) TYPE_ICON_SURFACE(com.android.launcher3.AbstractFloatingView.TYPE_ICON_SURFACE) UNINSTALL(com.android.launcher3.popup.SystemShortcut.UNINSTALL) StatefulActivity(com.android.launcher3.statemanager.StatefulActivity) PackageUserKey(com.android.launcher3.util.PackageUserKey) APP_INFO(com.android.launcher3.popup.SystemShortcut.APP_INFO) WidgetManagerHelper(com.android.launcher3.widget.WidgetManagerHelper) PropertyListBuilder(com.android.launcher3.anim.PropertyListBuilder) StatsLogManager(com.android.launcher3.logging.StatsLogManager) StrictMode(android.os.StrictMode) LauncherOverlayManager(com.android.systemui.plugins.shared.LauncherOverlayManager) FileDescriptor(java.io.FileDescriptor) StateHandler(com.android.launcher3.statemanager.StateManager.StateHandler) ScrimView(com.android.launcher3.views.ScrimView) Thunk(com.android.launcher3.util.Thunk) VisibleForTesting(androidx.annotation.VisibleForTesting) Collections(java.util.Collections) ViewGroup(android.view.ViewGroup) ItemInfoMatcher(com.android.launcher3.util.ItemInfoMatcher) ArrayList(java.util.ArrayList)

Example 42 with CellLayout

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

the class Workspace method onDropCompleted.

/**
 * Called at the end of a drag which originated on the workspace.
 */
public void onDropCompleted(final View target, final DragObject d, final boolean success) {
    if (success) {
        if (target != this && mDragInfo != null) {
            removeWorkspaceItem(mDragInfo.cell);
        }
    } else if (mDragInfo != null) {
        // When drag is cancelled, reattach content view back to its original parent.
        if (mDragInfo.cell instanceof LauncherAppWidgetHostView && d.dragView != null) {
            d.dragView.detachContentView(/* reattachToPreviousParent= */
            true);
        }
        final CellLayout cellLayout = mLauncher.getCellLayout(mDragInfo.container, mDragInfo.screenId);
        if (cellLayout != null) {
            cellLayout.onDropChild(mDragInfo.cell);
        } else if (FeatureFlags.IS_STUDIO_BUILD) {
            throw new RuntimeException("Invalid state: cellLayout == null in " + "Workspace#onDropCompleted. Please file a bug. ");
        }
    }
    View cell = getHomescreenIconByItemId(d.originalDragInfo.id);
    if (d.cancelled && cell != null) {
        cell.setVisibility(VISIBLE);
    }
    mDragInfo = null;
}
Also used : LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) DraggableView(com.android.launcher3.dragndrop.DraggableView) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) AppWidgetHostView(android.appwidget.AppWidgetHostView) View(android.view.View) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) DragView(com.android.launcher3.dragndrop.DragView)

Example 43 with CellLayout

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

the class Workspace method addToExistingFolderIfNecessary.

boolean addToExistingFolderIfNecessary(View newView, CellLayout target, int[] targetCell, float distance, DragObject d, boolean external) {
    if (distance > target.getFolderCreationRadius(targetCell))
        return false;
    View dropOverView = target.getChildAt(targetCell[0], targetCell[1]);
    if (!mAddToExistingFolderOnDrop)
        return false;
    mAddToExistingFolderOnDrop = false;
    if (dropOverView instanceof FolderIcon) {
        FolderIcon fi = (FolderIcon) dropOverView;
        if (fi.acceptDrop(d.dragInfo)) {
            mStatsLogManager.logger().withItemInfo(fi.mInfo).withInstanceId(d.logInstanceId).log(LauncherEvent.LAUNCHER_ITEM_DROP_COMPLETED_ON_FOLDER_ICON);
            fi.onDrop(d, false);
            // if the drag started here, we need to remove it from the workspace
            if (!external) {
                getParentCellLayoutForView(mDragInfo.cell).removeView(mDragInfo.cell);
            }
            return true;
        }
    }
    return false;
}
Also used : FolderIcon(com.android.launcher3.folder.FolderIcon) DraggableView(com.android.launcher3.dragndrop.DraggableView) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) AppWidgetHostView(android.appwidget.AppWidgetHostView) View(android.view.View) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) DragView(com.android.launcher3.dragndrop.DragView)

Example 44 with CellLayout

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

the class AppWidgetResizeFrame method setupForWidget.

private void setupForWidget(LauncherAppWidgetHostView widgetView, CellLayout cellLayout, DragLayer dragLayer) {
    mCellLayout = cellLayout;
    if (mWidgetView != null) {
        mWidgetView.removeOnAttachStateChangeListener(mWidgetViewAttachStateChangeListener);
    }
    mWidgetView = widgetView;
    mWidgetView.addOnAttachStateChangeListener(mWidgetViewAttachStateChangeListener);
    LauncherAppWidgetProviderInfo info = (LauncherAppWidgetProviderInfo) widgetView.getAppWidgetInfo();
    mDragLayer = dragLayer;
    mMinHSpan = info.minSpanX;
    mMinVSpan = info.minSpanY;
    mMaxHSpan = info.maxSpanX;
    mMaxVSpan = info.maxSpanY;
    mWidgetPadding = getDefaultPaddingForWidget(getContext(), widgetView.getAppWidgetInfo().provider, null);
    mReconfigureButton = (ImageButton) findViewById(R.id.widget_reconfigure_button);
    if (info.isReconfigurable()) {
        mReconfigureButton.setVisibility(VISIBLE);
        mReconfigureButton.setOnClickListener(view -> {
            mLauncher.setWaitingForResult(PendingRequestArgs.forWidgetInfo(mWidgetView.getAppWidgetId(), /* widgetHandler= */
            null, (ItemInfo) mWidgetView.getTag()));
            mLauncher.getAppWidgetHost().startConfigActivity(mLauncher, mWidgetView.getAppWidgetId(), Launcher.REQUEST_RECONFIGURE_APPWIDGET);
        });
        if (!hasSeenReconfigurableWidgetEducationTip()) {
            post(() -> {
                if (showReconfigurableWidgetEducationTip() != null) {
                    mLauncher.getSharedPrefs().edit().putBoolean(KEY_RECONFIGURABLE_WIDGET_EDUCATION_TIP_SEEN, true).apply();
                }
            });
        }
    }
    CellLayout.LayoutParams lp = (CellLayout.LayoutParams) mWidgetView.getLayoutParams();
    ItemInfo widgetInfo = (ItemInfo) mWidgetView.getTag();
    lp.cellX = lp.tmpCellX = widgetInfo.cellX;
    lp.cellY = lp.tmpCellY = widgetInfo.cellY;
    lp.cellHSpan = widgetInfo.spanX;
    lp.cellVSpan = widgetInfo.spanY;
    lp.isLockedToGrid = true;
    // When we create the resize frame, we first mark all cells as unoccupied. The appropriate
    // cells (same if not resized, or different) will be marked as occupied when the resize
    // frame is dismissed.
    mCellLayout.markCellsAsUnoccupiedForView(mWidgetView);
    mLauncher.getStatsLogManager().logger().withInstanceId(logInstanceId).withItemInfo(widgetInfo).log(LAUNCHER_WIDGET_RESIZE_STARTED);
    setOnKeyListener(this);
}
Also used : LauncherAppWidgetProviderInfo(com.android.launcher3.widget.LauncherAppWidgetProviderInfo) ItemInfo(com.android.launcher3.model.data.ItemInfo)

Example 45 with CellLayout

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

the class AppWidgetResizeFrame method updateInvalidResizeEffect.

private void updateInvalidResizeEffect(CellLayout cellLayout, CellLayout pairedCellLayout, float alpha, float springLoadedProgress, @Nullable AnimatorSet animatorSet) {
    int childCount = pairedCellLayout.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View child = pairedCellLayout.getChildAt(i);
        if (animatorSet != null) {
            animatorSet.play(mFirstFrameAnimatorHelper.addTo(ObjectAnimator.ofFloat(child, ALPHA, alpha)));
        } else {
            child.setAlpha(alpha);
        }
    }
    if (animatorSet != null) {
        animatorSet.play(mFirstFrameAnimatorHelper.addTo(ObjectAnimator.ofFloat(cellLayout, SPRING_LOADED_PROGRESS, springLoadedProgress)));
        animatorSet.play(mFirstFrameAnimatorHelper.addTo(ObjectAnimator.ofFloat(pairedCellLayout, SPRING_LOADED_PROGRESS, springLoadedProgress)));
    } else {
        cellLayout.setSpringLoadedProgress(springLoadedProgress);
        pairedCellLayout.setSpringLoadedProgress(springLoadedProgress);
    }
    boolean shouldShowCellLayoutBorder = springLoadedProgress > 0f;
    if (animatorSet != null) {
        animatorSet.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(Animator animator) {
                cellLayout.setIsDragOverlapping(shouldShowCellLayoutBorder);
                pairedCellLayout.setIsDragOverlapping(shouldShowCellLayoutBorder);
            }
        });
    } else {
        cellLayout.setIsDragOverlapping(shouldShowCellLayoutBorder);
        pairedCellLayout.setIsDragOverlapping(shouldShowCellLayoutBorder);
    }
}
Also used : Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ImageView(android.widget.ImageView) View(android.view.View) ArrowTipView(com.android.launcher3.views.ArrowTipView) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView)

Aggregations

CellLayout (com.android.launcher3.CellLayout)178 View (android.view.View)169 SuppressLint (android.annotation.SuppressLint)126 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)124 AppWidgetHostView (android.appwidget.AppWidgetHostView)105 Point (android.graphics.Point)95 DragView (com.android.launcher3.dragndrop.DragView)91 PendingAppWidgetHostView (com.android.launcher3.widget.PendingAppWidgetHostView)87 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)86 ItemInfo (com.android.launcher3.model.data.ItemInfo)73 BubbleTextView (com.android.launcher3.BubbleTextView)62 Rect (android.graphics.Rect)60 FolderIcon (com.android.launcher3.folder.FolderIcon)52 DragLayer (com.android.launcher3.dragndrop.DragLayer)50 ArrayList (java.util.ArrayList)48 FolderInfo (com.android.launcher3.model.data.FolderInfo)45 Workspace (com.android.launcher3.Workspace)43 DraggableView (com.android.launcher3.dragndrop.DraggableView)43 Animator (android.animation.Animator)42 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)40