| 包: | dji.open.pilot.base.ui.model |
classSince MSDK 5.20.1
ShapeDescriptor
背景形状描述符,封装圆角、描边、填充色等背景样式。
描述:
method
method
getCornerRadius
Since MSDK 5.20.1float getCornerRadius() |
获取四角统一圆角半径(dp)。
返回值
| 类型 | 说明 |
|---|---|
float | 四角统一圆角半径(dp)。 |
method
method
getCornerRadii
Since MSDK 5.20.1float[] getCornerRadii() |
获取四角独立圆角半径数组(dp),可能为 null。
返回值
| 类型 | 说明 |
|---|---|
float[] | 四角独立圆角半径数组(dp),可能为 null。 |
method
method
getStrokeWidth
Since MSDK 5.20.1int getStrokeWidth() |
获取描边宽度(dp)。
返回值
| 类型 | 说明 |
|---|---|
int | 描边宽度(dp)。 |
method
method
getStrokeColor
Since MSDK 5.20.1int getStrokeColor() |
获取描边颜色(ARGB)。
返回值
| 类型 | 说明 |
|---|---|
int | 描边颜色(ARGB)。 |
method
method
getFillColor
Since MSDK 5.20.1int getFillColor() |
获取填充颜色(ARGB)。
返回值
| 类型 | 说明 |
|---|---|
int | 填充颜色(ARGB)。 |
method
method
getShape
Since MSDK 5.20.1int getShape() |
获取形状类型:SHAPE_RECTANGLE 或 SHAPE_OVAL。
返回值
| 类型 | 说明 |
|---|---|
int | 形状类型:SHAPE_RECTANGLE 或 SHAPE_OVAL。 |
method
method
toJson
Since MSDK 5.20.1String toJson() |
将当前对象序列化为 JSON 字符串。
返回值
| 类型 | 说明 |
|---|---|
String | JSON 字符串,失败时返回空字符串。 |
method
method
fromJson
Since MSDK 5.20.1static ShapeDescriptor fromJson(String json) |
从 JSON 字符串还原 ShapeDescriptor,供服务端处理 RemoteViewProperty.BACKGROUND_SHAPE 时调用。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
json | String | 由 toJson() 生成的字符串。 |
返回值
| 类型 | 说明 |
|---|---|
static ShapeDescriptor | 还原的 ShapeDescriptor,解析失败时返回 null。 |
Related:
class
class
Builder
Since MSDK 5.20.1static class Builder |
ShapeDescriptor 构建器。