Class DynamicRestoreDialog
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
androidx.appcompat.app.AppCompatDialogFragment
com.pranavpandey.android.dynamic.support.dialog.fragment.DynamicDialogFragment
com.pranavpandey.android.dynamic.backup.dialog.DynamicRestoreDialog
- All Implemented Interfaces:
ComponentCallbacks
,DialogInterface.OnCancelListener
,DialogInterface.OnDismissListener
,SharedPreferences.OnSharedPreferenceChangeListener
,View.OnCreateContextMenuListener
,ActivityResultCaller
,HasDefaultViewModelProviderFactory
,LifecycleOwner
,ViewModelStoreOwner
,SavedStateRegistryOwner
,DynamicProductFlavor
A
DynamicDialogFragment
to provide the backup restore functionality.-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.fragment.app.Fragment
Fragment.InstantiationException, Fragment.SavedState
-
Field Summary
FieldsFields inherited from class com.pranavpandey.android.dynamic.support.dialog.fragment.DynamicDialogFragment
ADS_DEFAULT_BUTTON_COLOR
Fields inherited from class androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMAL
Fields inherited from class androidx.fragment.app.Fragment
mPreviousWho
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the backup file used by this dialog.Get the backup file URI used by this dialog.Get the backup listener used by this restore dialog.void
hideProgress
(int button) Hide progress for this dialog.boolean
Returns whether to delete the backup file after performing the restore operation.boolean
Returns whether the backup is ready to be restored.boolean
Returns whether the backup is valid.static DynamicRestoreDialog
Initialize the new instance of this fragment.protected DynamicDialog.Builder
onCustomiseBuilder
(DynamicDialog.Builder dialogBuilder, Bundle savedInstanceState) void
onSaveInstanceState
(Bundle outState) protected void
This method will be called to verify the backup.Set the backup file for this dialog.setBackupUri
(Uri backupUri) Set the backup file URI for this dialog.void
setDeleteBackup
(boolean deleteBackup) Set whether to delete the backup file after performing the restore operation.setDynamicBackup
(DynamicBackup dynamicBackup) Set the backup listener for this restore dialog.void
showDialog
(FragmentActivity fragmentActivity) void
showProgress
(int button) Show progress for this dialog.Methods inherited from class com.pranavpandey.android.dynamic.support.dialog.fragment.DynamicDialogFragment
finishActivity, getBooleanFromArguments, getBuilder, getButtonColor, getDynamicDialog, getLayoutRes, getNegativeButtonText, getNeutralButtonText, getOnCancelListener, getOnDismissListener, getOnKeyListener, getOnShowListener, getParcelableFromArguments, getPositiveButtonText, getProductFlavor, getStringFromArguments, isAutoDismiss, isCancelable, isOnSharedPreferenceChangeListener, onCancel, onCreate, onCreateDialog, onCustomiseDialog, onDestroyView, onDismiss, onPause, onResume, onSharedPreferenceChanged, setAutoDismiss, setBuilder, setButtonColor, setIsCancelable, setNegativeButtonText, setNeutralButtonText, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setPositiveButtonText, setResult, setResult, setResult, setResult, showDialog
Methods inherited from class androidx.appcompat.app.AppCompatDialogFragment
setupDialog
Methods inherited from class androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, onActivityCreated, onAttach, onDetach, onGetLayoutInflater, onStart, onStop, onViewStateRestored, requireComponentDialog, requireDialog, setCancelable, setShowsDialog, setStyle, show, show, showNow
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, 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, 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
-
Field Details
-
TAG
Tag for this dialog fragment.- See Also:
-
-
Constructor Details
-
DynamicRestoreDialog
public DynamicRestoreDialog()
-
-
Method Details
-
newInstance
Initialize the new instance of this fragment.- Returns:
- An instance of
DynamicRestoreDialog
.
-
onSaveInstanceState
- Overrides:
onSaveInstanceState
in classDialogFragment
-
showDialog
- Overrides:
showDialog
in classDynamicDialogFragment
-
onVerifyBackup
protected void onVerifyBackup()This method will be called to verify the backup. -
showProgress
public void showProgress(int button) Show progress for this dialog.- Parameters:
button
- The optional dialog button to be disabled.
-
hideProgress
public void hideProgress(int button) Hide progress for this dialog.- Parameters:
button
- The optional button to be enabled.
-
getDynamicBackup
Get the backup listener used by this restore dialog.- Returns:
- The backup listener used by this restore dialog.
-
getBackup
Get the backup file used by this dialog.- Returns:
- The backup file used by this dialog.
-
setBackup
Set the backup file for this dialog.- Parameters:
backup
- The backup file to be set.- Returns:
- The
DynamicRestoreDialog
object to allow for chaining of calls to set methods.
-
getBackupUri
Get the backup file URI used by this dialog.- Returns:
- The backup file URI used by this dialog.
-
setBackupUri
Set the backup file URI for this dialog.- Parameters:
backupUri
- The backup file URI to be set.- Returns:
- The
DynamicRestoreDialog
object to allow for chaining of calls to set methods.
-
isDeleteBackup
public boolean isDeleteBackup()Returns whether to delete the backup file after performing the restore operation.- Returns:
true
to delete the backup file after performing the restore operation.
-
setDeleteBackup
public void setDeleteBackup(boolean deleteBackup) Set whether to delete the backup file after performing the restore operation.- Parameters:
deleteBackup
-true
to delete the backup file after performing the restore operation.
-
isValidBackup
public boolean isValidBackup()Returns whether the backup is valid.- Returns:
true
if the backup is valid.
-
isReadyBackup
public boolean isReadyBackup()Returns whether the backup is ready to be restored.- Returns:
true
if the backup is ready to be restored.
-