Material design spinner extension for Feathers
You can either use a pre-compiled SWC file or the original source file and texture from the source directory. The
assets directory should be in the same level as your project's
src directory. Alternatively, you can update the path to the embedded texture.
You will also need to enable
depthAndStencil in your app descriptor XML:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/20.0"> ... <initialWindow> ... <depthAndStencil>true</depthAndStencil> ... </initialWindow> ... </application>
The spinner can be used as any other Starling DisplayObject.
import feathers.extensions.MaterialDesignSpinner; private var mSpinner:MaterialDesignSpinner; ... mSpinner = new MaterialDesignSpinner(); addChild(mSpinner);
You can change the color to your liking:
mSpinner.color = 0x00BCD4;
The animation starts automatically once it is displayed on the stage, and it is stopped when removed. You can pass in a custom
Juggler to manage the animation by yourself;
Starling.juggler is used by default.
var myJuggler:Juggler = new Juggler(); mSpinner.juggler = myJuggler;
The spinner extends
FeathersControl which means you are able to use it in your Feathers layouts.
mSpinner.layoutData = new AnchorLayoutData(NaN, NaN, NaN, NaN, 0, 0);
If you edit the texture and wish to re-compile the SWC file, you can use the provided ANT build script. Make sure to edit build.properties to match your local environment and execute
ant from the build directory.
Distributed under Apache License, version 2.0.