Need help with BusyIndicator?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

silverforge
122 Stars 24 Forks Apache License 2.0 77 Commits 1 Opened issues

Description

The BusyIndicator is a progress indicator with determined and indeterminate mode.

Services available

!
?

Need anything else?

Contributors list

No Data

README

Android Arsenal

Circle CI

Contents

What is this repository for?

The BusyIndicator is a progress indicator with determined and indeterminate state.

Current version is Download

BusyIndicatorDemo

How do I get set up?

dependencies {

...

compile 'com.silverforge.controls:busyindicator:1.2.0'

}

Issues/contact

Please do not hesitate to raise any issue you find related to BusyIndicator here

License

Apache 2.0

Copyright 2015 Janos Murvai-Gaal

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.

Configuration

You can control the busyindicator behavior or look & feel with the following attributes:

Indeterminate
v1.0
  • bigpoint_color - The foreground color of the points (circles) on outer radius. By default it is gray.
  • smallpoint_color - The foreground color of the point (circle) on the inner radius. By default it is black.
  • bigpoint_count - The count of points (circles) on outer radius. By default it is 4. (Range is integer between 4 and 20)
  • backgroundisvisible - true of false. If true you have a light gray rectangle background with rounded corner by default .
  • background_color - The background color if visible. By default it is light gray.
  • background_shape - The shape of background. (Values could be either rounded_rectangle or circle)
v1.1
  • angle_modifier - The speed multiplicator of the busy indicator. By default it is 1. (Range is integer between 1 and 3)
Determined

All of the attributes mentioned in previous section plus

v1.0
  • infinite - true of false. If true the busyindicator is active otherwise the load indicator is active.
  • percentageisvisible - true of false. If true the percentage text appears.
  • percentagedecimalplaces - Could be : [0, 1, 2]. The decimal places of the percentage text.
  • max_value - The max value of the progress.
v1.1
  • strokewidthmultiplier - The width multiplicator of the indicator. (Range is float between 0.2F and 14F)
  • loadpointsare_visible - true or false. If true the outer points are visible otherwise they are hidden.
  • indicator_alpha - The indicator color alpha. By default it is 100. (Range is integer between 100 and 255).

Dark rectangle background

Busy indicator

Progress indicator

Light circle background

Busy indicator

Progress indicator

Transparent background

Busy indicator

Progress indicator

Multi progress indicators

Progress indicator

Multi progress indicator

How to control progress indicator from code

Basically just set the maxValue() of busyIndicator and after that set the current value via setValue() frequently like the // NOTE indicates in the code below.

Note : You can set the maxValue with xml attribute as well like app:max_value="756"

For example if you have a progress from 0 to 756, you just set maxValue() to 756 and via setValue() inform the busyIndicator about the progress. BusyIndicator will do the percentage calculations.

        busyIndicator = (BusyIndicator) findViewById(R.id.finiteBusyIndicator);

    // NOTE : Set the maximum value
    busyIndicator.setMaxValue(102);

    new BusyIndicatorAsyncTask().execute();

...

class BusyIndicatorAsyncTask extends AsyncTask {
    @Override
    protected Object doInBackground(Object[] params) {

        for (int i = 0; i <= 102; i += 3) {
            final int a = i;
            runOnUiThread(new Runnable() {
                @Override
                public void run() {

                    // NOTE : You can set the current value of BusyIndicator
                    busyIndicator.setValue(a);
                }
            });

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        return null;
    }
}

v1.2

Set the color of the load indicator from code

    rectangleBusyIndicator = (BusyIndicator) view.findViewById(R.id.finiteRectangleBusyIndicator);

rectangleBusyIndicator.setSingleColor(Color.CYAN);

Add custom text below the percentage

    rectangleBusyIndicator = (BusyIndicator) view.findViewById(R.id.finiteRectangleBusyIndicator);

rectangleBusyIndicator.setCustomText("perec");

How to adjust indeterminate busy indicator speed

Actualy it's simple, you can set the angle modifier via setAngleModifier() method at any time. The busy indicator immediately changes the speed once you set it.

    class InfiniteBusyModifier extends AsyncTask {
        @Override
        protected Object doInBackground(Object[] params) {
            final Random rand = new Random();

        FragmentActivity activity = getActivity();

        while (true) {
            final int a = rand.nextInt(3) + 1;

            activity.runOnUiThread(new Runnable() {
                @Override
                public void run() {

                    // NOTE : You can set the speed
                    infiniteCircleBusyIndicator.setAngleModifier(a);
                }
            });

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

UI

DarkRect

LightCircle

Trans

Trans

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.