mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Move icon swipe gestures to experimental features
Fixes #5297 Closes #5451
This commit is contained in:
@@ -792,4 +792,6 @@
|
||||
<string name="allapps_use_web_suggestion_icon_label">Show web suggestion provider icon in search bar</string>
|
||||
<string name="allapps_match_qsb_style_label">Match dock search bar actions</string>
|
||||
<string name="allapps_match_qsb_style_description">Clicking the dock search bar will now open the app drawer search UI</string>
|
||||
<string name="icon_swipe_gestures">Icon swipe gestures</string>
|
||||
<string name="icon_swipe_gestures_description">Perform acttions when swiping left or right on icons instead of moving the home screen</string>
|
||||
</resources>
|
||||
|
||||
@@ -172,7 +172,7 @@ fun CustomizeAppDialog(
|
||||
)
|
||||
}
|
||||
|
||||
if (context.launcher.stateManager.state != LauncherState.ALL_APPS) {
|
||||
if (preferenceManager2.iconSwipeGestures.asState().value && context.launcher.stateManager.state != LauncherState.ALL_APPS) {
|
||||
PreferenceGroup(heading = stringResource(R.string.gestures_label)) {
|
||||
listOf(
|
||||
GestureType.SWIPE_LEFT,
|
||||
|
||||
@@ -670,6 +670,11 @@ class PreferenceManager2 private constructor(private val context: Context) :
|
||||
onSet = { reloadHelper.reloadGrid() },
|
||||
)
|
||||
|
||||
val iconSwipeGestures = preference(
|
||||
key = booleanPreferencesKey(name = "icon_swipe_gestures"),
|
||||
defaultValue = false,
|
||||
)
|
||||
|
||||
val doubleTapGestureHandler = serializablePreference<GestureHandlerConfig>(
|
||||
key = stringPreferencesKey("double_tap_gesture_handler"),
|
||||
defaultValue = GestureHandlerConfig.Sleep,
|
||||
|
||||
@@ -46,6 +46,11 @@ fun ExperimentalFeaturesPreferences(
|
||||
label = stringResource(id = R.string.always_reload_icons_label),
|
||||
description = stringResource(id = R.string.always_reload_icons_description),
|
||||
)
|
||||
SwitchPreference(
|
||||
adapter = prefs2.iconSwipeGestures.getAdapter(),
|
||||
label = stringResource(R.string.icon_swipe_gestures),
|
||||
description = stringResource(R.string.icon_swipe_gestures_description),
|
||||
)
|
||||
|
||||
val enableWallpaperBlur = prefs.enableWallpaperBlur.getAdapter()
|
||||
|
||||
|
||||
@@ -1208,7 +1208,9 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
View touchedView = findViewAtPosition(ev.getX(), ev.getY());
|
||||
if (touchedView instanceof ShortcutAndWidgetContainer container) {
|
||||
Boolean iconSwipeGestures = PreferenceExtensionsKt.firstBlocking(mPreferenceManager2.getIconSwipeGestures());
|
||||
|
||||
if (iconSwipeGestures && touchedView instanceof ShortcutAndWidgetContainer container) {
|
||||
container.onTouchEvent(ev);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user