dadouf / PagingImageGallery

114 stars 28 forks source link

Scroll in tablets #2

Open jarroyoesp opened 2 years ago

jarroyoesp commented 2 years ago

Hi @dadouf, nice project to learn how to build a custom carousel 😃 .

But one question, I have one problem when I rotate the screen or in tablets, when you scroll and try to select first or last position, recyclerview moves to second position, has it happened to you??

Thanks in advance

dadouf commented 2 years ago

Hola Javier!

Do you get this behavior on this project, or on a custom implementation you've made? I have just tried on a Pixel C tablet (emulator, I don't have a physical one) and it seems to work fine: https://drive.google.com/file/d/12KaERypiwE4ATtr5A3MAtBOKl7Tm1IqP/view?usp=sharing Let me know if you have exact steps to reproduce.

jarroyoesp commented 2 years ago

Hi David! Yes, with your example is working well. But we are creating a carousel like yours but with more elements visibles at the same time. When you configure it and in screen there are for example 7 items visibles, and you try to select first, recyclerView automatically moves the scroll to the second element.

You can try it changing the cover size in CarouselAdapter: vh.overlayableImageView.layoutParams = RecyclerView.LayoutParams( 100, RecyclerView.LayoutParams.MATCH_PARENT ) Thanks! :)