public final class

DialogNewPageFactory

extends Object
implements NewPageFactory
java.lang.Object
   ↳ com.pspdfkit.document.editor.page.DialogNewPageFactory

Class Overview

A factory for creating new pages using the NewPageDialog. This factory requires a FragmentManager to show the dialog.

Summary

Public Constructors
DialogNewPageFactory(FragmentManager fragmentManager)
Constructor taking the required FragmentManager.
DialogNewPageFactory(FragmentManager fragmentManager, Size documentPageSize)
Constructor taking the required FragmentManager and an optional Size that should be used as default in the NewPageDialog.
DialogNewPageFactory(FragmentManager fragmentManager, Size documentPageSize, List<PageTemplate> pageTemplates)
Constructor taking the required FragmentManager, an optional Size that should be used as default in the NewPageDialog, and optional PageTemplates for the user to choose from.
DialogNewPageFactory(FragmentManager fragmentManager, Size documentPageSize, List<PageTemplate> pageTemplates, boolean showPageTemplatesLast)
Constructor taking the required FragmentManager, an optional Size that should be used as default in the NewPageDialog, and optional PageTemplates for the user to choose from.
Public Methods
void onCreateNewPage(NewPageFactory.OnNewPageReadyListener callback)
This method is called every time the factory should create a NewPage instance.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pspdfkit.document.editor.page.NewPageFactory

Public Constructors

public DialogNewPageFactory (FragmentManager fragmentManager)

Constructor taking the required FragmentManager. The fragment manager is stored as weak reference, so the factory needs to be recreated whenever the activity is destroyed. Using this constructor behaves the same as if using the DialogNewPageFactory(FragmentManager, Size) constructor with a null document size.

Parameters
fragmentManager FragmentManager used to show the NewPageDialog dialog.

public DialogNewPageFactory (FragmentManager fragmentManager, Size documentPageSize)

Constructor taking the required FragmentManager and an optional Size that should be used as default in the NewPageDialog. The fragment manager is stored as weak reference, so the factory needs to be recreated whenever the activity is destroyed.

Parameters
fragmentManager FragmentManager used to show the NewPageDialog dialog.
documentPageSize Optional Size that will be shown as default page size option inside the dialog.

public DialogNewPageFactory (FragmentManager fragmentManager, Size documentPageSize, List<PageTemplate> pageTemplates)

Constructor taking the required FragmentManager, an optional Size that should be used as default in the NewPageDialog, and optional PageTemplates for the user to choose from. The fragment manager is stored as weak reference, so the factory needs to be recreated whenever the activity is destroyed.

Parameters
fragmentManager FragmentManager used to show the NewPageDialog dialog.
documentPageSize Optional Size that will be shown as default page size option inside the dialog.
pageTemplates A list of PageTemplates that the user can select from in addition to the default patterns.

public DialogNewPageFactory (FragmentManager fragmentManager, Size documentPageSize, List<PageTemplate> pageTemplates, boolean showPageTemplatesLast)

Constructor taking the required FragmentManager, an optional Size that should be used as default in the NewPageDialog, and optional PageTemplates for the user to choose from. The fragment manager is stored as weak reference, so the factory needs to be recreated whenever the activity is destroyed.

Parameters
fragmentManager FragmentManager used to show the NewPageDialog dialog.
documentPageSize Optional Size that will be shown as default page size option inside the dialog.
pageTemplates A list of PageTemplates that the user can select from in addition to the default patterns.
showPageTemplatesLast Set to true to display your PageTemplates after page pattern options. Set to false by default.

Public Methods

public void onCreateNewPage (NewPageFactory.OnNewPageReadyListener callback)

This method is called every time the factory should create a NewPage instance. Since creation of the new page can be a longer running asynchronous operation (for example via a page configuration dialog shown to the user) this method receives a callback that the factory can call once the new page is ready.

Parameters
callback OnNewPageReadyListener for notifying the editor once the new page is ready.