-
Notifications
You must be signed in to change notification settings - Fork 185
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
The best way dynamically add fragment to NestedScrollView? #22
Comments
Hello, You can use something like this:
the _ at the end of |
@miguelhincapie thank you for quick answer! Do yo mean use:
But how can I pass some parameters to the fragment, for example?
|
Yeah! you can handle the fragment like any simple fragment, this Lib doesn't care about or don't touch anything about the content inside "include" or "fragment". I mean this library only cares about 3 things:
You can do what you said before: .replace(R.id.bottom_sheet_content, TestFragment.newInstance()); If you get stuck trying it I can upload a more detailed sample to the project showing it... but I trusth you can do it ;) |
Thank you! |
I created fork and reproduced problem described above you can see my code to understand the problem. See short giff: |
ohhh I get it! I know about some bugs related to resizing original bottomsheet and the works around it, but I have not found anything for this one you are showing. If you take a look when the components get "refreshed", you will see its happening when you hide/unhide any item.
Let's find whats going on xD. |
By the way, have you tried using
when you are swiping/adding new fragment? |
@miguelhincapie not tried, I added fragment in main thread. What give this? |
Issue related with onLayoutChild method, i have noticed that parent.onLayoutChild(child, layoutDirection); doesn't call after added fragment. |
This hack works http://stackoverflow.com/a/35804525/1890996 I using now I click button for showing bottom sheet
And mannually call
|
Well being hack or not if it works I will use it too hahahaha. I need it for the current app I'm finishing. |
Have you seen Recent Support Library Revisions? they are talking about Fragment transactions. I'm gonna take a look at it to see if that can help us |
Place this solution in the example! This will greatly help those who will use this library. |
At this I'm full time with some personal project, I will do it when I can or if you can do it, I appreciate it. |
For example, instead
Use
and commit fragment, for example by button click
Right now in sample it works incorrect.
The text was updated successfully, but these errors were encountered: