Code Monkey home page Code Monkey logo

appcelerator-forks / appwerft.ti.fortunewheelview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appwerft/ti.fortunewheelview

0.0 2.0 0.0 8.28 MB

Fortune is a Titanium module that allows to implement a wheel like selector. This view includes customizable attributes which allows Fortune to be adaptable to many use cases. This is an elegant and user friendly selector that gives a new user experience.

JavaScript 4.85% Java 95.15%

appwerft.ti.fortunewheelview's Introduction

Ti.FortuneWheelView

This is a Titanium Mobile module project, that wrappes the project https://github.com/myriadmobile/fortune. Thanks to Myriad mobile

PRs welcome!

Usage


var Module = require('de.appwerft.fortunewheel');

var wheelView = Module.createWheelView({
    icons : ["amphibia", "aves", "insecta", "mammalia", "reptilia"].map(function(icon) {
        return Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "assets", icon + '.png').nativePath;
    }), // array of locale images, accepts a string path to a local file, or a TiBlob image object.
    wheelOptions : { /* following properties are optional */
        spinSensitivity : 1, // Multipler for spin speed. ie .5, half the speed of finger
        frameRate : 40, // Frames per second
        friction : 5, // Slows down friction radians per second
        velocityClamp : 15, // clamps max fling to radians per second
        flingable : true, // Decides if the user can fling
        grooves : true, // Locks at correct angles
        notch : 90; // Where the notch is located in degrees
        unselectScaleOffset : .8f, // Scale offset of unselected icons
        selectScaleOffset : 1.0, // Scale offset of the selected icons
        distanceScale : 1,0, // Float from 0 - 1 (should be) to decide how close to the edge the icons show
        centripetalPercent : .25f, // Float from -.5 - distancePercent amount of Centripetal force affects you
    }
});

wheelView.addEventListener('groovechanged',function(){
    console.log(arguments[0].index);
});

wheelView.setSelectedItem(2);
wheelView.getSelectedIndex();
wheelView.getSelectedIndex();


appwerft.ti.fortunewheelview's People

Watchers

James Cloos avatar Brenton House avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.