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 setMoreAnnotTypes(ArrayList<Integer> annotTypes)
Sets more annot types to show in annotation style dialog
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 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 setMoreAnnotTypes (ArrayList<Integer> annotTypes)

Sets more annot types to show in annotation style dialog

Parameters
annotTypes annot types to add

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 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