Open bqthuan opened 8 years ago
@bqthuan when you call initializeView() its called draggableView.attachTopFragment(topFragment);
void attachTopFragment(Fragment topFragment) { addFragmentToView(R.id.drag_view, topFragment); }
then
private void addFragmentToView(final int viewId, final Fragment fragment) { fragmentManager.beginTransaction().replace(viewId, fragment).commit(); } where viewId is R.id.drag_view by default so, for change top fragment, you need something like
getSupportFragmentManager().beginTransaction().replace(R.id.drag_view, YOUFRAGMENT).commit();
@tanaev Did you test your solution? It's not working for me.
I'm having the same issue, I'm unable to change the view hierarchy of the top fragment. The only thing that worked indeed was calling a requestLayout on the bottom fragment with a 500 ms delay (when doing it instantly, the touch would also have issues and onMaximize would be called each time i touched the top fragment).
Any way of doing this elegantly?
Hi you, After calling initializeView i cannot dynamic add view to TopFragment's layout, doesn't crash or throws any exception but doesn't showing the added view, seem not invalidated, i also call invalidate, requestLayout for TopFragment's layout, DraggablePanel and the added view, not working at all. Final solution that working : Calling requestLayout for BottomFragment's layout after adding view to TopFragment's layout. So, I have no idea how my solution works and this problem.