public class

AnnotStyleView

extends LinearLayout
implements View.OnClickListener View.OnFocusChangeListener AdapterView.OnItemClickListener AdapterView.OnItemSelectedListener SeekBar.OnSeekBarChangeListener TextView.OnEditorActionListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.pdftron.pdf.controls.AnnotStyleView

Class Overview

A LinearLayout that can adjust annotation appearance

Summary

Nested Classes
interface AnnotStyleView.OnColorLayoutClickedListener This interface is for switching between color picker and style picker  
interface AnnotStyleView.OnMoreAnnotTypeClickedListener  
interface AnnotStyleView.OnPresetSelectedListener This interface is for listening preset style buttons pressed event  
interface AnnotStyleView.OnStyleLayoutClickedListener This interface is for switching between icon picker and style picker  
Constants
String SOUND_ICON_FILL
String SOUND_ICON_OUTLINE
[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
AnnotStyleView(Context context)
Class constructor
AnnotStyleView(Context context, AttributeSet attrs)
Class constructor
AnnotStyleView(Context context, AttributeSet attrs, int defStyleAttr)
Class constructor
Public Methods
boolean checkPresets()
Check if there is any annotation preset matches current annotation style.
void deselectAllPresetsPreview()
Deselect all annotation presets preview button
void dismiss()
hide this annotation style view
int getColor(int colorMode)
Gets color based on color mode
void onClick(View v)
Callback method invoked when child view clicked
boolean onEditorAction(TextView v, int actionId, KeyEvent event)
hide keyboard and remove edit text focus when EditorInfo.IME_ACTION_DONE is clicked
void onFocusChange(View v, boolean hasFocus)
Callback method when there is a focus change in mThicknessEditText and #mOpacityEditText, When focus removed, set corresponding thickness or opacity
void onItemClick(AdapterView<?> parent, View view, int position, long id)
Called when icon grid item clicked
void onItemSelected(AdapterView<?> parent, View view, int position, long id)
Called when selected one item from font spinner
void onNothingSelected(AdapterView<?> parent)
Callback method to be invoked when the selection disappears from font spinner
void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
When slider progress changes, set corresponding value to annotation style
void onStartTrackingTouch(SeekBar seekBar)
void onStopTrackingTouch(SeekBar seekBar)
void savePresets()
Save annotation presets to settings
void setAnnotStyleHolder(AnnotStyle.AnnotStyleHolder annotStyleHolder)
Sets annotation style holder
void setAnnotStyleProperties(HashMap<Integer, AnnotStyleProperty> annotStyleProperties)
Sets the AnnotStyleProperties that will be used to hide elements of the AnnotStyleDialog.
void setAnnotType(int tabIndex, int annotType)
set annotation type
void setAnnotType(int annotType)
set annotation type
void setCanShowPressureSwitch(boolean canShow)
void setCanShowRichContentSwitch(boolean canShow)
Sets whether can show rich content option
void setCanShowTextAlignment(boolean canShowTextAlignment)
void setFontListFromAsset(Set<String> fontList)
Sets font list from asset for Free text fonts spinner
void setFontListFromStorage(Set<String> fontList)
Sets font list from storage for Free text fonts spinner
void setGroupAnnotStyles(ArrayList<AnnotStyle> annotStyles)
void setMoreAnnotTypes(ArrayList<Integer> annotTypes)
Sets more tools to display
void setOnColorLayoutClickedListener(AnnotStyleView.OnColorLayoutClickedListener listener)
Sets color layout clicked listener, color layout includes {stroke color layout, fill color layout, and text color layout}
void setOnDismissListener(OnDialogDismissListener listener)
void setOnMoreAnnotTypesClickListener(AnnotStyleView.OnMoreAnnotTypeClickedListener listener)
Sets a listener to listen more annot type click event
void setOnPresetSelectedListener(AnnotStyleView.OnPresetSelectedListener listener)
Sets on annotation preset selected listener
void setOnStyleLayoutClickedListener(AnnotStyleView.OnStyleLayoutClickedListener listener)
Sets style layout clicked listener, style layout includes {stroke style layout, line style layout, line staring style layout and line ending style layout}
void setShowPreset(boolean showPresets)
Sets whether to show preset list.
void setWhiteFontList(Set<String> whiteFontList)
Sets white font list for Free text fonts spinner
void show()
Show this view
void updateAnnotTypes()
void updateLayout()
Update layout
[Expand]
Inherited Methods
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnClickListener
From interface android.view.View.OnFocusChangeListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface android.widget.AdapterView.OnItemClickListener
From interface android.widget.AdapterView.OnItemSelectedListener
From interface android.widget.SeekBar.OnSeekBarChangeListener
From interface android.widget.TextView.OnEditorActionListener

Constants

public static final String SOUND_ICON_FILL

Constant Value: "annotation_icon_sound_fill"

public static final String SOUND_ICON_OUTLINE

Constant Value: "annotation_icon_sound_outline"

Public Constructors

public AnnotStyleView (Context context)

Class constructor

public AnnotStyleView (Context context, AttributeSet attrs)

Class constructor

public AnnotStyleView (Context context, AttributeSet attrs, int defStyleAttr)

Class constructor

Public Methods

public boolean checkPresets ()

Check if there is any annotation preset matches current annotation style. If true, then call onPresetSelected(AnnotStyle)

Returns
  • true then there is matched preset, false otherwise

public void deselectAllPresetsPreview ()

Deselect all annotation presets preview button

public void dismiss ()

hide this annotation style view

public int getColor (int colorMode)

Gets color based on color mode

Parameters
colorMode color mode, must be one of STROKE_COLOR or FILL_COLOR
Returns
  • color

public void onClick (View v)

Callback method invoked when child view clicked

Parameters
v clicked view

public boolean onEditorAction (TextView v, int actionId, KeyEvent event)

hide keyboard and remove edit text focus when EditorInfo.IME_ACTION_DONE is clicked

Parameters
v text view
actionId action id
event key event
Returns
  • Return true if you have consumed the action, else false.

public void onFocusChange (View v, boolean hasFocus)

Callback method when there is a focus change in mThicknessEditText and #mOpacityEditText, When focus removed, set corresponding thickness or opacity

Parameters
v focus changed view
hasFocus whether the view has focus

public void onItemClick (AdapterView<?> parent, View view, int position, long id)

Called when icon grid item clicked

Parameters
parent The AdapterView where the click happened.
view The view within the AdapterView that was clicked (this will be a view provided by the adapter)
position The position of the view in the adapter.
id The row id of the item that was clicked.

public void onItemSelected (AdapterView<?> parent, View view, int position, long id)

Called when selected one item from font spinner

Parameters
parent Font spinner
view selected view
position the position of the view in the adapter
id the row id of the item that was selected

public void onNothingSelected (AdapterView<?> parent)

Callback method to be invoked when the selection disappears from font spinner

Parameters
parent The AdapterView that now contains no selected item.

public void onProgressChanged (SeekBar seekBar, int progress, boolean fromUser)

When slider progress changes, set corresponding value to annotation style

Parameters
seekBar seek bar
progress progress value
fromUser True if the progress change was initiated by the user.

public void onStartTrackingTouch (SeekBar seekBar)

public void onStopTrackingTouch (SeekBar seekBar)

public void savePresets ()

Save annotation presets to settings

public void setAnnotStyleHolder (AnnotStyle.AnnotStyleHolder annotStyleHolder)

Sets annotation style holder

Parameters
annotStyleHolder annotation style holder

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 setAnnotType (int tabIndex, int annotType)

set annotation type

public void setAnnotType (int annotType)

set annotation type

public void setCanShowPressureSwitch (boolean canShow)

public void setCanShowRichContentSwitch (boolean canShow)

Sets whether can show rich content option

public void setCanShowTextAlignment (boolean canShowTextAlignment)

public void setFontListFromAsset (Set<String> fontList)

Sets font list from asset for Free text fonts spinner

Parameters
fontList font list

public void setFontListFromStorage (Set<String> fontList)

Sets font list from storage for Free text fonts spinner

Parameters
fontList font list

public void setGroupAnnotStyles (ArrayList<AnnotStyle> annotStyles)

public void setMoreAnnotTypes (ArrayList<Integer> annotTypes)

Sets more tools to display

Parameters
annotTypes The tools to display

public void setOnColorLayoutClickedListener (AnnotStyleView.OnColorLayoutClickedListener listener)

Sets color layout clicked listener, color layout includes {stroke color layout, fill color layout, and text color layout}

Parameters
listener The color layout clicked listener

public void setOnDismissListener (OnDialogDismissListener listener)

public void setOnMoreAnnotTypesClickListener (AnnotStyleView.OnMoreAnnotTypeClickedListener listener)

Sets a listener to listen more annot type click event

Parameters
listener The listener

public void setOnPresetSelectedListener (AnnotStyleView.OnPresetSelectedListener listener)

Sets on annotation preset selected listener

Parameters
listener annotation preset selected listener

public void setOnStyleLayoutClickedListener (AnnotStyleView.OnStyleLayoutClickedListener listener)

Sets style layout clicked listener, style layout includes {stroke style layout, line style layout, line staring style layout and line ending style layout}

Parameters
listener The style layout clicked listener

public void setShowPreset (boolean showPresets)

Sets whether to show preset list. Default true

Parameters
showPresets True if preset list is shown

public void setWhiteFontList (Set<String> whiteFontList)

Sets white font list for Free text fonts spinner

Parameters
whiteFontList white font list

public void show ()

Show this view

public void updateAnnotTypes ()

public void updateLayout ()

Update layout