Skip to content

preeti276/Android-Custom-Progress-Bar

Repository files navigation

Android-Custom-Progress-Bar

This source code will help you create a custom progress bar as shown below for your android app. It is bundled with animations and colors to enhace the UI of your android app.

Implementation

A main activity with this progress bar shows a particular fragment with a corresponding popping icon and text. The number of fragments displayed are equal to progress indicator icons on this progress bar. This number can be changed as per your use.

Important Files and Significance

CustomWaveView: This class extend the base View class and creates the background curve view in onDraw method.

CustomProgressViewGroup: This java class extends the base ViewGroup Class and adds the background, icons and text as children at particular co-ordinates.

ProgressBarActivity: This activity is your main activity with your progress bar and a frame layout to display fragments.

FragmentView: This is a default view for fragment. You can change the view and designs, and even add new fragments to display.

All you need to do

  • Clone/download the source code
  • Put the images of icon in the res/drawable folder with their names as "icon1", "icon2", etc.
  • Put the correspoding text in res/values/strings.xml folder with names as "text1", "text2", etc.
  • Add data/design to fragments if required.
  • No need to make any changes in ProgressBarActivity which acts like your MainActivity.

OR follow the todo in the code, important steps are also mentioned there.

NOTE

Uncomment the fill color code in CustomWaveView if you need the view with color as shown below. Though the recommended way is to use is without fill loop (as shown above) so as to improve the efficiency since the fill color tends to slow down the app performance.