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

+30 -2
View File
@@ -60,7 +60,22 @@
<string name="flexera_import_effect">What importing does</string>
<string name="flexera_import_effect_title">Replaces your current home screens</string>
<string name="flexera_import_effect_body">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.</string>
<!-- Left out: what sits where At a Glance goes while it is shown on the home screen -->
<string name="flexera_import_glance">In the top row of the first home screen</string>
<plurals name="flexera_import_glance_value">
<item quantity="one">%1$d. At a Glance takes this row. To keep it, switch off Show on home screen (Settings, At a Glance) before importing.</item>
<item quantity="other">%1$d. At a Glance takes this row. To keep them, switch off Show on home screen (Settings, At a Glance) before importing.</item>
</plurals>
<!-- Shown only when the import changes this setting -->
<string name="flexera_import_labels">Labels on the home screen</string>
<string name="flexera_import_labels_on">Switched on, as in the backup. This can be changed again in Settings.</string>
<string name="flexera_import_labels_off">Switched off, as in the backup. This can be changed again in Settings.</string>
<!-- Shown in place of what importing does when nothing in the backup can be placed -->
<string name="flexera_import_nothing_title">Nothing to import</string>
<string name="flexera_import_nothing_body">None of the items in this backup can be placed on the home screens here, so importing it would only empty yours.</string>
<string name="flexera_import_action">Import</string>
<!-- Shown on the Import button while the import runs -->
<string name="flexera_import_importing">Importing…</string>
<string name="flexera_import_done">Imported</string>
<string name="flexera_import_failed">The import failed</string>
<string name="flexera_import_unreadable">This is not a Smart Launcher backup that can be read</string>
@@ -69,7 +84,7 @@
<string name="flexera_about_share_qr_description">QR code that downloads the latest version</string>
<string name="flexera_about_privacy">Privacy</string>
<string name="flexera_about_privacy_title">What goes online</string>
<string name="flexera_about_privacy_body">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.</string>
<string name="flexera_about_privacy_body">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.</string>
<!-- Lawnchair's wording promised web results and grid settings that this app does not have -->
<string name="all_apps_device_search_hint">Search apps and more</string>
@@ -86,6 +101,8 @@
<!-- App drawer settings (app.flexera.ui.FlexeraDrawerSettings) -->
<string name="flexera_notification_previews">Notification previews</string>
<string name="flexera_notification_previews_description">Show an app\'s latest notification under its name in the app list. Works when notification dots are on (Settings, General).</string>
<!-- Read by screen readers for an app in the app list that shows its latest notification under its name. %1$s is the app's name with how many notifications it has, such as "Messages has 1 notification"; %2$s is the notification -->
<string name="flexera_notification_preview_description">%1$s. %2$s</string>
<string name="flexera_alphabet_heading">Alphabet</string>
<string name="flexera_alphabet_on_left">Alphabet on the left edge</string>
<string name="flexera_alphabet_on_left_description">For left-handed use. The letters normally sit on the right edge.</string>
@@ -108,6 +125,8 @@
<string name="flexera_quick_launch_description">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.</string>
<string name="flexera_quick_launch_first_page">Swipe past the first page</string>
<string name="flexera_quick_launch_last_page">Swipe past the last page</string>
<!-- Shown when a swipe past the first or the last page is to open an app that can no longer be opened. %1$s is the app's name -->
<string name="flexera_quick_launch_app_missing">%1$s isn\'t installed or is disabled</string>
<!-- The clock widget that comes with the launcher (app.flexera.widget) -->
<!-- Its name in the list of widgets -->
@@ -135,8 +154,13 @@
<string name="flexera_clock_widget_weather_search">Search</string>
<string name="flexera_clock_widget_weather_nothing">No place of that name was found</string>
<string name="flexera_clock_widget_weather_failed">The weather service could not be reached. Check the connection and try again.</string>
<!-- Shown above the places a search found, which are listed under it to pick from. %1$d is how many are listed: the weather service gives only the likeliest few, so a common name can have more -->
<plurals name="flexera_clock_widget_weather_found">
<item quantity="one">%1$d place of that name</item>
<item quantity="other">%1$d places of that name, the likeliest first</item>
</plurals>
<string name="flexera_clock_widget_weather_remove">Turn weather off</string>
<string name="flexera_clock_widget_weather_source">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.</string>
<string name="flexera_clock_widget_weather_source">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.</string>
<!-- The clock widget's weather line. %1$d is the temperature, %2$s a word for the sky, such as "Overcast" -->
<string name="flexera_weather_line">%1$d° · %2$s</string>
<string name="flexera_weather_clear">Clear</string>
@@ -193,11 +217,15 @@
<string name="flexera_update_download_size">%1$s download. The installation starts as soon as it\'s done.</string>
<string name="flexera_update_download_no_size">The installation starts as soon as the download is done.</string>
<string name="flexera_update_download_failed">The download didn\'t finish.</string>
<!-- Why a download failed, shown with the button that asks Android for local network access. %1$s is the update server's name, such as git.example.org -->
<string name="flexera_update_download_failed_local_network">%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.</string>
<string name="flexera_update_wrong_file">The downloaded file isn\'t a newer Flexera Launcher, so it was removed.</string>
<!-- %1$s is a version number such as 0.2.0 -->
<string name="flexera_update_downloading">Downloading version %1$s</string>
<!-- %1$d is a percentage from 0 to 100 -->
<string name="flexera_update_progress">%1$d%%. The installation starts as soon as it\'s done.</string>
<!-- Shown on the button while the download runs -->
<string name="flexera_update_downloading_button">Downloading…</string>
<!-- %1$s is a version number such as 0.2.0 -->
<string name="flexera_update_ready">Version %1$s is ready to install</string>
<!-- Button -->
@@ -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,
)
}
}
+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;