PagerScaffold: fix back key not closing widgets
This commit is contained in:
parent
074e6b788f
commit
8f4c5dcde0
@ -45,6 +45,7 @@ import de.mm20.launcher2.ui.launcher.search.SearchColumn
|
|||||||
import de.mm20.launcher2.ui.launcher.search.SearchVM
|
import de.mm20.launcher2.ui.launcher.search.SearchVM
|
||||||
import de.mm20.launcher2.ui.launcher.widgets.WidgetColumn
|
import de.mm20.launcher2.ui.launcher.widgets.WidgetColumn
|
||||||
import de.mm20.launcher2.ui.utils.rememberNotificationShadeController
|
import de.mm20.launcher2.ui.utils.rememberNotificationShadeController
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@ -174,6 +175,11 @@ fun PagerScaffold(
|
|||||||
isWidgetEditMode -> {
|
isWidgetEditMode -> {
|
||||||
viewModel.setWidgetEditMode(false)
|
viewModel.setWidgetEditMode(false)
|
||||||
}
|
}
|
||||||
|
widgetsScrollState.value != 0 -> {
|
||||||
|
scope.launch {
|
||||||
|
widgetsScrollState.animateScrollTo(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user