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

Get actual height #87

Open
konopkoman opened this issue Aug 28, 2018 · 0 comments
Open

Get actual height #87

konopkoman opened this issue Aug 28, 2018 · 0 comments

Comments

@konopkoman
Copy link

konopkoman commented Aug 28, 2018

Initially my FlowLayout is hidden, then I want to expand it using animation. The layout contains two lines of tags (buttons). The problem is I can't get actual height of FlowLayout with multiple lines of tags: it returns height (not sure) of single-line container.
Verbose question.

Animation expand code:

        v.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        final int targetHeight = v.getMeasuredHeight();

        v.getLayoutParams().height = 1;
        v.setVisibility(View.VISIBLE);
        Animation a = new Animation(){
            @Override
            protected void applyTransformation(float interpolatedTime, Transformation t) {
                v.getLayoutParams().height = interpolatedTime == 1
                        ? ViewGroup.LayoutParams.WRAP_CONTENT
                        : (int)(targetHeight * interpolatedTime);
                v.requestLayout();
            }

            @Override
            public boolean willChangeBounds() {
                return true;
            }
        };
@konopkoman konopkoman changed the title Get height of view Get actual height Aug 28, 2018
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