Skip to content
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

never recalculate the layout height after replace it programmatically #995

Open
boomrules opened this issue Sep 9, 2022 · 0 comments
Open

Comments

@boomrules
Copy link

boomrules commented Sep 9, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant