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