diff --git a/flexera/res/values/flexera_strings.xml b/flexera/res/values/flexera_strings.xml
index cfd4058e36..e05ff207bc 100644
--- a/flexera/res/values/flexera_strings.xml
+++ b/flexera/res/values/flexera_strings.xml
@@ -60,7 +60,22 @@
What importing does
Replaces your current home screens
The home screens you have now are removed. The grid takes the size it has in the backup and the dock is switched off, because Smart Launcher has none; both can be changed again in Settings. Icons of apps that are not installed on this phone are dropped. Make a backup first if you want to be able to go back.
+
+ In the top row of the first home screen
+
+ - %1$d. At a Glance takes this row. To keep it, switch off Show on home screen (Settings, At a Glance) before importing.
+ - %1$d. At a Glance takes this row. To keep them, switch off Show on home screen (Settings, At a Glance) before importing.
+
+
+ Labels on the home screen
+ Switched on, as in the backup. This can be changed again in Settings.
+ Switched off, as in the backup. This can be changed again in Settings.
+
+ Nothing to import
+ None of the items in this backup can be placed on the home screens here, so importing it would only empty yours.
Import
+
+ Importing…
Imported
The import failed
This is not a Smart Launcher backup that can be read
@@ -69,7 +84,7 @@
QR code that downloads the latest version
Privacy
What goes online
- Flexera Launcher goes online for two things. It asks its release page whether a newer version exists, about once a day, and downloads that version when you ask. And if you pick a place for the weather on a clock widget, it asks Open-Meteo, a weather service, for the weather there; that place is all it sends. Nothing else about you, your apps or your phone leaves it.
+ Flexera Launcher goes online for two things. It asks its release page whether a newer version exists, about once a day, and downloads that version when you ask. And if you pick a place for the weather on a clock widget, it asks Open-Meteo, a weather service, for the weather there. Looking a place up sends the name you type and your phone\'s language; asking for its weather sends the place, to about a kilometre, and whether you use Celsius or Fahrenheit. Nothing else about you, your apps or your phone leaves it.
Search apps and more
@@ -86,6 +101,8 @@
Notification previews
Show an app\'s latest notification under its name in the app list. Works when notification dots are on (Settings, General).
+
+ %1$s. %2$s
Alphabet
Alphabet on the left edge
For left-handed use. The letters normally sit on the right edge.
@@ -108,6 +125,8 @@
Swipe on from the first or the last home screen page, as if there were one more, to open an app or do something else. Has no effect while Infinite scrolling is on.
Swipe past the first page
Swipe past the last page
+
+ %1$s isn\'t installed or is disabled
@@ -135,8 +154,13 @@
Search
No place of that name was found
The weather service could not be reached. Check the connection and try again.
+
+
+ - %1$d place of that name
+ - %1$d places of that name, the likeliest first
+
Turn weather off
- Weather data by Open-Meteo.com. The launcher asks it about the place you pick, about once an hour while the clock is in view, and sends nothing else.
+ Weather data by Open-Meteo.com. A search sends it the name you type and your phone\'s language. Then the launcher asks it about the place you pick, in Celsius or Fahrenheit as your phone is set, about once an hour while the clock is in view. Nothing else is sent.
%1$d° · %2$s
Clear
@@ -193,11 +217,15 @@
%1$s download. The installation starts as soon as it\'s done.
The installation starts as soon as the download is done.
The download didn\'t finish.
+
+ %1$s is on the same network as this phone, and Android lets an app reach devices there only with your permission, which it calls Nearby devices. Once you allow it, the download starts again.
The downloaded file isn\'t a newer Flexera Launcher, so it was removed.
Downloading version %1$s
%1$d%%. The installation starts as soon as it\'s done.
+
+ Downloading…
Version %1$s is ready to install
diff --git a/flexera/src/app/flexera/home/FullScreenFolders.kt b/flexera/src/app/flexera/home/FullScreenFolders.kt
index acee27c847..9ccd65400d 100644
--- a/flexera/src/app/flexera/home/FullScreenFolders.kt
+++ b/flexera/src/app/flexera/home/FullScreenFolders.kt
@@ -8,11 +8,14 @@ import android.widget.TextView
import app.flexera.drawer.FlexeraDrawer
import app.lawnchair.preferences2.PreferenceManager2
import app.lawnchair.preferences2.firstCached
+import app.lawnchair.theme.color.tokens.ColorTokens
import com.android.launcher3.CellLayout
import com.android.launcher3.DeviceProfile
import com.android.launcher3.Launcher
import com.android.launcher3.R
import com.android.launcher3.Utilities
+import com.android.launcher3.pageindicators.PageIndicatorDots
+import com.android.launcher3.util.SystemUiController
import com.android.launcher3.util.Themes
import kotlin.math.max
import kotlin.math.roundToInt
@@ -20,23 +23,31 @@ import kotlin.math.roundToInt
/**
* Full-screen folders: a folder on the home screen or in the dock opens over the whole screen
* instead of as a floating panel. There is no panel. The home screen behind is blurred and
- * darkened as behind the app drawer ([FolderBlur], [dim]), and the folder's apps sit at the
- * bottom of the screen, within the thumb's reach, with the folder's name below them. They are
- * laid out like the home screen's icons: in its columns, in cells of the same size
- * ([cellSize], [com.android.launcher3.folder.FolderGridOrganizer.createFullScreenFolderGridOrganizer]).
+ * darkened as behind the app drawer ([FolderBlur], [dim]), with light status bar icons over it
+ * ([setLightBarIcons]), and the folder's apps sit at the bottom of the screen, within the
+ * thumb's reach, with the folder's name below them. They are laid out like the home screen's
+ * icons: in its columns, in cells of the same size
+ * ([cellSize], [com.android.launcher3.folder.FolderGridOrganizer.createFullScreenFolderGridOrganizer]),
+ * in no more rows than fit on the screen ([maxHeight]).
* Where the folder's icon is makes no difference to where its apps appear.
*
- * The folder view itself ([com.android.launcher3.folder.Folder]) is still only as large as its
- * apps and its name; the rest of the screen is the darkened home screen. So a tap there closes
- * the folder, as a tap beside a floating folder does, and an app dragged out of the folder leaves
- * it as before. Folders in the app list are left as they were.
+ * What is seen of the folder is its apps, its name and its page dots; everywhere else is the
+ * darkened home screen. So a tap anywhere else closes the folder, as a tap beside a floating
+ * folder does, also within the folder view ([com.android.launcher3.folder.Folder]), which is as
+ * wide as the home screen's grid: beside a short last row, or beside the name. A swipe on the
+ * grid still turns its pages. An app dragged out of the folder leaves it as before. A folder
+ * that a drag opens, to take an app, floats around its icon as before, so that it opens under
+ * the finger. Folders in the app list are left as they were.
*/
object FullScreenFolders {
/** Space between the folder's name, under its apps, and the navigation bar. */
private const val BOTTOM_MARGIN_DP = 16f
- /** Space kept free below the status bar, should a folder be taller than the screen allows. */
+ /**
+ * Space kept free below the status bar. A folder has no more rows than fit below it
+ * ([maxHeight]); its other apps go to its next pages.
+ */
private const val TOP_MARGIN_DP = 8f
/** The folder name's hint ("Unnamed folder") while it is being edited. */
@@ -89,16 +100,32 @@ object FullScreenFolders {
@JvmStatic
fun position(dragLayer: View, dp: DeviceProfile, width: Int, height: Int): IntArray {
val insets = dp.insets
- val density = dragLayer.resources.displayMetrics.density
val screenWidth = if (dragLayer.width > 0) dragLayer.width else dp.deviceProperties.widthPx
+ val left = insets.left + (screenWidth - insets.left - insets.right - width) / 2
+ return intArrayOf(left, max(highest(dragLayer, dp), bottom(dragLayer, dp) - height))
+ }
+
+ /**
+ * How tall a full-screen folder can be, its name included: from just below the status bar
+ * to its place above the navigation bar ([position]). Its grid has no more rows than fit in
+ * that, so that none is cut off.
+ */
+ @JvmStatic
+ fun maxHeight(dragLayer: View, dp: DeviceProfile): Int =
+ max(0, bottom(dragLayer, dp) - highest(dragLayer, dp))
+
+ /** Where a full-screen folder's bottom is in [dragLayer]: just above the navigation bar. */
+ private fun bottom(dragLayer: View, dp: DeviceProfile): Int {
val screenHeight =
if (dragLayer.height > 0) dragLayer.height else dp.deviceProperties.heightPx
- val left = insets.left + (screenWidth - insets.left - insets.right - width) / 2
- val bottom = screenHeight - insets.bottom - (BOTTOM_MARGIN_DP * density).roundToInt()
- val highest = insets.top + (TOP_MARGIN_DP * density).roundToInt()
- return intArrayOf(left, max(highest, bottom - height))
+ val margin = BOTTOM_MARGIN_DP * dragLayer.resources.displayMetrics.density
+ return screenHeight - dp.insets.bottom - margin.roundToInt()
}
+ /** The highest a full-screen folder's top goes in [dragLayer]: just below the status bar. */
+ private fun highest(dragLayer: View, dp: DeviceProfile): Int =
+ dp.insets.top + (TOP_MARGIN_DP * dragLayer.resources.displayMetrics.density).roundToInt()
+
/**
* How dark the home screen behind a full-screen folder gets (black, 0 to 1): as dark as
* behind the app drawer ([FlexeraDrawer.BACKDROP_COLOR]), whatever the theme and the
@@ -135,4 +162,29 @@ object FullScreenFolders {
name.setHintTextColor(Themes.getAttrColor(context, R.attr.folderHintTextColor))
}
}
+
+ /**
+ * Colours the folder's page dots for its style: white over the dimmed home screen, where the
+ * accent colour chosen for the panel all but disappears, or that colour on a floating panel.
+ */
+ @JvmStatic
+ fun stylePageIndicator(dots: PageIndicatorDots, fullScreen: Boolean) {
+ val panelColor = ColorTokens.pageIndicatorDotColor.resolveColor(dots.context)
+ dots.setPaintColor(if (fullScreen) Color.WHITE else panelColor)
+ }
+
+ /**
+ * Makes the status bar's and the navigation bar's icons light while a full-screen folder is
+ * open ([open]), as over the app drawer: its backdrop is dark whatever the wallpaper, and
+ * the home screen's icons would be dark over a light one. A floating folder leaves them to
+ * the home screen, as do all folders once closed.
+ */
+ @JvmStatic
+ fun setLightBarIcons(launcher: Launcher?, open: Boolean) {
+ val darkBars = SystemUiController.FLAG_DARK_STATUS or SystemUiController.FLAG_DARK_NAV
+ launcher?.systemUiController?.updateUiState(
+ SystemUiController.UI_STATE_FULL_SCREEN_FOLDER,
+ if (open) darkBars else 0,
+ )
+ }
}
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 301c7f002a..b31b06bc67 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -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 items, int pageNo) {
+ private void animateOpen(List 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 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.
diff --git a/src/com/android/launcher3/folder/FolderGridOrganizer.java b/src/com/android/launcher3/folder/FolderGridOrganizer.java
index 545b413616..df43ae2a62 100644
--- a/src/com/android/launcher3/folder/FolderGridOrganizer.java
+++ b/src/com/android/launcher3/folder/FolderGridOrganizer.java
@@ -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} & {@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));
diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java
index c7b10ab0a6..d7daf4aeb8 100644
--- a/src/com/android/launcher3/folder/FolderPagedView.java
+++ b/src/com/android/launcher3/folder/FolderPagedView.java
@@ -130,6 +130,7 @@ public class FolderPagedView extends PagedView 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 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;
+ }
}
/**
diff --git a/src/com/android/launcher3/folder/FolderScrimAnimationListener.kt b/src/com/android/launcher3/folder/FolderScrimAnimationListener.kt
index 5f73563297..8f6afa66c4 100644
--- a/src/com/android/launcher3/folder/FolderScrimAnimationListener.kt
+++ b/src/com/android/launcher3/folder/FolderScrimAnimationListener.kt
@@ -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)
}
}
diff --git a/src/com/android/launcher3/util/SystemUiController.java b/src/com/android/launcher3/util/SystemUiController.java
index 9fa6ce8b4a..6632841a86 100644
--- a/src/com/android/launcher3/util/SystemUiController.java
+++ b/src/com/android/launcher3/util/SystemUiController.java
@@ -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;