Package eltos.simpledialogfragment
Klasse SimpleProgressDialog
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
eltos.simpledialogfragment.SimpleDialog<SimpleProgressDialog>
eltos.simpledialogfragment.CustomViewDialog<SimpleProgressDialog>
eltos.simpledialogfragment.SimpleProgressDialog
- Alle implementierten Schnittstellen:
android.content.ComponentCallbacks,android.content.DialogInterface.OnCancelListener,android.content.DialogInterface.OnDismissListener,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner
A dialog that displays a progress
Created by eltos on 27.05.21.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic enumEnum for various progress bar types.Von Klasse geerbte verschachtelte Klassen/Schnittstellen eltos.simpledialogfragment.SimpleDialog
SimpleDialog.OnDialogResultListenerVon Klasse geerbte verschachtelte Klassen/Schnittstellen androidx.fragment.app.Fragment
androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final intResult type if dialog was auto-dismissed due a to completed taskprotected android.widget.TextViewprotected android.widget.ProgressBarprotected android.widget.TextViewprotected SimpleProgressTask<?, ?, ?> static final StringVon Klasse geerbte Felder eltos.simpledialogfragment.SimpleDialog
BUNDLE, CANCELABLE, FULLSCREEN, HTML, ICON_RESOURCE, MESSAGE, NEGATIVE_BUTTON_TEXT, NEUTRAL_BUTTON_TEXT, POSITIVE_BUTTON_TEXT, THEME, TITLEVon Klasse geerbte Felder androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMALVon Klasse geerbte Felder androidx.fragment.app.Fragment
mPreviousWho -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic SimpleProgressDialogbar()Veraltet.static SimpleProgressDialogbuild()Generic static method to build this dialogstatic SimpleProgressDialogbuildBar()Static method to build a progress dialog ofSimpleProgressDialog.Type.BARShows the percentage by default.static SimpleProgressDialogStatic method to build an indeterminate progress dialog ofSimpleProgressDialog.Type.CIRCLEprotected booleancallResultListener(int which, android.os.Bundle extras) static SimpleProgressDialogVeraltet.voidonCreate(android.os.Bundle savedInstanceState) protected android.view.ViewonCreateContentView(android.os.Bundle savedInstanceState) Inflate your custom view here.voidonResume()voidonSaveInstanceState(android.os.Bundle outState) percentage(boolean visible) Whether to show the percentage text or nottask(SimpleProgressTask<?, ?, ?> task, boolean cancelable, boolean autoDismiss) Connect an AsyncTask with this dialog.Set the progress bar type to any ofSimpleProgressDialog.TypePlease note that some features might not be available depending on the chosen typevoidSet or update the progress to be finished, i.e. 100% If a task is linked to this dialog, the "cancel" button is disabled, the positive one enabled, and the dialog dismissed if autoDismiss was setvoidSet or update the progress to be indeterminate before or while the dialog is shown.voidupdateInfoText(String text) Set or update the info text at the end of the bar / next to the circlevoidupdateMax(int max) Set or update the progress before or while the dialog is shown.voidupdateProgress(int progress) Set or update the progress before or while the dialog is shown.voidupdateProgress(int progress, int max) Set or update the progress before or while the dialog is shown.voidupdateProgress(Boolean indeterminate, Integer progress, Integer secondaryProgress, Integer max) Set or update the progress before or while the dialog is shown.voidupdateProgressText(String text) Set or update the progress text at the start of the progress bar / in the center of the circlevoidupdateSecondaryProgress(int progress) Set or update the progress before or while the dialog is shown.Von Klasse geerbte Methoden eltos.simpledialogfragment.CustomViewDialog
acceptsPositiveButtonPress, extractContentView, inflate, inflate, onCreateDialog, onDialogShown, onNegativeButtonClick, onNeutralButtonClick, onPositiveButtonClick, onResult, pressPositiveButton, setNegativeButtonEnabled, setNeutralButtonEnabled, setPositiveButtonEnabledVon Klasse geerbte Methoden eltos.simpledialogfragment.SimpleDialog
cancelable, extra, fullscreen, fullscreen, getArgs, getArgString, getContext, getExtras, getMessage, getTitle, icon, isCancelable, msg, msg, msgHtml, msgHtml, neg, neg, neg, neut, neut, neut, onCancel, onDestroyView, pos, pos, setArg, setArg, setArg, setArg, setButtonClickListener, setButtonEnabled, show, show, show, show, show, show, show, show, showKeyboard, theme, title, titleVon Klasse geerbte Methoden androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, onActivityCreated, onAttach, onDetach, onDismiss, onGetLayoutInflater, onStart, onStop, onViewStateRestored, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, showNowVon Klasse geerbte Methoden androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onViewCreated, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
Felddetails
-
TAG
- Siehe auch:
-
COMPLETED
public static final int COMPLETEDResult type if dialog was auto-dismissed due a to completed task- Siehe auch:
-
mProgressBar
protected android.widget.ProgressBar mProgressBar -
mProgressText
protected android.widget.TextView mProgressText -
mInfoText
protected android.widget.TextView mInfoText -
mTask
-
-
Konstruktordetails
-
SimpleProgressDialog
public SimpleProgressDialog()
-
-
Methodendetails
-
build
Generic static method to build this dialog- Gibt zurück:
- a new instance of a
SimpleProgressDialog
-
buildBar
Static method to build a progress dialog ofSimpleProgressDialog.Type.BARShows the percentage by default.- Gibt zurück:
- a new instance of a
SimpleProgressDialog
-
bar
Veraltet. -
buildIndeterminateCircle
Static method to build an indeterminate progress dialog ofSimpleProgressDialog.Type.CIRCLE- Gibt zurück:
- a new instance of a
SimpleProgressDialog
-
indeterminateCircle
Veraltet. -
type
Set the progress bar type to any ofSimpleProgressDialog.TypePlease note that some features might not be available depending on the chosen type- Parameter:
type- The progress bar typeSimpleProgressDialog.Type- Gibt zurück:
- this instance
-
percentage
Whether to show the percentage text or not- Parameter:
visible- percentage text visible or not- Gibt zurück:
- this instance
-
task
public SimpleProgressDialog task(SimpleProgressTask<?, ?, ?> task, boolean cancelable, boolean autoDismiss) Connect an AsyncTask with this dialog. This will - update the progress dialog based on the progress reported by the task (seeSimpleProgressTask.onProgressUpdate(Progress...)- if cancelable, add a neutral "cancel" button and disable it once the task finished - prevent the user from dismissing the dialog via the back button or by clicking outside it - if autoDismiss is true, dismiss the dialog after the task has ended - if autoDismiss is false, add a positive button "OK" that is only enabled after the task finished- Parameter:
task- : TheSimpleProgressTaskassociated with this dialogcancelable- : If a cancel button is shown to allow canceling the taskautoDismiss- : Whether to dismiss the dialog once the task finishes- Gibt zurück:
- this instance
-
updateProgress
public void updateProgress(@Nullable Boolean indeterminate, @Nullable Integer progress, @Nullable Integer secondaryProgress, @Nullable Integer max) Set or update the progress before or while the dialog is shown.- Parameter:
indeterminate- indeterminate mode (or null to keep the previous value)progress- primary progress (or null to keep the previous value)secondaryProgress- secondary progress (if any, or null to keep the previous value)max- maximum for progress (or null to keep the previous value)
-
updateProgress
public void updateProgress(int progress) Set or update the progress before or while the dialog is shown. This also sets indeterminate to false.- Parameter:
progress- primary progress
-
updateProgress
public void updateProgress(int progress, int max) Set or update the progress before or while the dialog is shown. This also sets indeterminate to false.- Parameter:
progress- primary progressmax- maximum for progress
-
updateMax
public void updateMax(int max) Set or update the progress before or while the dialog is shown.- Parameter:
max- maximum for progress
-
updateSecondaryProgress
public void updateSecondaryProgress(int progress) Set or update the progress before or while the dialog is shown. This also sets indeterminate to false.- Parameter:
progress- secondary progress
-
updateIndeterminate
public void updateIndeterminate()Set or update the progress to be indeterminate before or while the dialog is shown. To set indeterminate to false, useupdateProgress(java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.lang.Integer) -
updateFinished
public void updateFinished()Set or update the progress to be finished, i.e. 100% If a task is linked to this dialog, the "cancel" button is disabled, the positive one enabled, and the dialog dismissed if autoDismiss was set. * -
onResume
public void onResume()- Setzt außer Kraft:
onResumein Klasseandroidx.fragment.app.Fragment
-
updateProgressText
Set or update the progress text at the start of the progress bar / in the center of the circle- Parameter:
text- The text to show
-
updateInfoText
Set or update the info text at the end of the bar / next to the circle- Parameter:
text- The text to show
-
onCreateContentView
protected android.view.View onCreateContentView(android.os.Bundle savedInstanceState) Beschreibung aus Klasse kopiert:CustomViewDialogInflate your custom view here.- Angegeben von:
onCreateContentViewin KlasseCustomViewDialog<SimpleProgressDialog>- Parameter:
savedInstanceState- The last saved instance state of the Fragment, or null if this fragment is created for the first time.- Gibt zurück:
- Return a new View to be displayed by the Fragment.
-
onCreate
@CallSuper public void onCreate(android.os.Bundle savedInstanceState) - Setzt außer Kraft:
onCreatein KlasseCustomViewDialog<SimpleProgressDialog>
-
callResultListener
@CallSuper protected boolean callResultListener(int which, android.os.Bundle extras) - Setzt außer Kraft:
callResultListenerin KlasseCustomViewDialog<SimpleProgressDialog>
-
onSaveInstanceState
public void onSaveInstanceState(@NonNull android.os.Bundle outState) - Setzt außer Kraft:
onSaveInstanceStatein Klasseandroidx.fragment.app.DialogFragment
-