Class AnnotationToolVariant
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class AnnotationToolVariant implements Parcelable
Annotation tools can have variants represented by the name. To create a custom annotation tool variant use fromName, 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 to start the annotation creation mode with the specified variant of the provided annotation tool.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
AnnotationToolVariant.Preset
Annotation tool variants defined by the framework.
-
Field Summary
Fields Modifier and Type Field Description public final String
name
public final static Parcelable.Creator<AnnotationToolVariant>
CREATOR
-
Method Summary
Modifier and Type Method Description String
getName()
Gets the name of this annotation tool variant, or null
if this is the default one.static AnnotationToolVariant
defaultVariant()
Gets an instance of the default annotation tool variant used in the framework. static AnnotationToolVariant
fromPreset(@NonNull() AnnotationToolVariant.Preset preset)
Gets an instance of the tool variant from the specified framework presets (the variants that are inside the framework by default) static AnnotationToolVariant
fromName(@NonNull() String variantName)
Gets an instance of the annotation tool variant with specified name. boolean
equals(@Nullable() Object obj)
int
hashCode()
int
describeContents()
void
writeToParcel(Parcel dest, int flags)
-
-
Method Detail
-
getName
@Nullable() 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.
-
defaultVariant
@NonNull() static AnnotationToolVariant defaultVariant()
Gets an instance of the default annotation tool variant used in the framework.
- Returns:
Default annotation tool variant.
-
fromPreset
@NonNull() static AnnotationToolVariant fromPreset(@NonNull() 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.
-
fromName
@NonNull() static AnnotationToolVariant fromName(@NonNull() 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 . If you'd like to get one of the variants from our framework (from preset), you should use fromPreset 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.
-
hashCode
int hashCode()
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
-
-
-