Custom wheel widget for android

Related tags

UI/UX AndroidWheel
Overview

Wheel widget for Android

To include the wheel widget in the current layout, you should add in the layout xml this lines:

        <it.sephiroth.android.wheel.view.Wheel
            android:id="@+id/wheel"
            xmlns:sephiroth="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            sephiroth:numRotations="6"
            sephiroth:ticks="28" />

Where numRotations is the max number of rotations the wheel can perform and ticks is the total number of ticks the wheel will display.

In your activity you can add a OnScrollListener listener to the wheel widget, in this way:

	mWheel = (Wheel) findViewById( R.id.wheel );
	mWheel.setOnScrollListener( new OnScrollListener() {
		
		@Override
		public void onScrollStarted( Wheel view, float value, int roundValue ) {
		}
		
		@Override
		public void onScrollFinished( Wheel view, float value, int roundValue ) {
		}
		
		@Override
		public void onScroll( Wheel view, float value, int roundValue ) {
		}
	} );

Where float value is a value between -1.0 and 1.0 of the current indicator position and int roundValue is a value between -(ticksnumRotations) and (ticksnumRotations)

###Change the Wheel value The wheel position and value chan be changed programmatically at runtime using the Wheel's method setValue:

public void setValue( float value, boolean fireScrollEvent );
  • value is the new wheel value, a float between -1.0f and 1.0f, where 0.0f it's the center of the wheel.
  • fireScrollEvent: if true, once this method is called the onScrollFinished method will be called.

Screen Shots

Wheel running on ICS

Comments
  • Error importing android wheel to my project

    Error importing android wheel to my project

    Hey there! I just imported this project to Eclipse to use it as library, but when I added this library to my project, a lot of errors appeared suddenly in my project... Errors were like this: R cannot be resolved to a variable. So, which is the correct way to import android wheel?

    opened by bamsbamx 7
  • Set wheel position from code

    Set wheel position from code

    Thank you for making this very useful widget. I need to set its starting position to something other than halfway - e.g. the total range is 0 to 100, but I want it to start at 30 rather than 50.

    How can this be done?

    opened by bmb6agb 2
  • Adding support for Android 2.1 and 2.2

    Adding support for Android 2.1 and 2.2

    Your wheel looks great & funny. But, I must set API to >= 9 when build because in Wheel.java line 1084 you define a OverScroller (which only from API 9+). This mean I cannot run this app on Android 2.1 and 2.2.

    Can you take time to add support for 2.1 and 2.2?

    Thanks.

    opened by anticafe 1
  • Use with minimal XML

    Use with minimal XML

    Specifically, I'm trying to move the lines

    sephiroth:numRotations="2"
    sephiroth:ticks="20"
    

    to code, so that I can externalize the wheel and change it at will in my app. However, I can't find a way to control these via java rather than xml.

    opened by jamrader 0
  • SetValue causes a

    SetValue causes a "divide by 0" exception.

    Using the setvalue method gives me a divide by zero exception.

    My code is as follows:

                mWheel = (Wheel) v.findViewById(R.id.wheel);
                mWheel.setOnScrollListener( new Wheel.OnScrollListener() {
    
                    @Override
                    public void onScrollStarted( Wheel view, float value, int roundValue ) {
                        Log.i("SPINZ", "STARTED: f: " + value + " / i: " + roundValue);
                    }
    
                    @Override
                    public void onScrollFinished( Wheel view, float value, int roundValue ) {
                        Log.i("SPINZ", "FINISHED: f: " + value + " / i: " + roundValue);
                        roundValue *= -1;
                        roundValue += 40;
                        if (roundValue >= 0 && roundValue < sections.length)
                            mSectionTV.setText(sections[roundValue]);
                    }
    
                    @Override
                    public void onScroll( Wheel view, float value, int roundValue ) {
    
                        roundValue *= -1;
                        roundValue += 40;
                        if (roundValue >= 0 && roundValue < sections.length)
                            mSectionTV.setText(sections[roundValue]);
                    }
                } );
    
                mWheel.setValue(1.0f, true);
    

    If I take mWheel.setValue(1.0f, true) and move it to right after mWheel = (Wheel) v.findViewById(R.id.wheel), then I don't get the divide by zero exception, but the method doesn't do anything either.

    opened by jamrader 0
Owner
Alessandro Crugnola
Alessandro Crugnola
Simple and fantastic wheel view in realistic effect for android.

Overview ![Size](https://img.shields.io/badge/Size-17 KB-e91e63.svg) Contact Preview Demo WheelPicke.APK Include Compile compile 'cn.aigestudio.wheelp

Aige 2.5k Jan 6, 2023
Just a Wheel——A easy way to setEmptyView to ListView、GridView or RecyclerView etc..

中文说明在这里 TEmptyView Just a Wheel—— A easier way to setEmptyView. Without having to write xml file every time. It supports AdapterView(ListView,GridView

Barry 454 Jan 9, 2023
Android layout decorators : Injecting custom attributes in layout files, Using decorators to get rid of unnecessary class explosion with custom views

Decor Decor is a library that applies decorators to Android layout with additional attributes without the need to extend and create a custom View for

Mouna Cheikhna 304 Nov 25, 2022
Android widget for selecting a range of values.

RangeBar The RangeBar is similar to an enhanced SeekBar widget, though it doesn't make use of the SeekBar. It provides for the selection of a range of

Edmodo 715 Nov 14, 2022
segmentcontrol widget for android

中文 a simple SegmentControl Widget 使用: 添加依赖到build.gradle: dependencies { compile 'com.7heaven.widgets:segmentcontrol:1.17' } 相关属性: selectedColor 设置

7heaven 614 Nov 26, 2022
Android Thermometer Widget.

Thermometer Android Thermometer Widget. Developer Kofi Gyan ([email protected]) License Copyright 2016 Kofi Gyan. Licensed under the Apache Licen

Kofi Gyan 125 Nov 17, 2022
Android Widget

Circular Counter Circular Counter is an Android Widget I needed to implement for an application I was developing. As it could be useful to more people

Diogo Bernardino 254 Nov 25, 2022
A Pin view widget for Android

PinView A Pin view widget for Android. PinView has a feature that allows you to find out when they have completed all parameters. Support for Android

David Pizarro 287 Nov 14, 2022
This is a sample Android Studio project that shows the necessary code to create a note list widget, And it's an implementation of a lesson on the Pluralsight platform, but with some code improvements

NoteKeeper-Custom-Widgets This is a sample Android Studio project that shows the necessary code to create a note list widget, And it's an implementati

Ibrahim Mushtaha 3 Oct 29, 2022
A library that provides an implementation of the banner widget from the Material design.

MaterialBanner A banner displays a prominent message and related optional actions. MaterialBanner is a library that provides an implementation of the

Sergey Ivanov 252 Nov 18, 2022
It's a flip way to show share widget.

What's FlipShare ? It's a cool way to show share widget. Demo Usage step 1. Confirm your parentView to locate the share widget, and then you can custo

巴掌 630 Sep 5, 2022
TabSlider - An expanding slider widget which displays selected value

TabSlider - An expanding slider widget which displays selected value

null 1 Apr 20, 2022
Useful library to use custom fonts in your android app

EasyFonts A simple and useful android library to use custom fonts in android apps without adding fonts into asset/resource folder.Also by using this l

Vijay Vankhede 419 Sep 9, 2022
Custom android music player view.

InteractivePlayerView Custom android music player view. Screen Check it on youtube Usage(XML) Define it in your xml file. <co.mobiwise.library.Intera

Mert Şimşek 744 Dec 25, 2022
Android Library for Custom Switches.

Android Library for Custom Switches.

Angad Singh 376 Jan 4, 2023
IconicDroid is a custom Android Drawable which allows to draw icons from several iconic fonts.

IconicDroid IconicDroid is a custom Android Drawable which allows to draw icons from several iconic fonts. Try out the sample application on the Googl

Artur Termenji 387 Nov 20, 2022
Set custom font in Android application

MagicViews Provides a simple way to set custom font in Android application. Adding to your project Add the library as a dependency to your build.gradl

Ivan Kocijan 225 Nov 20, 2022
A beautiful Android custom View that works similar to a range or seekbar. With animations.

ValueBar A beautiful Android custom View that works similar to a range or seekbar. Selection by gesture. With animations. Supporting API level 11+. De

Philipp Jahoda 147 Nov 20, 2022
An android custom view that displays a circle with a colored arc given a mark

MarkView An android custom view that displays a circle with a colored arc given a mark. Usage Add as a dependency compile 'com.github.xiprox.markv

İhsan Işık 200 Nov 25, 2022