From 32bd35aa485d76a15a014eee8d6b35180218ed0b Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 12 Nov 2022 18:02:08 +0100 Subject: [PATCH] fix searchview --- app/release/output-metadata.json | 72 ------------------- .../libretube/ui/activities/MainActivity.kt | 4 ++ .../com/github/libretube/util/LayoutHelper.kt | 3 - 3 files changed, 4 insertions(+), 75 deletions(-) delete mode 100644 app/release/output-metadata.json delete mode 100644 app/src/main/java/com/github/libretube/util/LayoutHelper.kt diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json deleted file mode 100644 index 263b5ec17..000000000 --- a/app/release/output-metadata.json +++ /dev/null @@ -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" -} \ No newline at end of file diff --git a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index 28a2d331d..99ab6cf9f 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -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] diff --git a/app/src/main/java/com/github/libretube/util/LayoutHelper.kt b/app/src/main/java/com/github/libretube/util/LayoutHelper.kt deleted file mode 100644 index f8d65ac90..000000000 --- a/app/src/main/java/com/github/libretube/util/LayoutHelper.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.github.libretube.util - -object LayoutHelper