Skip to content

Q115/DelayedProgressDialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

DelayedProgressDialog

ProgressDialog is deprecated in Android O. This library was created to mimic the ease of use of ProgressDialog and to also add additional functionalities. Ideal for network operations to prevent loading icon from "flickering" the screen.

Install

Just copy dialog_progress.xml to your layout directory, and DelayedProgressDialog.java to your source code directory (change the default package name) and you'll be good to go.

How to use

DelayedProgressDialog progressDialog = new DelayedProgressDialog();
progressDialog.show(getSupportFragmentManager(), "tag");

//dismiss or cancel the dialog
progressDialog.cancel();

ProgressDialog with a loading icon will appear after DELAY_MILLISECOND if it's not cancelled before then. Content will show for MINIMUM_SHOW_DURATION_MILLISECOND. Change the values to suit your liking.

private static final int DELAY_MILLISECOND = 450;
private static final int MINIMUM_SHOW_DURATION_MILLISECOND = 300;

dialog_progress.xml just shows a ProgressBar, you can add other Views to layout if desired.

License

Apache 2.0

About

Simple Android progress dialog with a delay.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages