Coder Social home page Coder Social logo

rborn / ti.states Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codlylabs/ti.states

0.0 2.0 0.0 10.48 MB

UI state manager for Appcelerator Titanium

Home Page: http://codly.io

License: MIT License

JavaScript 58.23% CSS 8.17% Python 33.61%

ti.states's Introduction

UI States Manager for Appcelerator Titanium

UIStatesManager is a component that enables you define states for your user interface components. It changes the properties from one state to another with smooth ease animation. All you need is to define state specific styles and UIStatesManager will do the trasition automatically.

enter image description here

Quick Start

Get it

Add lib/ti.states.js to your lib folder inside your project.

Use it

First you have to add state specific styles to your tss like this:

"#view": {
	backgroundColor: "red"
}

"#view:state1": {
	top: '80%',
	right: '10%',
	width: '20%',
	height: '13%'
}

"#view:state2": {
	top: '25%',
	right: '25%',
	width: '50%',
	height: '50%'
}

Then require and initalize ti.states in your controller

var stateManager = require('ti.states');
stateManager.init($, "state1"); // initalize with current controller, default state

Then you can easily change your UI to any of your states

/***
* state: the new state
* duration: animation duration time in milliseconds
* callback: to be called after animation complete
***/
stateManager.changeToState('state2', 500, function(){
	// animations is done
});

Code and documentation copyright 2015 Codly, Inc. Code released under the MIT license.

ti.states's People

Contributors

codlylabs avatar

Watchers

 avatar  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.