From 6278f268397c415d7adb7f417507a964041b4ea8 Mon Sep 17 00:00:00 2001 From: HapeLee <63206378+HapeLee@users.noreply.github.com> Date: Wed, 27 May 2026 21:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=A1=B5=EF=BC=9A=E7=B2=BE?= =?UTF-8?q?=E5=87=86=E6=90=9C=E7=B4=A2=E4=BB=8ESettingsSheet=E7=A7=BB?= =?UTF-8?q?=E8=87=B3topbar=EF=BC=8C=E7=A7=BB=E9=99=A4=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=97=E8=A1=A8=E6=B0=B4=E5=B9=B3padding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/search/SearchScreen.kt | 34 +++++++------------ 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchScreen.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchScreen.kt index f3c6bb72d..13db03ff0 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchScreen.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchScreen.kt @@ -269,7 +269,7 @@ fun SearchScreen( }, actions = { TopBarAnimatedActionButton( - checked = isSourceGroupedMode || state.matchMode == MatchMode.EXACT || state.selectedSourceTypes.isNotEmpty(), + checked = isSourceGroupedMode || state.selectedSourceTypes.isNotEmpty(), onCheckedChange = { viewModel.onIntent(SearchIntent.SetSettingsSheetVisible(true)) }, @@ -278,6 +278,17 @@ fun SearchScreen( activeText = stringResource(R.string.setting), inactiveText = stringResource(R.string.setting), ) + TopBarAnimatedActionButton( + checked = state.matchMode == MatchMode.EXACT, + onCheckedChange = { + val newMode = if (state.matchMode == MatchMode.EXACT) MatchMode.DEFAULT else MatchMode.EXACT + viewModel.onIntent(SearchIntent.SetMatchMode(newMode)) + }, + iconChecked = AppIcons.PrecisionSearch, + iconUnchecked = AppIcons.UnPrecisionSearch, + activeText = stringResource(R.string.precision_search), + inactiveText = stringResource(R.string.precision_search), + ) TopBarAnimatedActionButton( checked = !state.isAllScope, onCheckedChange = { @@ -616,26 +627,6 @@ fun SearchScreen( } ) - CompactDropdownSettingItem( - title = stringResource(R.string.precision_search), - selectedValue = state.matchMode.value.toString(), - displayEntries = arrayOf( - stringResource(R.string.precision_search), - stringResource(R.string.search) - ), - entryValues = arrayOf( - MatchMode.EXACT.value.toString(), - MatchMode.DEFAULT.value.toString() - ), - imageVector = if (state.matchMode == MatchMode.EXACT) AppIcons.PrecisionSearch else AppIcons.UnPrecisionSearch, - onValueChange = { newValue -> - val mode = MatchMode.of(newValue.toInt()) - if (mode != state.matchMode) { - viewModel.onIntent(SearchIntent.SetMatchMode(mode)) - } - } - ) - Row( modifier = Modifier .fillMaxWidth() @@ -651,7 +642,6 @@ fun SearchScreen( } Column( - modifier = Modifier.padding(horizontal = 16.dp), verticalArrangement = Arrangement.spacedBy(4.dp) ) { SelectionItemCard(