1

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 (:

saeed foroughi
  • 1,662
  • 1
  • 13
  • 25
Nitzan Daloomy
  • 166
  • 5
  • 24

1 Answers1

1

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?

Tamir Abutbul
  • 7,301
  • 7
  • 25
  • 53
  • It's great! not doing exactly what I expected, but it's fine. I don't know though how to include the border with the effects wanted as mentioned in the question... can you please help me achieve the border too? thanks a lot for the help! ((: – Nitzan Daloomy Jan 20 '20 at 21:03
  • Check [how to put border around textview](https://stackoverflow.com/questions/42387152/how-to-put-border-around-textview) and maybe [this can help you](https://stackoverflow.com/questions/7690416/android-border-for-button) achive the border on your view part – Tamir Abutbul Jan 20 '20 at 21:05
  • but how should I put the border static-positioned in the center, and animate it? – Nitzan Daloomy Jan 20 '20 at 21:08
  • You could check what element of your recyclerView is in the center of the screen and put the border around it every time it gets to the center of the screen. – Tamir Abutbul Jan 20 '20 at 21:10