-
Notifications
You must be signed in to change notification settings - Fork 266
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
Improve annotation & implement shared element transition #40
base: dev
Are you sure you want to change the base?
Conversation
- add api addSharedElements that add shared element to last op (tail)
* | ||
* @return The default value is true. | ||
*/ | ||
boolean closeIfEmpty() default true; |
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.
did you tried bondContainerView = true
or stickyStack = true
?
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.
yes i was but it just not work on my case.
Example: i have main screen with 5 fragments (5 nav menu items) and i using addFragment
to add it and this method do not add to stack. so when i create new fragment with startFragment
and after finish i close it. it will check onBackPress
because my stack = 0 so it close activity
i meant the case when you have like 5 fragments on Map ( will not change on app life cycle ) but 0 on stack and you want to keep it when you add and remove other fragment from stack without trigger close() if stack size = 0
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.
@JustKiddingBaby check show
demo you will see it close application when you press back button that is something maybe user want to avoid
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.
@namkazt OK, i got it , thanks for the PR , i will review in weekend and merge it as soon .
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.
@namkazt please change the target branch to dev
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.
okey. will fix conflict when have free time.
- add Shared Element object - fix replace functions
1, add option closeIfEmpty to annotation @puppet
in some case that using Rigger.addFragment() ( fragment not added in stack ) and show ( without re-init fragment )
when press back button it will close current activity that maybe unwanted action. So set
@Puppet(containerViewId = R.id.fragment_container, closeIfEmpty = false)
will solve that problem.require:
in Activity to interrupted back press.
test: implementation 'com.github.namkazt:FragmentRigger:3d8e43637c'
2, implement shared element transaction
Note2: shared element transaction only work with replace for now ( show and hide will add next PR if this go thought )
How to make it work :
1, create shared elements
2, pass it thought replaceFragment method ( new replace method act like
startFragment
but call replace and addSharedElement)Note: on each fragment will need