An Android Widget for selecting items that rotate on a wheel.

Related tags

Layout wheel
Overview

CursorWheelLayout

CursorWheelLayout is an Android library that allows view to be placed on a rotatable wheel. It behaves like a Circular ListView where items rotate rather than scroll vertically(but without view recycle strategy). CursorWheelLayout consists of two components , the center item with id id_wheel_menu_center_item and the menu items that provided by CycleWheelAdapter.

The CursorWheelLayout can be used as a way to select one item from a list. The wheelSelectedAngle attribute determines what position on the wheel is selected. You can also receive a callback for when an item is clicked, and whether it is selected. Have a look at the sample for a working example!

Screenshot

1 2

Apk

Download Demo here

Setup

Gradle

compile 'github.hellocsl:CursorWheelLayout:1.1.0'

Maven

<dependency>
  <groupId>github.hellocsl</groupId>
  <artifactId>CursorWheelLayout</artifactId>
  <version>1.1.0</version>
  <type>pom</type>
</dependency>

Usage

  1. Add a custom view in Xml
  <github.hellocsl.cursorwheel.CursorWheelLayout
        android:id="@+id/test_circle_menu_right"
        android:layout_width="306dip"
        android:layout_height="306dip"
        android:layout_gravity="center_vertical|right|bottom"
        android:layout_marginBottom="-153dp"
        android:layout_marginRight="-153dip"
        app:wheelBackgroundColor="@color/colorAccent_Translucent"
        app:wheelCursorColor="@color/red"
        app:wheelCursorHeight="20dip"
        app:wheelFlingValue="460"
        app:wheelSelectedAngle="225">

        <github.hellocsl.cursorwheellayout.widget.SwitchButton
            android:id="@id/id_wheel_menu_center_item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:boardWidth="0dip"
            app:uncheckRevealColor="#ff2a2f36"
        />
    </github.hellocsl.cursorwheel.CursorWheelLayout>
  1. Define your WheelCycleAdapter
public class SimpleTextAdapter implements CursorWheelLayout.CycleWheelAdapter{

        public int getCount(){
        //...
        }

        public View getView(View parent, int position){
        //...
        }

        public Object getItem(int position){
        //...
        }

}
  1. Set your WheelCycleAdapter similar to how you would set an adapter with a ListView
        SimpleTextAdapter simpleTextAdapter = new SimpleTextAdapter(this, menuItemDatas);
        mTestCircleMenuLeft.setAdapter(simpleTextAdapter);

Listener

  1. A listener for when the closest item to the SelectionAngle changes.
      mTestCircleMenuTop.setOnMenuSelectedListener(new CursorWheelLayout.OnMenuSelectedListener() {
            @Override
            public void onItemSelected(CursorWheelLayout parent, View view, int pos) {
                Toast.makeText(MainActivity.this, "Top Menu selected position:" + pos, Toast.LENGTH_SHORT).show();
            }
        });
  1. A listener for when an item is clicked.
        mTestCircleMenuTop.setOnMenuItemClickListener(new CursorWheelLayout.OnMenuItemClickListener() {
            @Override
            public void onItemClick(View view, int pos) {
                Toast.makeText(MainActivity.this, "Top Menu click position:" + pos, Toast.LENGTH_SHORT).show();

            }
        });

Useful attributes

Here are the custom attributes that can be declared in xml:

  • wheelSelectedAngle
  • wheelPaddingRadio
  • wheelCenterRadio
  • wheelItemRadio
  • wheelFlingValue
  • wheelCursorHeight
  • wheelCursorColor
  • wheelBackgroundColor
  • wheelItemRotateMode

Refer to

http://blog.csdn.net/lmj623565791/article/details/43131133

License

Apache License Version 2.0 http://apache.org/licenses/LICENSE-2.0.txt

Comments
  • Use github.hellocsl.cursorwheel.CursorWheelLayout instead of github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout in my xml file and not work in my device 4.3

    Use github.hellocsl.cursorwheel.CursorWheelLayout instead of github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout in my xml file and not work in my device 4.3

    I have changed to CursorWheelLayout , this my xml -->

    <github.hellocsl.cursorwheel.CursorWheelLayout android:id="@+id/test_circle_menu_top" android:layout_width="280dip" android:layout_height="280dip" android:layout_gravity="center_horizontal|top" app:wheelCursorColor="#009688" app:wheelCursorHeight="19dip" app:wheelSelectedAngle="270">

    <TextView
        android:id="@id/id_wheel_menu_center_item"
        style="@style/TextAppearance.AppCompat.Large.Inverse"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="Wheel"
        android:textColor="#009688"
        />
    

    </github.hellocsl.cursorwheel.CursorWheelLayout>

    It appears the same error

    FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{github.hellocsl.cursorwheellayout/github.hellocsl.cursorwheellayout.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class github.hellocsl.cursorwheel.CursorWheelLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) at android.app.ActivityThread.access$700(ActivityThread.java:159) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5419) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class github.hellocsl.cursorwheel.CursorWheelLayout at android.view.LayoutInflater.createView(LayoutInflater.java:626) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:29) at android.app.Activity.performCreate(Activity.java:5372) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)  at android.app.ActivityThread.access$700(ActivityThread.java:159)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:176)  at android.app.ActivityThread.main(ActivityThread.java:5419)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:525)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:417) at android.view.LayoutInflater.createView(LayoutInflater.java:600) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)  at android.view.LayoutInflater.inflate(LayoutInflater.java:498)  at android.view.LayoutInflater.inflate(LayoutInflater.java:398)  at android.view.LayoutInflater.inflate(LayoutInflater.java:354)  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:29)  at android.app.Activity.performCreate(Activity.java:5372)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)  at android.app.ActivityThread.access$700(ActivityThread.java:159)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:176)  at android.app.ActivityThread.main(ActivityThread.java:5419)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:525)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.NoSuchMethodError: android.view.ViewGroup. at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:0) at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:0) at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:0) at java.lang.reflect.Constructor.constructNative(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)  at android.view.LayoutInflater.createView(LayoutInflater.java:600)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)  at android.view.LayoutInflater.inflate(LayoutInflater.java:498)  at android.view.LayoutInflater.inflate(LayoutInflater.java:398)  at android.view.LayoutInflater.inflate(LayoutInflater.java:354)  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:29)  at android.app.Activity.performCreate(Activity.java:5372)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)  at android.app.ActivityThread.access$700(ActivityThread.java:159)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:176)  at android.app.ActivityThread.main(ActivityThread.java:5419)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:525)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)  at dalvik.system.NativeStart.main(Native Method) 

    opened by juamor86 6
  • java.lang.ArithmeticException: divide by zero

    java.lang.ArithmeticException: divide by zero

    Hi,

    I'm using this Library in a fragment:

    `

           <github.hellocsl.cursorwheel.CursorWheelLayout
    
            android:id="@+id/circle_menu"
            android:layout_width="300dip"
            android:layout_height="300dip"
            android:layout_gravity="right|bottom"
            android:layout_marginBottom="-120dp"
            android:layout_marginRight="-120dip"
            app:wheelBackgroundColor="@color/pink"
            app:wheelCursorColor="@color/red"
            app:wheelCursorHeight="20dip"
            app:wheelFlingValue="460"
            app:wheelSelectedAngle="225">
    
    
            <ImageView
                android:id="@id/id_wheel_menu_center_item"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:src="@drawable/car"
                android:textColor="#009688"
                />
    
        </github.hellocsl.cursorwheel.CursorWheelLayout>`
    

    but i've an exception:

    java.lang.ArithmeticException: divide by zero at github.hellocsl.cursorwheel.CursorWheelLayout.onLayout(CursorWheelLayout.java:362) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579) at android.widget.LinearLayout.onLayout(LinearLayout.java:1488) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:435) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579) at android.widget.LinearLayout.onLayout(LinearLayout.java:1488) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735) at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1724) at android.widget.LinearLayout.onLayout(LinearLayout.java:1490) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1187) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) at android.view.View.layout(View.java:16637) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2179) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1939) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1115) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6029) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5458) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

    Thank you

    opened by moelfassi 5
  • Not work in device with 4.3

    Not work in device with 4.3

    Good morning, I am testing in device with 4.3 and not work .

    java.lang.RuntimeException: Unable to start activity ComponentInfo{github.hellocsl.cursorwheellayout/github.hellocsl.cursorwheellayout.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) at android.app.ActivityThread.access$700(ActivityThread.java:159) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5419) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout at android.view.LayoutInflater.createView(LayoutInflater.java:626) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:38) at android.app.Activity.performCreate(Activity.java:5372) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)  at android.app.ActivityThread.access$700(ActivityThread.java:159)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:176)  at android.app.ActivityThread.main(ActivityThread.java:5419)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:525)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)  at dalvik.system.NativeStart.main(Native Method) 

    opened by juamor86 3
  • 无法运行呀

    无法运行呀

    03.268 19888-19888/github.hellocsl.cursorwheellayout E/ActivityThread: Failed to inflate android.view.InflateException: Binary XML file line #12: Error inflating class github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout at android.view.LayoutInflater.createView(LayoutInflater.java:620) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:38) at android.app.Activity.performCreate(Activity.java:5242) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2172) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2268) at android.app.ActivityThread.access$800(ActivityThread.java:145) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5094) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:594) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)  at android.view.LayoutInflater.inflate(LayoutInflater.java:492)  at android.view.LayoutInflater.inflate(LayoutInflater.java:397)  at android.view.LayoutInflater.inflate(LayoutInflater.java:353)  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:38)  at android.app.Activity.performCreate(Activity.java:5242)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2172)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2268)  at android.app.ActivityThread.access$800(ActivityThread.java:145)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5094)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.NoSuchMethodError: android.view.ViewGroup. at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:214) at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:209) at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:205) at github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout.(SimpleTextCursorWheelLayout.java:19) at java.lang.reflect.Constructor.constructNative(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)  at android.view.LayoutInflater.createView(LayoutInflater.java:594)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)  at android.view.LayoutInflater.inflate(LayoutInflater.java:492)  at android.view.LayoutInflater.inflate(LayoutInflater.java:397)  at android.view.LayoutInflater.inflate(LayoutInflater.java:353)  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:38)  at android.app.Activity.performCreate(Activity.java:5242)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2172)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2268)  at android.app.ActivityThread.access$800(ActivityThread.java:145)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5094)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702)  at dalvik.system.NativeStart.main(Native Method) 

    duplicate 
    opened by stay4cold 1
  • 刚刚运行就报bug

    刚刚运行就报bug

    FATAL EXCEPTION: main Process: github.hellocsl.cursorwheellayout, PID: 20584 java.lang.RuntimeException: Unable to start activity ComponentInfo{github.hellocsl.cursorwheellayout/github.hellocsl.cursorwheellayout.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2264) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313) at android.app.ActivityThread.access$1100(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5336) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout at android.view.LayoutInflater.createView(LayoutInflater.java:640) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:775) at android.view.LayoutInflater.inflate(LayoutInflater.java:512) at android.view.LayoutInflater.inflate(LayoutInflater.java:409) at android.view.LayoutInflater.inflate(LayoutInflater.java:358) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:38) at android.app.Activity.performCreate(Activity.java:5302) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2228) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)  at android.app.ActivityThread.access$1100(ActivityThread.java:141)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5336)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:614) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:775)  at android.view.LayoutInflater.inflate(LayoutInflater.java:512)  at android.view.LayoutInflater.inflate(LayoutInflater.java:409)  at android.view.LayoutInflater.inflate(LayoutInflater.java:358)  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:38)  at android.app.Activity.performCreate(Activity.java:5302)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2228)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)  at android.app.ActivityThread.access$1100(ActivityThread.java:141)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5336)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.NoSuchMethodError: android.view.ViewGroup. at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:214) at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:209) at github.hellocsl.cursorwheel.CursorWheelLayout.(CursorWheelLayout.java:205) at github.hellocsl.cursorwheellayout.widget.SimpleTextCursorWheelLayout.(SimpleTextCursorWheelLayout.java:19) at java.lang.reflect.Constructor.constructNative(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)  at android.view.LayoutInflater.createView(LayoutInflater.java:614)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:775)  at android.view.LayoutInflater.inflate(LayoutInflater.java:512)  at android.view.LayoutInflater.inflate(LayoutInflater.java:409)  at android.view.LayoutInflater.inflate(LayoutInflater.java:358)  at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at github.hellocsl.cursorwheellayout.MainActivity.onCreate(MainActivity.java:38)  at android.app.Activity.performCreate(Activity.java:5302)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2228)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)  at android.app.ActivityThread.access$1100(ActivityThread.java:141)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5336)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)  at dalvik.system.NativeStart.main(Native Method) 

    opened by Johnjson 1
  • JCenter Deprecation Maven Migration

    JCenter Deprecation Maven Migration

    JFrog has alluded to their shutting down of Jcenter and this seems to break the ability to use this library. Migration to Maven Central would be greatly appreciated.

    opened by MarhardtHoldings 0
  • How can I set up the round (finite scrolling)?

    How can I set up the round (finite scrolling)?

    Hi, It would be very helpful if you tell me how can I set up the finite scrolling, still it scroll infinite. I want to setup the round so that it won't do the infinite scrolling.

    Your input much helpful.

    opened by jaypratapsingh 0
  • Create in programming dynamically

    Create in programming dynamically

    How can I create circlewheel in java code and dynamically size it.

    CursorWheelLayout testCircleMenu = new CursorWheelLayout(context); testCircleMenu.setLayoutParams(new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); fl.addView(testCircleMenu);

    and get exception:

    ava.lang.ArithmeticException: divide by zero at CursorWheelLayout.dispatchDraw(CursorWheelLayout.java:589) at android.view.View.draw(View.java:17472)

    opened by jaag12 0
Releases(v1.1.0)
Owner
HelloCsl
Read the fucking source code.
HelloCsl
Android Library that lights items for tutorials or walk-throughs etc...

Spotlight Gradle dependencies { implementation 'com.github.takusemba:spotlight:x.x.x' } Usage val spotlight = Spotlight.Builder(this) .setTarg

TakuSemba 3.4k Dec 23, 2022
CircularStats - Custom Widget to display stats of any thing

CircularStats This is a custom widget made with Jetpack Compose for displaying s

null 14 Jul 2, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Jan 5, 2023
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.

Please switch to DragView, for the best support, thank you DraggablePanel Download allprojects { repositories { ... maven { url 'https://jitp

Hoàng Anh Tuấn 103 Oct 12, 2022
FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

null 33 Dec 8, 2022
A wave view of android,can be used as progress bar.

WaveView ![Gitter](https://badges.gitter.im/Join Chat.svg) A wave view of android,can be used as progress bar. Screenshot APK demo.apk What can be use

Kai Wang 1.3k Dec 28, 2022
An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu

ResideLayout An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu. Can be used on Android 1.6(I haven't try it.)

Yang Hui 392 Oct 12, 2022
An Android library that help you to build app with swipe back gesture.

SwipeBackLayout An Android library that help you to build app with swipe back gesture. Demo Apk GooglePlay Requirement The latest android-support-v4.j

ike_w0ng 6.1k Dec 29, 2022
TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.

This project isn't maintained anymore. It is now recommended to use https://github.com/peterLaurence/MapView. MapView is maintained by Peter, one of o

Mike Dunn 1.5k Nov 21, 2022
Ultra Pull to Refresh for Android. Support all the views.

Welcome to follow me on GitHub or Twitter GitHub: https://github.com/liaohuqiu Twitter: https://twitter.com/liaohuqiu 中文版文档 Wanna auto-load-more? This

Huqiu Liao 9.6k Jan 5, 2023
SwipeBack is an android library that can finish a activity by using gesture.

SwipeBack SwipeBack is a android library that can finish a activity by using gesture. You can set the swipe direction,such as left,top,right and botto

Eric 1.7k Nov 21, 2022
A very simple arc layout library for Android

ArcLayout A very simple arc layout library for Android. Try out the sample application on the Play Store. Usage (For a working implementation of this

ogaclejapan 1.4k Dec 26, 2022
Android layout that simulates physics using JBox2D

PhysicsLayout Android layout that simulates physics using JBox2D. Simply add views, enable physics, and watch them fall! See it in action with the sam

John Carlson 689 Dec 29, 2022
Android component which presents a dismissible view from the bottom of the screen

BottomSheet BottomSheet is an Android component which presents a dismissible view from the bottom of the screen. BottomSheet can be a useful replaceme

Flipboard 4.5k Dec 28, 2022
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

Umano: News Read To You 9.4k Dec 31, 2022
Allows the easy creation of animated transition effects when the state of Android UI has changed

android-transition Android-Transition allows the easy creation of view transitions that reacts to user inputs. The library is designed to be general e

Kai 615 Nov 14, 2022
Stale Android Toasts made tasty.

FrenchToast Stale Android Toasts made tasty. Android Toasts are amazing, but they have a few major drawbacks: You cannot control when they show up as

py - Pierre Yves Ricau 367 Nov 15, 2022
waveview for android

中文介绍 WaveView A view to display wave effect. Screenshot Integration implementation 'com.gelitenight.waveview:waveview:1.0.0' Setter methods: setWaveS

NIGHT 1.6k Dec 21, 2022