File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
app/src/main/java/com/example/nav3recipes/scenes/materiallistdetail Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
27
27
import androidx.compose.material3.adaptive.layout.calculatePaneScaffoldDirective
28
28
import androidx.compose.material3.adaptive.navigation3.ListDetailSceneStrategy
29
29
import androidx.compose.material3.adaptive.navigation3.rememberListDetailSceneStrategy
30
+ import androidx.compose.runtime.remember
30
31
import androidx.compose.ui.Alignment
31
32
import androidx.compose.ui.unit.dp
32
33
import androidx.navigation3.runtime.NavKey
@@ -65,12 +66,14 @@ class MaterialListDetailActivity : ComponentActivity() {
65
66
setContent {
66
67
67
68
val backStack = rememberNavBackStack(ConversationList )
68
- val listDetailStrategy = rememberListDetailSceneStrategy<NavKey >(
69
- // Override the defaults so that there isn't a horizontal space between the panes.
70
- directive = calculatePaneScaffoldDirective(
71
- windowAdaptiveInfo = currentWindowAdaptiveInfo()
72
- ).copy(horizontalPartitionSpacerSize = 0 .dp)
73
- )
69
+
70
+ // Override the defaults so that there isn't a horizontal space between the panes.
71
+ val windowAdaptiveInfo = currentWindowAdaptiveInfo()
72
+ val directive = remember(windowAdaptiveInfo) {
73
+ calculatePaneScaffoldDirective(windowAdaptiveInfo)
74
+ .copy(horizontalPartitionSpacerSize = 0 .dp)
75
+ }
76
+ val listDetailStrategy = rememberListDetailSceneStrategy<NavKey >(directive = directive)
74
77
75
78
NavDisplay (
76
79
backStack = backStack,
You can’t perform that action at this time.
0 commit comments