首页顶栏去搜索按钮,改大标题下常驻圆角搜索条(Keep 式);关于页作者主页去前置图标
This commit is contained in:
@@ -12,7 +12,6 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Public
|
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
@@ -90,7 +89,6 @@ fun AboutScreen(
|
|||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = { Text(stringResource(R.string.author_homepage)) },
|
headlineContent = { Text(stringResource(R.string.author_homepage)) },
|
||||||
supportingContent = { Text(stringResource(R.string.author_handle)) },
|
supportingContent = { Text(stringResource(R.string.author_handle)) },
|
||||||
leadingContent = { Icon(Icons.Default.Public, contentDescription = null) },
|
|
||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable {
|
||||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://airnan.cn"))
|
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://airnan.cn"))
|
||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
|
|||||||
@@ -138,11 +138,6 @@ fun TokensScreen(
|
|||||||
} else {
|
} else {
|
||||||
MediumFlexibleTopAppBar(
|
MediumFlexibleTopAppBar(
|
||||||
title = { Text(stringResource(R.string.app_name)) },
|
title = { Text(stringResource(R.string.app_name)) },
|
||||||
actions = {
|
|
||||||
IconButton(onClick = { isSearchExpanded = true }) {
|
|
||||||
Icon(Icons.Default.Search, contentDescription = stringResource(R.string.search))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scrollBehavior = scrollBehavior
|
scrollBehavior = scrollBehavior
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -158,6 +153,33 @@ fun TokensScreen(
|
|||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(padding)
|
.padding(padding)
|
||||||
) {
|
) {
|
||||||
|
if (!isSearchExpanded) {
|
||||||
|
Surface(
|
||||||
|
shape = MaterialTheme.shapes.extraLarge,
|
||||||
|
color = MaterialTheme.colorScheme.surfaceContainerHigh,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||||
|
.clickable { isSearchExpanded = true }
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.padding(horizontal = 16.dp, vertical = 14.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Search,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(12.dp))
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.search_tokens),
|
||||||
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
val latestUiState by rememberUpdatedState(uiState)
|
val latestUiState by rememberUpdatedState(uiState)
|
||||||
if (uiState.groupedTokens.isEmpty()) {
|
if (uiState.groupedTokens.isEmpty()) {
|
||||||
if (uiState.searchQuery.isBlank()) {
|
if (uiState.searchQuery.isBlank()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user