umano / AndroidSlidingUpPanel

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.
http://umano.me
Apache License 2.0
9.5k stars 2.26k forks source link

never recalculate the layout height after replace it programmatically #995

Open boomrules opened 2 years ago

boomrules commented 2 years ago

I add the second child in sliding panel with:

<include layout="@layout/search_location" />

But at a moment I need to replace this layout with another. Using next code:

FrameLayout mainLayout = findViewById(R.id.slide);
 View layout = View.inflate(this,R.layout.menu_settings,null);
 mainLayout.removeAllViews();
 mainLayout.addView(layout);

The new layout is shortest as the first one.

The problem is that when show the slide panel it will jump to the same point as for old layout. if hide it and reveal again he is displayed ok now.

Here is slider with first layout:

http://ghiduldrumetului.ro/1.jpg

And here with replaced one:

http://ghiduldrumetului.ro/2.jpg

What need to do that slidepanel to calculate well the height after replacement of second child layout?