Skip to content

Commit 28401e5

Browse files
committed
close search at opening settings/about
1 parent dfb87a8 commit 28401e5

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ android {
6363
}
6464

6565
dependencies {
66-
implementation 'com.github.SimpleMobileTools:Simple-Commons:4d36cc84e9'
66+
implementation 'com.github.SimpleMobileTools:Simple-Commons:f84b3a7e61'
6767
implementation 'com.github.Stericson:RootTools:df729dcb13'
6868
implementation 'com.github.Stericson:RootShell:1.6'
6969
implementation 'com.alexvasilkov:gesture-views:2.5.2'

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,7 @@ class MainActivity : SimpleActivity() {
411411

412412
main_view_pager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
413413
override fun onPageScrollStateChanged(state: Int) {
414-
if (isSearchOpen) {
415-
(getCurrentFragment() as? ItemOperationsListener)?.searchQueryChanged("")
416-
searchMenuItem?.collapseActionView()
417-
}
414+
closeSearchIfOpen()
418415
}
419416

420417
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
@@ -493,6 +490,13 @@ class MainActivity : SimpleActivity() {
493490
}
494491
}
495492

493+
private fun closeSearchIfOpen() {
494+
if (isSearchOpen) {
495+
(getCurrentFragment() as? ItemOperationsListener)?.searchQueryChanged("")
496+
searchMenuItem?.collapseActionView()
497+
}
498+
}
499+
496500
private fun openPath(path: String, forceRefresh: Boolean = false) {
497501
if (mIsPasswordProtectionPending && !mWasProtectionHandled) {
498502
return
@@ -599,11 +603,13 @@ class MainActivity : SimpleActivity() {
599603
}
600604

601605
private fun launchSettings() {
606+
closeSearchIfOpen()
602607
hideKeyboard()
603608
startActivity(Intent(applicationContext, SettingsActivity::class.java))
604609
}
605610

606611
private fun launchAbout() {
612+
closeSearchIfOpen()
607613
val licenses = LICENSE_GLIDE or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GESTURE_VIEWS
608614

609615
val faqItems = arrayListOf(

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.6.0'
4+
ext.kotlin_version = '1.6.10'
55

66
repositories {
77
google()

0 commit comments

Comments
 (0)