We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following Magellan code would lead to a persisted Context reference:
override fun onShow(context: Context, binding: LoadingSectionBinding) { ... blend { immediate() target(placeholderViews).animations { alpha(minAlpha) } }.then { stagger(subjects = placeholderViews, timeBetweenTargets = staggerStepMillis, timeUnit = MILLISECONDS) { currentView -> duration(time = pulseDurationMillis, timeUnit = MILLISECONDS) repeat(count = INFINITE, mode = REVERSE) target(currentView).animations { alpha(maxAlpha) } } }.start() } override fun onHide(context: Context, binding: LoadingSectionBinding) { ... blend.stopPulsing(*placeholderViews.toTypedArray()) }
Avoiding the use of Blend's wrapper and using the Android animator directly fixes the leak:
override fun onShow(context: Context, binding: LoadingSectionBinding) { ... animator = blend { immediate() target(placeholderViews).animations { alpha(minAlpha) } }.then { stagger(subjects = placeholderViews, timeBetweenTargets = staggerStepMillis, timeUnit = MILLISECONDS) { currentView -> duration(time = pulseDurationMillis, timeUnit = MILLISECONDS) repeat(count = INFINITE, mode = REVERSE) target(currentView).animations { alpha(maxAlpha) } } }.prepare() animator!!.start() } override fun onHide(context: Context, binding: LoadingSectionBinding) { animator!!.cancel() animator = null }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following Magellan code would lead to a persisted Context reference:
Avoiding the use of Blend's wrapper and using the Android animator directly fixes the leak:
The text was updated successfully, but these errors were encountered: