目录

ScaleAnimation

Class Info

public class ScaleAnimation extends Animation

控制缩放的动画类。

Public Constructor Summary

Constructor Name

ScaleAnimation(float fromX, float toX, float fromY, float toY)

使用起始坐标缩放比例与目的坐标缩放比例创建ScaleAnimation对象。0表示收缩到没有,1表示正常无伸缩,值小于1表示收缩,值大于1表示放大。图标放大的最大尺寸为(width:1080,height:1080),单位:像素。

Public Method Summary

Qualifier and Type

Method Name and Description

long

getDuration()

获取动画持续时间。

float

getFromX()

获取动画开始时横坐标。

float

getFromY()

获取动画开始时纵坐标。

Interpolator

getInterpolator()

获取插值器。

float

getToX()

获取动画结束时的横坐标。

float

getToY()

获取动画结束时的纵坐标。

void

setDuration(long duration)

设置动画持续时间。

void

setInterpolator(Interpolator interpolator)

设置动画插值器。

Methods Inherited from Class com.huawei.hms.maps.model.animation.Animation

setDuration(long duration),setInterpolator(Interpolator interpolator)

Public Constructors

[h2]ScaleAnimation

Constructor

public ScaleAnimation(float fromX, float toX, float fromY, float toY)

使用起始坐标缩放比例与目的坐标缩放比例创建ScaleAnimation对象。0表示收缩到没有,1表示正常无伸缩,值小于1表示收缩,值大于1表示放大。图标放大的最大尺寸为(width:1080,height:1080),单位:像素。

Parameters

Name

Description

fromX

指动画开始时应用的水平缩放倍数。

toX

指动画结束时应用的水平缩放倍数。

fromY

指动画开始时应用的垂直缩放倍数。

toY

指动画结束时应用的垂直缩放倍数。

Public Methods

[h2]getDuration

Method

public long getDuration()

获取动画持续时间。

Returns

Type

Description

long

动画持续时间,单位:毫秒。

[h2]getFromX

Method

public float getFromX()

获取动画开始时横坐标。

Returns

Type

Description

float

开始时横坐标。

[h2]getFromY

Method

public float getFromY()

获取动画开始时纵坐标。

Returns

Type

Description

float

动画开始时纵坐标。

[h2]getInterpolator

Method

public Interpolator getInterpolator()

获取插值器。

Returns

Type

Description

Interpolator

插值器。

[h2]getToX

Method

public float getToX()

获取动画结束时的横坐标。

Returns

Type

Description

float

动画结束时的横坐标。

[h2]getToY

Method

public float getToY()

获取动画结束时的纵坐标。

Returns

Type

Description

float

动画结束时的纵坐标。

[h2]setDuration

Method

public void setDuration(long duration)

设置动画持续时间。

Parameters

Name

Description

duration

动画持续时间,单位:毫秒,默认为250毫秒。

[h2]setInterpolator

Method

public void setInterpolator(Interpolator interpolator)

设置动画插值器。

Parameters

Name

Description

interpolator

插值器。