Compare commits

...
3 Commits
Author SHA1 Message Date
TMC 2cdb779dac Release 1.0.6 2026-11-18 13:12:01 +01:00
TMCandClaude Opus 5.5 be15483e34 Home screen margins: on the grid page, with its live preview
The side, top and bottom margins move from the Home screen settings to
the grid page, renamed "Grid and margins", under its preview of the
home screen. The preview shows the margins being chosen together with
the columns, rows and dock icons, and nothing changes on the home
screen until Apply.

The preview builds its own InvariantDeviceProfile from
PreviewOverrides, as it does for a foldable's dock icons; the overrides
now carry the three margins, the IDP keeps them for the device profiles
it makes (set before initGrid, which makes them), and DeviceProfile
uses them in place of the kept preferences. Apply writes them with the
grid. HomeScreenGridPreferences keeps a little more room for the
settings under the preview (0.46 of the height instead of 0.40), as its
own comment asks when preferences are added.

Tested on the emulator: the page shows the preview; 40, 48, 48 dp moved
the preview's columns in and rows down while the launcher still
reported 8 dp and 0; after Apply the home screen matched the preview;
8, 0, 0 and Apply restored it. The Home screen page lists "Grid and
margins" and no longer has the sliders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 12:57:28 +01:00
TMCandClaude Opus 5.5 0306c1d2ce Website: version 1.0.5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 12:43:19 +01:00
10 changed files with 80 additions and 24 deletions

No files matched your search

+1 -1
View File
@@ -280,7 +280,7 @@
<div class="install">
<div class="install__main">
<h2 id="install-title">Install Flexera</h2>
<p class="intro">Version <span data-version>1.0.4</span>, for Android 8.0 or newer. It’s free, and there are no ads in it.</p>
<p class="intro">Version <span data-version>1.0.5</span>, for Android 8.0 or newer. It’s free, and there are no ads in it.</p>
<div class="install__actions">
<a class="btn btn--lg" href="https://git.mariosem.es/msemes/Flexera-Launcher-Releases/releases/download/latest/FlexeraLauncher.apk" data-apk><svg class="btn__mark" aria-hidden="true"><use href="#b-android"/></svg>Download the APK</a>
<a class="link" href="https://git.mariosem.es/msemes/Flexera-Launcher-Releases/releases">Every release, with its notes</a>
+1 -1
View File
@@ -9,7 +9,7 @@
'use strict';
/** The version shown on the page. Change it here after a release. */
const VERSION = '1.0.4';
const VERSION = '1.0.5';
/* The phone is drawn at 390 x 844, one pixel per dp; the numbers below are the app's own. */
const W = 390, H = 844;
const STATUS_H = 40, NAV_H = 24;
+3
View File
@@ -122,9 +122,12 @@
<string name="flexera_full_screen_folders">Full screen folders</string>
<string name="flexera_full_screen_folders_description">Opens folders over the whole screen, with their apps at the bottom, within reach of your thumb</string>
<!-- Home screen settings, Layout: the space at the screen's sides, above the first row and below the last (app.flexera.home.HomeMargins) -->
<string name="flexera_home_margins">Margins</string>
<string name="flexera_home_side_margins">Side margins</string>
<string name="flexera_home_top_margin">Top margin</string>
<string name="flexera_home_bottom_margin">Bottom margin</string>
<!-- Lawnchair's "Home screen grid", the settings page with the preview, which has the margins as well since 1.0.6 -->
<string name="home_screen_grid">Grid and margins</string>
<string name="flexera_quick_launch">Quick launch</string>
<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>
+11 -9
View File
@@ -3,8 +3,7 @@ package app.flexera.home
import android.util.DisplayMetrics
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import app.lawnchair.preferences.getAdapter
import app.lawnchair.preferences2.preferenceManager2
import app.lawnchair.preferences.PreferenceAdapter
import app.lawnchair.ui.preferences.components.controls.SliderPreference
import com.android.launcher3.R
import com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR
@@ -12,7 +11,8 @@ import com.android.launcher3.testing.shared.ResourceUtils.pxFromDp
/**
* The home screen's margins: the space at its sides, above its first row and below its last,
* in dp, set under Settings, Home screen, Layout.
* in dp, set under Settings, Home screen, Grid and margins, where the preview shows them with the
* grid before they are kept (HomeScreenGridPreferences, through PreviewOverrides).
*
* They replace Lawnchair's Horizontal and Vertical padding, which scaled the grid's own margins
* by a percentage. On a phone those are 8 dp at the sides and nothing at the top or bottom, so
@@ -55,27 +55,29 @@ object HomeMargins {
fun topBottomPx(chosenDp: Int, metrics: DisplayMetrics): Int =
pxFromDp(chosenDp.coerceIn(0, MAX_TOP_BOTTOM_DP).toFloat(), metrics)
/** The three sliders, in place of Lawnchair's two (HomeScreenPreferences). */
/**
* The three sliders, on the grid page in place of Lawnchair's two padding sliders on the home
* screen page. They change [side], [top] and [bottom], which the grid page keeps on Apply.
*/
@Composable
fun Preferences() {
val prefs2 = preferenceManager2()
fun Preferences(side: PreferenceAdapter<Int>, top: PreferenceAdapter<Int>, bottom: PreferenceAdapter<Int>) {
SliderPreference(
label = stringResource(id = R.string.flexera_home_side_margins),
adapter = prefs2.homeSideMargin.getAdapter(),
adapter = side,
valueRange = 0..MAX_SIDE_DP,
step = 2,
showUnit = "dp",
)
SliderPreference(
label = stringResource(id = R.string.flexera_home_top_margin),
adapter = prefs2.homeTopMargin.getAdapter(),
adapter = top,
valueRange = 0..MAX_TOP_BOTTOM_DP,
step = 4,
showUnit = "dp",
)
SliderPreference(
label = stringResource(id = R.string.flexera_home_bottom_margin),
adapter = prefs2.homeBottomMargin.getAdapter(),
adapter = bottom,
valueRange = 0..MAX_TOP_BOTTOM_DP,
step = 4,
showUnit = "dp",
+1 -1
View File
@@ -2,4 +2,4 @@
# build.gradle reads this and derives the Android version code from it
# (major * 10000 + minor * 100 + patch), so the name and the code can never disagree.
# flexera/release.ps1 raises it for every release.
versionName=1.0.5
versionName=1.0.6
@@ -89,6 +89,11 @@ class DeviceProfileOverrides @Inject constructor(
/** Override for any other value that's not a DBGridInfo, extends this value when needed */
data class PreviewOverrides(
val foldableDatabaseHotseatIcons: Int? = null,
// Flexera Launcher: margins shown in a preview before they are kept
// (app.flexera.home.HomeMargins); read by DeviceProfile.
val homeSideMarginDp: Int? = null,
val homeTopMarginDp: Int? = null,
val homeBottomMarginDp: Int? = null,
)
data class Options(
@@ -35,6 +35,7 @@ import app.lawnchair.DeviceProfileOverrides
import app.lawnchair.preferences.asPreferenceAdapter
import app.lawnchair.preferences.getAdapter
import app.lawnchair.preferences.preferenceManager
import app.lawnchair.preferences2.preferenceManager2
import app.lawnchair.ui.preferences.LocalIsExpandedScreen
import app.lawnchair.ui.preferences.LocalNavController
import app.lawnchair.ui.preferences.components.GridOverridesPreview
@@ -78,6 +79,19 @@ fun HomeScreenGridPreferences(
mutableIntStateOf(originalHotseatColumnsUnfolded.coerceAtLeast(originalHotseatColumns))
}
// Flexera Launcher: the home screen's margins, shown in the preview and kept on Apply with
// the grid (app.flexera.home.HomeMargins).
val prefs2 = preferenceManager2()
val sideMarginAdapter = prefs2.homeSideMargin.getAdapter()
val topMarginAdapter = prefs2.homeTopMargin.getAdapter()
val bottomMarginAdapter = prefs2.homeBottomMargin.getAdapter()
val originalSideMargin = remember { sideMarginAdapter.state.value }
val originalTopMargin = remember { topMarginAdapter.state.value }
val originalBottomMargin = remember { bottomMarginAdapter.state.value }
val sideMargin = rememberSaveable { mutableIntStateOf(originalSideMargin) }
val topMargin = rememberSaveable { mutableIntStateOf(originalTopMargin) }
val bottomMargin = rememberSaveable { mutableIntStateOf(originalBottomMargin) }
LaunchedEffect(hotseatColumns.intValue) {
if (hotseatColumnsUnfolded.intValue < hotseatColumns.intValue) {
hotseatColumnsUnfolded.intValue = hotseatColumns.intValue
@@ -101,7 +115,8 @@ fun HomeScreenGridPreferences(
// This should be enough for 3 preferences, they can't scroll beyond this.
// Should you introduce another prefs, raise the value by a little so that they
// have an indication that you can scroll the entries.
isPortrait -> (maxHeight * 0.40f).coerceAtLeast(315.dp)
// Flexera Launcher: raised from 0.40 for the margins below the grid.
isPortrait -> (maxHeight * 0.46f).coerceAtLeast(315.dp)
// Landscape mode
else -> (maxHeight * 0.52f).coerceAtLeast(280.dp)
@@ -125,13 +140,12 @@ fun HomeScreenGridPreferences(
numHotseatColumns = hotseatColumns.intValue,
)
},
previewOverrides = if (isFoldable) {
DeviceProfileOverrides.PreviewOverrides(
foldableDatabaseHotseatIcons = hotseatColumnsUnfolded.intValue,
)
} else {
DeviceProfileOverrides.PreviewOverrides()
},
previewOverrides = DeviceProfileOverrides.PreviewOverrides(
foldableDatabaseHotseatIcons = if (isFoldable) hotseatColumnsUnfolded.intValue else null,
homeSideMarginDp = sideMargin.intValue,
homeTopMarginDp = topMargin.intValue,
homeBottomMarginDp = bottomMargin.intValue,
),
)
Column(
@@ -208,6 +222,14 @@ fun HomeScreenGridPreferences(
)
}
}
// Flexera Launcher: the margins, below the grid.
PreferenceGroup(heading = stringResource(id = R.string.flexera_home_margins)) {
app.flexera.home.HomeMargins.Preferences(
side = sideMargin.asPreferenceAdapter(),
top = topMargin.asPreferenceAdapter(),
bottom = bottomMargin.asPreferenceAdapter(),
)
}
}
val navController = LocalNavController.current
@@ -219,6 +241,10 @@ fun HomeScreenGridPreferences(
hotseatColumnsAdapter.onChange(hotseatColumns.intValue)
hotseatColumnsUnfoldedAdapter.onChange(hotseatColumnsUnfolded.intValue)
}
// Flexera Launcher: the margins, which reload the grid again once kept.
sideMarginAdapter.onChange(sideMargin.intValue)
topMarginAdapter.onChange(topMargin.intValue)
bottomMarginAdapter.onChange(bottomMargin.intValue)
InvariantDeviceProfile.INSTANCE.get(context).onPreferencesChanged(context)
navController.popBackStack()
}
@@ -226,7 +252,10 @@ fun HomeScreenGridPreferences(
val isChanged = columns.intValue != originalColumns ||
rows.intValue != originalRows ||
hotseatColumns.intValue != originalHotseatColumns ||
hotseatColumnsUnfolded.intValue != originalHotseatColumnsUnfolded
hotseatColumnsUnfolded.intValue != originalHotseatColumnsUnfolded ||
sideMargin.intValue != originalSideMargin ||
topMargin.intValue != originalTopMargin ||
bottomMargin.intValue != originalBottomMargin
Box(
modifier = Modifier
@@ -189,9 +189,9 @@ fun HomeScreenPreferences(
destination = HomeScreenGrid,
subtitle = stringResource(id = R.string.x_by_y, columns, rows),
)
// Flexera Launcher: margins in dp in place of Horizontal and Vertical padding, which
// scaled margins too small to see (app.flexera.home.HomeMargins).
app.flexera.home.HomeMargins.Preferences()
// Flexera Launcher: Horizontal and Vertical padding scaled margins too small to see.
// The margins in dp that replace them are on the grid page, with its preview
// (app.flexera.home.HomeMargins).
SwitchPreference(
adapter = lockHomeScreenAdapter,
label = stringResource(id = R.string.home_screen_lock),
@@ -383,6 +383,15 @@ public class DeviceProfile {
.firstCached(preferenceManager2.getHomeTopMargin());
homeBottomMarginDp = PreferenceCacheExtensionsKt
.firstCached(preferenceManager2.getHomeBottomMargin());
// Flexera Launcher: in a preview, the margins being chosen (HomeScreenGridPreferences).
app.lawnchair.DeviceProfileOverrides.PreviewOverrides preview = inv.flexeraPreviewOverrides;
if (preview != null) {
if (preview.getHomeSideMarginDp() != null) homeSideMarginDp = preview.getHomeSideMarginDp();
if (preview.getHomeTopMarginDp() != null) homeTopMarginDp = preview.getHomeTopMarginDp();
if (preview.getHomeBottomMarginDp() != null) {
homeBottomMarginDp = preview.getHomeBottomMarginDp();
}
}
widgetPaddingFactor = Utilities.boundToRange(PreferenceCacheExtensionsKt
.firstCached(preferenceManager2.getWidgetPaddingFactor()), 0f, 2f);
// Flexera Launcher: read with the grid, which the setting reloads when it changes.
@@ -353,9 +353,17 @@ public class InvariantDeviceProfile {
this.mDisplayController = DisplayController.INSTANCE.get(context.getApplicationContext());
this.mWMProxy = WindowManagerProxy.INSTANCE.get(context.getApplicationContext());
String gridName = DeviceProfileOverrides.INSTANCE.get(context).getGridName(dbGridInfo);
// Flexera Launcher: set before initGrid, which makes the device profiles that read it.
flexeraPreviewOverrides = previewOverrides;
initGrid(context, gridName, dbGridInfo, previewOverrides);
}
/**
* Flexera Launcher: what a preview shows in place of the kept preferences, such as margins
* not applied yet (app.flexera.home.HomeMargins); null outside a preview.
*/
public DeviceProfileOverrides.PreviewOverrides flexeraPreviewOverrides;
private String initGrid(Context context, String gridName) {
Info displayInfo = mDisplayController.getInfo();
List<DisplayOption> allOptions = getPredefinedDeviceProfiles(