java.lang.Object | |
↳ | com.pspdfkit.preferences.PSPDFKitPreferences |
Allows you to read and write global preferences.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | PREFERENCES_NAME | Name of the shared preferences. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
clearPreferences()
Wipes all user preferences, handle with care.
| ||||||||||
synchronized static PSPDFKitPreferences |
get(Context context)
Gets global singleton preferences instance.
| ||||||||||
String |
getAnnotationCreator(String defaultCreator)
Retrieves the annotation creator
| ||||||||||
List<Pair<AnnotationTool, AnnotationToolVariant>> |
getLastAnnotationTools()
Gets the list of annotation tools as they were last used/selected.
| ||||||||||
ToolbarCoordinatorLayout.LayoutParams.Position |
getLastToolbarPosition(ContextualToolbar contextualToolbar, ToolbarCoordinatorLayout.LayoutParams.Position defaultPosition)
Gets the last position of the given toolbar.
| ||||||||||
List<Integer> |
getRecentlyUsedColors()
Gets the recently used colors.
| ||||||||||
boolean |
isAnnotationCreatorSet()
Checks if the annotation creator has been set
| ||||||||||
Boolean |
isComparisonFirstLaunch()
Returns True if it's the first time launching comparison alignment dialog and false when it
has been launched before.
| ||||||||||
Boolean |
isMeasurementSnappingEnabled()
Returns
true if snapping to page graphics for measurement tools is enabled. | ||||||||||
Boolean |
isSmartGuidesEnabled()
Returns
true if smart guides for various angles is enabled. | ||||||||||
Boolean |
isSnapToSelfEnabled()
Returns
true if snapping to self is enabled. | ||||||||||
void |
resetAnnotationCreator()
Resets the annotation creator by nullifying the value.
| ||||||||||
void |
setAnnotationCreator(String creator)
Sets the annotation creator.
| ||||||||||
void |
setIsComparisonFirstLaunch(boolean isComparisonFirstLaunch)
Sets if comparison alignment dialog has been launched before
| ||||||||||
void |
setLastAnnotationTool(AnnotationTool tool)
Sets the last used annotation tool.
| ||||||||||
void |
setLastAnnotationTool(AnnotationTool tool, AnnotationToolVariant toolVariant)
Sets the last used annotation tool.
| ||||||||||
void |
setLastToolbarPosition(ContextualToolbar contextualToolbar, ToolbarCoordinatorLayout.LayoutParams.Position position)
Saves the last position of the given toolbar.
| ||||||||||
void |
setMeasurementSnappingEnabled(boolean enabled)
Enables snapping to page graphics for measurement tools.
| ||||||||||
void |
setRecentlyUsedColors(List<Integer> recentlyUsedColors)
Replaces the list of recently used colors with the new list.
| ||||||||||
void |
setSmartGuidesEnabled(boolean enabled)
Enables smart guides for predefined angles.
| ||||||||||
void |
setSnapToSelfEnabled(boolean enabled)
Enables snapping to itself at the end of shape
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Name of the shared preferences.
Wipes all user preferences, handle with care.
Gets global singleton preferences instance.
Retrieves the annotation creator
defaultCreator | the default creator that will be returned if no creator has been previously stored. |
---|
Gets the list of annotation tools as they were last used/selected. Items that were not yet selected are not in the list, so this means that list will be empty at the beginning so that needs to be handled as well.
Gets the last position of the given toolbar.
contextualToolbar | Toolbar for which to get the position. |
---|---|
defaultPosition | Default toolbar position. |
Gets the recently used colors.
Checks if the annotation creator has been set
false
if the annotation creator has not been set, true
otherwise.
Returns True if it's the first time launching comparison alignment dialog and false when it has been launched before. .
Returns true
if snapping to page graphics for measurement tools is enabled.
Default value is true
.
Returns true
if smart guides for various angles is enabled.
Default value is true
.
Returns true
if snapping to self is enabled.
Default value is true
.
Resets the annotation creator by nullifying the value.
Sets the annotation creator.
creator | the creator to set |
---|
Sets if comparison alignment dialog has been launched before
Sets the last used annotation tool. This method will add the tool to the beginning of the last selected tools list. If it already exists there, it will be just moved to the first place.
tool | Tool to be set as the last used one. |
---|
Sets the last used annotation tool. This method will add the tool to the beginning of the last selected tools list. If it already exists there, it will be just moved to the first place.
tool | Tool to be set as the last used one. |
---|---|
toolVariant | Variant of the annotation tool for which to set the value. |
Saves the last position of the given toolbar.
contextualToolbar | Toolbar for which to save the position. |
---|---|
position | Position to be saved. |
Enables snapping to page graphics for measurement tools.
Replaces the list of recently used colors with the new list.
recentlyUsedColors | The new colors to set as recently used colors. |
---|
Enables smart guides for predefined angles.
Enables snapping to itself at the end of shape