UI调整,群聊天室开发
This commit is contained in:
@@ -35,6 +35,7 @@ import com.aiosman.ravenow.ui.agent.AddAgentScreen
|
||||
import com.aiosman.ravenow.ui.group.CreateGroupChatScreen
|
||||
import com.aiosman.ravenow.ui.chat.ChatAiScreen
|
||||
import com.aiosman.ravenow.ui.chat.ChatScreen
|
||||
import com.aiosman.ravenow.ui.chat.GroupChatScreen
|
||||
import com.aiosman.ravenow.ui.comment.CommentsScreen
|
||||
import com.aiosman.ravenow.ui.comment.notice.CommentNoticeScreen
|
||||
import com.aiosman.ravenow.ui.crop.ImageCropScreen
|
||||
@@ -94,6 +95,7 @@ sealed class NavigationRoute(
|
||||
data object FavouriteList : NavigationRoute("FavouriteList")
|
||||
data object Chat : NavigationRoute("Chat/{id}")
|
||||
data object ChatAi : NavigationRoute("ChatAi/{id}")
|
||||
data object ChatGroup : NavigationRoute("ChatGroup/{id}")
|
||||
data object CommentNoticeScreen : NavigationRoute("CommentNoticeScreen")
|
||||
data object ImageCrop : NavigationRoute("ImageCrop")
|
||||
data object AccountSetting : NavigationRoute("AccountSetting")
|
||||
@@ -385,6 +387,20 @@ fun NavigationController(
|
||||
}
|
||||
}
|
||||
|
||||
composable(
|
||||
route = NavigationRoute.ChatGroup.route,
|
||||
arguments = listOf(navArgument("id") { type = NavType.StringType })
|
||||
) {
|
||||
val encodedId = it.arguments?.getString("id")
|
||||
val decodedId = encodedId?.let { java.net.URLDecoder.decode(it, "UTF-8") }
|
||||
|
||||
CompositionLocalProvider(
|
||||
LocalAnimatedContentScope provides this,
|
||||
) {
|
||||
GroupChatScreen(decodedId?:"")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
composable(route = NavigationRoute.CommentNoticeScreen.route) {
|
||||
CompositionLocalProvider(
|
||||
@@ -494,6 +510,14 @@ fun NavHostController.navigateToChatAi(id: String) {
|
||||
)
|
||||
}
|
||||
|
||||
fun NavHostController.navigateToGroupChat(id: String) {
|
||||
val encodedId = java.net.URLEncoder.encode(id, "UTF-8")
|
||||
navigate(
|
||||
route = NavigationRoute.ChatGroup.route
|
||||
.replace("{id}", encodedId)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun NavHostController.goTo(
|
||||
|
||||
Reference in New Issue
Block a user