mirror of
https://github.com/jrpie/Launcher.git
synced 2025-06-08 02:11:24 +02:00
fix: stop longPressHandler when activity finishes
Some checks failed
Android CI / build (push) Has been cancelled
Some checks failed
Android CI / build (push) Has been cancelled
This commit is contained in:
parent
ce939111d0
commit
919108bbd0
1 changed files with 10 additions and 3 deletions
|
@ -160,7 +160,6 @@ class WidgetManagerView(widgetPanelId: Int, context: Context, attrs: AttributeSe
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.actionMasked == MotionEvent.ACTION_UP) {
|
if (event.actionMasked == MotionEvent.ACTION_UP) {
|
||||||
longPressHandler.removeCallbacksAndMessages(null)
|
|
||||||
val id = selectedWidgetOverlayView?.widgetId ?: return true
|
val id = selectedWidgetOverlayView?.widgetId ?: return true
|
||||||
val widget = Widget.byId(id) ?: return true
|
val widget = Widget.byId(id) ?: return true
|
||||||
widget.position = newPosition
|
widget.position = newPosition
|
||||||
|
@ -176,8 +175,16 @@ class WidgetManagerView(widgetPanelId: Int, context: Context, attrs: AttributeSe
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun endInteraction() {
|
private fun endInteraction() {
|
||||||
startWidgetPosition = null
|
synchronized(this) {
|
||||||
selectedWidgetOverlayView?.mode = null
|
longPressHandler.removeCallbacksAndMessages(null)
|
||||||
|
startWidgetPosition = null
|
||||||
|
selectedWidgetOverlayView?.mode = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
endInteraction()
|
||||||
|
super.onDetachedFromWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateWidgets(activity: Activity, widgets: Collection<Widget>?) {
|
override fun updateWidgets(activity: Activity, widgets: Collection<Widget>?) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue