fix: 搜索记录为空提示文字颜色

This commit is contained in:
HuanCheng65 2023-09-30 20:21:17 +08:00
parent 2c4f7c5fc6
commit e7994c6889
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
2 changed files with 13 additions and 6 deletions

View File

@ -226,7 +226,7 @@ private fun getLightDynamicColor(tonalPalette: TonalPalette): ExtendedColors {
onBottomBarSurface = tonalPalette.neutralVariant30,
text = tonalPalette.neutralVariant10,
textSecondary = tonalPalette.neutralVariant40,
textDisabled = tonalPalette.neutralVariant100,
textDisabled = tonalPalette.neutralVariant70,
background = tonalPalette.neutralVariant99,
chip = tonalPalette.neutralVariant95,
onChip = tonalPalette.neutralVariant40,

View File

@ -25,9 +25,11 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Icon
@ -264,7 +266,9 @@ fun SearchPage(
}
} else {
Column(
modifier = Modifier.fillMaxSize()
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
SearchHistoryList(
searchHistories = searchHistories,
@ -403,16 +407,19 @@ private fun SearchHistoryList(
onDelete: (SearchHistory) -> Unit = {},
onClear: () -> Unit = {},
) {
val hasItem = remember(searchHistories) {
searchHistories.isNotEmpty()
}
val hasMore = remember(searchHistories) {
searchHistories.size > 6
}
val showItem = remember(expanded, hasMore, searchHistories) {
if (!expanded && hasMore) searchHistories.take(6) else searchHistories
}
val hasItem = remember(showItem) {
showItem.isNotEmpty()
}
Column(modifier = Modifier.fillMaxWidth()) {
Column(
modifier = Modifier
.fillMaxWidth()
) {
Row(
modifier = Modifier
.padding(horizontal = 16.dp, vertical = 16.dp),