Class DynamicRestoreDialog

All Implemented Interfaces:
ComponentCallbacks, DialogInterface.OnCancelListener, DialogInterface.OnDismissListener, SharedPreferences.OnSharedPreferenceChangeListener, View.OnCreateContextMenuListener, ActivityResultCaller, HasDefaultViewModelProviderFactory, LifecycleOwner, ViewModelStoreOwner, SavedStateRegistryOwner, DynamicProductFlavor

public class DynamicRestoreDialog extends DynamicDialogFragment
A DynamicDialogFragment to provide the backup restore functionality.
  • Field Details

  • Constructor Details

    • DynamicRestoreDialog

      public DynamicRestoreDialog()
  • Method Details

    • newInstance

      @NonNull public static DynamicRestoreDialog newInstance()
      Initialize the new instance of this fragment.
      Returns:
      An instance of DynamicRestoreDialog.
    • onCustomiseBuilder

      @NonNull protected DynamicDialog.Builder onCustomiseBuilder(@NonNull DynamicDialog.Builder dialogBuilder, @Nullable Bundle savedInstanceState)
      Overrides:
      onCustomiseBuilder in class DynamicDialogFragment
    • onSaveInstanceState

      public void onSaveInstanceState(@NonNull Bundle outState)
      Overrides:
      onSaveInstanceState in class DialogFragment
    • showDialog

      public void showDialog(@NonNull FragmentActivity fragmentActivity)
      Overrides:
      showDialog in class DynamicDialogFragment
    • 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

      @Nullable public DynamicBackup getDynamicBackup()
      Get the backup listener used by this restore dialog.
      Returns:
      The backup listener used by this restore dialog.
    • setDynamicBackup

      @NonNull public DynamicRestoreDialog setDynamicBackup(@Nullable DynamicBackup dynamicBackup)
      Set the backup listener for this restore dialog.
      Parameters:
      dynamicBackup - The backup listener to be set.
      Returns:
      The DynamicRestoreDialog object to allow for chaining of calls to set methods.
    • getBackup

      @Nullable public File getBackup()
      Get the backup file used by this dialog.
      Returns:
      The backup file used by this dialog.
    • setBackup

      @NonNull public DynamicRestoreDialog setBackup(@NonNull File backup)
      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

      @Nullable public Uri getBackupUri()
      Get the backup file URI used by this dialog.
      Returns:
      The backup file URI used by this dialog.
    • setBackupUri

      @NonNull public DynamicRestoreDialog setBackupUri(@Nullable Uri backupUri)
      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.