Class AnnotationToolVariant

  • All Implemented Interfaces:

    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.

    • Constructor Detail

    • Method Detail

      • getName

        @Nullable() String getName()

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


        The name of the 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)

        preset - Preset for which to get the annotation tool variant.

        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.

        variantName - Name of the variant to get an instance of.

        An instance of the annotation tool variant with the specified variant name.