Revert "Bring back widget open/closing transition"
This reverts commit 8b3be3640d.
reason : causing issue below U
This commit is contained in:
@@ -74,7 +74,6 @@ import com.android.launcher3.Utilities
|
||||
import com.android.launcher3.model.data.ItemInfo
|
||||
import com.android.launcher3.popup.SystemShortcut
|
||||
import com.android.launcher3.statemanager.StateManager
|
||||
import com.android.launcher3.uioverrides.QuickstepInteractionHandler
|
||||
import com.android.launcher3.uioverrides.QuickstepLauncher
|
||||
import com.android.launcher3.uioverrides.states.OverviewState
|
||||
import com.android.launcher3.util.ActivityOptionsWrapper
|
||||
@@ -338,24 +337,12 @@ class LawnchairLauncher :
|
||||
|
||||
override fun createAppWidgetHolder(): LauncherWidgetHolder {
|
||||
val factory = LauncherWidgetHolder.HolderFactory.newFactory(this) as LawnchairWidgetHolder.LawnchairHolderFactory
|
||||
return try {
|
||||
factory.newInstance(
|
||||
this,
|
||||
{ appWidgetId: Int ->
|
||||
workspace.removeWidget(
|
||||
appWidgetId,
|
||||
)
|
||||
},
|
||||
QuickstepInteractionHandler(this),
|
||||
return factory.newInstance(
|
||||
this,
|
||||
) { appWidgetId: Int ->
|
||||
workspace.removeWidget(
|
||||
appWidgetId,
|
||||
)
|
||||
} catch (t: Throwable) {
|
||||
LauncherWidgetHolder.HolderFactory.newFactory(this).newInstance(
|
||||
this,
|
||||
) { appWidgetId: Int ->
|
||||
workspace.removeWidget(
|
||||
appWidgetId,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,21 +4,27 @@ import android.appwidget.AppWidgetHost
|
||||
import android.content.Context
|
||||
import android.widget.RemoteViews
|
||||
import com.android.internal.annotations.Keep
|
||||
import com.android.launcher3.uioverrides.QuickstepWidgetHolder
|
||||
import com.android.launcher3.config.FeatureFlags
|
||||
import com.android.launcher3.widget.LauncherWidgetHolder
|
||||
import java.util.function.IntConsumer
|
||||
|
||||
class LawnchairWidgetHolder(
|
||||
context: Context,
|
||||
intConsumer: IntConsumer?,
|
||||
interactionHandler: RemoteViews.InteractionHandler?,
|
||||
) : QuickstepWidgetHolder(context, intConsumer, interactionHandler) {
|
||||
class LawnchairWidgetHolder(context: Context, intConsumer: IntConsumer?) : LauncherWidgetHolder(context, intConsumer) {
|
||||
|
||||
@Keep
|
||||
class LawnchairHolderFactory
|
||||
@Suppress("unused")
|
||||
constructor(context: Context) :
|
||||
QuickstepHolderFactory(context) {
|
||||
HolderFactory() {
|
||||
override fun newInstance(
|
||||
context: Context,
|
||||
appWidgetRemovedCallback: IntConsumer?,
|
||||
): LauncherWidgetHolder {
|
||||
return try {
|
||||
newInstance(context, appWidgetRemovedCallback, null)
|
||||
} catch (t: Throwable) {
|
||||
super.newInstance(context, appWidgetRemovedCallback)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context The context of the caller
|
||||
@@ -26,14 +32,12 @@ class LawnchairWidgetHolder(
|
||||
* @param interactionHandler The interaction handler when the widgets are clicked
|
||||
* @return A new [LauncherWidgetHolder] instance
|
||||
*/
|
||||
override fun newInstance(
|
||||
fun newInstance(
|
||||
context: Context,
|
||||
appWidgetRemovedCallback: IntConsumer?,
|
||||
interactionHandler: RemoteViews.InteractionHandler?,
|
||||
): LauncherWidgetHolder {
|
||||
return try {
|
||||
LawnchairWidgetHolder(context, appWidgetRemovedCallback, interactionHandler)
|
||||
} catch (t: Throwable) {
|
||||
return if (!FeatureFlags.ENABLE_WIDGET_HOST_IN_BACKGROUND.get()) {
|
||||
object : LauncherWidgetHolder(context, appWidgetRemovedCallback) {
|
||||
override fun createHost(
|
||||
context: Context,
|
||||
@@ -46,6 +50,8 @@ class LawnchairWidgetHolder(
|
||||
return host
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LawnchairWidgetHolder(context, appWidgetRemovedCallback)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user