DelayedProgress Library

ProgressBar and ProgressDialog that waits a minimum time to be dismissed before showing. Once visible, the they will be visible for a minimum amount of time to avoid "flashes" in the UI.

License

License

GroupId

GroupId

com.tasomaniac
ArtifactId

ArtifactId

delayed-progress
Last Version

Last Version

0.4
Release Date

Release Date

Type

Type

aar
Description

Description

DelayedProgress Library
ProgressBar and ProgressDialog that waits a minimum time to be dismissed before showing. Once visible, the they will be visible for a minimum amount of time to avoid "flashes" in the UI.
Project URL

Project URL

https://github.com/tasomaniac/DelayedProgress
Source Code Management

Source Code Management

https://github.com/tasomaniac/DelayedProgress

Download delayed-progress

How to add to project

<!-- https://jarcasting.com/artifacts/com.tasomaniac/delayed-progress/ -->
<dependency>
    <groupId>com.tasomaniac</groupId>
    <artifactId>delayed-progress</artifactId>
    <version>0.4</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.tasomaniac/delayed-progress/
implementation 'com.tasomaniac:delayed-progress:0.4'
// https://jarcasting.com/artifacts/com.tasomaniac/delayed-progress/
implementation ("com.tasomaniac:delayed-progress:0.4")
'com.tasomaniac:delayed-progress:aar:0.4'
<dependency org="com.tasomaniac" name="delayed-progress" rev="0.4">
  <artifact name="delayed-progress" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.tasomaniac', module='delayed-progress', version='0.4')
)
libraryDependencies += "com.tasomaniac" % "delayed-progress" % "0.4"
[com.tasomaniac/delayed-progress "0.4"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » support-v4 jar 24.2.1

Project Modules

There are no modules declared in this project.

DelayedProgress

Android Arsenal Build Status License

ProgressBar and ProgressDialog that waits a minimum time to be dismissed before showing. Once visible, the they will be visible for a minimum amount of time to avoid "flashes" in the UI.

They extend platform version of them so that you can just replace all of your ProgressBar and ProgressDialog implementations quickly.

How does it look like?

Here is a demonstration of the usage in GDG Android App. As you can see here, on orientation change, the data is loaded quickly and has no progress indicator.

Usage

DelayedProgressBar

DelayedProgressBar is an extension to ProgressBar that handles automatic delaying and prevents flashes in the UI.

You can create it programatically just like you do with ProgressBar or you can use it in your XMLs.

<com.tasomaniac.android.widget.DelayedProgressBar
    android:id="@android:id/progress"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    style="?android:progressBarStyleHorizontal"/>

And you have to use show() and hide() functions instead of setting its visibility manually to have awesome delaying functionality.

Additionally we have show(boolean animate) and hide(boolean animate) that fades in and out the ProgressBar.

progressbar.show(true);

Lastly, if you want to do something when the animation ends, you can use the below function with endAction.

progressbar.show(true, new Runnable() {
    @Override
    public void run() {
        //Do something
    }
});

progressbar.hide(true, new Runnable() {
    @Override
    public void run() {
        //Do something
    }
});

DelayedProgressDialog

DelayedProgressDialog is an extension to ProgressDialog that handles automatic delaying and prevents flashes in the UI. You can use it just like ProgressDialog. Just use show() and dismiss() appropriately and it will handle the rest.

To create a DelayedProgressDialog with default timing values

DelayedProgressDialog.showDelayed(context, title, message, indeterminate, cancelable);

You can use make() to just create (without calling show()) it manually. This way you can modify it easily before calling show()

DelayedProgressDialog.makeDelayed(context, title, message, indeterminate, cancelable);

And configure

DelayedProgressDialog dialog = DelayedProgressDialog.make(...);
dialog.setMinDelay(2000);
dialog.setMinShowTime(500);
dialog.show();

Download

compile 'com.tasomaniac:delayed-progress:0.4'

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright (C) 2015 Said Tahsin Dane

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.

Versions

Version
0.4
0.3
0.2