Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

WheelView in Android

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In this article, WheelView is added in android. WheelView provides a very impressive UI that allows the developer to create a Wheel and add items according to his need. Some important tags provided by WheelView are wheelArcBackgroundColor, wheelAnchorAngle, wheelStartAngle, wheelMode, wheelCenterIcon, and many more. It can be used where the user wants to select items from a list of items. Suppose in the banking app, the user has the option to select its bank account to check balance, payment history, etc in that case this can be used.


  • It can be customized according to the requirements.
  • It provides animation with the view which improves the User Interface.
  • It provides an inbuilt layout that its alternatives like Custom Dialog which can be used instead of wheel view does not provide.

Step by Step Implementation

Step 1: Create a New Project

To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio.

Step 2: Add dependency and JitPack Repository

Navigate to the Gradle Scripts > build.gradle(Module:app) and add the below dependency in the dependencies section.   

implementation ‘com.github.psuzn:WheelView:1.0.1’

Add the JitPack repository to your build file. Add it to your root build.gradle at the end of repositories inside the allprojects{ } section.

allprojects {

 repositories {


   maven { url “” }



After adding this dependency sync your project and now we will move towards its implementation.  

Step 3: Working with the activity_main.xml file

Navigate to the app > res > layout > activity_main.xml and add the below code to that file. Below is the code for the activity_main.xml file. 



Step 4: Working with the MainActivityfile

Go to the MainActivity file and refer to the following code. Below is the code for the MainActivity file. Comments are added inside the code to understand the code in more detail.


import android.os.Bundle;
import java.util.Arrays;
import me.sujanpoudel.wheelview.WheelView;
public class MainActivity extends AppCompatActivity {
    protected void onCreate(Bundle savedInstanceState) {
        // create a string array  of tiles
        String[] titles={"Bubble Sort", "Quick Sort", "Merge Sort", "Radix Sort"};
        // get the reference of the wheelView
        WheelView wheelView =(WheelView)findViewById(;
        // convert tiles array to list and pass it to setTitles


import android.os.Bundle
import me.sujanpoudel.wheelview.WheelView
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        val wheelView = findViewById<WheelView>(
        wheelView.titles = listOf("Bubble Sort", "Quick Sort", "Merge Sort", "Radix Sort")


My Personal Notes arrow_drop_up
Last Updated : 30 Apr, 2021
Like Article
Save Article
Similar Reads