Skip to content

marwa-eltayeb/ProgressDialog

Repository files navigation

ProgressDialog

Build Codacy Badge CodeFactor Min API Level Maven Central

Android Library to create various kinds of Custom Progress Dialog

animated animated animated animated

animated animated animated animated

Why using ProgressDialog is an asset?

  • You have various kinds of dialogs.
  • You create your own dialog and use them.
  • You can change your ProgressDialog width and height.
  • You can customize ProgressDialog title (change text color, size, font and visibility).
  • You can customize Feedback message (change color, size, font and visibility).
  • You can customize your ProgressBar (change color, size, font and visibility).
  • You can add many shapes as a ProgressBar.
  • You can use your favorite image as a ProgressBar.
  • And much more...

Add ProgressDialog to your project

From Maven Central

implementation 'io.github.marwa-eltayeb:progressdialog:1.0.0'

Code Example

TextView customTitle = new TextView(this);
customTitle.setText(getResources().getString(R.string.please_wait));
customTitle.setPadding(20, 30, 20, 30);
customTitle.setTextSize(20F);
customTitle.setBackgroundColor(getResources().getColor(R.color.pink));
customTitle.setTextColor(Color.WHITE);

ProgressDialog progressDialog = new ProgressDialog(this)
    .setDialogPadding(50)
    .setCustomTitle(customTitle)
    .setTextSize(18)
    .setProgressBarColor(getResources().getColor(R.color.pink))
    .setText("Loading...");

progressDialog.show();

Documentation

ProgressDialog Library is designed with a fluent interface concept which makes it easily customized.

Set ProgressDialog title.

setTitle(String title);

Set ProgressDialog custom title.

setCustomTitle(View customTitle)

Set ProgressDialog message.

setMessage(String message)

Set ProgressDialog icon.

setIcon(int resID)

Set ProgressDialog background color.

setDialogBackground(int color)

Set ProgressDialog background drawable.

setDialogBackgroundDrawable(Drawable drawable)

Set whether ProgressDialog is cancelable.

setCancelable(boolean cancelable)

Set ProgressDialog dim amount.

setDialogDimAmount(float amount)

Set ProgressDialog to transparent.

setDialogTransparent()

Set ProgressDialog padding.

setDialogPadding(int padding)

Set ProgressDialog gravity.

setDialogGravity(int position)

Set ProgressDialog height.

setDialogHeight(int height)

Set ProgressDialog width.

setDialogWidth(int width)

Show ProgressDialog.

show()

Hide ProgressDialog.

dismiss()

Dismiss ProgressDialog.

dismiss()

Cancel ProgressDialog.

cancel()

Set a listener when ProgressDialog is shown.

setOnShowListener(DialogInterface.OnShowListener listener)

Set a listener when ProgressDialog is canceled.

setOnCancelListener(DialogInterface.OnCancelListener listener)

Set a listener when ProgressDialog is dismissed.

setOnDismissListener(DialogInterface.OnDismissListener listener)

Set ProgressBar color

setProgressBarColor(int color)

Set ProgressBar background color

setProgressBarBackGround(int color)

Set ProgressBar background color

setProgressBarBackGround(Drawable drawable)

Define the drawable used to draw the ProgressBar

setProgressDrawable(Drawable drawable)

Set ProgressBar visibility

setProgressBarVisibility(int visibility)

Set the current progress to the specified value.

setProgress(int progress)

Set the upper range of the ProgressBar max.

setProgressMax(int max)

Define the drawable used to draw the ProgressBar in indeterminate mode.

setProgressBarShape(Drawable drawable)

Set ProgressBar padding

setProgressBarPadding(int padding)

Set the Percentage of Progressbar

setProgressbarPercent(String text)

Set the text of the FeedBack text

setText(String text)

Set the size of the FeedBack text

setTextSize(float size)

Set the visibility of FeedBack Text

setTextVisibility(int visibility)

Set the color of the FeedBack text

setTextColor(int color)

Set the color of the FeedBack text background

setTextBackground(int color)

Set the padding of the FeedBack text

setTextPadding(int left, int top, int right, int bottom)

Set the padding of the FeedBack text

setTextPadding(int padding)

Set the bottom padding of the FeedBack text

setTextPaddingBottom(int bottom)

Set the custom shape of the FeedBack text

setTextShape(int shape)

Set the font of the FeedBack text

setTextFont(Typeface font)

License

MIT License

Copyright (c) 2022 Marwa Eltayeb

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.