Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06e90a1479 | ||
|
|
ec5b36c482 | ||
|
|
f0b728199a |
No files matched your search
+1
-1
@@ -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.3</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.4</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
@@ -9,7 +9,7 @@
|
||||
'use strict';
|
||||
|
||||
/** The version shown on the page. Change it here after a release. */
|
||||
const VERSION = '1.0.3';
|
||||
const VERSION = '1.0.4';
|
||||
/* 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;
|
||||
|
||||
@@ -121,6 +121,10 @@
|
||||
<!-- Folder settings: folders open over the whole screen, apps at the bottom (app.flexera.home.FullScreenFolders) -->
|
||||
<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_side_margins">Side margins</string>
|
||||
<string name="flexera_home_top_margin">Top margin</string>
|
||||
<string name="flexera_home_bottom_margin">Bottom margin</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>
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
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.ui.preferences.components.controls.SliderPreference
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR
|
||||
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.
|
||||
*
|
||||
* 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
|
||||
* the sides moved by a few dp over the whole slider and the top and bottom not at all, and it
|
||||
* looked as if the settings did nothing.
|
||||
*
|
||||
* The rows and columns share what room the margins leave, so larger margins also bring the
|
||||
* icons closer together; that is how the spacing between icons is set. Rows that become too
|
||||
* short for their icons get smaller icons, as Launcher3 does by itself (DeviceProfile
|
||||
* .updateAvailableDimensions). Columns get no such help, so the side margins are kept narrow
|
||||
* enough that every column stays wider than what is seen of its icon ([sidePx]).
|
||||
*/
|
||||
object HomeMargins {
|
||||
|
||||
/** The side margins of a new install: the grid's own on a phone (dynamic_grid_left_right_margin). */
|
||||
const val DEFAULT_SIDE_DP = 8
|
||||
|
||||
private const val MAX_SIDE_DP = 48
|
||||
private const val MAX_TOP_BOTTOM_DP = 120
|
||||
|
||||
/** The least room a column keeps beside what is seen of its icon. */
|
||||
private const val MIN_COLUMN_GAP_DP = 4f
|
||||
|
||||
/**
|
||||
* The side margin, in pixels, for a grid of [columns] columns across [availableWidthPx] with
|
||||
* icons [iconSizeDp] in size: the owner's [chosenDp], or less where that would make a column
|
||||
* narrower than its icon.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun sidePx(chosenDp: Int, metrics: DisplayMetrics, availableWidthPx: Int, columns: Int, iconSizeDp: Float): Int {
|
||||
val chosen = pxFromDp(chosenDp.coerceIn(0, MAX_SIDE_DP).toFloat(), metrics)
|
||||
val column = pxFromDp(iconSizeDp, metrics) * ICON_VISIBLE_AREA_FACTOR +
|
||||
pxFromDp(MIN_COLUMN_GAP_DP, metrics)
|
||||
val most = ((availableWidthPx - columns.coerceAtLeast(1) * column) / 2f).toInt()
|
||||
return chosen.coerceAtMost(most).coerceAtLeast(0)
|
||||
}
|
||||
|
||||
/** A top or bottom margin of [chosenDp], in pixels. */
|
||||
@JvmStatic
|
||||
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). */
|
||||
@Composable
|
||||
fun Preferences() {
|
||||
val prefs2 = preferenceManager2()
|
||||
SliderPreference(
|
||||
label = stringResource(id = R.string.flexera_home_side_margins),
|
||||
adapter = prefs2.homeSideMargin.getAdapter(),
|
||||
valueRange = 0..MAX_SIDE_DP,
|
||||
step = 2,
|
||||
showUnit = "dp",
|
||||
)
|
||||
SliderPreference(
|
||||
label = stringResource(id = R.string.flexera_home_top_margin),
|
||||
adapter = prefs2.homeTopMargin.getAdapter(),
|
||||
valueRange = 0..MAX_TOP_BOTTOM_DP,
|
||||
step = 4,
|
||||
showUnit = "dp",
|
||||
)
|
||||
SliderPreference(
|
||||
label = stringResource(id = R.string.flexera_home_bottom_margin),
|
||||
adapter = prefs2.homeBottomMargin.getAdapter(),
|
||||
valueRange = 0..MAX_TOP_BOTTOM_DP,
|
||||
step = 4,
|
||||
showUnit = "dp",
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -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.4
|
||||
versionName=1.0.5
|
||||
@@ -895,6 +895,24 @@ class PreferenceManager2 @Inject constructor(
|
||||
onSet = { reloadHelper.reloadGrid() },
|
||||
)
|
||||
|
||||
// Flexera Launcher: the home screen's margins in dp, in place of the padding factors
|
||||
// workspacePaddingHorizontalFactor and workspacePaddingVerticalFactor (app.flexera.home.HomeMargins).
|
||||
val homeSideMargin = preference(
|
||||
key = intPreferencesKey(name = "flexera_home_side_margin"),
|
||||
defaultValue = app.flexera.home.HomeMargins.DEFAULT_SIDE_DP,
|
||||
onSet = { reloadHelper.reloadGrid() },
|
||||
)
|
||||
val homeTopMargin = preference(
|
||||
key = intPreferencesKey(name = "flexera_home_top_margin"),
|
||||
defaultValue = 0,
|
||||
onSet = { reloadHelper.reloadGrid() },
|
||||
)
|
||||
val homeBottomMargin = preference(
|
||||
key = intPreferencesKey(name = "flexera_home_bottom_margin"),
|
||||
defaultValue = 0,
|
||||
onSet = { reloadHelper.reloadGrid() },
|
||||
)
|
||||
|
||||
// Flexera Launcher: whether the home screen behind an open folder is blurred
|
||||
// (app.flexera.home.FolderBlur). Read when a folder opens, so nothing has to be reloaded.
|
||||
val folderBlur = preference(
|
||||
|
||||
@@ -189,20 +189,9 @@ fun HomeScreenPreferences(
|
||||
destination = HomeScreenGrid,
|
||||
subtitle = stringResource(id = R.string.x_by_y, columns, rows),
|
||||
)
|
||||
SliderPreference(
|
||||
label = stringResource(id = R.string.horizontal_padding_label),
|
||||
adapter = prefs2.workspacePaddingHorizontalFactor.getAdapter(),
|
||||
step = 0.05f,
|
||||
valueRange = 0F..2F,
|
||||
showAsPercentage = true,
|
||||
)
|
||||
SliderPreference(
|
||||
label = stringResource(id = R.string.vertical_padding_label),
|
||||
adapter = prefs2.workspacePaddingVerticalFactor.getAdapter(),
|
||||
step = 0.05f,
|
||||
valueRange = 0F..2F,
|
||||
showAsPercentage = true,
|
||||
)
|
||||
// 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()
|
||||
SwitchPreference(
|
||||
adapter = lockHomeScreenAdapter,
|
||||
label = stringResource(id = R.string.home_screen_lock),
|
||||
|
||||
@@ -348,6 +348,10 @@ public class DeviceProfile {
|
||||
private float allAppsCellHeightMultiplier;
|
||||
private float workspacePaddingHorizontalFactor;
|
||||
private float workspacePaddingVerticalFactor;
|
||||
// Flexera Launcher: the home screen's margins in dp (app.flexera.home.HomeMargins).
|
||||
private int homeSideMarginDp;
|
||||
private int homeTopMarginDp;
|
||||
private int homeBottomMarginDp;
|
||||
private float widgetPaddingFactor;
|
||||
// Flexera Launcher: widgets lined up with the icons (app.flexera.widget.FlexeraWidgets).
|
||||
public boolean alignWidgetsWithIcons;
|
||||
@@ -369,10 +373,16 @@ public class DeviceProfile {
|
||||
.firstCached(preferenceManager2.getDrawerCellHeightFactor());
|
||||
// Lawnchair: clamp the user padding factors to their slider ranges so a restored or
|
||||
// manually edited preference can't feed out-of-range values into the layout math.
|
||||
workspacePaddingHorizontalFactor = Utilities.boundToRange(PreferenceCacheExtensionsKt
|
||||
.firstCached(preferenceManager2.getWorkspacePaddingHorizontalFactor()), 0f, 2f);
|
||||
workspacePaddingVerticalFactor = Utilities.boundToRange(PreferenceCacheExtensionsKt
|
||||
.firstCached(preferenceManager2.getWorkspacePaddingVerticalFactor()), 0f, 2f);
|
||||
// Flexera Launcher: margins in dp take the place of these factors, which scaled margins
|
||||
// of 8 dp and nothing and so seemed to do nothing (app.flexera.home.HomeMargins).
|
||||
workspacePaddingHorizontalFactor = 1f;
|
||||
workspacePaddingVerticalFactor = 1f;
|
||||
homeSideMarginDp = PreferenceCacheExtensionsKt
|
||||
.firstCached(preferenceManager2.getHomeSideMargin());
|
||||
homeTopMarginDp = PreferenceCacheExtensionsKt
|
||||
.firstCached(preferenceManager2.getHomeTopMargin());
|
||||
homeBottomMarginDp = PreferenceCacheExtensionsKt
|
||||
.firstCached(preferenceManager2.getHomeBottomMargin());
|
||||
widgetPaddingFactor = Utilities.boundToRange(PreferenceCacheExtensionsKt
|
||||
.firstCached(preferenceManager2.getWidgetPaddingFactor()), 0f, 2f);
|
||||
// Flexera Launcher: read with the grid, which the setting reloads when it changes.
|
||||
@@ -677,6 +687,13 @@ public class DeviceProfile {
|
||||
// width and get centered, leaving a visible side gap even at factor 0.
|
||||
desiredWorkspaceHorizontalMarginPx =
|
||||
Math.round(desiredWorkspaceHorizontalMarginPx * workspacePaddingHorizontalFactor);
|
||||
// Flexera Launcher: the owner's side margins (app.flexera.home.HomeMargins), except
|
||||
// beside a landscape phone's side bar, where the grid keeps none.
|
||||
if (!isVerticalBarLayout()) {
|
||||
desiredWorkspaceHorizontalMarginPx = app.flexera.home.HomeMargins.sidePx(
|
||||
homeSideMarginDp, mMetrics, mDeviceProperties.getAvailableWidthPx(),
|
||||
inv.numColumns, inv.iconSize[mTypeIndex]);
|
||||
}
|
||||
desiredWorkspaceHorizontalMarginOriginalPx = desiredWorkspaceHorizontalMarginPx;
|
||||
|
||||
splitPlaceholderInset = res.getDimensionPixelSize(R.dimen.split_placeholder_inset);
|
||||
@@ -1801,6 +1818,9 @@ public class DeviceProfile {
|
||||
int bottomHotseatReserve = Math.min(hotseatBarSizePx, paddingBottom);
|
||||
paddingBottom = bottomHotseatReserve
|
||||
+ Math.round((paddingBottom - bottomHotseatReserve) * workspacePaddingVerticalFactor);
|
||||
// Flexera Launcher: the owner's top and bottom margins (app.flexera.home.HomeMargins).
|
||||
paddingTop += app.flexera.home.HomeMargins.topBottomPx(homeTopMarginDp, mMetrics);
|
||||
paddingBottom += app.flexera.home.HomeMargins.topBottomPx(homeBottomMarginDp, mMetrics);
|
||||
|
||||
padding.set(paddingLeft, paddingTop, paddingRight, paddingBottom);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user