RecyclerView highlights the final gallery effect and holds the layout on both sides. recyclerview Gallery
First, give you a gif. Otherwise, it would be boring.
I forgot where I saw it .....
I have been looking for NNNNNN for a long time. I think it will take a long time to write the result based on my current capabilities. So, I 'd like to go back and try again...
Don't underestimate this. I found this one for three or four days (just my heaven)
Let's talk a little bit about code.
Step 1
Add dependency (do not ask where to add)
Compile 'com. azoft. carousellayoutmanager: carousel: 1.2.1'
Step 2
You can use the system for layout.
Step 3
Adapter configuration (normally writing your own logic has nothing to do with this, mainly layoutmanage)
Step 4
Activity Configuration
InitRecyclerView () method content ------ key points
Please refer to the following link for more information: when there are already too many threads, there are already too many threads
// Implement the zoom Effect
// Enable zoom effect. this line can be customized
LayoutManager. setPostLayoutListener (newCarouselZoomPostLayoutListener ());
LayoutManager. setMaxVisibleItems (2 );
RecyclerView. setLayoutManager (layoutManager );
// Fixed the item size
// We recommend CT only fixed sized item for now
RecyclerView. setHasFixedSize (true );
// Sample adapter with random data
RecyclerView. setAdapter (adapter );
// Implement intermediate item scrolling
// Enable center post scrolling
RecyclerView. addOnScrollListener (newCenterScrollListener ());
// Item sliding listener
DefaultChildSelectionListener. initCenterItemListener (newdefachilchildselectionlistener. OnCenterItemClickListener (){
@ Override
Public voidonCenterItemClicked (@ NonNullfinalRecyclerViewrecyclerView, @ NonNullfinalCarouselLayoutManagercarouselLayoutManager, @ NonNullfinalViewv ){
Final intposition = recyclerView. getChildLayoutPosition (v );
}, RecyclerView, layoutManager );
// Item click listener
LayoutManager. addOnItemSelectionListener (newreceivusellayoutmanager. OnCenterItemSelectionListener (){
@ Override
Public voidonCenterItemChanged (final intadapterPosition ){
If (CarouselLayoutManager. INVALID_POSITION! = AdapterPosition ){
}
}
});
Now we can complete the process. You can go back to multiple contact persons, because I also forgot where the original demo was (IT seems I found IT in the blue leopard) because I am in a project, so I am too lazy to write a demo. You can also try searching for carousellayoutmanager on github. Maybe you can find it and download the demo and change it to some pitfalls.
Success !!!!!