All Projects → adef145 → SpinningWheelAndroid

adef145 / SpinningWheelAndroid

Licence: Apache-2.0 license
Custom Spinning Wheel View for Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to SpinningWheelAndroid

Rocksmith-Diy-Realtone-Cable
diy realtone cable
Stars: ✭ 48 (+6.67%)
Mutual labels:  custom
Unity3D-Cars
A project built for a Renaissance Coders tutorial to introduce vehicle physics.
Stars: ✭ 60 (+33.33%)
Mutual labels:  wheel
time
The simplest but configurable online clock
Stars: ✭ 77 (+71.11%)
Mutual labels:  custom
pip-custom-platform
pip+wheel wrapper which allows you to choose a custom platform name for building, downloading, and installing wheels.
Stars: ✭ 50 (+11.11%)
Mutual labels:  wheel
Tensorflow-binaries
Tensorflow GNU/Linux, MacOS binaries compiled with SSE4.1, SSE4.2 and AVX
Stars: ✭ 14 (-68.89%)
Mutual labels:  wheel
cibuildwheel
🎡 Build Python wheels for all the platforms on CI with minimal configuration.
Stars: ✭ 1,350 (+2900%)
Mutual labels:  wheel
Arc-for-Vivaldi
Make Vivaldi integrate with Arc.
Stars: ✭ 30 (-33.33%)
Mutual labels:  custom
KKRefreshLayout
An android refresh layout, support custom vertical/horizontal refresh.
Stars: ✭ 13 (-71.11%)
Mutual labels:  custom
CircularDialogs
Android dialog library to give user feedback about the common operations like Success, Warning and Errors.
Stars: ✭ 35 (-22.22%)
Mutual labels:  custom
installer
A low-level library for installing from a Python wheel distribution.
Stars: ✭ 72 (+60%)
Mutual labels:  wheel
SPLarkController
Custom transition between controllers. Settings controller for your iOS app.
Stars: ✭ 967 (+2048.89%)
Mutual labels:  custom
DEMOS TO MySelf Android
自己平时的一些积累,相当于自己的一个demo库,比较杂,后续会一个一个整理出来
Stars: ✭ 36 (-20%)
Mutual labels:  custom
trampolim
A modern Python build backend
Stars: ✭ 39 (-13.33%)
Mutual labels:  wheel
Env-KB
A custom mechanical keyboard inspired by the CFTKB Mysterium utilizing the Raspberry Pi Pico
Stars: ✭ 203 (+351.11%)
Mutual labels:  custom
mini-humidifier
Minimalistic humidifier card for Home Assistant Lovelace UI
Stars: ✭ 129 (+186.67%)
Mutual labels:  custom
TensorFlow-Raspberry-Pi
TensorFlow installation wheels for Raspberry Pi 32-bit OS
Stars: ✭ 18 (-60%)
Mutual labels:  wheel
TrendingCustomAlert
You can use a ready-made custom alert controller.
Stars: ✭ 25 (-44.44%)
Mutual labels:  custom
ansible-role-admin-users
Ansible role to manage admin users, authorized keys and sudo access.
Stars: ✭ 18 (-60%)
Mutual labels:  wheel
no-manylinux
Install this package to disable manylinux wheels when dowloading from pip.
Stars: ✭ 23 (-48.89%)
Mutual labels:  wheel
react-eyedrop
Seamlessly integrate a static typed, fully-tested color-picking React component/hook!
Stars: ✭ 17 (-62.22%)
Mutual labels:  custom

SpinningWheelAndroid

1

Attributes

  • wheel_colors -> Color value
  • wheel_stroke_color -> Color value
  • wheel_stroke_width -> Dimension value
  • wheel_items -> Array of string
  • wheel_text_size -> Dimension value
  • wheel_text_color -> Color value
  • wheel_arrow_color -> Color value
  • wheel_arrow_width -> Dimension value
  • wheel_arrow_height -> Dimension value

Example

  1. Custom view in xml
<com.adefruandta.spinningwheel.SpinningWheelView
        android:id="@+id/wheel"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        app:wheel_arrow_color="@android:color/black"
        app:wheel_colors="@array/rainbow_dash"
        app:wheel_items="@array/dummy"
        app:wheel_stroke_color="@android:color/black"
        app:wheel_stroke_width="5dp"/>
  1. Custom view in java
public class MainActivity extends AppCompatActivity implements SpinningWheelView.OnRotationListener<String> {

        ...
        
        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                
                ...

                SpinningWheelView wheelView = (SpinningWheelView) findViewById(R.id.wheel);

                // Can be array string or list of object
                wheelView.setItems(R.array.dummy);
                
                // Set listener for rotation event
                wheelView.setOnRotationListener(new OnRotationListener<String>() {
                        // Call once when start rotation
                        @Override
                        public void onRotation() {
                        Log.d("XXXX", "On Rotation");
                        }

                        // Call once when stop rotation
                        @Override
                        public void onStopRotation(String item) {
                        Log.d("XXXX", "On Rotation");
                        }
                });
                
                // If true: user can rotate by touch
                // If false: user can not rotate by touch
                wheelView.setEnabled(false);
                
                rotate.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        // max angle 50
                        // duration 10 second
                        // every 50 ms rander rotation
                        wheelView.rotate(50, 3000, 50);
                    }
                });
        }

Download

Configure your project-level build.gradle to include the 'android-apt' plugin:

repositories {
    maven {
        url 'https://dl.bintray.com/adef145/maven/'
    }
}

...

dependencies {
    compile 'com.adefruandta.spinningwheel:spinningwheel:0.1.0'
}

Licence

Copyright 2017 Ade Fruandta

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].