PagerScaffold: fix back key not closing widgets

This commit is contained in:
MM20 2022-08-25 20:18:31 +02:00
parent 074e6b788f
commit 8f4c5dcde0
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -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.widgets.WidgetColumn
import de.mm20.launcher2.ui.utils.rememberNotificationShadeController
import kotlinx.coroutines.launch
import kotlin.math.roundToInt
@Composable
@ -174,6 +175,11 @@ fun PagerScaffold(
isWidgetEditMode -> {
viewModel.setWidgetEditMode(false)
}
widgetsScrollState.value != 0 -> {
scope.launch {
widgetsScrollState.animateScrollTo(0)
}
}
}
}