From deebad0708bcf7d09236420a432b117d68bb543e Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Sat, 25 May 2024 22:20:46 +0300 Subject: [PATCH 1/3] [FIX][sorting turned off during search] --- .../feature/files/presentation/FilesListFragment.kt | 3 +++ .../snfilemanager/feature/media/presentation/MediaFragment.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt index 2736ad3..02b6606 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt @@ -507,6 +507,7 @@ class FilesListFragment : item.setOnActionExpandListener( object : MenuItem.OnActionExpandListener { override fun onMenuItemActionExpand(p0: MenuItem): Boolean { + getToolbar().menu.findItem(R.id.sort).isVisible = false return true } @@ -515,6 +516,8 @@ class FilesListFragment : actionMode?.finish() false } else { + getToolbar().menu.findItem(R.id.sort).isVisible = true + invalidateOptionsMenu() true } } diff --git a/app/src/main/java/com/sn/snfilemanager/feature/media/presentation/MediaFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/media/presentation/MediaFragment.kt index 9b1cbc3..1ab692d 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/media/presentation/MediaFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/media/presentation/MediaFragment.kt @@ -356,6 +356,7 @@ class MediaFragment : item.setOnActionExpandListener( object : MenuItem.OnActionExpandListener { override fun onMenuItemActionExpand(p0: MenuItem): Boolean { + getToolbar().menu.findItem(R.id.sort).isVisible = false return true } @@ -364,6 +365,8 @@ class MediaFragment : actionMode?.finish() false } else { + getToolbar().menu.findItem(R.id.sort).isVisible = true + invalidateOptionsMenu() true } } From 1246c61384f4e542c0cc3e4c036e433b78f9d62c Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Mon, 27 May 2024 22:31:02 +0300 Subject: [PATCH 2/3] [DEV][minor imp and version bump] --- CHANGELOG.md | 4 ++++ app/build.gradle | 4 ++-- .../feature/files/presentation/FilesListFragment.kt | 1 + .../feature/files/presentation/FilesListViewModel.kt | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10c643d..36c3330 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.0.0-beta9 (**.**.****) +* The issue of the screen not refreshing when a single file is deleted has been resolved +* The sorting feature is hidden while the search is active + ## v1.0.0-beta-8 (25.05.2024) * Sorting feature added for file and media items * The synchronization issue with the show hidden files setting button has been fixed diff --git a/app/build.gradle b/app/build.gradle index 9190ba0..2193bd2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,8 +39,8 @@ android { applicationId "com.sn.snfilemanager" minSdk 26 targetSdk 34 - versionCode 8 - versionName "1.0.0-beta8" + versionCode 9 + versionName "1.0.0-beta9" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt index 02b6606..87d0310 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListFragment.kt @@ -190,6 +190,7 @@ class FilesListFragment : JobType.DELETE -> { activity?.runOnUiThread { data?.filterIsInstance()?.let { adapter?.removeItems(it) } + adapter?.itemCount?.let { count -> if (count == 0) viewModel.setEmptyToFileList() } } } diff --git a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt index 2900d8d..3e3b664 100644 --- a/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt +++ b/app/src/main/java/com/sn/snfilemanager/feature/files/presentation/FilesListViewModel.kt @@ -119,6 +119,10 @@ class FilesListViewModel fun isSingleItemSelected(): Boolean = selectedItemList.size == 1 + fun setEmptyToFileList() { + _updateListLiveData.value = Event(mutableListOf()) + } + fun addSelectedItem( file: FileModel, selected: Boolean, From cd835c736316a2bb6df57bc72da651fd074a7c13 Mon Sep 17 00:00:00 2001 From: Emre Esen Date: Fri, 31 May 2024 20:52:59 +0300 Subject: [PATCH 3/3] [DEV][changelog edited] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c3330..e911b0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v1.0.0-beta9 (**.**.****) +## v1.0.0-beta9 (31.05.2024) * The issue of the screen not refreshing when a single file is deleted has been resolved * The sorting feature is hidden while the search is active