Skip to content

Commit 5954061

Browse files
committed
Fix view snapping behavior on shared element transition from comparison to inspection screen
1 parent ba07142 commit 5954061

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/kotlin/com/w2sv/autocrop/ui/screen/cropinspection/CropInspectionScreen.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ import androidx.compose.foundation.layout.Arrangement
88
import androidx.compose.foundation.layout.Box
99
import androidx.compose.foundation.layout.Column
1010
import androidx.compose.foundation.layout.Row
11+
import androidx.compose.foundation.layout.WindowInsets
1112
import androidx.compose.foundation.layout.fillMaxHeight
1213
import androidx.compose.foundation.layout.fillMaxSize
1314
import androidx.compose.foundation.layout.fillMaxWidth
1415
import androidx.compose.foundation.layout.padding
16+
import androidx.compose.foundation.layout.systemBarsIgnoringVisibility
1517
import androidx.compose.foundation.pager.rememberPagerState
1618
import androidx.compose.material.icons.Icons
1719
import androidx.compose.material.icons.automirrored.filled.ArrowBack
@@ -69,6 +71,7 @@ fun CropInspectionScreen(
6971
var showProcedureDialogForIndex by rememberSaveable { mutableStateOf<Int?>(null) }
7072
val transitionNameToImageView = remember { mutableMapOf<String, View>() }
7173

74+
// Navigate to exit screen if no crop bundles left
7275
OnChange(cropBundles.size) {
7376
if (it == 0) {
7477
navController.navigateAnimatedAndPopCurrentDestination(CropInspectionFragmentDirections.navigateToExitScreen())
@@ -77,6 +80,9 @@ fun CropInspectionScreen(
7780

7881
Scaffold(
7982
modifier = modifier,
83+
// Ignore system bars visibility so that no snapping behavior occurs during shared element transition from comparison screen,
84+
// during which system bars are unhidden
85+
contentWindowInsets = WindowInsets.systemBarsIgnoringVisibility,
8086
floatingActionButton = {
8187
ProcedureFabRow(
8288
onComparisonButtonClick = {

0 commit comments

Comments
 (0)