Full-screen folders: fixes from the pre-release audit

The audit of 2026-11-14 found these in the new full-screen folders, all
confirmed by independent reviewers and checked on the emulator where
marked:
- A folder that a drag opens (hovering an app over its icon) opens as a
  floating folder around its icon again, so the drop lands in it
  (emulator: the app went into the folder). The page for that drag is
  worked out with the grid the folder actually opens with.
- A tap beside the apps or beside the name closes the folder; only the
  name's text starts renaming (emulator). Swipes between pages still
  work from the grid's empty cells.
- Rows are capped to what fits above the folder's bottom margin; extra
  apps go to the next page instead of being cut off.
- A folder that finishes closing no longer resets the backdrop, blur,
  scale and status bar of a folder that has just opened; one still
  closing is finished at once when another opens. A folder animating
  closed also lets a new touch through, so a tap on another folder right
  after closing one opens it (emulator, 0.25 s apart).
- Status bar icons are light over a full-screen folder (a new
  SystemUiController state), and the page dots are white on its backdrop.

flexera_strings.xml carries the new strings of this whole round of
fixes, so that each of the following commits finds them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
TMCandClaude Opus 5.5 committed 2026-11-14 18:50:49 +01:00
1 parent ea4e823df7
commit f79b503ffb
7 files changed
+285 -37

No files matched your search

+154 -9
View File
@@ -276,6 +276,10 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
// gestures (e.g. 3-finger / palm screenshot) don't accidentally dismiss it.
private boolean mPendingOutsideClose = false;
private boolean mPendingOutsideKeyboardDismiss = false;
// Flexera Launcher: the touch that may close the folder is on a full-screen folder's grid,
// beside its apps; the grid has the touch as well, for a swipe between pages
// (onControllerInterceptTouchEvent).
private boolean mOutsideTouchOnGrid = false;
private float mOutsideDownX;
private float mOutsideDownY;
private final int mTouchSlop;
@@ -553,10 +557,12 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
*/
private void setFullScreen(boolean fullScreen) {
mFullScreen = fullScreen;
mContent.setFullScreen(fullScreen);
// The grid's rows are fitted to the room the folder has, which depends on its style.
mContent.setFullScreen(fullScreen, getMaxContentAreaHeight());
// No panel behind the apps of a full-screen folder: the dimmed home screen is behind them.
mBackground.setAlpha(fullScreen ? 0 : LawnchairUtilsKt.getFolderBackgroundAlpha(getContext()));
FullScreenFolders.styleName(mFolderName, fullScreen);
FullScreenFolders.stylePageIndicator(mPageIndicator, fullScreen);
}
/**
@@ -836,6 +842,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
* Opens the folder as part of a drag operation
*/
public void beginExternalDrag() {
// Flexera Launcher: folders still closing finish first (see animateOpen). Should this be
// one of them, finishing later would clear the drag noted below (closeComplete).
finishClosingFolders();
mIsExternalDrag = true;
mIsDragInProgress = true;
@@ -847,7 +856,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
mEmptyCellRank = items.size();
items.add(null); // Add an empty spot at the end
animateOpen(items, mEmptyCellRank / mContent.itemsPerPage());
// Flexera Launcher: the empty spot's rank; its page depends on the grid the folder opens
// with (animateOpen).
animateOpen(items, mEmptyCellRank);
}
/**
@@ -863,17 +874,27 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
* Opens the user folder described by the specified tag. The opening of the folder
* is animated relative to the specified View. If the View is null, no animation
* is played.
*
* Flexera Launcher: on the page of the item of {@code rankToShow}, instead of on a page
* worked out by the caller, whose grid could still be that of the folder's last opening.
*/
private void animateOpen(List<ItemInfo> items, int pageNo) {
private void animateOpen(List<ItemInfo> items, int rankToShow) {
if (!shouldAnimateOpen(items)) {
return;
}
Folder openFolder = getOpen(mActivityContext);
closeOpenFolder(openFolder);
// Flexera Launcher: the folder just closed, and any other still closing, this one too,
// finishes closing now, so that it hands the backdrop back before this one takes it.
finishClosingFolders();
// Flexera Launcher: before the apps are bound, which style them for it.
setFullScreen(mActivityContext instanceof Launcher && !isInAppDrawer()
// Flexera Launcher: before the apps are bound, which style them for it. A folder that a
// drag opens floats around its icon, as before, so that it opens under the finger, which
// is where the app is dropped into it.
setFullScreen(mActivityContext instanceof Launcher && !isInAppDrawer() && !mIsExternalDrag
&& FullScreenFolders.isOn(getContext()));
// Flexera Launcher: light bar icons over a full-screen folder's dark backdrop.
FullScreenFolders.setLightBarIcons(mLauncherDelegate.getLauncher(), mFullScreen);
mContent.bindItems(items);
mContent.setCanAnnouncePageDescriptionForFolder(true);
centerAboutIcon();
@@ -899,7 +920,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
+ mContent.getTotalChildCount());
mContent.completePendingPageChanges();
mContent.setCurrentPage(pageNo);
// Flexera Launcher: the page of rankToShow, in the grid the folder has now opened with.
mContent.setCurrentPage(rankToShow / mContent.itemsPerPage());
Log.d("b/383526431", "animateOpen: content child count after pending page"
+ " changes: " + mContent.getTotalChildCount());
@@ -1027,6 +1049,30 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
return false;
}
/**
* Flexera Launcher: folders still closing finish closing at once, as a folder opens. A folder
* that finishes closing hands the backdrop, the blur and the workspace's scale back to the
* home screen (FolderScrimAnimationListener, closeComplete), and two folders animating them
* at the same time would leave the one opening without its backdrop. And a full-screen
* folder, whose icon a tap can reach while it closes, opened again then would be taken off
* the screen as its closing ended.
*/
private void finishClosingFolders() {
BaseDragLayer dragLayer = mActivityContext.getDragLayer();
ArrayList<Folder> closing = new ArrayList<>();
for (int i = 0; i < dragLayer.getChildCount(); i++) {
if (dragLayer.getChildAt(i) instanceof Folder folder && folder.mIsAnimatingClosed) {
closing.add(folder);
}
}
for (Folder folder : closing) {
AnimatorSet animator = folder.mCurrentAnimator;
if (animator != null) {
animator.end();
}
}
}
@Override
protected boolean isOfType(int type) {
return (type & TYPE_FOLDER) != 0;
@@ -1169,10 +1215,17 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
setState(STATE_CLOSED);
mContent.setCurrentPage(0);
// Flexera Launcher: a folder open by now has the backdrop, the blur, the workspace's scale
// and the bar icons; they are not this one's to hand back.
if (getOpen(mActivityContext) != null) {
return;
}
if (Flags.enableExpressiveFolderExpansion()) {
FolderAnimationSpringBuilderManager.resetLauncherScale(mLauncherDelegate);
FolderAnimationSpringBuilderManager.resetScrimAndZoom(mLauncherDelegate);
}
// Flexera Launcher: and the bar icons a full-screen folder made light.
FullScreenFolders.setLightBarIcons(mLauncherDelegate.getLauncher(), false);
}
@Override
@@ -1467,6 +1520,13 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
@VisibleForTesting
int getMaxContentAreaHeight() {
DeviceProfile grid = mActivityContext.getDeviceProfile();
if (mFullScreen) {
// Flexera Launcher: a full-screen folder has the screen from just below the status bar
// to its place above the navigation bar, which its grid's rows are fitted to
// (FolderPagedView.setFullScreen).
return FullScreenFolders.maxHeight(mActivityContext.getDragLayer(), grid)
- getPaddingTop() - getPaddingBottom() - getFooterHeight();
}
return grid.getDeviceProperties().getAvailableHeightPx() - grid.getTotalWorkspacePadding().y
- getFooterHeight();
}
@@ -1973,10 +2033,19 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
@Override
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
if (mOutsideTouchOnGrid && ev.getActionMasked() != MotionEvent.ACTION_DOWN) {
// Flexera Launcher: the rest of a touch beside the apps on a full-screen folder's
// grid, which the grid has as well (see below). Lifted as a tap, it closes the folder.
if (mPendingOutsideClose) {
onControllerTouchEvent(ev);
}
return false;
}
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
BaseDragLayer dl = (BaseDragLayer) getParent();
mPendingOutsideClose = false;
mPendingOutsideKeyboardDismiss = false;
mOutsideTouchOnGrid = false; // Flexera Launcher: see mOutsideTouchOnGrid.
if (mIsEditingName) {
if (!dl.isEventOverView(mFolderName, ev)) {
@@ -1989,7 +2058,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
return true;
}
return false;
} else if (!dl.isEventOverView(this, ev)) {
} else if (isEventOutside(dl, ev)) { // Flexera Launcher: see isEventOutside.
// Defer folder close to ACTION_UP so multi-finger gestures
// (e.g. 3-finger screenshot, palm swipe) don't dismiss the
// folder before they're recognized by the system. See issue
@@ -1997,12 +2066,73 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
mPendingOutsideClose = true;
mOutsideDownX = ev.getX();
mOutsideDownY = ev.getY();
return true;
// Flexera Launcher: on a full-screen folder's grid, beside or between its apps,
// the grid gets the touch too, so that a swipe there still turns its pages.
mOutsideTouchOnGrid = mFullScreen && dl.isEventOverView(mContent, ev);
return !mOutsideTouchOnGrid;
}
}
return false;
}
/**
* Flexera Launcher: whether a touch is beside the folder, where it closes the folder. A
* full-screen folder (app.flexera.home.FullScreenFolders) has no panel, and its view is as
* wide as the home screen's grid, with its name's field across it: what is seen of it is its
* apps, its name and its page dots, and a touch anywhere else is on the darkened home screen.
*/
private boolean isEventOutside(BaseDragLayer dl, MotionEvent ev) {
if (!dl.isEventOverView(this, ev)) {
return true;
}
if (!mFullScreen) {
return false;
}
boolean onApp = mContent.iterateOverItems((info, v) ->
v.getVisibility() == VISIBLE && dl.isEventOverView(v, ev)) != null;
return !onApp && !isEventOverShownView(dl, mPageIndicator, ev)
&& !isEventOverShownView(dl, mLeftArrow, ev)
&& !isEventOverShownView(dl, mRightArrow, ev)
&& !isEventOverName(dl, ev);
}
/** Flexera Launcher: whether a touch is over {@code view}, which may be absent or hidden. */
private static boolean isEventOverShownView(
BaseDragLayer dl, @Nullable View view, MotionEvent ev) {
return view != null && view.getVisibility() == VISIBLE && dl.isEventOverView(view, ev);
}
/**
* Flexera Launcher: whether a touch is on the folder's name as it is drawn. The name's field
* is as wide as the folder; the name is only as wide as its text, or as the footer is high
* for a short one, so that it is still easy to touch.
*/
private boolean isEventOverName(BaseDragLayer dl, MotionEvent ev) {
if (mFolderName.getVisibility() != VISIBLE || mFolderName.getWidth() <= 0) {
return false;
}
dl.getDescendantRectRelativeToSelf(mFolderName, sTempRect);
if (!sTempRect.contains((int) ev.getX(), (int) ev.getY())) {
return false;
}
CharSequence text = isEmpty(mFolderName.getText())
? mFolderName.getHint() : mFolderName.getText();
int start = mFolderName.getCompoundPaddingLeft();
int room = mFolderName.getWidth() - start - mFolderName.getCompoundPaddingRight();
float textWidth = isEmpty(text) ? 0
: mFolderName.getPaint().measureText(text, 0, text.length());
float width = Math.min(room, Math.max(textWidth, mFooterHeight));
int gravity = Gravity.getAbsoluteGravity(mFolderName.getGravity(),
mFolderName.getLayoutDirection()) & Gravity.HORIZONTAL_GRAVITY_MASK;
float left = gravity == Gravity.LEFT ? start
: gravity == Gravity.RIGHT ? start + room - width
: start + (room - width) / 2;
// Where along the field the touch is, in the field's own pixels, as the folder may be
// scaled while it opens.
float x = (ev.getX() - sTempRect.left) * mFolderName.getWidth() / sTempRect.width();
return x >= left && x <= left + width;
}
@Override
public boolean onControllerTouchEvent(MotionEvent ev) {
if (!mPendingOutsideClose && !mPendingOutsideKeyboardDismiss) {
@@ -2028,7 +2158,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
&& !dl.isEventOverView(mFolderName, ev)) {
mFolderName.dispatchBackKey();
} else if (mPendingOutsideClose
&& !dl.isEventOverView(this, ev)) {
// Flexera Launcher: beside a full-screen folder's apps as well.
&& isEventOutside(dl, ev)) {
mLauncherDelegate.interceptOutsideTouch(ev, dl, this);
}
}
@@ -2050,6 +2181,20 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
return !mIsEditingName;
}
/**
* Flexera Launcher: a folder animating closed lets a new touch through to what lies under it.
* A full-screen folder covers the bottom rows of the home screen, where folders usually are,
* so a tap on another folder right after closing this one used to land on this one and do
* nothing. A touch that began before the close still goes where it went.
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (mIsAnimatingClosed && ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
return false;
}
return super.dispatchTouchEvent(ev);
}
/**
* Alternative to using {@link #getClipToOutline()} as it only works with derivatives of
* rounded rect.
@@ -58,6 +58,7 @@ public class FolderGridOrganizer {
this(maxCountX, maxCountY, false);
}
// Flexera Launcher: see mFullRows.
private FolderGridOrganizer(int maxCountX, int maxCountY, boolean fullRows) {
mMaxCountX = maxCountX;
mMaxCountY = maxCountY;
@@ -74,12 +75,15 @@ public class FolderGridOrganizer {
/**
* Flexera Launcher: the grid of an open full-screen folder (app.flexera.home.FullScreenFolders):
* the home screen's columns, filled row by row, and as many rows as a folder may have. Only
* the open folder is laid out with it; its icon's preview keeps the folder grid.
* the home screen's columns, filled row by row, and as many rows as a folder may have, or as
* fit on the screen ({@code rowsThatFit}) where that is fewer, so that no row is cut off and
* the other apps go to the next pages. Only the open folder is laid out with it; its icon's
* preview keeps the folder grid.
*/
public static FolderGridOrganizer createFullScreenFolderGridOrganizer(DeviceProfile profile) {
return new FolderGridOrganizer(
Math.max(1, profile.inv.numColumns), Math.max(1, profile.numFolderRows), true);
public static FolderGridOrganizer createFullScreenFolderGridOrganizer(
DeviceProfile profile, int rowsThatFit) {
return new FolderGridOrganizer(Math.max(1, profile.inv.numColumns),
Math.max(1, Math.min(profile.numFolderRows, rowsThatFit)), true);
}
/**
@@ -120,6 +124,8 @@ public class FolderGridOrganizer {
* maintaining the restrictions of {@link #mMaxCountX} &amp; {@link #mMaxCountY}.
*/
private void calculateGridSize(int count) {
// Flexera Launcher: full rows (see mFullRows), and only as many of them as the items
// fill, up to a page's worth.
if (mFullRows) {
mCountX = mMaxCountX;
mCountY = Math.max(1, Math.min(mMaxCountY, (count + mMaxCountX - 1) / mMaxCountX));
@@ -130,6 +130,7 @@ public class FolderPagedView extends PagedView<PageIndicatorDots> implements Cli
super(context, attrs);
ActivityContext activityContext = ActivityContext.lookupContext(context);
mOrganizer = folderGridOrganizer;
// Flexera Launcher: the grid a floating folder goes back to (setFullScreen).
mFloatingOrganizer = folderGridOrganizer;
mIsRtl = Utilities.isRtl(getResources());
@@ -148,14 +149,22 @@ public class FolderPagedView extends PagedView<PageIndicatorDots> implements Cli
/**
* Flexera Launcher: a full-screen folder (app.flexera.home.FullScreenFolders) lays its apps out
* in the home screen's columns, each as wide as on the home screen; a floating one in its own
* grid. Called as the folder opens, before its items are bound.
* grid. Called as the folder opens, before its items are bound. {@code maxHeight} is the most
* this view can be high in the folder, its padding included.
*/
void setFullScreen(boolean fullScreen) {
void setFullScreen(boolean fullScreen, int maxHeight) {
mFullScreen = fullScreen;
mOrganizer = fullScreen
? FolderGridOrganizer.createFullScreenFolderGridOrganizer(
mFolder.mActivityContext.getDeviceProfile())
: mFloatingOrganizer;
if (fullScreen && mFolder.mActivityContext instanceof Launcher launcher) {
// No more rows, of the cells createAndAddNewPage gives them, than fit in that height;
// the apps that do not fit go to the next pages.
DeviceProfile grid = launcher.getDeviceProfile();
int gap = grid.folderCellLayoutBorderSpacePx.y;
int room = maxHeight - getPaddingTop() - getPaddingBottom();
int rowsThatFit = (room + gap) / (FullScreenFolders.cellSize(launcher).y + gap);
mOrganizer = FolderGridOrganizer.createFullScreenFolderGridOrganizer(grid, rowsThatFit);
} else {
mOrganizer = mFloatingOrganizer;
}
}
/**
@@ -49,6 +49,9 @@ class FolderScrimAnimationListener(
}
private fun restoreScrimAfterFolderClose() {
// Flexera Launcher: a folder open by now has the backdrop, the blur, the scale and the
// bar icons; they are not this one's to hand back (Folder.closeComplete).
if (Folder.getOpen(launcher) != null) return
scrimView.alpha = 1f
scrimView.setScrimColors(
launcher.stateManager.state.getWorkspaceScrimColor(launcher),
@@ -62,5 +65,7 @@ class FolderScrimAnimationListener(
if (Utilities.ATLEAST_S && launcher.stateManager.state.getDepth(launcher) == 0f) {
launcher.depthBlurTargets.forEach { it.setRenderEffect(null) }
}
// Flexera Launcher: and the bar icons a full-screen folder made light.
app.flexera.home.FullScreenFolders.setLightBarIcons(launcher, false)
}
}
@@ -37,6 +37,8 @@ public class SystemUiController {
public static final int UI_STATE_ALL_APPS = 4;
// Flexera Launcher: quick launch's black page (app.flexera.home.QuickLaunchPage).
public static final int UI_STATE_QUICK_LAUNCH_PAGE = 5;
// Flexera Launcher: a full-screen folder's dark backdrop (app.flexera.home.FullScreenFolders).
public static final int UI_STATE_FULL_SCREEN_FOLDER = 6;
public static final int FLAG_LIGHT_NAV = 1 << 0;
public static final int FLAG_DARK_NAV = 1 << 1;
@@ -56,7 +58,8 @@ public class SystemUiController {
public @interface SystemUiControllerFlags {}
private final View mView;
private final int[] mStates = new int[6];
// Flexera Launcher: one for each state above, Flexera's two included.
private final int[] mStates = new int[7];
public SystemUiController(View view) {
mView = view;