Search in sources :

Example 86 with CellLayout

use of com.android.launcher3.CellLayout in project android_packages_apps_Trebuchet by LineageOS.

the class FolderPagedView method verifyVisibleHighResIcons.

/**
 * Ensures that all the icons on the given page are of high-res
 */
public void verifyVisibleHighResIcons(int pageNo) {
    CellLayout page = getPageAt(pageNo);
    if (page != null) {
        ShortcutAndWidgetContainer parent = page.getShortcutsAndWidgets();
        for (int i = parent.getChildCount() - 1; i >= 0; i--) {
            BubbleTextView icon = ((BubbleTextView) parent.getChildAt(i));
            icon.verifyHighRes();
            // Set the callback back to the actual icon, in case
            // it was captured by the FolderIcon
            Drawable d = icon.getCompoundDrawables()[1];
            if (d != null) {
                d.setCallback(icon);
            }
        }
    }
}
Also used : CellLayout(com.android.launcher3.CellLayout) ShortcutAndWidgetContainer(com.android.launcher3.ShortcutAndWidgetContainer) Drawable(android.graphics.drawable.Drawable) BubbleTextView(com.android.launcher3.BubbleTextView) SuppressLint(android.annotation.SuppressLint)

Example 87 with CellLayout

use of com.android.launcher3.CellLayout in project android_packages_apps_Trebuchet by LineageOS.

the class FolderPagedView method unbindItems.

/**
 * Removes all the icons from the folder
 */
public void unbindItems() {
    for (int i = getChildCount() - 1; i >= 0; i--) {
        CellLayout page = (CellLayout) getChildAt(i);
        ShortcutAndWidgetContainer container = page.getShortcutsAndWidgets();
        for (int j = container.getChildCount() - 1; j >= 0; j--) {
            container.getChildAt(j).setVisibility(View.VISIBLE);
            mViewCache.recycleView(R.layout.folder_application, container.getChildAt(j));
        }
        page.removeAllViews();
        mViewCache.recycleView(R.layout.folder_page, page);
    }
    removeAllViews();
    mViewsBound = false;
}
Also used : CellLayout(com.android.launcher3.CellLayout) ShortcutAndWidgetContainer(com.android.launcher3.ShortcutAndWidgetContainer) SuppressLint(android.annotation.SuppressLint)

Example 88 with CellLayout

use of com.android.launcher3.CellLayout in project android_packages_apps_Trebuchet by LineageOS.

the class PreviewBackground method animateToRest.

public void animateToRest() {
    // This can be called multiple times -- we need to make sure the drawing delegate
    // is saved and restored at the beginning of the animation, since cancelling the
    // existing animation can clear the delgate.
    CellLayout cl = mDrawingDelegate;
    int cellX = mDelegateCellX;
    int cellY = mDelegateCellY;
    animateScale(1f, 1f, () -> delegateDrawing(cl, cellX, cellY), this::clearDrawingDelegate);
}
Also used : CellLayout(com.android.launcher3.CellLayout) Paint(android.graphics.Paint)

Example 89 with CellLayout

use of com.android.launcher3.CellLayout in project android_packages_apps_Trebuchet by LineageOS.

the class WorkspaceAndHotseatScrim method draw.

public void draw(Canvas canvas) {
    // Draw the background below children.
    if (mScrimAlpha > 0) {
        // Update the scroll position first to ensure scrim cutout is in the right place.
        mWorkspace.computeScrollWithoutInvalidation();
        CellLayout currCellLayout = mWorkspace.getCurrentDragOverlappingLayout();
        canvas.save();
        if (currCellLayout != null && currCellLayout != mLauncher.getHotseat()) {
            // Cut a hole in the darkening scrim on the page that should be highlighted, if any.
            mLauncher.getDragLayer().getDescendantRectRelativeToSelf(currCellLayout, mHighlightRect);
            canvas.clipRect(mHighlightRect, Region.Op.DIFFERENCE);
        }
        super.draw(canvas);
        canvas.restore();
    }
    if (!mHideSysUiScrim) {
        if (mSysUiProgress <= 0) {
            mAnimateScrimOnNextDraw = false;
            return;
        }
        if (mAnimateScrimOnNextDraw) {
            mSysUiAnimMultiplier = 0;
            reapplySysUiAlphaNoInvalidate();
            ObjectAnimator oa = createSysuiMultiplierAnim(1);
            oa.setDuration(600);
            oa.setStartDelay(mLauncher.getWindow().getTransitionBackgroundFadeDuration());
            oa.start();
            mAnimateScrimOnNextDraw = false;
        }
        if (mDrawTopScrim) {
            mTopScrim.draw(canvas);
        }
        if (mDrawBottomScrim) {
            canvas.drawBitmap(mBottomMask, null, mFinalMaskRect, mBottomMaskPaint);
        }
    }
}
Also used : CellLayout(com.android.launcher3.CellLayout) ObjectAnimator(android.animation.ObjectAnimator)

Example 90 with CellLayout

use of com.android.launcher3.CellLayout in project Neo-Launcher by NeoApplications.

the class AppWidgetResizeFrame method showForWidget.

public static void showForWidget(LauncherAppWidgetHostView widget, CellLayout cellLayout) {
    Launcher launcher = Launcher.getLauncher(cellLayout.getContext());
    AbstractFloatingView.closeAllOpenViews(launcher);
    DragLayer dl = launcher.getDragLayer();
    AppWidgetResizeFrame frame = (AppWidgetResizeFrame) launcher.getLayoutInflater().inflate(R.layout.app_widget_resize_frame, dl, false);
    frame.setupForWidget(widget, cellLayout, dl);
    ((DragLayer.LayoutParams) frame.getLayoutParams()).customPosition = true;
    dl.addView(frame);
    frame.mIsOpen = true;
    frame.snapToWidget(false);
}
Also used : DragLayer(com.android.launcher3.dragndrop.DragLayer)

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