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

InfinitePlaceHolderView: some item doesn't display on first load #56

Closed
HauLuu opened this issue Oct 6, 2017 · 4 comments
Closed

InfinitePlaceHolderView: some item doesn't display on first load #56

HauLuu opened this issue Oct 6, 2017 · 4 comments

Comments

@HauLuu
Copy link

HauLuu commented Oct 6, 2017

In my project. I added 20 item views into an InfinitiePlaceHolder using addView method.

At the first load, some of the item views doesn't display, some of them does.

Scrolling up/down or calling refresh method on InfinitiePlaceHolder make missing item views appear.

I'm using Kotlin. BTW

@janishar
Copy link
Owner

@Saiga04
"At the first load, some of the item views doesn't display, some of them does."
can you provide some code so that I can look into this?

@janishar
Copy link
Owner

Closing this now

@iamdeadman
Copy link

Facing similar issues here, when I set the visibility for some items based on the data value they disappear after scroll and when they are recreated using the resolve method. I suspect that the data from the class level variables is getting lost when the Resolve method is called after scrolling.

For example to give you a reference -
I have a child view for a placeholder setup list this -

public TeacherTuitionQueryListCardItem(Context context, FragmentManager fragmentManager, Map<String, String> data,
                                           TeacherTuitionQueryListItemCallback callback) {
        this.mContext = context;
        this.fm = fragmentManager;
        this.mSummary = data;
        this.mCallback = callback;
    }

Now, in my -

@Resolve
public void onResolved() {
try {
            if(mSummary.get("location") != null && !mSummary.get("location").isEmpty()) {
                tuitionLocation.setText(mSummary.get("location"));
            } else {
                tuitionLocation.setVisibility(android.view.View.GONE);
                tuitionLocationPrefix.setVisibility(android.view.View.GONE);
            }
        } catch(Exception ignored){}       
}

So, I suspect that the value of mSummary gets lost when Resolved method is called after scrolling out and back in

@janishar
Copy link
Owner

@iamdeadman Please check the location field. Let me know how you are storing location? Also, put a debug flag in onResolve to see if mSummary is null or not and post me the findings.

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

3 participants