这是indexloc提供的服务,不要输入任何密码
Skip to content

Rename movableSharedElementScope to requireThreePaneMovableSharedElementScope() #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ fun <NavigationState : Node, Destination : Node> PanedNavHostConfiguration<
)
}

fun <Destination : Node> PaneScope<ThreePane, Destination>.movableSharedElementScope(): MovableSharedElementScope {
fun <Destination : Node> PaneScope<
ThreePane,
Destination
>.requireThreePaneMovableSharedElementScope(): MovableSharedElementScope {
check(this is ThreePaneMovableSharedElementScope) {
"""
The current AdaptivePaneScope (${this::class.qualifiedName}) is not an instance of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.coroutineScope
import androidx.lifecycle.viewmodel.compose.viewModel
import com.tunjid.demo.common.ui.data.ChatsRepository
import com.tunjid.demo.common.ui.data.ProfileRepository
import com.tunjid.demo.common.ui.data.SampleDestination
import com.tunjid.demo.common.ui.data.SampleDestination.NavTabs
import com.tunjid.treenav.compose.threepane.ThreePane
import com.tunjid.treenav.compose.threepane.configurations.movableSharedElementScope
import com.tunjid.treenav.compose.threepane.configurations.requireThreePaneMovableSharedElementScope
import com.tunjid.treenav.compose.threepane.threePaneListDetailStrategy

fun chatPaneStrategy() = threePaneListDetailStrategy<SampleDestination>(
Expand All @@ -48,7 +46,7 @@ fun chatPaneStrategy() = threePaneListDetailStrategy<SampleDestination>(
)
}
ChatScreen(
movableSharedElementScope = movableSharedElementScope(),
movableSharedElementScope = requireThreePaneMovableSharedElementScope(),
state = viewModel.state.collectAsStateWithLifecycle().value,
onAction = viewModel.accept,
modifier = Modifier.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import androidx.lifecycle.coroutineScope
import androidx.lifecycle.viewmodel.compose.viewModel
import com.tunjid.demo.common.ui.data.ChatsRepository
import com.tunjid.demo.common.ui.data.SampleDestination
import com.tunjid.treenav.compose.threepane.configurations.movableSharedElementScope
import com.tunjid.treenav.compose.threepane.configurations.requireThreePaneMovableSharedElementScope
import com.tunjid.treenav.compose.threepane.threePaneListDetailStrategy

fun chatRoomPaneStrategy(
Expand All @@ -38,7 +38,7 @@ fun chatRoomPaneStrategy(
)
}
ChatRoomsScreen(
movableSharedElementScope = movableSharedElementScope(),
movableSharedElementScope = requireThreePaneMovableSharedElementScope(),
state = viewModel.state.collectAsStateWithLifecycle().value,
onAction = viewModel.accept,
modifier = Modifier.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import com.tunjid.demo.common.ui.data.SampleDestination
import com.tunjid.demo.common.ui.profile.ProfileScreen
import com.tunjid.demo.common.ui.profile.ProfileViewModel
import com.tunjid.treenav.compose.threepane.configurations.movableSharedElementScope
import com.tunjid.treenav.compose.threepane.configurations.requireThreePaneMovableSharedElementScope
import com.tunjid.treenav.compose.threepane.threePaneListDetailStrategy

fun mePaneStrategy(
Expand All @@ -38,7 +38,7 @@ fun mePaneStrategy(
)
}
ProfileScreen(
movableSharedElementScope = movableSharedElementScope(),
movableSharedElementScope = requireThreePaneMovableSharedElementScope(),
state = viewModel.state.collectAsStateWithLifecycle().value,
onAction = viewModel.accept
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import com.tunjid.demo.common.ui.data.SampleDestination
import com.tunjid.demo.common.ui.data.SampleDestination.NavTabs
import com.tunjid.treenav.compose.threepane.ThreePane
import com.tunjid.treenav.compose.threepane.configurations.movableSharedElementScope
import com.tunjid.treenav.compose.threepane.configurations.requireThreePaneMovableSharedElementScope
import com.tunjid.treenav.compose.threepane.threePaneListDetailStrategy

fun profilePaneStrategy() = threePaneListDetailStrategy<SampleDestination>(
Expand All @@ -48,7 +48,7 @@ fun profilePaneStrategy() = threePaneListDetailStrategy<SampleDestination>(
)
}
ProfileScreen(
movableSharedElementScope = movableSharedElementScope(),
movableSharedElementScope = requireThreePaneMovableSharedElementScope(),
state = viewModel.state.collectAsStateWithLifecycle().value,
onAction = viewModel.accept,
modifier = Modifier.fillMaxSize(),
Expand Down
Loading