feat: 历史记录新 UI
This commit is contained in:
parent
0c75052380
commit
ffb20dc817
|
|
@ -21,6 +21,7 @@ import com.google.accompanist.pager.HorizontalPager
|
||||||
import com.google.accompanist.pager.rememberPagerState
|
import com.google.accompanist.pager.rememberPagerState
|
||||||
import com.huanchengfly.tieba.post.R
|
import com.huanchengfly.tieba.post.R
|
||||||
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.ProvideNavigator
|
||||||
import com.huanchengfly.tieba.post.ui.page.history.list.HistoryListPage
|
import com.huanchengfly.tieba.post.ui.page.history.list.HistoryListPage
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.BackNavigationIcon
|
import com.huanchengfly.tieba.post.ui.widgets.compose.BackNavigationIcon
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.MyScaffold
|
import com.huanchengfly.tieba.post.ui.widgets.compose.MyScaffold
|
||||||
|
|
@ -113,6 +114,7 @@ fun HistoryPage(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
|
ProvideNavigator(navigator = navigator) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
count = 2,
|
count = 2,
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
|
|
@ -125,6 +127,7 @@ fun HistoryPage(
|
||||||
} else {
|
} else {
|
||||||
HistoryListPage(type = HistoryUtil.TYPE_FORUM)
|
HistoryListPage(type = HistoryUtil.TYPE_FORUM)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -30,6 +30,8 @@ import com.huanchengfly.tieba.post.fromJson
|
||||||
import com.huanchengfly.tieba.post.models.ThreadHistoryInfoBean
|
import com.huanchengfly.tieba.post.models.ThreadHistoryInfoBean
|
||||||
import com.huanchengfly.tieba.post.models.database.History
|
import com.huanchengfly.tieba.post.models.database.History
|
||||||
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.ForumPageDestination
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.Chip
|
import com.huanchengfly.tieba.post.ui.widgets.Chip
|
||||||
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.LazyLoad
|
import com.huanchengfly.tieba.post.ui.widgets.compose.LazyLoad
|
||||||
|
|
@ -74,6 +76,7 @@ fun HistoryListPage(
|
||||||
)
|
)
|
||||||
|
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
val navigator = LocalNavigator.current
|
||||||
val snackbarHostState = LocalSnackbarHostState.current
|
val snackbarHostState = LocalSnackbarHostState.current
|
||||||
LaunchedEffect(null) {
|
LaunchedEffect(null) {
|
||||||
onEvent<HistoryListUiEvent.Delete.Failure>(viewModel) {
|
onEvent<HistoryListUiEvent.Delete.Failure>(viewModel) {
|
||||||
|
|
@ -123,10 +126,9 @@ fun HistoryListPage(
|
||||||
},
|
},
|
||||||
onClick = {
|
onClick = {
|
||||||
when (it.type) {
|
when (it.type) {
|
||||||
HistoryUtil.TYPE_FORUM -> ForumActivity.launch(
|
HistoryUtil.TYPE_FORUM -> {
|
||||||
context,
|
navigator.navigate(ForumPageDestination(it.data))
|
||||||
it.data
|
}
|
||||||
)
|
|
||||||
|
|
||||||
HistoryUtil.TYPE_THREAD -> {
|
HistoryUtil.TYPE_THREAD -> {
|
||||||
val extra =
|
val extra =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue