package

androidx.annotation

Enums

InspectableProperty.ValueTypeThe type of value packed into a primitive {int}.
RestrictTo.Scope

Annotation Types

AnimatorResDenotes that an integer parameter, field or method return value is expected to be an animator resource reference (e.g.
AnimResDenotes that an integer parameter, field or method return value is expected to be an anim resource reference (e.g.
AnyResDenotes that an integer parameter, field or method return value is expected to be a resource reference of any type.
AnyThreadDenotes that the annotated method can be called from any thread (e.g. it is "thread safe".)
ArrayResDenotes that an integer parameter, field or method return value is expected to be an array resource reference (e.g.
AttrResDenotes that an integer parameter, field or method return value is expected to be an attribute reference (e.g.
BinderThreadDenotes that the annotated method should only be called on the binder thread.
BoolResDenotes that an integer parameter, field or method return value is expected to be a boolean resource reference.
CallSuperDenotes that any overriding methods should invoke this method as well.
CheckResultDenotes that the annotated method returns a result that it typically is an error to ignore.
ColorIntDenotes that the annotated element represents a packed color int, AARRGGBB.
ColorLong

Denotes that the annotated element represents a packed color long.

ColorResDenotes that an integer parameter, field or method return value is expected to be a color resource reference (e.g.
ContentViewAnnotation that can be attached to a constructor with a single LayoutRes parameter to denote what layout the component intends to inflate and set as its content.
DimenResDenotes that an integer parameter, field or method return value is expected to be a dimension resource reference (e.g.
DimensionDenotes that an integer parameter, field or method return value is expected to represent a dimension.
DrawableResDenotes that an integer parameter, field or method return value is expected to be a drawable resource reference (e.g.
FloatRangeDenotes that the annotated element should be a float or double in the given range

Example:


  @FloatRange(from=0.0,to=1.0)
  public float getAlpha() {
      ...
  }
 
FontResDenotes that an integer parameter, field or method return value is expected to be a font resource reference (e.g.
FractionResDenotes that an integer parameter, field or method return value is expected to be a fraction resource reference.
GuardedByDenotes that the annotated method or field can only be accessed when holding the referenced lock.
HalfFloat

Denotes that the annotated element represents a half-precision floating point value.

IdResDenotes that an integer parameter, field or method return value is expected to be an id resource reference (e.g.
InspectablePropertyDenotes that the annotated method is the getter for a resources-backed property that should be shown in Android Studio's inspection tools.
InspectableProperty.EnumEntryOne entry in an enumeration packed into a primitive {int}.
InspectableProperty.FlagEntryOne flag value of many that may be packed into a primitive {int}.
IntDefDenotes that the annotated element of integer type, represents a logical type and that its value should be one of the explicitly named constants.
IntegerResDenotes that an integer parameter, field or method return value is expected to be an integer resource reference (e.g.
InterpolatorResDenotes that an integer parameter, field or method return value is expected to be an interpolator resource reference (e.g.
IntRangeDenotes that the annotated element should be an int or long in the given range

Example:


  @IntRange(from=0,to=255)
  public int getAlpha() {
      ...
  }
 
KeepDenotes that the annotated element should not be removed when the code is minified at build time.
LayoutResDenotes that an integer parameter, field or method return value is expected to be a layout resource reference (e.g.
LongDefDenotes that the annotated long element represents a logical type and that its value should be one of the explicitly named constants.
MainThreadDenotes that the annotated method should only be called on the main thread.
MenuResDenotes that an integer parameter, field or method return value is expected to be a menu resource reference.
NavigationResDenotes that an integer parameter, field or method return value is expected to be a navigation resource reference (e.g.
NonNullDenotes that a parameter, field or method return value can never be null.
NullableDenotes that a parameter, field or method return value can be null.
PluralsResDenotes that an integer parameter, field or method return value is expected to be a plurals resource reference.
PxDenotes that an integer parameter, field or method return value is expected to represent a pixel dimension.
RawResDenotes that an integer parameter, field or method return value is expected to be a raw resource reference.
RequiresApiDenotes that the annotated element should only be called on the given API level or higher.
RequiresFeatureDenotes that the annotated element requires one or more features.
RequiresPermissionDenotes that the annotated element requires (or may require) one or more permissions.
RequiresPermission.ReadSpecifies that the given permission is required for read operations.
RequiresPermission.WriteSpecifies that the given permission is required for write operations.
RestrictToDenotes that the annotated element should only be accessed from within a specific scope (as defined by RestrictTo.Scope).
SizeDenotes that the annotated element should have a given size or length.
StringDefDenotes that the annotated String element, represents a logical type and that its value should be one of the explicitly named constants.
StringResDenotes that an integer parameter, field or method return value is expected to be a String resource reference (e.g.
StyleableResDenotes that an integer parameter, field or method return value is expected to be a styleable resource reference (e.g.
StyleResDenotes that an integer parameter, field or method return value is expected to be a style resource reference (e.g.
TransitionResDenotes that an integer parameter, field or method return value is expected to be a transition resource reference.
UiThreadDenotes that the annotated method or constructor should only be called on the UI thread.
VisibleForTestingDenotes that the class, method or field has its visibility relaxed, so that it is more widely visible than otherwise necessary to make code testable.
WorkerThreadDenotes that the annotated method should only be called on a worker thread.
XmlResDenotes that an integer parameter, field or method return value is expected to be an XML resource reference.