public class

AnnotStyleDialogFragment

extends DialogFragment
implements AnnotStyleView.OnPresetSelectedListener AnnotStyle.AnnotStyleHolder
java.lang.Object
   ↳ DialogFragment
     ↳ 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(boolean waitBottomSheet)
Dismiss the dialog
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 onConfigurationChanged(Configuration newConfig)
Overload implementation of onConfigurationChanged(Configuration)
void onCreate(Bundle savedInstanceState)
Overload implementation of onCreate(Bundle)
Dialog onCreateDialog(Bundle savedInstanceState)
Overload implementation of onCreateDialog(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 onViewCreated(View view, Bundle savedInstanceState)
Overload implementation of onViewCreated(View, 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 setCanShowRichContentSwitch(boolean canShow)
void setOnAnnotStyleChangeListener(AnnotStyle.OnAnnotStyleChangeListener listener)
Sets Annotation style change listener.
void setOnDismissListener(DialogInterface.OnDismissListener listener)
Sets on dismiss listener
void setOnMoreAnnotTypesClickListener(AnnotStyleView.OnMoreAnnotTypeClickedListener listener)
Sets more annot types row item click event listener
void show(FragmentManager fragmentManager)
Show the dialog
[Expand]
Inherited Methods
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 (boolean waitBottomSheet)

Dismiss the dialog

Parameters
waitBottomSheet whether to wait for bottom sheet to collapse.

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 onConfigurationChanged (Configuration newConfig)

Overload implementation of onConfigurationChanged(Configuration)

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 Dialog onCreateDialog (Bundle savedInstanceState)

Overload implementation of onCreateDialog(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 onViewCreated (View view, Bundle savedInstanceState)

Overload implementation of onViewCreated(View, Bundle)

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 setCanShowRichContentSwitch (boolean canShow)

public void setOnAnnotStyleChangeListener (AnnotStyle.OnAnnotStyleChangeListener listener)

Sets Annotation style change listener.

Parameters
listener annotation style change listener

public void setOnDismissListener (DialogInterface.OnDismissListener listener)

Sets on dismiss listener

Parameters
listener dismiss listener

public void setOnMoreAnnotTypesClickListener (AnnotStyleView.OnMoreAnnotTypeClickedListener listener)

Sets more annot types row item click event listener

Parameters
listener The listener

public void show (FragmentManager fragmentManager)

Show the dialog