Full-screen folders: apps at the bottom in the home screen's grid
At the user's request, a folder on the home screen or in the dock opens over the whole screen instead of as a floating panel. Settings, Folders, "Full screen folders", on by default; switched off, folders float as before. Folders in the app list are unchanged. - No panel. The home screen behind is darkened and blurred as behind the app drawer: black at 78% (FlexeraDrawer.BACKDROP_COLOR) and the largest blur radius, which the drawer's depth comes to. - The apps sit at the bottom of the screen, centred, just above the navigation bar, with white labels and the folder's name below them, wherever the folder's icon is. - They are laid out like the home screen's icons: its column count, filled row by row (FolderGridOrganizer.createFullScreenFolderGridOrganizer), in cells the size of the home screen's cells as a page lays them out (larger than the device profile's cell size, which the page stretches), so that the columns line up with the home screen's. A row is never lower than one app with its label needs. The folder icon's preview keeps the folder grid. While a full-screen folder is open, state changes leave the scrim alone (WorkspaceStateTransitionAnimation.setScrim), so that dragging an app inside the folder no longer lightens its backdrop; the folder hands the scrim back as it closes. The depth controller's folder blur now carries its own strength (FolderBlur.strength); quick launch scales its blur by FolderBlur.STRENGTH itself and looks as before. While full-screen folders are on, Settings hides the panel's opacity and the folder column count, which do not apply to them. Checked on the emulator (Android 17, 4-column test grid): open, tap an app, tap outside, Back, rename with the keyboard (the folder lifts above it), reorder inside the folder (the backdrop holds), drag an app out to the home screen, the setting off and on again (the floating folder comes back with its panel, 3 columns and dark labels), and columns and rows 259 and 243 px apart, as on the home screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a79962e5c4
commit
2a14ae11e0
12 files changed
+335
-39
No files matched your search
@@ -139,6 +139,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.patrykmichalik.opto.core.PreferenceExtensionsKt;
|
||||
import app.flexera.home.FullScreenFolders;
|
||||
import app.lawnchair.preferences2.PreferenceManager2;
|
||||
import app.lawnchair.theme.color.ColorOption;
|
||||
import app.lawnchair.theme.color.tokens.ColorTokens;
|
||||
@@ -297,6 +298,14 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
||||
|
||||
private @NonNull GradientDrawable mBackground;
|
||||
|
||||
/**
|
||||
* Flexera Launcher: whether this folder is open full screen (app.flexera.home.FullScreenFolders):
|
||||
* no panel, its apps in the home screen's columns at the bottom of the screen, its name below
|
||||
* them. Decided each time it opens, and kept until it opens again, so that it closes as it
|
||||
* opened.
|
||||
*/
|
||||
private boolean mFullScreen;
|
||||
|
||||
PreferenceManager2 preferenceManager2;
|
||||
|
||||
/**
|
||||
@@ -533,6 +542,23 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
||||
return mInfo.container == ItemInfo.NO_ID;
|
||||
}
|
||||
|
||||
/** Flexera Launcher: see {@link #mFullScreen}. */
|
||||
public boolean isFullScreen() {
|
||||
return mFullScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flexera Launcher: sets up this folder, about to open, as a full-screen or a floating one.
|
||||
* Everything is set both ways, because a folder view lives on from one opening to the next.
|
||||
*/
|
||||
private void setFullScreen(boolean fullScreen) {
|
||||
mFullScreen = fullScreen;
|
||||
mContent.setFullScreen(fullScreen);
|
||||
// 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* LC: App drawer folders live in Lawnchair's own database and are not part of the
|
||||
* launcher model, so writing them through ModelWriter can collide with an unrelated
|
||||
@@ -845,6 +871,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
||||
Folder openFolder = getOpen(mActivityContext);
|
||||
closeOpenFolder(openFolder);
|
||||
|
||||
// Flexera Launcher: before the apps are bound, which style them for it.
|
||||
setFullScreen(mActivityContext instanceof Launcher && !isInAppDrawer()
|
||||
&& FullScreenFolders.isOn(getContext()));
|
||||
mContent.bindItems(items);
|
||||
mContent.setCanAnnouncePageDescriptionForFolder(true);
|
||||
centerAboutIcon();
|
||||
@@ -1398,13 +1427,23 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
||||
int centeredLeft = centerX - width / 2;
|
||||
int centeredTop = centerY - height / 2;
|
||||
|
||||
sTempRect.set(mActivityContext.getFolderBoundingBox());
|
||||
int left = Utilities.boundToRange(centeredLeft, sTempRect.left, sTempRect.right - width);
|
||||
int top = Utilities.boundToRange(centeredTop, sTempRect.top, sTempRect.bottom - height);
|
||||
int[] inOutPosition = new int[]{left, top};
|
||||
mActivityContext.updateOpenFolderPosition(inOutPosition, sTempRect, width, height);
|
||||
left = inOutPosition[0];
|
||||
top = inOutPosition[1];
|
||||
int left;
|
||||
int top;
|
||||
if (mFullScreen) {
|
||||
// Flexera Launcher: at the bottom of the screen, wherever the folder's icon is.
|
||||
int[] position = FullScreenFolders.position(
|
||||
parent, mActivityContext.getDeviceProfile(), width, height);
|
||||
left = position[0];
|
||||
top = position[1];
|
||||
} else {
|
||||
sTempRect.set(mActivityContext.getFolderBoundingBox());
|
||||
left = Utilities.boundToRange(centeredLeft, sTempRect.left, sTempRect.right - width);
|
||||
top = Utilities.boundToRange(centeredTop, sTempRect.top, sTempRect.bottom - height);
|
||||
int[] inOutPosition = new int[]{left, top};
|
||||
mActivityContext.updateOpenFolderPosition(inOutPosition, sTempRect, width, height);
|
||||
left = inOutPosition[0];
|
||||
top = inOutPosition[1];
|
||||
}
|
||||
|
||||
int folderPivotX = width / 2 + (centeredLeft - left);
|
||||
int folderPivotY = height / 2 + (centeredTop - top);
|
||||
|
||||
Reference in new issue
Block a user