-
-
Notifications
You must be signed in to change notification settings - Fork 643
fix(Android): drawing order for multiple disappearing screens #2806
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
Merged
kkafar
merged 15 commits into
main
from
@kligarski/drawing-order-for-multiple-disappearing-screens-2
Apr 2, 2025
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4cbd032
Cleanup ScreensCoordinatorLayout code
kkafar 97b0025
Move Screens{CoordinatorLayout,Animation} to separate package
kkafar 472e8a5
Track disappearing transitioning children & disable child drawing ord…
kkafar 51e98e1
Make it for push screens
kkafar f482314
Move ChildDrawingOrderStrategy interface to separate file
kkafar d8eab84
Code cleanup
kkafar 6655a66
change SwapLastTwo into ReverseOrderStartingFrom to account for mutli…
kligarski 56b2cf2
cleanup + clarifying comment
kligarski fc308c6
Merge branch 'main' into @kligarski/drawing-order-for-multiple-disapp…
kkafar f44513a
Add comments
kkafar d6857e8
change to reversing whole list instead of using indexes
kligarski 611ed88
Merge branch 'main' into @kligarski/drawing-order-for-multiple-disapp…
kkafar 264cae7
Fix typo
kkafar 2dc640c
Fix naming & change ReverseInRange to ReverseFromIndex
kkafar 2f15672
Move strategies to separate file
kkafar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
android/src/main/java/com/swmansion/rnscreens/stack/anim/ScreensAnimation.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.swmansion.rnscreens.stack.anim | ||
|
|
||
| import android.view.animation.Animation | ||
| import android.view.animation.Transformation | ||
| import com.swmansion.rnscreens.ScreenFragment | ||
|
|
||
| internal class ScreensAnimation( | ||
| private val mFragment: ScreenFragment, | ||
| ) : Animation() { | ||
| override fun applyTransformation( | ||
| interpolatedTime: Float, | ||
| t: Transformation, | ||
| ) { | ||
| super.applyTransformation(interpolatedTime, t) | ||
| // interpolated time should be the progress of the current transition | ||
| mFragment.dispatchTransitionProgressEvent(interpolatedTime, !mFragment.isResumed) | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Action point for the future: Fragment
ScreenFragmentshould have onTransitionProgress callback & it should be called here. This class should not dispatch the events directly.