ExtraLayoutSpace of RecyclerView

Post on 14-Apr-2017

3.030 views 0 download

Transcript of ExtraLayoutSpace of RecyclerView

ExtraLayoutSpace of RecyclerView

kyobashi.dex #2 @amyu_san

ABOUT ME

▸ Name : Yuki Mima

▸ Twitter : @amyu_san

▸ github : amyu

▸ Work : Android App Engineer

Why do you use RecyclerView

I can not be implemented in the ListView

TEXT

The good point of RecyclerView

▸ Easy implementation of Animation

▸ Easy implementation of Animation

▸ Easy implementation of Animation

▸ Easy implementation of Animation

▸ Easy implementation of pre-load

▸ Easy implementation of Cache

TEXT

What is ExtraLayoutSpace

▸ The amount of extra space that should be laid out by LayoutManager.

ExtraLayoutSpace = 0

https://www.youtube.com/watch?v=1xMNmMjqEbI

ExtraLayoutSpace = Display Heigh

https://www.youtube.com/watch?v=4c7ZID7yjII

TEXT

How to implement

▸ Override the LinearLayoutManager#getExtraLayoutSpace

Returns the amount of extra space that should be laid out by LayoutManager.

By default, LinearLayoutManager lays out 1 extra page of items while smooth scrolling and 0 otherwise.

You can override this method to implement your custom layout pre-cache logic.

protected int getExtraLayoutSpace (RecyclerView.State state)

Laying out invisible elements will eventually come with performance cost!

But it improves user experience!!!!

Try to use!