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 = new 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  
@interface AnnotStyleDialogFragment.SelectStyleMode Selected style mode for style picker view  
class AnnotStyleDialogFragment.Theme  
Constants
int BORDER_STYLE The selected style is the border style of annotation.
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 LINE_END_STYLE The selected style is the line ending style of annotation.
int LINE_START_STYLE The selected style is the line starting style of annotation.
int LINE_STYLE The selected style is the line style 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
void dismiss(boolean waitBottomSheet)
Wrapper for dismiss where it will check lifecycle on the fragment to prevent crash when dismissing while backgrounded
AnnotationPropertyPreviewView getAnnotPreview()
Abstract method for getting current annotation style preview view
SparseArray<AnnotationPropertyPreviewView> getAnnotPreviews()
Abstract method for getting all annotation style preview views
AnnotStyle getAnnotStyle()
Overload implementation of getAnnotStyle() Gets annotation style
ArrayList<AnnotStyle> getAnnotStyles()
int getCurrentTabIndex()
static AnnotStyleDialogFragment newInstance()
Creates a new instance of AnnotStyleDialogFragment
void onAnnotStyleLayoutUpdated()
Abstract method to notify when the annot style layout has changed
void onCreate(Bundle savedInstanceState)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onPageScrollStateChanged(int state)
void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
void onPageSelected(int position)
void onPresetDeselected(AnnotStyle presetStyle)
Overload implementation of onPresetDeselected(AnnotStyle)
void onPresetSelected(AnnotStyle presetStyle)
Overload implementation of onPresetSelected(AnnotStyle)
void onSaveInstanceState(Bundle outState)
void onViewStateRestored(Bundle savedInstanceState)
void saveAnnotStyles()
Saves annotation styles to settings
void setAnnotPreviewVisibility(int visibility)
Abstract method for setting annotation style preview visibility
void setAnnotStyle(int tabIndex, AnnotStyle annotStyle)
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(int tabIndex, boolean canShow)
void setCanShowPressureSwitch(boolean canShow)
void setCanShowRichContentSwitch(int tabIndex, boolean canShow)
void setCanShowRichContentSwitch(boolean canShow)
void setCanShowTextAlignment(boolean canShowTextAlignment)
Sets whether to show text alignment in the annot style dialog
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 BORDER_STYLE

The selected style is the border style of annotation.

Constant Value: 0 (0x00000000)

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 LINE_END_STYLE

The selected style is the line ending style of annotation.

Constant Value: 3 (0x00000003)

public static final int LINE_START_STYLE

The selected style is the line starting style of annotation.

Constant Value: 2 (0x00000002)

public static final int LINE_STYLE

The selected style is the line style 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 void dismiss (boolean waitBottomSheet)

Wrapper for dismiss where it will check lifecycle on the fragment to prevent crash when dismissing while backgrounded

Parameters
waitBottomSheet whether to wait for bottom sheet to collapse.

public AnnotationPropertyPreviewView getAnnotPreview ()

Abstract method for getting current annotation style preview view

Returns
  • preview of annotation style

public SparseArray<AnnotationPropertyPreviewView> getAnnotPreviews ()

Abstract method for getting all annotation style preview views

Returns
  • preview of annotation style

public AnnotStyle getAnnotStyle ()

Overload implementation of getAnnotStyle() Gets annotation style

Returns
  • annotation style

public ArrayList<AnnotStyle> getAnnotStyles ()

public int getCurrentTabIndex ()

public static AnnotStyleDialogFragment newInstance ()

Creates a new instance of AnnotStyleDialogFragment

Returns
  • a new AnnotStyleDialogFragment

public void onAnnotStyleLayoutUpdated ()

Abstract method to notify when the annot style layout has changed

public void onCreate (Bundle savedInstanceState)

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

public void onPageScrollStateChanged (int state)

public void onPageScrolled (int position, float positionOffset, int positionOffsetPixels)

public void onPageSelected (int position)

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)

public void onViewStateRestored (Bundle savedInstanceState)

public void saveAnnotStyles ()

Saves annotation styles to settings

public void setAnnotPreviewVisibility (int visibility)

Abstract method for setting annotation style preview visibility

public void setAnnotStyle (int tabIndex, AnnotStyle annotStyle)

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 (int tabIndex, boolean canShow)

public void setCanShowPressureSwitch (boolean canShow)

public void setCanShowRichContentSwitch (int tabIndex, boolean canShow)

public void setCanShowRichContentSwitch (boolean canShow)

public void setCanShowTextAlignment (boolean canShowTextAlignment)

Sets whether to show text alignment in the annot style dialog

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