LuckyWheel_Android
mmoamenn
25
Visit GitHub RepoWheel Widgets

LuckyWheel Android

Android custom component that displays a lucky wheel. it ⁠ features easy customize of colors, addition of items and it's very trivial to integrate in your application.

Sample

Lucky wheel

Installing

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
	compile 'com.github.mmoamenn:LuckyWheel_Android:0.0.2'
}

XML

<com.bluehomestudio.luckywheel.LuckyWheel android:id="@+id/lwv" android:layout_width="250dp" android:layout_height="250dp" android:layout_centerInParent="true" LuckyWheel:background_color="@color/colorPrimary" LuckyWheel:arrow_image="@drawable/ic_action"/>

You must use the following properties in your XML

Choose the background color

LuckyWheel:background_color

Choose wheel image arrow

LuckyWheel:arrow_image

JAVA

Functions to use after reference the Lucky wheel

  • Create wheel sections

    List<WheelItem> wheelItems = new ArrayList<>();

    wheelItems.add(new WheelItem(Color.LTGRAY, BitmapFactory.decodeResource(getResources(), R.drawable.ic_action_name)));

    wheelItems.add(new WheelItem(Color.BLUE, BitmapFactory.decodeResource(getResources(), R.drawable.ic_action_name)));

    wheelItems.add(new WheelItem(Color.BLACK, BitmapFactory.decodeResource(getResources(), R.drawable.ic_action_name)));

    wheelItems.add(new WheelItem(Color.GRAY, BitmapFactory.decodeResource(getResources(), R.drawable.ic_action_name)));

  • Add sections to wheel

    addWheelItems(wheelItems);

  • Rotate to any section

    rotateWheelTo(2);

  • On target reach listener

     setLuckyWheelReachTheTarget(new OnLuckyWheelReachTheTarget() {
          
          @Override
          public void onReachTarget() {
          
              // target reached do operation her    
          
          }
      });
    
Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT