Android-SpinKit Documentation

repository·master·Indexed 27 days ago

https://github.com/ybq/android-spinkit

A library providing various loading animations for Android applications, inspired by the SpinKit web project. It includes the SpinKitView component for XML layouts and support for using animations like DoubleBounce, Wave, and RotatingPlane as indeterminate drawables for standard Android ProgressBars.

Tokens
787
Snippets
4
Records
6
Agent score
44%

What's inside Android-SpinKit

  1. Use SpinKitView in XML layouts

    master

    You can add loading animations directly to your XML layouts using the SpinKitView component. Use the style attribute to select the animation type and app:SpinKit_Color to set the animation color.

    <com.github.ybq.android.spinkit.SpinKitView
         xmlns:app="http://schemas.android.com/apk/res-auto"
         android:id="@+id/spin_kit"
         style="@style/SpinKitView.Large.Circle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         app:SpinKit_Color="@color/colorAccent" />
  2. Use SpinKit animations with ProgressBar

    master

    To use a SpinKit animation with a standard Android ProgressBar, instantiate the desired animation class and set it as the indeterminate drawable using setIndeterminateDrawable().

    ProgressBar progressBar = (ProgressBar)findViewById(R.id.progress);
    DoubleBounce doubleBounce = new DoubleBounce();
    progressBar.setIndeterminateDrawable(doubleBounce);
  3. Use SpinKit with ProgressBar in Java

    master

    To use a SpinKit animation with a standard Android ProgressBar, instantiate a Sprite (such as DoubleBounce) and set it as the indeterminate drawable of the progress bar.

    ProgressBar progressBar = (ProgressBar)findViewById(R.id.progress);
    Sprite doubleBounce = new DoubleBounce();
    progressBar.setIndeterminateDrawable(doubleBounce);
  4. Available SpinKit animation styles

    master

    The following animation styles are available for use in SpinKitView (via styles) or as drawable objects:

    • RotatingPlane
    • DoubleBounce
    • Wave
    • WanderingCubes
    • Pulse
    • ChasingDots
    • ThreeBounce
    • Circle
    • CubeGrid
    • FadingCircle
    • FoldingCube
    • RotatingCircle
  5. Available SpinKit Styles and Animations

    master

    Android-SpinKit provides several predefined styles that can be applied to SpinKitView. These styles control both the animation type and the size (e.g., .Large, .Small).

    Available Animation Types:

    • RotatingPlane
    • DoubleBounce
    • Wave
    • WanderingCubes
    • Pulse
    • ChasingDots
    • ThreeBounce
    • Circle
    • CubeGrid
    • FadingCircle
    • FoldingCube
    • RotatingCircle

    Base Styles:

    • @style/SpinKitView
    • @style/SpinKitView.Circle
    • @style/SpinKitView.Large
    • @style/SpinKitView.Small
    • @style/SpinKitView.Small.DoubleBounce