浏览代码

Adding more UI polish, add comments for future enhancements.

mpm11011 4 年之前
父节点
当前提交
381c061ebc

+ 0 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt

@@ -96,8 +96,6 @@ class AboutController : SettingsController() {
         }
 
         preferenceCategory {
-            titleRes = R.string.about_resources
-
             preference {
                 key = "pref_about_website"
                 titleRes = R.string.website

+ 2 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt

@@ -19,6 +19,7 @@ import com.bluelinelabs.conductor.ControllerChangeType
 import eu.kanade.tachiyomi.R
 import eu.kanade.tachiyomi.data.preference.PreferencesHelper
 import eu.kanade.tachiyomi.ui.base.controller.BaseController
+import eu.kanade.tachiyomi.util.system.getResourceColor
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.Job
@@ -83,7 +84,7 @@ abstract class SettingsController : PreferenceController() {
 
     private fun animatePreferenceHighlight(view: View) {
         ValueAnimator
-            .ofObject(ArgbEvaluator(), Color.TRANSPARENT, R.attr.rippleColor)
+            .ofObject(ArgbEvaluator(), Color.TRANSPARENT, view.context.getResourceColor(R.attr.rippleColor))
             .apply {
                 duration = 500L
                 repeatCount = 2

+ 4 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchController.kt

@@ -86,6 +86,8 @@ class SettingsSearchController :
             }
 
             override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
+                searchView.onActionViewCollapsed() // Required to show the query in the view
+                router.popCurrentController()
                 return true
             }
         })
@@ -135,9 +137,10 @@ class SettingsSearchController :
 
     /**
      * returns a list of `SettingsSearchItem` to be shown as search results
+     * Future update: should we add a minimum length to the query before displaying results? Consider other languages.
      */
     fun getResultSet(query: String? = null): List<SettingsSearchItem> {
-        if (!query.isNullOrBlank() && query.length >= 3) {
+        if (!query.isNullOrBlank()) {
             return SettingsSearchHelper.getFilteredResults(query)
                 .map { SettingsSearchItem(it, null) }
         }

+ 1 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchHelper.kt

@@ -77,6 +77,7 @@ object SettingsSearchHelper {
 
     /**
      * Extracts the data needed from a `Preference` to create a `SettingsSearchResult`, and then adds it to `prefSearchResultList`
+     * Future enhancement: make bold the text matched by the search query.
      */
     private fun getSettingSearchResult(ctrl: SettingsController, pref: Preference, breadcrumbs: String = "") {
         when (pref) {