DraggablePanel icon indicating copy to clipboard operation
DraggablePanel copied to clipboard

Dynamic change TopFragment's layout after calling initializeView

Open bqthuan opened this issue 9 years ago • 3 comments

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.

bqthuan avatar Nov 16 '15 22:11 bqthuan

@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 avatar Nov 22 '15 19:11 tanaev

@tanaev Did you test your solution? It's not working for me.

bqthuan avatar Nov 23 '15 04:11 bqthuan

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?

andreimarinescu avatar Jun 15 '16 09:06 andreimarinescu