public static class

AnnotStyleDialogFragment.Builder

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.controls.AnnotStyleDialogFragment.Builder

Class Overview

Builder for building annotation style dialog

Summary

Public Constructors
Builder()
Creates a builder for an annotation style dialog
Builder(AnnotStyle annotStyle)
Creates a builder for an annotation style dialog with given annotation style
Public Methods
AnnotStyleDialogFragment build()
Creates an AnnotStyleDialogFragment with the arguments supplied to this builder.
AnnotStyleDialogFragment.Builder setAnchor(Rect anchor)
Sets anchor rectangle in window location for tablet mode.
AnnotStyleDialogFragment.Builder setAnchor(RectF anchor)
Sets anchor rectangle in window location for tablet mode.
AnnotStyleDialogFragment.Builder setAnchorInScreen(Rect anchor)
Sets anchor rectangle in screen position for tablet mode.
AnnotStyleDialogFragment.Builder setAnchorView(View view)
Sets anchor view for tablet mode.
AnnotStyleDialogFragment.Builder setAnnotStyle(AnnotStyle annotStyle)
Sets annotation style to the builder, it is used for setting annotation style for dialog
AnnotStyleDialogFragment.Builder setExtraAnnotStyles(ArrayList<AnnotStyle> extraAnnotStyles)
Sets extra annotation styles to the builder, if valid, extra annotation styles will be shown in tabs
AnnotStyleDialogFragment.Builder setFontListFromAsset(Set<String> fontList)
Sets custom font list from Asset for free text tool.
AnnotStyleDialogFragment.Builder setFontListFromStorage(Set<String> fontList)
Sets custom font list from Storage for free text tool.
AnnotStyleDialogFragment.Builder setGroupAnnotTypes(ArrayList<AnnotStyle> annotStyles)
AnnotStyleDialogFragment.Builder setInitialTabIndex(int tabIndex)
AnnotStyleDialogFragment.Builder setMoreAnnotTypes(int tabIndex, ArrayList<Integer> annotTypes)
Sets more annot types to show in annotation style dialog
AnnotStyleDialogFragment.Builder setMoreAnnotTypes(ArrayList<Integer> annotTypes)
Sets more annot types to show in annotation style dialog
AnnotStyleDialogFragment.Builder setShowHorizontally(boolean showRight)
Whether to prioritize showing the dialog to the left or right of the anchor.
AnnotStyleDialogFragment.Builder setShowPreset(boolean showPreset)
Whether to show the preset list.
AnnotStyleDialogFragment.Builder setShowPressureSensitivePreview(boolean showPressurePreview)
Sets whether to show pressure sensitive thickness preview for signatures.
AnnotStyleDialogFragment.Builder setShowPreview(boolean showPreview)
Whether to show the preview.
AnnotStyleDialogFragment.Builder setTabTitles(String[] tabTitles)
AnnotStyleDialogFragment.Builder setWhiteListFont(Set<String> whiteListFont)
Sets white list fonts.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Creates a builder for an annotation style dialog

public Builder (AnnotStyle annotStyle)

Creates a builder for an annotation style dialog with given annotation style

Parameters
annotStyle The annotation style for building the dialog

Public Methods

public AnnotStyleDialogFragment build ()

Creates an AnnotStyleDialogFragment with the arguments supplied to this builder.

Returns

public AnnotStyleDialogFragment.Builder setAnchor (Rect anchor)

Sets anchor rectangle in window location for tablet mode. The annotation style dialog will be displayed around the anchor rectangle. This is equivalent to call setAnchor(RectF)

Parameters
anchor The anchor rectangle
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setAnchor (RectF anchor)

Sets anchor rectangle in window location for tablet mode. The annotation style dialog will be displayed around the anchor rectangle.
You can get window location of a view as follows:

 int[] pos = new int[2];
 view.getLocationInWindow(pos);
 RectF rect = new RectF(pos[0], pos[1], pos[0] + view.getWidth(), pos[1] + view.getHeight());
 builder.setAnchor(rect);
 

where view is an instance of View, and builder is an instance of AnnotStyleDialogFragment.Builder

Parameters
anchor The anchor rectangle
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setAnchorInScreen (Rect anchor)

Sets anchor rectangle in screen position for tablet mode. The annotation style dialog will be displayed around the anchor rectangle.
You can get screen location of a view as follows:

 int[] pos = new int[2];
 view.getLocationInScreen(pos);
 RectF rect = new RectF(pos[0], pos[1], pos[0] + view.getWidth(), pos[1] + view.getHeight());
 builder.setAnchorInScreen(rect);
 

where view is an instance of View, and builder is an instance of AnnotStyleDialogFragment.Builder

Parameters
anchor The anchor rectangle
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setAnchorView (View view)

Sets anchor view for tablet mode. The annotation style dialog will be displayed around the anchor rectangle.

Parameters
view The anchor view
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setAnnotStyle (AnnotStyle annotStyle)

Sets annotation style to the builder, it is used for setting annotation style for dialog

Parameters
annotStyle The annotation style for building dialog. This is equivalent to call: new Builder(annotStyle)
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setExtraAnnotStyles (ArrayList<AnnotStyle> extraAnnotStyles)

Sets extra annotation styles to the builder, if valid, extra annotation styles will be shown in tabs

Parameters
extraAnnotStyles The extra annotation styles for building dialog.
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setFontListFromAsset (Set<String> fontList)

Sets custom font list from Asset for free text tool. You can get font list fonts from getFreeTextFontsFromAssets()

Parameters
fontList The font list from asset
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setFontListFromStorage (Set<String> fontList)

Sets custom font list from Storage for free text tool. You can get font list fonts from getFreeTextFontsFromStorage()

Parameters
fontList The font list from storage
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setGroupAnnotTypes (ArrayList<AnnotStyle> annotStyles)

public AnnotStyleDialogFragment.Builder setInitialTabIndex (int tabIndex)

public AnnotStyleDialogFragment.Builder setMoreAnnotTypes (int tabIndex, ArrayList<Integer> annotTypes)

Sets more annot types to show in annotation style dialog

Parameters
annotTypes annot types to add

public AnnotStyleDialogFragment.Builder setMoreAnnotTypes (ArrayList<Integer> annotTypes)

Sets more annot types to show in annotation style dialog

Parameters
annotTypes annot types to add

public AnnotStyleDialogFragment.Builder setShowHorizontally (boolean showRight)

Whether to prioritize showing the dialog to the left or right of the anchor. Prioritizes showing on left side if possible.

public AnnotStyleDialogFragment.Builder setShowPreset (boolean showPreset)

Whether to show the preset list. By default this is true.

Parameters
showPreset true if showing the preset
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setShowPressureSensitivePreview (boolean showPressurePreview)

Sets whether to show pressure sensitive thickness preview for signatures.

Parameters
showPressurePreview true to show pressure sensitive thickness preview, false otherwise
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setShowPreview (boolean showPreview)

Whether to show the preview. By default this is true.

Parameters
showPreview true if showing the preview
Returns
  • The builder

public AnnotStyleDialogFragment.Builder setTabTitles (String[] tabTitles)

public AnnotStyleDialogFragment.Builder setWhiteListFont (Set<String> whiteListFont)

Sets white list fonts. You can get white list fonts from getFreeTextFonts()

Parameters
whiteListFont The white list fonts.
Returns
  • The builder