feat: 消息列表跳转
This commit is contained in:
parent
f8c6df25cd
commit
3a9ea7b471
|
|
@ -26,12 +26,13 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import com.huanchengfly.tieba.post.R
|
import com.huanchengfly.tieba.post.R
|
||||||
import com.huanchengfly.tieba.post.activities.FloorActivity
|
|
||||||
import com.huanchengfly.tieba.post.activities.ThreadActivity
|
|
||||||
import com.huanchengfly.tieba.post.activities.UserActivity
|
import com.huanchengfly.tieba.post.activities.UserActivity
|
||||||
import com.huanchengfly.tieba.post.arch.collectPartialAsState
|
import com.huanchengfly.tieba.post.arch.collectPartialAsState
|
||||||
import com.huanchengfly.tieba.post.arch.pageViewModel
|
import com.huanchengfly.tieba.post.arch.pageViewModel
|
||||||
import com.huanchengfly.tieba.post.ui.common.theme.compose.ExtendedTheme
|
import com.huanchengfly.tieba.post.ui.common.theme.compose.ExtendedTheme
|
||||||
|
import com.huanchengfly.tieba.post.ui.page.LocalNavigator
|
||||||
|
import com.huanchengfly.tieba.post.ui.page.destinations.SubPostsPageDestination
|
||||||
|
import com.huanchengfly.tieba.post.ui.page.destinations.ThreadPageDestination
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.Avatar
|
import com.huanchengfly.tieba.post.ui.widgets.compose.Avatar
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.EmoticonText
|
import com.huanchengfly.tieba.post.ui.widgets.compose.EmoticonText
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.LazyLoad
|
import com.huanchengfly.tieba.post.ui.widgets.compose.LazyLoad
|
||||||
|
|
@ -55,6 +56,7 @@ fun NotificationsListPage(
|
||||||
viewModel.initialized = true
|
viewModel.initialized = true
|
||||||
}
|
}
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
val navigator = LocalNavigator.current
|
||||||
val isRefreshing by viewModel.uiState.collectPartialAsState(
|
val isRefreshing by viewModel.uiState.collectPartialAsState(
|
||||||
prop1 = NotificationsListUiState::isRefreshing,
|
prop1 = NotificationsListUiState::isRefreshing,
|
||||||
initial = false
|
initial = false
|
||||||
|
|
@ -97,13 +99,20 @@ fun NotificationsListPage(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable {
|
.clickable {
|
||||||
if (it.isFloor == "1") {
|
if (it.isFloor == "1") {
|
||||||
FloorActivity.launch(
|
navigator.navigate(
|
||||||
context,
|
SubPostsPageDestination(
|
||||||
it.threadId!!,
|
threadId = it.threadId!!.toLong(),
|
||||||
subPostId = it.postId
|
subPostId = it.postId!!.toLong(),
|
||||||
|
loadFromSubPost = true
|
||||||
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ThreadActivity.launch(context, it.threadId!!, it.postId)
|
navigator.navigate(
|
||||||
|
ThreadPageDestination(
|
||||||
|
threadId = it.threadId!!.toLong(),
|
||||||
|
postId = it.postId!!.toLong()
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(horizontal = 16.dp, vertical = 12.dp),
|
.padding(horizontal = 16.dp, vertical = 12.dp),
|
||||||
|
|
@ -158,13 +167,19 @@ fun NotificationsListPage(
|
||||||
.clip(RoundedCornerShape(6.dp))
|
.clip(RoundedCornerShape(6.dp))
|
||||||
.clickable {
|
.clickable {
|
||||||
if ("1" == it.isFloor && it.quotePid != null) {
|
if ("1" == it.isFloor && it.quotePid != null) {
|
||||||
FloorActivity.launch(
|
navigator.navigate(
|
||||||
context,
|
SubPostsPageDestination(
|
||||||
it.threadId!!,
|
threadId = it.threadId!!.toLong(),
|
||||||
postId = it.quotePid
|
postId = it.quotePid.toLong(),
|
||||||
|
loadFromSubPost = true,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ThreadActivity.launch(context, it.threadId!!)
|
navigator.navigate(
|
||||||
|
ThreadPageDestination(
|
||||||
|
threadId = it.threadId!!.toLong(),
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.background(ExtendedTheme.colors.chip, RoundedCornerShape(6.dp))
|
.background(ExtendedTheme.colors.chip, RoundedCornerShape(6.dp))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue