question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any reason, we measure child to size 0

See original GitHub issue

Hi I am currently reading the zoom layout code in onMeasure of ZoomLayout

// Measure ourselves as MATCH_PARENT
        val widthMode = View.MeasureSpec.getMode(widthMeasureSpec)
        val heightMode = View.MeasureSpec.getMode(heightMeasureSpec)
        if (widthMode == View.MeasureSpec.UNSPECIFIED || heightMode == View.MeasureSpec.UNSPECIFIED) {
            throw RuntimeException("$TAG must be used with fixed dimensions (e.g. match_parent)")
        }
        val widthSize = View.MeasureSpec.getSize(widthMeasureSpec)
        val heightSize = View.MeasureSpec.getSize(heightMeasureSpec)
        setMeasuredDimension(widthSize, heightSize)

        // Measure our child as unspecified.
        val spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
        measureChildren(spec, spec)

May I ask why do we measure child to 0 size

Thanks #

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xiaogegexiaocommented, Apr 5, 2019

Thanks @natario1 .

For having ZL in RecyclerView, I create a branch on my git repo.

https://github.com/xiaogegexiao/ZoomLayout/tree/experimental/xiao/zoomlayout-in-recyclerview.

You can take a look when you have time

0reactions
xiaogegexiaocommented, Apr 14, 2019

@markusressel Yeah, thanks, I think it works. Just wonder whether it will support ZL in recyclerview. I will close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Body Image: Move Over Size 0, Some Women Brag About ...
Body Image: Move Over Size 0, Some Women Brag About Fitting Into Kids Clothes · Caption Options · Glamour Daily.
Read more >
When a Size 0 Isn't Really 0: The Psychology Behind Top ...
1 rule of shopping. The fact is, 15 years ago, size zero and 2 did not exist in American clothes. “They are really...
Read more >
When a Child is Unusually Short - HealthyChildren.org
Short stature refers to any child who has a height well below what is typical for that child's age and sex. The term...
Read more >
Baby clothing sizes, explained: What you need to know to ...
Newborn or 0-3 months? Experts help break down the confusing world of baby sizes and how they relate to clothes.
Read more >
The Trouble With Growth Charts - The New York Times
Those lines you see on the growth chart don't represent a single child's growth — they're an amalgam of measurements of millions of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found