Skip to content

Commit

Permalink
修改了HomePage的名字为SearchPage
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlwicked committed Sep 24, 2024
1 parent 29f5a0f commit ce57ce0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ package me.him188.ani.app.ui.home

import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import me.him188.ani.app.ui.foundation.ProvideCompositionLocalsForPreview
import me.him188.ani.app.ui.foundation.ProvideFoundationCompositionLocalsForPreview

@Composable
@Preview(backgroundColor = 0xFF000000, showBackground = true)
internal fun PreviewHomePagePortrait() {
ProvideCompositionLocalsForPreview {
HomePage()
ProvideFoundationCompositionLocalsForPreview {
SearchPage()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ import me.him188.ani.app.ui.home.search.SubjectPreviewColumn
import me.him188.ani.app.ui.home.search.SubjectSearchBar

@Composable
fun HomePage(
fun SearchPage(
modifier: Modifier = Modifier,
contentPadding: PaddingValues = PaddingValues(0.dp),
searchBarFocusRequester: FocusRequester = remember { FocusRequester() },
contentWindowInsets: WindowInsets = ScaffoldDefaults.contentWindowInsets,
) {
val searchViewModel = viewModel { SearchViewModel() }
val snackBarHostState = remember { SnackbarHostState() }
val searchViewModel = viewModel { SearchViewModel() } // 改成SubjectSearchState(无injection, 可以依赖于其他的state)
val snackBarHostState = remember { SnackbarHostState() } // 改成toaster
val layoutDirection = LocalLayoutDirection.current

val searchTag by searchViewModel.searchTags.collectAsStateWithLifecycle()
Expand Down
6 changes: 3 additions & 3 deletions app/shared/src/commonMain/kotlin/ui/main/HomeScene.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import me.him188.ani.app.ui.foundation.layout.LocalPlatformWindow
import me.him188.ani.app.ui.foundation.layout.isWidthAtLeastMedium
import me.him188.ani.app.ui.foundation.layout.setRequestFullScreen
import me.him188.ani.app.ui.foundation.theme.AniThemeDefaults
import me.him188.ani.app.ui.home.HomePage
import me.him188.ani.app.ui.home.SearchPage
import me.him188.ani.app.ui.home.search.SearchViewModel
import me.him188.ani.app.ui.profile.AccountViewModel
import me.him188.ani.app.ui.profile.ProfilePage
Expand Down Expand Up @@ -259,7 +259,7 @@ private fun HomeSceneLandscape(
VerticalPager(pagerState, userScrollEnabled = false) {
when (it) {
0 -> {
HomePage(
SearchPage(
Modifier.fillMaxSize(),
searchBarFocusRequester = searchBarFocusRequester,
contentWindowInsets = windowInsets,
Expand Down Expand Up @@ -400,7 +400,7 @@ private fun HomeScenePortrait(
) {
HorizontalPager(pagerState, userScrollEnabled = false) {
when (it) {
0 -> HomePage(
0 -> SearchPage(
contentPadding = contentPadding,
searchBarFocusRequester = searchBarFocusRequester,
)
Expand Down

0 comments on commit ce57ce0

Please sign in to comment.