Class NewPageDialog
-
- All Implemented Interfaces:
-
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
public class NewPageDialog extends AppCompatDialogFragment
Dialog for choosing properties for a newly created PDF page. A call to show will prepare and show the dialog, creating it if necessary. When calling this method after a configuration change, it will restore and use the previously added dialog.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
NewPageDialog.Callback
This listener interface needs to be implemented by any class that wishes to handle new page creation event.
-
Field Summary
Fields Modifier and Type Field Description public final static String
FRAGMENT_TAG
public final static String
ARG_DOCUMENT_PAGE_SIZE
-
Constructor Summary
Constructors Constructor Description NewPageDialog()
Primary constructor of the NewPageDialog.
-
Method Summary
Modifier and Type Method Description static void
show(@NonNull() FragmentManager fragmentManager, @Nullable() Size documentPageSize, @NonNull() NewPageDialog.Callback callback)
Shows the dialog to the user. static void
show(@NonNull() FragmentManager fragmentManager, @Nullable() Size documentPageSize, @NonNull() List<PageTemplate> pageTemplates, @NonNull() NewPageDialog.Callback callback)
Shows the dialog to the user. static void
show(@NonNull() FragmentManager fragmentManager, @Nullable() Size documentPageSize, @NonNull() List<PageTemplate> pageTemplates, boolean showPageTemplatesLast, @NonNull() NewPageDialog.Callback callback)
Shows the dialog to the user. static void
hide(@NonNull() FragmentManager fragmentManager)
Hides the dialog if visible. static boolean
restore(@NonNull() FragmentManager fragmentManager, @NonNull() NewPageDialog.Callback callback)
Restore existing dialog. static boolean
restore(@NonNull() FragmentManager fragmentManager, @NonNull() List<PageTemplate> pageTemplates, @NonNull() NewPageDialog.Callback callback)
Restore existing dialog. static boolean
restore(@NonNull() FragmentManager fragmentManager, @NonNull() List<PageTemplate> pageTemplates, boolean showPageTemplatesLast, @NonNull() NewPageDialog.Callback callback)
Restore existing dialog. void
onCreate(Bundle savedInstanceState)
void
onDismiss(DialogInterface dialog)
void
onStart()
Dialog
onCreateDialog(Bundle savedInstanceState)
void
setupDialog(Dialog dialog, int style)
Context
getContext()
-
-
Constructor Detail
-
NewPageDialog
NewPageDialog()
Primary constructor of the NewPageDialog.
-
-
Method Detail
-
show
static void show(@NonNull() FragmentManager fragmentManager, @Nullable() Size documentPageSize, @NonNull() NewPageDialog.Callback callback)
Shows the dialog to the user.
- Parameters:
fragmentManager
- Fragment manager for performing necessary fragment transactions.documentPageSize
- A custom size representative for the current document.callback
- A Callback that will be notified of confirmation or dismissal of the dialog.
-
show
static void show(@NonNull() FragmentManager fragmentManager, @Nullable() Size documentPageSize, @NonNull() List<PageTemplate> pageTemplates, @NonNull() NewPageDialog.Callback callback)
Shows the dialog to the user.
- Parameters:
fragmentManager
- Fragment manager for performing necessary fragment transactions.documentPageSize
- A custom size representative for the current document.pageTemplates
- A list of PageTemplates that the user can select from in addition to the default patterns.callback
- A Callback that will be notified of confirmation or dismissal of the dialog.
-
show
static void show(@NonNull() FragmentManager fragmentManager, @Nullable() Size documentPageSize, @NonNull() List<PageTemplate> pageTemplates, boolean showPageTemplatesLast, @NonNull() NewPageDialog.Callback callback)
Shows the dialog to the user.
- Parameters:
fragmentManager
- Fragment manager for performing necessary fragment transactions.documentPageSize
- A custom size representative for the current document.pageTemplates
- A list of PageTemplates that the user can select from in addition to the default patterns.showPageTemplatesLast
- Set totrue
to display your PageTemplates after page pattern options.callback
- A Callback that will be notified of confirmation or dismissal of the dialog.
-
hide
static void hide(@NonNull() FragmentManager fragmentManager)
Hides the dialog if visible.
- Parameters:
fragmentManager
- Fragment manager for performing necessary fragment transactions.
-
restore
static boolean restore(@NonNull() FragmentManager fragmentManager, @NonNull() NewPageDialog.Callback callback)
Restore existing dialog.
- Parameters:
fragmentManager
- Fragment manager for querying dialog fragment state.callback
- A Callback that will be notified of confirmation or dismissal of the dialog.- Returns:
True when dialog has been restored, false otherwise.
-
restore
static boolean restore(@NonNull() FragmentManager fragmentManager, @NonNull() List<PageTemplate> pageTemplates, @NonNull() NewPageDialog.Callback callback)
Restore existing dialog.
- Parameters:
fragmentManager
- Fragment manager for querying dialog fragment state.pageTemplates
- A list of PageTemplates that the user can select from in addition to the original patterns.callback
- A Callback that will be notified of confirmation or dismissal of the dialog.- Returns:
True when dialog has been restored, false otherwise.
-
restore
static boolean restore(@NonNull() FragmentManager fragmentManager, @NonNull() List<PageTemplate> pageTemplates, boolean showPageTemplatesLast, @NonNull() NewPageDialog.Callback callback)
Restore existing dialog.
- Parameters:
fragmentManager
- Fragment manager for querying dialog fragment state.pageTemplates
- A list of PageTemplates that the user can select from in addition to the original patterns.showPageTemplatesLast
- Set totrue
to display your PageTemplates after page pattern options.callback
- A Callback that will be notified of confirmation or dismissal of the dialog.- Returns:
True when dialog has been restored, false otherwise.
-
onDismiss
void onDismiss(DialogInterface dialog)
-
onStart
void onStart()
-
onCreateDialog
@NonNull() Dialog onCreateDialog(Bundle savedInstanceState)
-
setupDialog
void setupDialog(Dialog dialog, int style)
-
getContext
Context getContext()
-
-
-
-