Android library to display progress like google does in some of his services.

Overview

GoogleProgressBar

This library is not maintained anymore and there will be no further releases

Android library to display different kind of google related animations for the progressBar.

These animations have been finished so far:

FoldingCirclesProgressBar GoogleMusicDicesDrawable NexusRotationCross.gif NexusRotationCross.gif

TODO

  • Different colors for the already existing `GoogleMusicDicesDrawable'. Either the whole dice or his faces.

I also would love to receive your pull requests to create any of the following animations or others that you think fit on this library:

  • NEXUS_CIRCLES:

    Nexus 5 circles boot progress animation (Just the circles bouncing)

  • NEXUS_CROSS:

    Galaxy nexus shinny cross boot animation

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 Drawables 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 Drawables 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 Drawables 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.

Including in your project

You can either add the library to your application as a library project or add the following dependency to your build.gradle:

Maven Central

dependencies {
    compile 'com.jpardogo.googleprogressbar:library:(latest version)'
}

Proguard

In order to use this library with proguard you need to add this line to your proguard.cfg:

-keep class com.jpardogo.android.googleprogressbar.** { *; }

How to contribute?

  • Pull request to dev branch NO master.

Acknowledgements

Developed By

Javier Pardo de Santayana Gómez - [email protected]

Follow me on Twitter Follow me on Google+ Follow me on LinkedIn

License

Copyright 2013 Javier Pardo de Santayana Gómez

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Proguard

    Proguard

    If you are using proguard this methods are removed:

    • float getScale() from GoogleMusicDicesDrawable
    • void setScale(float scale) from GoogleMusicDicesDrawable
    • void setRotationAngle(int angle) from NexusRotationCrossDrawable
    • int getRotationAngle() from NexusRotationCrossDrawable

    I have to add this line to proguard.cfg: -keep class com.jpardogo.android.googleprogressbar.** { *; }

    opened by DesarrolloAntonio 8
  • converted folding circles progress bar to folding circles drawable

    converted folding circles progress bar to folding circles drawable

    So here is quite a big pull request, not sure if you agree with this one.

    Here is the fixes it brings:

    • converted FoldingCirclesProgressBar to FoldingCircleDrawable so it can be reused in many other situations. plus it makes the use of it more clean from a progress bar (that's for #2)
    • cleaned up the code a bit. the new class is a bit lighter than the first one
    • the animation speed can be modified easily now with android:indeterminateDuration on the ProgressBar (that's for #1)
    opened by romainpiel 7
  • Fix visual problem and add new style

    Fix visual problem and add new style

    The bug shows like this in low resolution screen:

    device-2015-01-23-203704

    I fix it by drawing twice, which likes adding it a "thickness" attribute. It's the easiest way to fix, I guess because of the transition from "dp" to "px". And I've tried to draw only once by adding 1 or 0.5f on "mHalf", problem still exists.

    Here is the performance after drawing twice: device-2015-01-23-203740

    opened by MewX 5
  • Antialias and a couple of comments

    Antialias and a couple of comments

    Hey,

    Good job mate for this library! A couple of comments there:

    • you should set the antialias to the paints, I've tried and it looks better
    • I'm not sure if inheriting from ProgressBar is a good idea. You are doing some extra work in your super.onDraw(canvas) I would actually clone the code from ProgressBar, remove what I don't need and set that as a base class for my custom progress bars.

    Good idea anyway!

    opened by romainpiel 3
  • Preview failed, and showed exceptions in Android Studio 1.0

    Preview failed, and showed exceptions in Android Studio 1.0

    I use GPB in a cardview, and Android Studio 1.0 show me an exception.

    The way I use:

    <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:card-view="http://schemas.android.com/apk/res-auto"
        xmlns:gpb="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="140dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="10dp"
        android:clickable="true"
        android:foreground="?android:attr/selectableItemBackground"
        card-view:cardBackgroundColor="@color/novel_item_white"
        card-view:contentPadding="5dp"
        card-view:cardElevation="2dp"
        card-view:cardMaxElevation="4dp">
            <com.jpardogo.android.googleprogressbar.library.GoogleProgressBar
                android:id="@+id/google_progress"
                android:layout_width="20dp"
                android:layout_height="20dp"
                gpb:type="folding_circles"
                android:layout_centerVertical="true"
                android:layout_centerHorizontal="true" />
    </android.support.v7.widget.CardView>
    

    The exception:

    android.content.res.Resources$NotFoundException: Int array resource ID #0x7f050000
        at android.content.res.Resources.getIntArray(Resources.java:522)
        at com.jpardogo.android.googleprogressbar.library.FoldingCirclesDrawable$Builder.initDefaults(FoldingCirclesDrawable.java:256)
        at com.jpardogo.android.googleprogressbar.library.FoldingCirclesDrawable$Builder.<init>(FoldingCirclesDrawable.java:251)
        at com.jpardogo.android.googleprogressbar.library.GoogleProgressBar.buildDrawable(GoogleProgressBar.java:42)
        at com.jpardogo.android.googleprogressbar.library.GoogleProgressBar.<init>(GoogleProgressBar.java:32)
        at com.jpardogo.android.googleprogressbar.library.GoogleProgressBar.<init>(GoogleProgressBar.java:22)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
        at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:379)
        at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:99)
        at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:172)
        at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
        at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132)
        at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
        at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
        at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)
        at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:400)
        at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:332)
        at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
        at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:688)
        at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:677)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
        at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:677)
        at com.android.tools.idea.rendering.RenderService.render(RenderService.java:815)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:646)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:82)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:589)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
        at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:584)
        at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
        at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
        at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
        at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
        at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
        at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
        at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
        at com.intellij.util.Alarm$Request$1.run(Alarm.java:327)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    
    opened by MewX 2
  • fix preview problem in ADT

    fix preview problem in ADT

    Changes:

    Add "if( isInEditMode( ) ) return;" to prevent preview problem in new ADT; Updated gradle feature: replace "runProguard false" by "minifyEnabled false".

    Original preview problem sample happens when use "<com.jpardogo.android.googleprogressbar.library.GoogleProgressBar>" tag in layout XML:

    originalcode

    opened by MewX 1
  • create Progressbar programmatically

    create Progressbar programmatically

    as per your code, you are using progressbar from xml. but how can we create progressbar programmatically with Foldingdrawable.? i tried simple but didnt showing progressbar.

    opened by dhaval0122 1
  • Main manifest has <uses-sdk android:minSdkVersion='8'> but library uses minSdkVersion='11'

    Main manifest has but library uses minSdkVersion='11'

    I want to reference the library in my project(https://github.com/snowdream/android-widgets).i get the error as follows.
    It seems that the minSdkVersion of my project is 8, but your minSdkVersion is 11.
    If your library is avaiable for minSdkVersion 8, can you modify it to minSdkVersion 8,thank you.

    [/home/snowdream/workspace/git/android-widgets/lib/src/main/AndroidManifest.xml, /home/snowdream/workspace/git/android-widgets/lib/build/exploded-aar/com.jpardogo.googleprogressbar/library/1.0.0/AndroidManifest.xml:2]   
    Main manifest has <uses-sdk android:minSdkVersion='8'> but library uses minSdkVersion='11'
    
    opened by snowdream 1
  • How to make Chrome ProgressBar rotate?

    How to make Chrome ProgressBar rotate?

    Hi, could you improve the Chrome ProgressBar animation in order to make it rotate clockwise or counterclockwise while switching circles positions? Thank you in advance.

    opened by goldmont 0
  • CustomProgressBar

    CustomProgressBar

    This PR consist in:

    • Custom GoogleProgressBar that can be use directly form the XML layout.
    • attr.xml file for the GoogleProgressBar to be set directly from the xml.
    • FoldingCirclesDrawable Builder
    • gradle.build file dependencies remove from library module
    • AndroidManifest.xml refactor to remove code not needed in library module The Builder will make the #6 easier to be accomplish.
    opened by jpardogo 0
  • Getting null pointer exception while showing progressbar

    Getting null pointer exception while showing progressbar

    I am using this library in viewpager i am getting this crash

    java.lang.NullPointerException: Attempt to read from null array at com.jpardogo.android.googleprogressbar.library.ChromeFloatingCirclesDrawable.draw(ChromeFloatingCirclesDrawable.java:189) at android.widget.ProgressBar.drawTrack(ProgressBar.java:1803) at android.widget.ProgressBar.onDraw(ProgressBar.java:1770) at android.view.View.draw(View.java:17503) at android.view.View.updateDisplayListIfDirty(View.java:16496) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3907) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3887) at android.view.View.updateDisplayListIfDirty(View.java:16456) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3907) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3887) at android.view.View.updateDisplayListIfDirty(View.java:16456) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3907) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3887) at android.view.View.updateDisplayListIfDirty(View.java:16456)

    opened by skyshine999 1
  • null instead context in fragments

    null instead context in fragments

    some time in fragment throws exception when i use :

    
    //So i use it like this 
    getActivity().findViewById(R.id.google_progress).setVisibility(View.INVISIBLE);
    
    

    and i know getActivity some time return null instead context but still is problem ! you have any suggest can cover this ?

    /**
         * Return the {@link FragmentActivity} this fragment is currently associated with.
         * May return {@code null} if the fragment is associated with a {@link Context}
         * instead.
         */
        final public FragmentActivity getActivity() {
            return mHost == null ? null : (FragmentActivity) mHost.getActivity();
        }
    
    
    opened by abbashosseini 0
Owner
JPARDOGO
Android language writer and translator. Twitter: @jpardogo
JPARDOGO
Android loading or progress dialog widget library, provide efficient way to implement iOS like loading dialog and progress wheel

ACProgressLite English Version / 中文版本 An Android loading widget library. Lite and easy to use, strong customizability. Can be used to implement 'iOS'

Cloudist Technology Co., Ltd. 234 Nov 24, 2022
IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

heyangyang 6 Aug 25, 2022
:barber: [Android Library] Stacked dual progress indicator progress-bar

StackedHorizontalProgressBar Specs Featured in Show some ❤️ Android library with ability to show two progress indicators in one horizontal progress ba

Nishant Srivastava 98 Nov 11, 2022
A progress wheel for android, intended for use instead of the standard progress bar.

Deprecation warning This project is no-longer maintained, and has not been maintained for a few years now. If you're looking for an alternative librar

Todd Davies 2.7k Dec 29, 2022
Progress Button is a android library for hanling different types state like active, finished, enabled, disabled and reset with a single line of code.

Progress Button is a android library for hanling different types state like active, finished, enabled, disabled and reset with a single line of code.

Sagar Khurana 38 Nov 15, 2022
A simple lib to create a ring-like progress view with corner edges

ProgressRingView Installation Gradle: dependencies { compile 'com.github.flepsik:progress-ring-view:1.2.1' } Maven: <dependency> <groupId>com.g

null 71 Dec 5, 2021
MusicBar 2.1 0.0 Java view visualize progress bar for sound file like sound cloud

MusicBar Setup dependencies { implementation 'com.oze.music:MusicBar:1.0.5' } Usage Function Description setAnimationChangeListener(OnMusicBarAn

emad 74 Aug 26, 2022
Simple Progress View that you can compare things, like statistics of a Football match

Simple Progress View that you can compare things, like statistics of a Football match

Kostas Antoniou 29 Jun 8, 2022
An instagram-like segmented progress bar

An instagram-like segmented progress bar

Tiago Ornelas 286 Jan 6, 2023
A 'Google Fit' like activity indicator for Android

WheelIndicatorView A 'Google Fit' like activity indicator for Android Screenshots Usage How to use: Add a "WheelIndicatorView" in the layout editor li

David Lázaro 396 Nov 25, 2022
[Android] Round Corner Progress Bar Library for Android

RoundCornerProgressBar Round corner is cool. Let's make your progress bar to round corner Colorful progress bar with round corner on progress which yo

Akexorcist 2.3k Dec 31, 2022
[Android] Round Corner Progress Bar Library for Android

RoundCornerProgressBar Round corner is cool. Let's make your progress bar to round corner Colorful progress bar with round corner on progress which yo

Akexorcist 2.3k Jan 7, 2023
An android library to display a progressbar that goes around an image.

android-square-progressbar First things first This library is setup to work with the Android Studio and Gradle. If you're using the Eclipse environmen

Yannick Signer 1.3k Nov 15, 2022
A customizable, animated progress bar that features rounded corners. This Android library is designed to look great and be simple to use 🎉

RoundedProgressBar Easy, Beautiful, Customizeable The RoundedProgressBar library gives you a wide range of customizable options for making progress ba

null 541 Jan 1, 2023
A circular android ProgressBar library which extends View, and the usage same as ProgressBar, It has solid,line and solid_line three styles. Besides, progress value can be freely customized.

CircleProgressBar 中文版文档 The CircleProgressBar extends View, It has both solid and line two styles. Besides, progress value can be freely customized. I

dinus_developer 1.2k Jan 3, 2023
DownloadProgressBar is an android library that delivers awesome custom progress bar. You can manipulate it's state in every way.

Download Progress Bar Android progress bar with cool animation, inspired by : https://dribbble.com/shots/2012292-Download-Animation ###Attributes Attr

Mariusz Brona 978 Nov 10, 2022
Android library for showing progress in a highly customizable pie.

ProgressPieView Android library for showing progress in a highly customizable pie. Choose from the broad spectre of styleable elements: ppvStrokeWidth

Filip Puđak 399 Dec 29, 2022
Open source android library for different progress bar designs

MultiProgressBar A progress bar library for Android that provides customized progress bars. Built with ❤︎ by Aseem Khare ?? Installation Add this in y

Aseem Khare 124 Nov 15, 2022
Android library with collection of cool progress views.

CoolProgressViews Android library with collection of cool progress views. DEMO LINK Also Mention in: Android Library Hunt MaterialUp DEMO DOWNLOAD Add

Amanjeet Singh 83 Nov 29, 2022