mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Dynamic enable/disable GestureNavContract (#3791)
* Add toggleable separete recent activities * Fix styling * Apply suggestions changes by @SuperDragonXD * Simplify and make it clean suggestion by @suphon-t - Remove toggle - Dynamically disable if user used Quickswitch * remove unused config
This commit is contained in:
@@ -60,7 +60,9 @@ import app.lawnchair.theme.ThemeProvider
|
||||
import app.lawnchair.ui.popup.LawnchairShortcut
|
||||
import app.lawnchair.util.getThemedIconPacksInstalled
|
||||
import app.lawnchair.util.unsafeLazy
|
||||
import com.android.launcher3.AbstractFloatingView
|
||||
import com.android.launcher3.BaseActivity
|
||||
import com.android.launcher3.GestureNavContract
|
||||
import com.android.launcher3.LauncherAppState
|
||||
import com.android.launcher3.LauncherRootView
|
||||
import com.android.launcher3.LauncherState
|
||||
@@ -74,6 +76,7 @@ import com.android.launcher3.uioverrides.states.OverviewState
|
||||
import com.android.launcher3.util.SystemUiController.UI_STATE_BASE_WINDOW
|
||||
import com.android.launcher3.util.Themes
|
||||
import com.android.launcher3.util.TouchController
|
||||
import com.android.launcher3.views.FloatingSurfaceView
|
||||
import com.android.launcher3.widget.LauncherWidgetHolder
|
||||
import com.android.launcher3.widget.RoundedCornerEnforcement
|
||||
import com.android.systemui.plugins.shared.LauncherOverlayManager
|
||||
@@ -307,6 +310,20 @@ class LawnchairLauncher :
|
||||
}
|
||||
}
|
||||
|
||||
override fun handleGestureContract(intent: Intent?) {
|
||||
if (!LawnchairApp.isRecentsEnabled) {
|
||||
val gnc = GestureNavContract.fromIntent(intent)
|
||||
if (gnc != null) {
|
||||
AbstractFloatingView.closeOpenViews(
|
||||
this,
|
||||
false,
|
||||
AbstractFloatingView.TYPE_ICON_SURFACE,
|
||||
)
|
||||
FloatingSurfaceView.show(this, gnc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun createAppWidgetHolder(): LauncherWidgetHolder {
|
||||
val factory = LauncherWidgetHolder.HolderFactory.newFactory(this) as LawnchairWidgetHolder.LawnchairHolderFactory
|
||||
return factory.newInstance(
|
||||
|
||||
Reference in New Issue
Block a user