Drop non-quickstep versions

This commit is contained in:
Suphon Thanakornpakapong
2021-06-03 23:36:42 +07:00
parent 1d79fec07e
commit 8f9f9677ac
3 changed files with 3 additions and 76 deletions

View File

@@ -46,7 +46,7 @@
attributes and intent filters the same
-->
<activity
android:name="app.lawnchair.LawnchairLauncher"
android:name="com.android.launcher3.Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"

View File

@@ -1,67 +0,0 @@
/*
* Copyright 2021, Lawnchair
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package app.lawnchair
import android.content.Context
import android.content.ContextWrapper
import com.android.launcher3.Launcher
import com.android.systemui.plugins.shared.LauncherOverlayManager
import app.lawnchair.nexuslauncher.OverlayCallbackImpl
import app.lawnchair.util.restartLauncher
import com.android.launcher3.LauncherAppState
open class LawnchairLauncher : Launcher() {
private var paused = false
override fun onResume() {
super.onResume()
restartIfPending()
paused = false
}
override fun onPause() {
super.onPause()
paused = true
}
open fun restartIfPending() {
if (sRestart) {
lawnchairApp.restart(false)
}
}
fun scheduleRestart() {
if (paused) {
sRestart = true
} else {
restartLauncher(this)
}
}
companion object {
var sRestart = false
@JvmStatic
fun getLauncher(context: Context): LawnchairLauncher {
return context as? LawnchairLauncher
?: (context as ContextWrapper).baseContext as? LawnchairLauncher
?: LauncherAppState.getInstance(context).launcher as LawnchairLauncher
}
}
}

View File

@@ -19,10 +19,8 @@ package app.lawnchair.util.preferences
import android.content.Context
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import app.lawnchair.LawnchairLauncher
import app.lawnchair.LawnchairLauncherQuickstep
import app.lawnchair.nexuslauncher.OverlayCallbackImpl
import com.android.launcher3.BuildConfig
import com.android.launcher3.LauncherAppState
import com.android.launcher3.states.RotationHelper
import com.android.launcher3.util.MainThreadInitializedObject
@@ -34,12 +32,8 @@ class PreferenceManager private constructor(context: Context) : BasePreferenceMa
model.forceReload()
}
private val scheduleRestart = {
if (BuildConfig.FLAVOR_recents == "withQuickstep") {
LawnchairLauncherQuickstep.instance?.scheduleRestart()
Unit
} else {
LawnchairLauncher.getLauncher(context).scheduleRestart()
}
LawnchairLauncherQuickstep.instance?.scheduleRestart()
Unit
}
private val reloadGrid = scheduleRestart