GithubHelp home page GithubHelp logo

tieusangaka / crandroidmbootanimationview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cleveroad/android-marshmallow-boot-animation

0.0 2.0 0.0 299 KB

License: MIT License

Java 100.00%

crandroidmbootanimationview's Introduction

Android Marshmallow Boot Animation View

Implementation of Android Marshmallow Boot Animation.

Demo image

To use LoadingAnimationView first add dependency to your project:

dependencies {
    compile 'com.cleveroad:androidmanimation:0.9.1'
}

Then you can declare it in your layout file like this:

    <com.cleveroad.androidmanimation.LoadingAnimationView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/animation"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="16dp"
        app:lav_backgroundColor="@android:color/black"
        app:lav_firstColor="@color/google_red"
        app:lav_secondColor="@color/google_green"
        app:lav_thirdColor="@color/google_blue"
        app:lav_fourthColor="@color/google_yellow"
        app:lav_speedCoefficient="1.0"
        />

Pay attention that you need to manually start/pause/stop animation.

    private LoadingAnimationView animation;
    
    ...
    
    @Override
    protected void onResume() {
        super.onResume();
        // user interacts with screen, start animation
        animation.startAnimation();
    }

    @Override
    protected void onPause() {
        // user stops interacting with screen, pause animation, save your battery!
        animation.pauseAnimation();
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        // user leaves screen. Clean up everything. 
        animation.stopAnimation();
        super.onDestroy();
    }

Another way to display loading animation is to use builder and display a dialog:

    AnimationDialogFragment fragment = new AnimationDialogFragment.Builder()
            .setBackgroundColor(Color.WHITE)
            .setFirstColor(getResources().getColor(R.color.google_red))
            .setSecondColor(getResources().getColor(R.color.google_green))
            .setThirdColor(getResources().getColor(R.color.google_blue))
            .setFourthColor(getResources().getColor(R.color.google_yellow))
            .setSpeedCoefficient(1.0f)
            .build();
    fragment.show(getSupportFragmentManager(), "Animation");

Changelog

Version Changes
v.0.9.1 Replaced Timer with ValueAnimator
v.0.9.0 First public release

Migrations from v.0.9.0 to v.0.9.1

  • LoadingAnimationView.getState() was replaced with LoadingAnimationView.isRunning() method.
  • All resources marked as private, prefix lav_ added to their names.
  • Minimum SDK version set to 12

#### Support #### * * * If you have any other questions regarding the use of this library, please contact us for support at [email protected] (email subject: "Android loading animation view. Support request.") or

Use our contacts:


#### License #### * * * The MIT License (MIT)
Copyright (c) 2016 Cleveroad Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

crandroidmbootanimationview's People

Contributors

iojjj avatar ponomarenko-cr avatar jekaua avatar

Watchers

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