Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Horizontal Scroll View with picker

The user needs to enter their weight in the sign up page of my App, for which a horizontal scroll view is created, on which the center element data will be taken as the user's height in inches.

enter image description here

I tried implementing the Spinner Wheel Library from Android SpinnerWheel but it supports only int values and does not support fractions.

I also tried the Android HorizontalScrollView with Center Lock library but it does not support auto scrolling.

Can anyone please suggest some examples or tips to implement the above mentioned scroll view with the center element value taken as the field entry?

Thanks in Advance!

like image 854
Timson Avatar asked Oct 14 '14 09:10

Timson


1 Answers

You can use recycler view and set it to scroll horizontally instead of using any custom library.

     RecyclerView recycler= (RecyclerView) itemView.findViewById(R.id.recycler);

     LinearLayoutManager llManager = new LinearLayoutManager(mcontext, LinearLayoutManager.HORIZONTAL, false);
        recycler.setLayoutManager(llManager);

Then to centeralize your desire location, Refer Recyclerview scrolling. And customise it as per your requirement

like image 200
Beena Avatar answered Sep 21 '22 13:09

Beena