-
Notifications
You must be signed in to change notification settings - Fork 41
fix: shutdown ImageLoader onDropViewInstance on android #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: shutdown ImageLoader onDropViewInstance on android #311
Conversation
🦋 Changeset detectedLatest commit: 137adaf The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this!
packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt
Outdated
Show resolved
Hide resolved
05a184e
to
648fa69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for changing it! One more small nit and we are good to go
@@ -384,6 +384,10 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) { | |||
updateTextAppearance() | |||
} | |||
|
|||
fun shutdownImageLoader() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we call this onDropViewInstance
? If in the future there is some other deinit code then we will have universal function to do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course! Will fix asap
packages/react-native-bottom-tabs/android/src/newarch/RCTTabViewManager.kt
Show resolved
Hide resolved
648fa69
to
574d8d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
PR Description
imageLoader.shutdown()
is calledonDetachedFromWindow
. But this lifecycle method is called when opening a modal on top of the current view containing bottom tabs. When then closing the modal theImageLoader
has been shutdown and wont load icons anymore. Solved this by checking ifimageLoader
is null in thegetDrawable
method and if so creates it again.Fixes #309
How to test?