The second Android 11 Developer Preview is now available, test it out and share your feedback.

FlagEntry

@Target([AnnotationTarget.CLASS, AnnotationTarget.FILE]) class FlagEntry
androidx.annotation.InspectableProperty.FlagEntry

One flag value of many that may be packed into a primitive {int}.

Summary

Public constructors

<init>(name: String, target: Int, mask: Int)

One flag value of many that may be packed into a primitive {int}.

Properties

Int

A mask that the property will be bitwise anded with before comparing to the target.

String

The string name of this flag.

Int

A target value that the property's value must equal after masking.

Public constructors

<init>

FlagEntry(
    name: String,
    target: Int,
    mask: Int)

One flag value of many that may be packed into a primitive {int}.

Properties

mask

val mask: Int

A mask that the property will be bitwise anded with before comparing to the target. If set to 0 (the default), the value of target() will be used as a mask. Zero was chosen as the default since bitwise and with zero is always zero.

Return
Int A mask, or 0 to use the target as a mask

name

val name: String

The string name of this flag.

Return
String A string name

target

val target: Int

A target value that the property's value must equal after masking. If a mask is not supplied (i.e., mask() is 0), the target will be reused as the mask. This handles the common case where no flags mutually exclude each other.

Return
Int The target value to compare against