How to create a WheelPicker that displays custom Views

Iron Man :

I have a custom View called CustomProgressBar. I want to have a wheelView that will have a list of CustomProgressBar Views as its data.

this is how a CustomProgressBar looks:

CustomProgressBar

and this is how I want my WheelView to look (not exactly, but this is the idea):

enter image description here

I want the border of the selected CustomProgressBar to expand when onScroll, and re-shrink when selected.

Only if possible I'd like it to be in 3D, like in here (only the 3D effect, not the look)

So, to conclude, I want a 3D WheelPicker that can carry my CustomProgressBar View Items, and I want the selected-items border to be custom and animated to expand on scroll and re-shrink on the selected item.

Thanks in advance (:

Tamir Abutbul :

I would combine RecyclerView with CarouselLayoutManager.

I have used it before and it works great, in your recyclerView you can put any type of view (In your case just put your CustomProgressBar)

How to use according to the Github page:

  • Implementation:

    //current latest vaersion is 1.2.4
    implementation 'com.azoft.carousellayoutmanager:carousel:version'
    
  • In your code:

    final CarouselLayoutManager layoutManager = new 
    CarouselLayoutManager(CarouselLayoutManager.VERTICAL);
    
    final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setHasFixedSize(true);
    

Note : this may help you Use custom View in a RecyclerView Adapter?

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=356659&siteId=1