Android tutorial

How To Create Animated Progress Bar in Android

Hi  Everyone in this article I am sharing How To Create Animated Progress Bar in Android. It’s very easy to use an animated progress bar with GitHub library. Today Animated is the best part of  Android UI Is the Most important Part to develop a good android app.

In Android, ProgressBar is used to display the status of work being done like analyzing the status of work or downloading a file, etc. In Android, by default, a progress bar will be displayed as a spinning wheel but If we want it to be displayed as a horizontal bar then we need to use style attribute as horizontal. It mainly uses the “android.widget.ProgressBar” 

 

Let’s Start To Create Animated Progress Bar in Android

Step: 1 Add Animated Progress Bar Library in your build.gradle  

implementation 'com.roger.catloadinglibrary:catloadinglibrary:1.0.4'

After adding the library to sync your project and add this code in your java class.

Step 2: Create a Progress Bar in your java class and Implement code in your class. 

CatLoadingView mView;

@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    mView = new CatLoadingView();
    findViewById(R.id.button).setOnClickListener(
            new View.OnClickListener() {
                @Override public void onClick(View v) {
                    mView.show(getSupportFragmentManager(), "");
                }
            });
}

Set Background Color

mView.setBackgroundColor(Color.parseColor("#000000"));

 

https://www.youtube.com/watch?v=L8BP8a5PX6M