An android library to display a progressbar that goes around an image.

Overview

android-square-progressbar Download

square image

First things first

This library is setup to work with the Android Studio and Gradle. If you're using the Eclipse environment then check out the legacy repository here: android-square-progressbar-legacy.

You can find my blog post about the newest version here: halcyon.ch - android-square-progressbar v.1.6.0, also check out the post about the previous major 1.5.0 version here.

The example application is available at the play store:

Get it on Google Play

Join the chat at https://gitter.im/mrwonderman/android-square-progressbar

General idea

Sometimes you don't have enough space in your layout to display a wide progressbar. So this library gives you a complete new possibility to display a progress. You can simply show a progressbar around an image. And this progressbar can be configured in a lot of different ways, like colour, outline, display of the percentage and so on.

Examples

Here are some examples of how these progressbars could look like:

normal / default rounded corners show percent indeterminate
setRoundedCorners(true) showProgress(true) drawOutline(true)
setOpacity(true) setIndeterminate(true)

There are some further examples available here (with code) : Examples

How to use it? / How to install? / How to contribute?

Check the wiki for more information about how to use, how to install or how to contribute.

If you have questions about the code or if you need some help, you can try the Gitter-Group.

Usage

Gradle

This library now works with gradle and will soon be available on the central maven repository. For the moment its on jCenter at Bintray. Just add the following repository to your root build.gradle:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jcenter.bintray.com" }
    }
}

Then in your app build.gradle:

dependencies {
    // other repos ...
    implementation 'ch.halcyon:squareprogressbar:1.6.4'
}

Code

After adding the gradle depedency from above you can go to your xml layout and add the following code for a squareprogressbar:

<ch.halcyon.squareprogressbar.SquareProgressBar
    android:id="@+id/sprogressbar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:paddingTop="20dp" >
</ch.halcyon.squareprogressbar.SquareProgressBar>

To set some basic settings use the following java-code:

SquareProgressBar squareProgressBar = findViewById(R.id.sprogressbar);
squareProgressBar.setImage(R.drawable.example);
squareProgressBar.setProgress(50.0);

Now you can make the squareprogressbar as fancy as you like. Check the usage page for all the different possiblities.

Comments
  • can make a method getIamgeView for squareprogressbar?

    can make a method getIamgeView for squareprogressbar?

    i want to use universal-image-loader to loading net picture ,and show progress。 squareprogressbar very nice,but only set local drawable and bitmap; can you get my idea?

    question 
    opened by tosslife 4
  • layer is breaking and then constructing again at bottom corners.

    layer is breaking and then constructing again at bottom corners.

    rightcorner

    leftcorner

    while seekbar is being dragged, if we clearly observe there the progress will break and complete again. please check the screenshots at bottom borders.

    bug 
    opened by topoapp 3
  • NPE on the setImageScaleType(ImageView.ScaleType.CENTER);

    NPE on the setImageScaleType(ImageView.ScaleType.CENTER);

    Why the image reference assigning after constructor called. It may cause NPE if someone calls setImageScaleType before setting an image. squareprogressbar 93 line

    
        public void setImage(int image) {
            imageView = (ImageView) findViewById(R.id.imageView1);
            imageView.setImageResource(image);
    
        }
    
    
    bug fixed 
    opened by gordonpro 3
  • can I implement this fancy progress bar in pull-to-refresh-listview

    can I implement this fancy progress bar in pull-to-refresh-listview

    I have a listview showing a list of files, when use click download all files, I want to use this progressbar to show downloading progress, is it possible for that?

    opened by Logan676 3
  • Border not fitting the image

    Border not fitting the image

    Hi there!

    Thanks for all the awesome work done! I am using your library with this image: hourglass

    However, the progress bar doesn't follow the image on the top and bottom edges. It may be some silly mistake on my side, but till now I haven't found it :) It likely is because of the LinearLayout in which the view is put.

    Screenshot: screenshot_2014-04-29-14-27-15

    Sorry for big images. :)

    bug fixed 
    opened by niosus 3
  • Setup with gradle

    Setup with gradle

    I wanted to try your library but as it was setup I could not integrate it in my project. With this gradle setup I can integrate it as a module or I can use the generated .aar. I think those changes can be pretty useful and facilitate the upgrade of you library for people who are using it.

    enhancement 
    opened by elodieferrais 3
  • How to set bitmap for image?

    How to set bitmap for image?

    I notice method public void setImage(int image) allows us to set a drawable to image, not a bitmap.

    Do we have any such method public void setImage(Bitmap bitmap)?

    question 
    opened by anticafe 2
  • .setIndeterminate(true); not working

    .setIndeterminate(true); not working

    When i use view.setIndeterminate(true); not progress displays around the image.

        <ch.halcyon.squareprogressbar.SquareProgressBar
            android:id="@+id/iv_photo"
            android:layout_width="@dimen/_200sdp"
            android:layout_height="@dimen/_200sdp"
            android:layout_centerHorizontal="true" />
    
    opened by darwinfrancis 1
  • Wanted to setImageDrawable because there was only the setImageResource

    Wanted to setImageDrawable because there was only the setImageResource

    This is useful when using Picasso like this

    Picasso.with(getActivity()) .load(imageURL) .into(streetViewImage, new com.squareup.picasso.Callback() { @Override public void onSuccess() { SquareProgressBar squareProgressBar = (SquareProgressBar) getView().findViewById(R.id.search_street_view_image_SquareProgressBar); ImageView streetViewImage = (ImageView) getView().findViewById(R.id.search_street_view_image); int id = Resources.getSystem().getIdentifier("ic_dialog_alert", "drawable", "android"); squareProgressBar.setImage(streetViewImage.getDrawable()); squareProgressBar.setProgress(50.0); squareProgressBar.setIndeterminate(true); streetViewImage.setImageDrawable(null); }

    @Override public void onError() { //do smth when there is picture loading error } });

    opened by erikswed 1
  • fixed draw logic

    fixed draw logic

    changed the way the progressbar gets drawn. this should fix the issues that sometimes the progressbar looked as if it would break apart. also optimised the code slightly.

    opened by mrwonderman 0
  • about height of navigate bar.

    about height of navigate bar.

    int cW = canvas.getWidth();
    int cH = canvas.getHeight();
    Log.i("taohui", "" + cW + "-" + cH + ", " + Dimens.INSTANCE.getScreenWidth() + "-" + Dimens.INSTANCE.getScreenHeight());
    

    2020-06-21 17:59:51.088 32699-32699/me.taosunkist.hello I/taohui: 1080-2340, 1080-2131 2020-06-21 17:59:51.310 32699-32699/me.taosunkist.hello I/taohui: 1080-2340, 1080-2131 2020-06-21 17:59:51.332 32699-32699/me.taosunkist.hello I/taohui: 1080-2340, 1080-2131 2020-06-21 17:59:51.344 32699-32699/me.taosunkist.hello I/taohui: 1080-2340, 1080-2131

    opened by TaoSunkist 0
  • Allow setting fixed progress for indeterminate mode.

    Allow setting fixed progress for indeterminate mode.

    Thank you for this great library.

    It would be great if developer could set the fixed progress even in the indeterminate mode instead of only able to see a single dot in progress bar.

    opened by DroidBoyJr 0
Now deprecated. A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar

Description Small library allowing you to make a smooth indeterminate progress bar. You can either user your progress bars and set this drawable or us

Antoine Merle 4.4k Dec 30, 2022
Android library to realize the various states and transitions in a ProgressBar.

StateProgressBar StateProgressBar is an Android library to realize the various states and transitions in a ProgressBar. Quick Start Get a feel of how

Kofi Gyan 1.5k Jan 9, 2023
A beautiful, slim Android ProgressBar.

Android NumberProgressBar The NumberProgressBar is a bar, slim and sexy (every man wants! ). I decided to do this because I was really tired of androi

代码家 6k Jan 7, 2023
Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

LoadingDrawable: Android cool animation collection 前言 CircleRotate源码解析 Fish源码解析 LoadingDrawable is some android animations implement of drawable: a li

dinus_developer 4.1k Dec 27, 2022
Android ProgressBar that "bends" under its own weight. Inspired by http://drbl.in/nwih

RopeProgressBar Android ProgressBar that "bends" under its own weight. Attributes Attribute Type Default Usage app:ropeMax integer 0 The max value of

Christian De Angelis 206 Dec 18, 2022
ArcProgressbar project let create Arc progressbar in android in simplest way.

Arc Progressbar In Android ArcProgressbar project let create Arc progressbar in android in simplest way. USAGE To make a Arc Progressbar add ArcProgre

Manish 40 Dec 11, 2022
Holo Circular ProgressBar

HoloCircularProgressBar What is HoloCircularProgressBar HoloCircularProgressBar is a Custom View implementation for Android you might know from the An

Pascal Welsch 957 Nov 15, 2022
MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4 v21+)

MaterialLoadingProgressBar MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4

lsjwzh 1.1k Nov 19, 2022
Progressbar with whorl style

WhorlView 一个加载View 预览 使用 step1 添加gradle配置 dependencies { compile 'com.tt:whorlviewlibrary:1.0.3' } step2 在xml中添加WhorlView <com.tt.whorlviewli

AndroidKy 409 Dec 3, 2022
Material Design ProgressBar with consistent appearance

MaterialProgressBar Material Design ProgressBar with consistent appearance on Android 4.0+. Why MaterialProgressBar? Consistent appearance on Android

Hai Zhang 2.2k Jan 1, 2023
Material progress circle around any FloatingActionButton. 100% Guidelines.

FABProgressCircle Android library to provide a material progress circle around your FloatingActionButton. This component is compatible with any existe

Jorge Castillo 1.2k Nov 28, 2022
Android library to display progress like google does in some of his services.

GoogleProgressBar This library is not maintained anymore and there will be no further releases Android library to display different kind of google rel

JPARDOGO 1.3k Dec 27, 2022
ColoringLoading 4.7 0.0 Java This project provide Coloring Loading View for Android. And this project is not using the image file!

ColoringLoading ![Release](https://img.shields.io/github/release/recruit-lifestyle/ColoringLoading.svg?label=maven version) This project provide Color

Recruit Lifestyle Co. Ltd. 379 Jul 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 providing to realize wave loading effect.

WaveLoadingView WaveLoadingView - An Android library that provides a realistic wave-loading effect. Sample Usage For a working implementation of this

Tang 1.7k Jan 2, 2023
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
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