From f9672a4fc5eef6076abd062726fa13d14cc9695f Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 19 Oct 2022 17:55:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/search/SearchScope.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchScope.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchScope.kt index 58df4746f..b38832600 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchScope.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchScope.kt @@ -24,7 +24,7 @@ data class SearchScope(private var scope: String) { return scope } - val stateLiveData = MutableLiveData("") + val stateLiveData = MutableLiveData(scope) fun update(scope: String) { this.scope = scope @@ -33,10 +33,16 @@ data class SearchScope(private var scope: String) { fun update(groups: List) { scope = groups.joinToString(",") + stateLiveData.postValue(scope) } fun update(source: BookSource) { scope = "${source.bookSourceName}::${source.bookSourceUrl}" + stateLiveData.postValue(scope) + } + + fun isSource(): Boolean { + return scope.contains("::") } val display: String