GoogleProgressBar
Android library to display different kind of google related animations for the progressBar.
Live Demo
https://play.google.com/store/apps/details?id=com.jpardogo.android.googleprogressbar
Usage
Dynamically
Add a ProgressBar to the xml layout:
<ProgressBar
android:id="@+id/google_progress"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"/>
Choose from the list of Drawable
s the one you want to use and place it in your code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.inject(this);
mProgressBar.setIndeterminateDrawable(new your_list_option.Builder(this)
.build());
//...
}
your_list_option
can be replace for:
- FoldingCirclesDrawable
- GoogleMusicDicesDrawable
- NexusRotationCrossDrawable
- ChromeFloatingCircles
The more custom Drawable
s finished, the more options in this list.
Attributes depending on the drawable:
Color
mProgressBar.setIndeterminateDrawable(new you_list_option.Builder(this)
.colors(getResources().getIntArray(R.array.colors) //Array of 4 colors
.build());
- FoldingCirclesDrawable
- NexusRotationCrossDrawable
- ChromeFloatingCirclesDrawable
So far GoogleMusicDicesDrawable
doesn't have color options.
The animation speed can be modified easily with android:indeterminateDuration
in the xml.
If not colors are define the 4 default google colors (red,blue, yellow and green) will be used.
From XML
When you want to use the GoogleProgresBar
from XML you need to add the following view to your layout:
<com.jpardogo.android.googleprogressbar.library.GoogleProgressBar
android:id="@+id/google_progress"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
gpb:type="your_list_option"/>
The require attribute gpb:type
will specify the type of ProgressBar
to display
your_list_option
can be replace for:
- folding_circles
- nexus_rotation_cross
- google_music_dices
- chrome_floating_circles
The more custom Drawable
s finished, the more options in this list.
Each type of GoogleProgressBar
have different attributes:
Attributes depending on type:
Color
- folding_circles
- nexus_rotation_cross
gpb:colors="@array/colors"
- Optional, If not colors are define the 4 default google colors (red,blue, yellow and green) will be used.
- It needs to be an array of 4 colors
So far google_music_dices
doesn't have color options.
The animation speed can be modified easily with android:indeterminateDuration
in the xml.