android sdk装到固态了,ChecksSdkIntAtLeast

ChecksSdkIntAtLeast

public

abstract

@interface

ChecksSdkIntAtLeast

implements

Annotationandroidx.annotation.ChecksSdkIntAtLeast

Denotes that the annotated method checks if the SDK_INT API level is

at least the given value, and either returns it or executes the

given lambda in that case (or if it's a field, has the value true).

The API level can be specified either as an API level via

Examples:// Simple version check

@ChecksSdkIntAtLeast(api = Build.VERSION_CODES.O)

public static boolean isAtLeastO() {

return Build.VERSION.SDK_INT >= 26;

}

// Required API level is passed in as first argument, and function

// in second parameter is executed if SDK_INT is at least that high:

@ChecksSdkIntAtLeast(parameter = 0, lambda = 1)

inline fun fromApi(value: Int, action: () -> Unit) {

if (Build.VERSION.SDK_INT >= value) {

action()

}

}

// Kotlin property:

@get:ChecksSdkIntAtLeast(api = Build.VERSION_CODES.GINGERBREAD)

val isGingerbread: Boolean

get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD

// Java field:

@ChecksSdkIntAtLeast(api = Build.VERSION_CODES.LOLLIPOP)

public static final boolean SUPPORTS_LETTER_SPACING =

Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;

Summary

Public methods

int

The API level is at least the given level

String

The API level is at least the given codename (such as "R")

int

The parameter number for a lambda that will be executed if the API level is at least

the value supplied via

int

The API level is specified in the given parameter, where the first parameter is number 0

Inherited methods

From interface

java.lang.annotation.Annotation

abstract

Class extends Annotation>

annotationType()

abstract

boolean

equals(Object arg0)

abstract

int

hashCode()

abstract

String

toString()

Public methods

api

public int api ()

The API level is at least the given level

Returns

int

codename

public String codename ()

The API level is at least the given codename (such as "R")

Returns

String

lambda

public int lambda ()

The parameter number for a lambda that will be executed if the API level is at least

the value supplied via

Returns

int

parameter

public int parameter ()

The API level is specified in the given parameter, where the first parameter is number 0

Returns

int

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值