forked from recloudstream/cloudstream
Fix searching in repos & search provider selection bottom sheet
This commit is contained in:
parent
63c713fc68
commit
e67d248f7f
4 changed files with 16 additions and 15 deletions
|
@ -17,6 +17,7 @@ import androidx.fragment.app.activityViewModels
|
|||
import androidx.preference.PreferenceManager
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.lagradost.cloudstream3.*
|
||||
|
@ -232,6 +233,7 @@ class SearchFragment : Fragment() {
|
|||
val builder =
|
||||
BottomSheetDialog(ctx)
|
||||
|
||||
builder.behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||
builder.setContentView(R.layout.home_select_mainpage)
|
||||
builder.show()
|
||||
builder.let { dialog ->
|
||||
|
|
|
@ -1,27 +1,22 @@
|
|||
package com.lagradost.cloudstream3.ui.settings.extensions
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.*
|
||||
import android.widget.SearchView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.map
|
||||
import com.lagradost.cloudstream3.AcraApplication
|
||||
import com.lagradost.cloudstream3.CommonActivity
|
||||
import com.lagradost.cloudstream3.R
|
||||
import com.lagradost.cloudstream3.mvvm.logError
|
||||
import com.lagradost.cloudstream3.mvvm.observe
|
||||
import com.lagradost.cloudstream3.ui.home.HomeFragment.Companion.getPairList
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar
|
||||
import com.lagradost.cloudstream3.ui.settings.appLanguages
|
||||
import com.lagradost.cloudstream3.ui.settings.getCurrentLocale
|
||||
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
|
||||
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showMultiDialog
|
||||
import com.lagradost.cloudstream3.utils.SubtitleHelper
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.toPx
|
||||
import com.lagradost.cloudstream3.utils.USER_SELECTED_HOMEPAGE_API
|
||||
import kotlinx.android.synthetic.main.fragment_plugins.*
|
||||
|
||||
const val PLUGINS_BUNDLE_NAME = "name"
|
||||
|
|
|
@ -210,7 +210,7 @@ class PluginsViewModel : ViewModel() {
|
|||
// Return list to base state if no query
|
||||
this.sortedBy { it.plugin.second.name }
|
||||
} else {
|
||||
this.sortedBy { -FuzzySearch.ratio(it.plugin.second.name, query) }
|
||||
this.sortedBy { -FuzzySearch.partialRatio(it.plugin.second.name.lowercase(), query.lowercase()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<menu xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<!-- app:searchHintIcon="@drawable/search_icon"-->
|
||||
<!-- android:icon="@drawable/search_icon"-->
|
||||
<item
|
||||
android:id="@+id/search_button"
|
||||
android:icon="@drawable/search_icon"
|
||||
android:title="@string/title_search"
|
||||
app:actionViewClass="android.widget.SearchView"
|
||||
app:searchHintIcon="@drawable/search_icon"
|
||||
app:showAsAction="ifRoom" />
|
||||
android:icon="@drawable/search_icon"
|
||||
android:searchIcon="@drawable/search_icon"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="always|collapseActionView"
|
||||
tools:ignore="AppCompatResource" />
|
||||
<item
|
||||
android:id="@+id/lang_filter"
|
||||
android:icon="@drawable/ic_baseline_language_24"
|
||||
|
|
Loading…
Reference in a new issue