UI调整,群聊开发
This commit is contained in:
@@ -95,7 +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 ChatGroup : NavigationRoute("ChatGroup/{id}/{name}/{avatar}")
|
||||
data object CommentNoticeScreen : NavigationRoute("CommentNoticeScreen")
|
||||
data object ImageCrop : NavigationRoute("ImageCrop")
|
||||
data object AccountSetting : NavigationRoute("AccountSetting")
|
||||
@@ -389,15 +389,18 @@ fun NavigationController(
|
||||
|
||||
composable(
|
||||
route = NavigationRoute.ChatGroup.route,
|
||||
arguments = listOf(navArgument("id") { type = NavType.StringType })
|
||||
arguments = listOf(navArgument("id") { type = NavType.StringType },
|
||||
navArgument("name") { type = NavType.StringType },
|
||||
navArgument("avatar") { type = NavType.StringType })
|
||||
) {
|
||||
val encodedId = it.arguments?.getString("id")
|
||||
val decodedId = encodedId?.let { java.net.URLDecoder.decode(it, "UTF-8") }
|
||||
|
||||
val name = it.arguments?.getString("name")
|
||||
val avatar = it.arguments?.getString("avatar")
|
||||
CompositionLocalProvider(
|
||||
LocalAnimatedContentScope provides this,
|
||||
) {
|
||||
GroupChatScreen(decodedId?:"")
|
||||
GroupChatScreen(decodedId?:"",name?:"",avatar?:"")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,24 +435,12 @@ fun NavigationController(
|
||||
}
|
||||
composable(
|
||||
route = NavigationRoute.AddAgent.route,
|
||||
enterTransition = {
|
||||
fadeIn(animationSpec = tween(durationMillis = 0))
|
||||
},
|
||||
exitTransition = {
|
||||
fadeOut(animationSpec = tween(durationMillis = 0))
|
||||
}
|
||||
) {
|
||||
AddAgentScreen()
|
||||
}
|
||||
|
||||
composable(
|
||||
route = NavigationRoute.CreateGroupChat.route,
|
||||
enterTransition = {
|
||||
fadeIn(animationSpec = tween(durationMillis = 0))
|
||||
},
|
||||
exitTransition = {
|
||||
fadeOut(animationSpec = tween(durationMillis = 0))
|
||||
}
|
||||
) {
|
||||
CreateGroupChatScreen()
|
||||
}
|
||||
@@ -500,6 +491,7 @@ fun NavHostController.navigateToChat(id: String) {
|
||||
navigate(
|
||||
route = NavigationRoute.Chat.route
|
||||
.replace("{id}", id)
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
@@ -510,11 +502,15 @@ fun NavHostController.navigateToChatAi(id: String) {
|
||||
)
|
||||
}
|
||||
|
||||
fun NavHostController.navigateToGroupChat(id: String) {
|
||||
fun NavHostController.navigateToGroupChat(id: String,name:String,avatar:String) {
|
||||
val encodedId = java.net.URLEncoder.encode(id, "UTF-8")
|
||||
val encodedName = java.net.URLEncoder.encode(name, "UTF-8")
|
||||
val encodedAvator = java.net.URLEncoder.encode(avatar, "UTF-8")
|
||||
navigate(
|
||||
route = NavigationRoute.ChatGroup.route
|
||||
.replace("{id}", encodedId)
|
||||
.replace("{name}", encodedName)
|
||||
.replace("{avatar}", encodedAvator)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user