Skip to content

When w,h =0, onSizeChanged should not be continued... #177

@kyungin-park

Description

@kyungin-park

I wanted to add this StaggeredGridView in PullToRefresh library,
but I failed it because onSizeChanged is called first while creating refreshable view (StaggeredGridView) on PullToRefresh.
And then onMeasure is called.
onMeasure can not remake mColumnLefts since onSizeChanged has already made mColumnLefts, mColumnBottoms, mColumnTops, etc even though w and h was 0.

So,

StaggeredGridView.java

@Override
protected void onSizeChanged(int w, int h) {
    super.onSizeChanged(w, h);

///////////////// This kind of code is needed.
    if(w <= 0 || h <= 0) {
        return;
    }

Please consider this.
Thank you a lot for your great work~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions