Reputation: 873
I want to create a view where items view will be in circular round. Here i am sharing my image to describe my requirement.
The number of items will be dynamic.
Can anyone suggest library for this kind of stuff?
Upvotes: 3
Views: 3764
Reputation: 35549
You need to check this library : WheelView
add dependency to your build.gradle
dependencies {
compile 'com.github.lukedeighton:wheelview:0.3.1'
}
add custom view to your xml
<com.lukedeighton.wheelview.WheelView
android:id="@+id/wheelview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:wheelColor="@color/grey_400"
app:rotatableWheelDrawable="false"
app:selectionAngle="90.0"
app:wheelPosition="bottom"
app:wheelOffsetY="60dp"
app:repeatItems="true"
app:wheelRadius="276dp"
app:wheelItemCount="14"
app:wheelPadding="13dp"
app:wheelItemRadius="43dp"/>
set adapter in java code
wheelView.setAdapter(new WheelAdapter() {
@Override
public Drawable getDrawable(int position) {
//return drawable here - the position can be seen in the gifs above
}
@Override
public int getCount() {
//return the count
}
});
Upvotes: 2