Make your own LOGO as a Circular Progress bar in Android


In this article, i’ll show how to make your own logo to be a circular progress bar.

We need progress bar sometimes to inform user that some stuff going behind the screen or to inform the user to wait until something loading. Well then instead of using default old style circular bar with rotation, if we use our own logo as circular progress bar will be nice in both the ways i.e UI for the user and branding our stuff to the user. so lets get started.

In this example, i’m using simple rotate animation, for effects one can use frame animation.

Code for animation:

Now Create a new ProgressDialog with a custom layout.

To reuse the code in the entire project, i’m using static method setUIToWait. The new ProgressDialog is created with ProgressDialog.show(context, null, null) with empty title, message and added the custom layout to it. If you don’t  provide Background to transparent, then the entire view will be plain white background.

Now the custom layout is:

Now from anywhere use this code to show the circular progress bar.

ScreenShot:

logo_circular

 

Complete code:

MainActivity.java

ShowProgressDialog.java

activity_main.xml

circular_progress.xml

loader_anim.xml

 

Hope this helpful. Your valuable comments are always welcomed. It will help to improve my post and understanding.


About Durga Chiranjeevi

I’m a normal guy, engineer by education who is passionate about Programming and Internet. An android enthusiast, now moving for cross platforms and game development.