Merge pull request #1823 from Bnyro/master

fix searchview
This commit is contained in:
Bnyro 2022-11-12 18:02:43 +01:00 committed by GitHub
commit ea4929eaaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 75 deletions

View File

@ -1,72 +0,0 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.github.libretube",
"variantName": "release",
"elements": [
{
"type": "UNIVERSAL",
"filters": [],
"attributes": [],
"versionCode": 21,
"versionName": "0.7.0",
"outputFile": "app-universal-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "armeabi-v7a"
}
],
"attributes": [],
"versionCode": 21,
"versionName": "0.7.0",
"outputFile": "app-armeabi-v7a-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "arm64-v8a"
}
],
"attributes": [],
"versionCode": 21,
"versionName": "0.7.0",
"outputFile": "app-arm64-v8a-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "x86_64"
}
],
"attributes": [],
"versionCode": 21,
"versionName": "0.7.0",
"outputFile": "app-x86_64-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "x86"
}
],
"attributes": [],
"versionCode": 21,
"versionName": "0.7.0",
"outputFile": "app-x86-release.apk"
}
],
"elementType": "File"
}

View File

@ -52,6 +52,7 @@ class MainActivity : BaseActivity() {
val autoRotationEnabled = PreferenceHelper.getBoolean(PreferenceKeys.AUTO_ROTATION, false)
lateinit var searchView: SearchView
lateinit var searchItem: MenuItem
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -202,6 +203,8 @@ class MainActivity : BaseActivity() {
private fun removeSearchFocus() {
searchView.setQuery("", false)
searchView.clearFocus()
searchView.isIconified = true
searchItem.collapseActionView()
searchView.onActionViewCollapsed()
}
@ -211,6 +214,7 @@ class MainActivity : BaseActivity() {
// stuff for the search in the topBar
val searchItem = menu.findItem(R.id.action_search)
this.searchItem = searchItem
searchView = searchItem.actionView as SearchView
val searchViewModel = ViewModelProvider(this)[SearchViewModel::class.java]

View File

@ -1,3 +0,0 @@
package com.github.libretube.util
object LayoutHelper