nested-fragments | nested fragments in various widgets | Android library
kandi X-RAY | nested-fragments Summary
kandi X-RAY | nested-fragments Summary
Samples of nested fragments in various widgets (TabHost, ViewPager)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nested-fragments
nested-fragments Key Features
nested-fragments Examples and Code Snippets
Community Discussions
Trending Discussions on nested-fragments
QUESTION
I have a main activity with a linearLayout container called "mainActivityContainer". In this container I make many fragment transactions, managing the backstack for back-navigation. I manage all transactions with getSupportFragmentManager.
Now, I am in fragment sportsFragment which is loaded in the "mainActivityContainer". sportsFragment loads sportsFragmentXml. sportsFragmentXml has a view "mainFragmentContainer" where I load a list of sports. When I click on a date filter from sportsFragmentXml, I add a new fragment with getChildFragmentManager, a customCalendarFragment, into mainFragmentContainer, in order to filter the sport events based on date.
...ANSWER
Answered 2018-Jun-11 at 10:55After many test and trials, I replaced the getChildFragmentManager with the normal getFragmentManager and this solved my issue.
QUESTION
Hello good programmers of stack overflow! I've spent a good week with this problem and am now very desperate for a solution.
The scenarioI'm using android.app.Fragment's not to be confused with the support fragments.
I have 6 child fragments named:
FragmentOne
FragmentTwo
FragmentThree
FragmentA
FragmentB
FragmentC
I have 2 parent fragments named:
FragmentNumeric
FragmentAlpha
I have 1 activity named:
MainActivity
They behave in the following:
- Child fragments are fragments that only show a view, they do not show nor contain fragments.
- Parent fragments fill their entire view with a single child fragment. They're able to replace the child fragment with other child fragments.
- The activity fills most of its view with a parent fragment. It can replace it with other parent fragments. So at any one time the screen has just a single child fragment showing.
As you've probably guessed,
FragmentNumeric
shows child fragments FragmentOne
, FragmentTwo
, and FragmentThree
.
FragmentAlpha
shows child fragments FragmentA
, FragmentB
, and FragmentC
.
I'm trying to transition/animate parent and child fragments. The child fragments transition smoothly and as expected. However when I transition to a new parent fragment, it looks terrible. The child fragment looks like it runs an independent transition from its parent fragment. And the child fragment looks like it is removed from the parent fragment as well. A gif of it can be viewed here https://imgur.com/kOAotvk. Notice what happens when I click Show Alpha.
The closest question & answers I could find are here: Nested fragments disappear during transition animation however all of the answers are unsatisfying hacks.
Animator XML FilesI have the following animator effects (duration is long for testing purposes):
fragment_enter.xml
...ANSWER
Answered 2017-Oct-23 at 12:47You are getting so wired result, cause you are using exit animations for your Fragment. Basically, we have such issues with Fragment animation every time, and finally moved from source Fragment animation, to using own, each time we preforming transition.
1) To verify this behavior, you can just remove exit animation for fragment, and everything will be ok. In most cases it should be enough, cause exit animation very specific and used only for single fragment managing (not in you case, with childs)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nested-fragments
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page