public class

AnnotStyleDialogFragment

extends BaseBottomDialogFragment
implements AnnotStyleView.OnPresetSelectedListener AnnotStyle.AnnotStyleHolder
java.lang.Object
   ↳ DialogFragment
     ↳ com.pdftron.pdf.dialog.base.BaseBottomDialogFragment
       ↳ com.pdftron.pdf.controls.AnnotStyleDialogFragment
Known Direct Subclasses

Class Overview

Annotation style dialog fragment is a DialogFragment that shows annotation style properties in a bottom sheet. With the style dialog, users can edit annotation styles easily with style presets as well as choosing their own colors through the advanced color picker. The style dialog also provides a recent and a favorite list for quick access.

You can show annotation style dialog as follows:

 AnnotStyle annotStyle = new AnnotStyle();
 // set annotation type to annot Style
 annotStyle.setAnnotType(Annot.e_Square);
 // set blue stroke, yellow fill color, thickness 5, opacity 0.8 to annotation style
 annotStyle.setStyle(Color.BLUE, Color.YELLOW, 5, 0.8);
 AnnotStyleDialogFragment annotStyleDialog = AnnotStyleDialogFragment.Builder(annotStyle).build();
 annotStyleDialog.show(getActivity().getSupportFragmentManager());
 

Summary

Nested Classes
class AnnotStyleDialogFragment.Builder Builder for building annotation style dialog  
@interface AnnotStyleDialogFragment.SelectColorMode Selected color mode for color picker view  
Constants
int COLOR The selected color is the color of annotation obtained from getColorAsRGB()
int FILL_COLOR The selected color is the fill color of annotation.
int STROKE_COLOR The selected color is the stroke color of annotation.
int TEXT_COLOR The selected color is the text color of FreeText annotation.
Fields
public static final String TAG
Public Constructors
AnnotStyleDialogFragment()
Public Methods
void dismiss()
Dismiss the dialog
AnnotationPropertyPreviewView getAnnotPreview()
Abstract method for getting annotation style preview view
AnnotStyle getAnnotStyle()
Overload implementation of getAnnotStyle() Gets annotation style
static AnnotStyleDialogFragment newInstance()
Creates a new instance of AnnotStyleDialogFragment
void onCreate(Bundle savedInstanceState)
Overload implementation of onCreate(Bundle)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Overload implementation of DialogFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)
void onPresetDeselected(AnnotStyle presetStyle)
Overload implementation of onPresetDeselected(AnnotStyle)
void onPresetSelected(AnnotStyle presetStyle)
Overload implementation of onPresetSelected(AnnotStyle)
void onSaveInstanceState(Bundle outState)
Overload implementation of onSaveInstanceState(Bundle)
void onViewStateRestored(Bundle savedInstanceState)
Overload implementation of onViewStateRestored(Bundle)
void saveAnnotStyles()
Saves annotation styles to settings
void setAnnotPreviewVisibility(int visibility)
Abstract method for setting annotation style preview visibility
void setAnnotStyle(AnnotStyle annotStyle)
void setAnnotStyleProperties(HashMap<Integer, AnnotStyleProperty> annotStyleProperties)
Sets the AnnotStyleProperties that will be used to hide elements of the AnnotStyleDialog.
void setCanShowPressureSwitch(boolean canShow)
void setCanShowRichContentSwitch(boolean canShow)
void setOnAnnotStyleChangeListener(AnnotStyle.OnAnnotStyleChangeListener listener)
Sets Annotation style change listener.
void setOnMoreAnnotTypesClickListener(AnnotStyleView.OnMoreAnnotTypeClickedListener listener)
Sets more annot types row item click event listener
[Expand]
Inherited Methods
From class com.pdftron.pdf.dialog.base.BaseBottomDialogFragment
From class java.lang.Object
From interface com.pdftron.pdf.controls.AnnotStyleView.OnPresetSelectedListener
From interface com.pdftron.pdf.model.AnnotStyle.AnnotStyleHolder

Constants

public static final int COLOR

The selected color is the color of annotation obtained from getColorAsRGB()

Constant Value: 3 (0x00000003)

public static final int FILL_COLOR

The selected color is the fill color of annotation.

Constant Value: 1 (0x00000001)

public static final int STROKE_COLOR

The selected color is the stroke color of annotation.

Constant Value: 0 (0x00000000)

public static final int TEXT_COLOR

The selected color is the text color of FreeText annotation.

Constant Value: 2 (0x00000002)

Fields

public static final String TAG

Public Constructors

public AnnotStyleDialogFragment ()

Public Methods

public void dismiss ()

Dismiss the dialog

public AnnotationPropertyPreviewView getAnnotPreview ()

Abstract method for getting annotation style preview view

Returns
  • preview of annotation style

public AnnotStyle getAnnotStyle ()

Overload implementation of getAnnotStyle() Gets annotation style

Returns
  • annotation style

public static AnnotStyleDialogFragment newInstance ()

Creates a new instance of AnnotStyleDialogFragment

Returns
  • a new AnnotStyleDialogFragment

public void onCreate (Bundle savedInstanceState)

Overload implementation of onCreate(Bundle)

Parameters
savedInstanceState If the fragment is being re-created from a previous saved state, this is the state.

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Overload implementation of DialogFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)

public void onPresetDeselected (AnnotStyle presetStyle)

Overload implementation of onPresetDeselected(AnnotStyle)

Parameters
presetStyle presetStyle

public void onPresetSelected (AnnotStyle presetStyle)

Overload implementation of onPresetSelected(AnnotStyle)

Parameters
presetStyle presetStyle

public void onSaveInstanceState (Bundle outState)

Overload implementation of onSaveInstanceState(Bundle)

Parameters
outState Bundle in which to place your saved state.

public void onViewStateRestored (Bundle savedInstanceState)

Overload implementation of onViewStateRestored(Bundle)

Parameters
savedInstanceState If the fragment is being re-created from a previous saved state, this is the state.

public void saveAnnotStyles ()

Saves annotation styles to settings

public void setAnnotPreviewVisibility (int visibility)

Abstract method for setting annotation style preview visibility

public void setAnnotStyle (AnnotStyle annotStyle)

public void setAnnotStyleProperties (HashMap<Integer, AnnotStyleProperty> annotStyleProperties)

Sets the AnnotStyleProperties that will be used to hide elements of the AnnotStyleDialog.

Parameters
annotStyleProperties hash map of annot types and the AnnotStyleProperties

public void setCanShowPressureSwitch (boolean canShow)

public void setCanShowRichContentSwitch (boolean canShow)

public void setOnAnnotStyleChangeListener (AnnotStyle.OnAnnotStyleChangeListener listener)

Sets Annotation style change listener.

Parameters
listener annotation style change listener

public void setOnMoreAnnotTypesClickListener (AnnotStyleView.OnMoreAnnotTypeClickedListener listener)

Sets more annot types row item click event listener

Parameters
listener The listener