public final class

AnnotationToolVariant

extends Object
implements Parcelable
java.lang.Object
   ↳ com.pspdfkit.ui.special_mode.controller.AnnotationToolVariant

Class Overview

Annotation tools can have variants represented by the name. To create a custom annotation tool variant use fromName(String), and to get an instance of the default tool variant used by the framework, use defaultVariant() static creator.

This class represents a variant of the tool. You can pass it alongside the AnnotationTool in enterAnnotationCreationMode(AnnotationTool, AnnotationToolVariant) to start the annotation creation mode with the specified variant of the provided annotation tool.

Summary

Nested Classes
enum AnnotationToolVariant.Preset Annotation tool variants defined by the framework. 
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<AnnotationToolVariant> CREATOR
Protected Constructors
AnnotationToolVariant(Parcel in)
Public Methods
static AnnotationToolVariant defaultVariant()
Gets an instance of the default annotation tool variant used in the framework.
int describeContents()
boolean equals(Object obj)
static AnnotationToolVariant fromName(String variantName)
Gets an instance of the annotation tool variant with specified name.
static AnnotationToolVariant fromPreset(AnnotationToolVariant.Preset preset)
Gets an instance of the tool variant from the specified framework presets (the variants that are inside the framework by default)
String getName()
Gets the name of this annotation tool variant, or null if this is the default one.
int hashCode()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<AnnotationToolVariant> CREATOR

Protected Constructors

protected AnnotationToolVariant (Parcel in)

Public Methods

public static AnnotationToolVariant defaultVariant ()

Gets an instance of the default annotation tool variant used in the framework.

Returns
  • Default annotation tool variant.

public int describeContents ()

public boolean equals (Object obj)

public static AnnotationToolVariant fromName (String variantName)

Gets an instance of the annotation tool variant with specified name. The variant cannot be an empty string.

When specifying your own preset, make sure that the name doesn't collide with the pre-defined variants used in the framework. Those are defined in enum called AnnotationToolVariant.Preset. If you'd like to get one of the variants from our framework (from preset), you should use fromPreset(Preset) static creator.

Parameters
variantName Name of the variant to get an instance of.
Returns
  • An instance of the annotation tool variant with the specified variant name.

public static AnnotationToolVariant fromPreset (AnnotationToolVariant.Preset preset)

Gets an instance of the tool variant from the specified framework presets (the variants that are inside the framework by default)

Parameters
preset Preset for which to get the annotation tool variant.
Returns
  • Annotation tool variant of the specified preset.

public String getName ()

Gets the name of this annotation tool variant, or null if this is the default one.

Returns
  • The name of the tool variant.

public int hashCode ()

public void writeToParcel (Parcel dest, int flags)