diff --git a/CHANGELOG.md b/CHANGELOG.md index 10c643d..e911b0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 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 + ## 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 2736ad3..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() } } } @@ -507,6 +508,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 +517,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/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, 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 } }