pref: 跳转新版搜索
This commit is contained in:
parent
0154bcbfdd
commit
4ccf213ce0
|
|
@ -20,7 +20,6 @@ import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
|
@ -28,12 +27,12 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.compose.ui.util.fastForEachIndexed
|
import androidx.compose.ui.util.fastForEachIndexed
|
||||||
import com.huanchengfly.tieba.post.R
|
import com.huanchengfly.tieba.post.R
|
||||||
import com.huanchengfly.tieba.post.activities.NewSearchActivity
|
|
||||||
import com.huanchengfly.tieba.post.arch.GlobalEvent
|
import com.huanchengfly.tieba.post.arch.GlobalEvent
|
||||||
import com.huanchengfly.tieba.post.arch.emitGlobalEvent
|
import com.huanchengfly.tieba.post.arch.emitGlobalEvent
|
||||||
import com.huanchengfly.tieba.post.arch.onGlobalEvent
|
import com.huanchengfly.tieba.post.arch.onGlobalEvent
|
||||||
import com.huanchengfly.tieba.post.goToActivity
|
|
||||||
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.SearchPageDestination
|
||||||
import com.huanchengfly.tieba.post.ui.page.main.explore.concern.ConcernPage
|
import com.huanchengfly.tieba.post.ui.page.main.explore.concern.ConcernPage
|
||||||
import com.huanchengfly.tieba.post.ui.page.main.explore.hot.HotPage
|
import com.huanchengfly.tieba.post.ui.page.main.explore.hot.HotPage
|
||||||
import com.huanchengfly.tieba.post.ui.page.main.explore.personalized.PersonalizedPage
|
import com.huanchengfly.tieba.post.ui.page.main.explore.personalized.PersonalizedPage
|
||||||
|
|
@ -113,7 +112,7 @@ private fun TabText(
|
||||||
@Composable
|
@Composable
|
||||||
fun ExplorePage() {
|
fun ExplorePage() {
|
||||||
val account = LocalAccount.current
|
val account = LocalAccount.current
|
||||||
val context = LocalContext.current
|
val navigator = LocalNavigator.current
|
||||||
|
|
||||||
val loggedIn = remember(account) { account != null }
|
val loggedIn = remember(account) { account != null }
|
||||||
|
|
||||||
|
|
@ -156,7 +155,7 @@ fun ExplorePage() {
|
||||||
icon = Icons.Rounded.Search,
|
icon = Icons.Rounded.Search,
|
||||||
contentDescription = stringResource(id = R.string.title_search)
|
contentDescription = stringResource(id = R.string.title_search)
|
||||||
) {
|
) {
|
||||||
context.goToActivity<NewSearchActivity>()
|
navigator.navigate(SearchPageDestination)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,11 @@ import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import com.huanchengfly.tieba.post.R
|
import com.huanchengfly.tieba.post.R
|
||||||
import com.huanchengfly.tieba.post.activities.NewSearchActivity
|
|
||||||
import com.huanchengfly.tieba.post.goToActivity
|
|
||||||
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.SearchPageDestination
|
||||||
import com.huanchengfly.tieba.post.ui.page.main.notifications.list.NotificationsListPage
|
import com.huanchengfly.tieba.post.ui.page.main.notifications.list.NotificationsListPage
|
||||||
import com.huanchengfly.tieba.post.ui.page.main.notifications.list.NotificationsType
|
import com.huanchengfly.tieba.post.ui.page.main.notifications.list.NotificationsType
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.ActionItem
|
import com.huanchengfly.tieba.post.ui.widgets.compose.ActionItem
|
||||||
|
|
@ -32,7 +31,7 @@ import kotlinx.coroutines.launch
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun NotificationsPage() {
|
fun NotificationsPage() {
|
||||||
val context = LocalContext.current
|
val navigator = LocalNavigator.current
|
||||||
val pages = listOf<Pair<String, (@Composable () -> Unit)>>(
|
val pages = listOf<Pair<String, (@Composable () -> Unit)>>(
|
||||||
stringResource(id = R.string.title_reply_me) to @Composable {
|
stringResource(id = R.string.title_reply_me) to @Composable {
|
||||||
NotificationsListPage(type = NotificationsType.ReplyMe)
|
NotificationsListPage(type = NotificationsType.ReplyMe)
|
||||||
|
|
@ -54,7 +53,7 @@ fun NotificationsPage() {
|
||||||
icon = Icons.Rounded.Search,
|
icon = Icons.Rounded.Search,
|
||||||
contentDescription = stringResource(id = R.string.title_search)
|
contentDescription = stringResource(id = R.string.title_search)
|
||||||
) {
|
) {
|
||||||
context.goToActivity<NewSearchActivity>()
|
navigator.navigate(SearchPageDestination)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -555,7 +555,7 @@ private fun SearchTopBar(
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(id = R.string.hint_search),
|
text = stringResource(id = R.string.hint_search),
|
||||||
color = ExtendedTheme.colors.onTopBarSurface.copy(alpha = ContentAlpha.disabled)
|
color = ExtendedTheme.colors.onTopBarSurface.copy(alpha = ContentAlpha.medium)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue