butterknife.BindArray Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of butterknife-annotations Show documentation
Show all versions of butterknife-annotations Show documentation
Field and method binding for Android views.
The newest version!
package butterknife;
import androidx.annotation.ArrayRes;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Bind a field to the specified array resource ID. The type of array will be inferred from the
* annotated element.
*
* String array:
*
* {@literal @}BindArray(R.array.countries) String[] countries;
*
*
* Int array:
*
* {@literal @}BindArray(R.array.phones) int[] phones;
*
*
* Text array:
*
* {@literal @}BindArray(R.array.options) CharSequence[] options;
*
*
* {@link android.content.res.TypedArray}:
*
* {@literal @}BindArray(R.array.icons) TypedArray icons;
*
*/
@Retention(RUNTIME) @Target(FIELD)
public @interface BindArray {
/** Array resource ID to which the field will be bound. */
@ArrayRes int value();
}