How to make a recyclerview that shows one item and shows another item when it is swiped horizontally? - kotlin

For example the recyclerview should show one image at the same time and other image should be shown when the recyclerview is swiped horizontally.(https://i.stack.imgur.com/4BBrs.jpg)
I use Linear Layout as horizontally to show images.

I've found a solution. I wanted to show just one item or image at the same time in a recylerview and when the recyclerview is swiped next item would be shown to the user. That work is just basic as adding that piece of code in the below after making the configuration of your recylerview.
PagerSnapHelper().attachToRecyclerView(yourRecyclerView)

Related

recyclerview with both vertical and horizontal scrolling use layoutManager

I want to create a table using RecyclerView that scrolls both horizontally and vertically (without using the HorizontalScrollView)
I used this class
https://github.com/devunwired/recyclerview-playground/blob/master/app/src/main/java/com/example/android/recyclerplayground/layout/FixedGridLayoutManager.java
But unfortunately it has a bug and has not been updated since 2016.
For example, I want the page to scroll from right to left when opened activity, but it is not possible
Please help me if anyone knows.

How to create a unique RecyclerView for another RecyclerView in a separate activity

I have an application in which on the first activity I create an Item in the recyclerView (a section consisting of one or two words), and by clicking on it I go to another activity where the RecyclerView is also located in which I create ordinary notes by filling out the adapter. The problem is that for each Item I need a separate recyclerView, and wherever I clicked, the same recyclerView opensenter image description here
enter image description here
It's the basic data problem I think.
Maybe You're not passing the right data when an item is clicked. Try putting some logs or debug points where you pass the data in the next activity to set it in the recyclerview.

Scrolled to the bottom when ads (admob) loaded in recyclerview in android

I have a recyclerview with 7 items in it. In the bottom of the list, I insert a banner of admob. I have inserted successfully.However, when the ads (in the bottom of the list) loaded, it automatically scrolled my view to the bottom.
I have used "ScrollToPosition(0)" but it doesn't have any effects.
I want my list always in the top when the ads loaded. What should I do?
Many Thanks.

Android recycler view item position

In my app I am showing a list of cards in a recycler view. The card view consists of two textviews and one imageview. Whenever the user clicks on the imageView of a cardview I need the position of the cardview. Any help would be appreciated.
You can set an OnClickListener for your ImageView inside your Adapter , from there you can get the position of current Item by using getAdapterPosition() method.
also you can see :
Get position of clicked item in recycler view
How do I get the position selected in a RecyclerView?

RecyclerView with page scrolling (Vertical ViewPager)

I want to open a different row on scrolling RecyclerView vertically and hide previous row completely. Similar to ViewPager but vertically. I have tried the library VerticalViewPager, but it is just a vertical RecyclerView.
Please suggest me.