Giter VIP home page Giter VIP logo

titanium-circular-progress-bar's Introduction

Circular Progress Bar for Titanium

Not much to say here, except:

  1. It's a circular progress bar, with the % displayed in the middle
  2. It works in Titanium Classic and Titanium Alloy
  3. It works in iOS and it works in Android
  4. It returns a Ti.UI.View object

Circular Progress Bar Options

circularProgressBar({options})

percent: A value between 0 and 1
size: The size of the circular progress bar
margin: The margin of the circular progress bar
backgroundColor: The backgroundColor of the circular area
progressColor: The backgroundColor of the progress bar
--
topper.color: The center circle color
topper.size: The size of the center circle
--
font.visible: Boolean to display the font or not
font.color: The font color
font.size: The fontSize
font.shadowColor: The font shadow color
font.shadowRadius: The font shadow radius
font.shadowOffset.x: The x value of the shadow shadowOffset
font.shadowOffset.y: The y value of the shadow shadowOffset

To update the progress bar, call the update method, passing it a new percent value.

example:

var circularProgressBar = require("circularProgressBar");
var done = 0;
var circleProgress = circularProgressBar({
	percent:done,
	size:50,
	margin:4,
	backgroundColor:'#fff',
	progressColor:'red',
	topper: {
		color:'#fff',
		size: 36
	},
	font: {
		visible: true,
		color: '#900',
		size: 12,
		shadowColor: '#aaa',
		shadowRadius: 1,
		shadowOffset: {
			x: 0,
			y: 1
		}
	}
});
var upd = function() {
	done += 0.01;
	done = parseFloat(done.toFixed(2));
	if (done > 1.00) return;
	console.log(done);
	circleProgress.update(done);
	setTimeout(upd,100);
};
setTimeout(upd,100);

circleProgress.addEventListener("click",function(e){
	if (done >= 1.00) {
		done = 0.00;
		setTimeout(upd,100);         
	}
});

titanium-circular-progress-bar's People

Watchers

James Cloos avatar Osui 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.