Some Kotlin Problem with solutions Every developer need to know

Liquid Pour Loading Animation Android Example

Today i am giving you a great animation tutorial for loading progress with liquid pour effect and in previous article you can learn to create your custom loading progress bar by using Road runner library. But here you'll teach another cool animation effect for your loading animation.
You can also check : Circular Fillable Loaders Android Library
Just look at the example below :

Cool animation for all project : Kick Out the Wrong Password Android Animation

In xml layout file

        android:clickable="true" />

Uses startPour() to start the animation.

LiquidButton liquidButton = (LiquidButton) findViewById(;
      liquidButton.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
            LiquidButton btn = (LiquidButton) v;

Set fillAfter using setFillAfter(), befault as not fill after


Set autoPlay using setAutoPlay(), default as not palying automatically


Register PourFinishListener to the widget

It will send a callback onPourFinish() when the animation completed, and onProgressUpdate() when new progress is updated;
liquidButton.setPourFinishListener(new LiquidButton.PourFinishListener() {

            public void onPourFinish() {
                  Toast.makeText(MainActivity.this, "Finish", Toast.LENGTH_SHORT).show();

            public void onProgressUpdate(float progress) {
                  textView.setText(String.format("%.2f", progress * 100) + "%");

How to update and finish the animation?

You'll able to uses changeProgress() to alternate the progress of the liquid level. (You need AutoPlay turn Off to be able to do that.) Progress are measure in float, where 1f = 100%;
Note :
By default the widget starts a finish animation when the progress is 1f, but you can also uses finishPour to start the finish Animation.

How to?

dependencies {    
            compile 'com.gospelware.liquidbutton:liquidButtonLib:1.1.4'

Hope you like this tutorial. If it is then please give some time to share with your friends.