rockerhieu / rv-adapter-endless

Endless support for RecyclerView.Adapter
MIT License
107 stars 24 forks source link

Custom PendingViewHolder implementation #11

Closed yayaa closed 7 years ago

yayaa commented 7 years ago

Hey, i'm back! πŸ˜„ https://github.com/rockerhieu/rv-adapter-endless/pull/5

I found some time and update my implementation, actually updated the commits and unnecessary files :) Please take a look, you can even consider commits one by one, they should be meaningful πŸ‘

This solves https://github.com/rockerhieu/rv-adapter-endless/issues/9 and also https://github.com/rockerhieu/rv-adapter-endless/issues/8

Changes

yayaa commented 7 years ago

How this solves #8

Simple create something like this, and set it to endlessAdapter

public class LoadMoreViewHolder extends RecyclerView.ViewHolder {

    public LoadMoreViewHolder(View view) {
        super(view);
        useFullSpan();
    }

    // Set fullSpan to fit screen
    private void useFullSpan() {
        StaggeredGridLayoutManager.LayoutParams layoutParams = new StaggeredGridLayoutManager
                .LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        layoutParams.setFullSpan(true);
        itemView.setLayoutParams(layoutParams);
    }

}
rockerhieu commented 7 years ago

Let me have a look...

yayaa commented 7 years ago

How do you wanna proceed with this PR? @rockerhieu Do you have anything else? Do you need me to change something in order to accept or what?

yayaa commented 7 years ago

what_now

rockerhieu commented 7 years ago

Hey I'm travelling for Google IO. Will respond when I'm back.

On May 13, 2017 1:28 PM, "Yahya Bayramoğlu" notifications@github.com wrote:

[image: what_now] https://cloud.githubusercontent.com/assets/2683375/26029009/73044308-382b-11e7-8868-9178034130f9.gif

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rockerhieu/rv-adapter-endless/pull/11#issuecomment-301272847, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOPYc6xo0ltSbMXMp0HCKgk9NMNH4lFks5r5hJ9gaJpZM4L3M3J .

rockerhieu commented 7 years ago

Hey @yayaa, wanna update the example to demonstrate the new changes? i.e the ability to use a custom PendingViewHolder?

yayaa commented 7 years ago

@rockerhieu without tools travis fails, added that line back. And updated the sample πŸ‘ please take a look

rockerhieu commented 7 years ago

Waiting for the green badge...

rockerhieu commented 7 years ago

@yayaa I just checked, it seems that tools isn't the cause: https://travis-ci.org/rockerhieu/rv-adapter-endless/builds/238249499. There were some lint errors.

rockerhieu commented 7 years ago

Thanks @yayaa

yayaa commented 7 years ago

Thank you as well πŸ‘ @rockerhieu When you release the version, you can also close the 2 open issues you have :)