mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Improved the selection and deselection of ZIM files for deletion.
* Fixed: A memory leak in `HelpFragment` which is showing after migrating the localLibrary fragment to compose.
This commit is contained in:
parent
4205fc41b7
commit
00f79df953
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.download
|
||||
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.core.content.edit
|
||||
@ -158,7 +159,9 @@ class DownloadTest : BaseActivityTest() {
|
||||
"Couldn't find downloaded file\n Original Exception: ${e.message}"
|
||||
)
|
||||
}
|
||||
LeakAssertions.assertNoLeaks()
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
|
||||
LeakAssertions.assertNoLeaks()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getOnlineLibraryList(): List<LibraryListItem> {
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.main
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.core.content.edit
|
||||
import androidx.lifecycle.Lifecycle
|
||||
@ -131,6 +132,8 @@ class TopLevelDestinationTest : BaseActivityTest() {
|
||||
clickSupportKiwixOnSideNav()
|
||||
pressBack()
|
||||
}
|
||||
LeakAssertions.assertNoLeaks()
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
|
||||
LeakAssertions.assertNoLeaks()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -563,6 +563,8 @@ class LocalLibraryFragment : BaseFragment(), CopyMoveFileHandler.FileCopyMoveCal
|
||||
// Force recomposition by first setting an empty list before assigning the updated list.
|
||||
// This is necessary because modifying an object's property doesn't trigger recomposition,
|
||||
// as Compose still considers the list unchanged.
|
||||
updateLibraryScreenState(fileSelectListState = FileSelectListState(emptyList()))
|
||||
// Update the real state for UI.
|
||||
updateLibraryScreenState(
|
||||
fileSelectListState = state,
|
||||
noFilesViewItem = Triple(
|
||||
|
@ -133,6 +133,7 @@ class StorageSelectDialog : DialogFragment() {
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
storageSelectDialogViewBinding?.root?.removeAllViews()
|
||||
storageSelectDialogViewBinding = null
|
||||
}
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ abstract class HelpFragment : BaseFragment() {
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
fragmentHelpBinding?.root?.removeAllViews()
|
||||
fragmentHelpBinding = null
|
||||
}
|
||||
}
|
||||
|
@ -159,6 +159,7 @@ class CustomDownloadFragment : BaseFragment(), FragmentActivityExtensions {
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
fragmentCustomDownloadBinding?.root?.removeAllViews()
|
||||
fragmentCustomDownloadBinding = null
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user