目录

ScaleAnimation

Class Info

public class ScaleAnimation extends Animation

A class for controlling the animation scale.

Public Constructor Summary

Constructor Name

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

Creates a ScaleAnimation object using the scaling ratios of the initial coordinates and target coordinates. The value 0 indicates that the animation is scaled to disappear, and the value 1 indicates that the animation is not scaled. A value between 0 and 1 indicates that the animation is scaled down, and a value greater than 1 indicates that the animation is scaled up. The maximum icon dimensions are 1080 width x 1080 height, in pixels.

Public Method Summary

Qualifier and Type

Method Name and Description

long

getDuration()

Obtains the animation duration.

float

getFromX()

Obtains the initial X coordinate of the animation start point.

float

getFromY()

Obtains the initial Y coordinate of the animation start point.

Interpolator

getInterpolator()

Obtains an interpolator.

float

getToX()

Obtains the target X coordinate of the animation end point.

float

getToY()

Obtains the target Y coordinate of the animation end point.

void

setDuration(long duration)

Sets the animation duration.

void

setInterpolator(Interpolator interpolator)

Sets an animation 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)

Creates a ScaleAnimation object using the scaling ratios of the initial coordinates and target coordinates. The value 0 indicates that the animation is scaled to disappear, and the value 1 indicates that the animation is not scaled. A value between 0 and 1 indicates that the animation is scaled down, and a value greater than 1 indicates that the animation is scaled up. The maximum icon dimensions are 1080 width x 1080 height, in pixels.

Parameters

Name

Description

fromX

Horizontal scale ratio when the animation starts.

toX

Horizontal scale ratio when the animation ends.

fromY

Vertical scale ratio when the animation starts.

toY

Vertical scale ratio when the animation ends.

Public Methods

[h2]getDuration

Method

public long getDuration()

Obtains the animation duration.

Returns

Type

Description

long

Animation duration, in milliseconds.

[h2]getFromX

Method

public float getFromX()

Obtains the initial X coordinate of the animation start point.

Returns

Type

Description

float

Initial X coordinate of the animation start point.

[h2]getFromY

Method

public float getFromY()

Obtains the initial Y coordinate of the animation start point.

Returns

Type

Description

float

Initial Y coordinate of the animation start point.

[h2]getInterpolator

Method

public Interpolator getInterpolator()

Obtains an interpolator.

Returns

Type

Description

Interpolator

Interpolator.

[h2]getToX

Method

public float getToX()

Obtains the target X coordinate of the animation end point.

Returns

Type

Description

float

Target X coordinate of the animation end point.

[h2]getToY

Method

public float getToY()

Obtains the target Y coordinate of the animation end point.

Returns

Type

Description

float

Target Y coordinate of the animation end point.

[h2]setDuration

Method

public void setDuration(long duration)

Sets the animation duration.

Parameters

Name

Description

duration

Animation duration, in milliseconds. The default value is 250.

[h2]setInterpolator

Method

public void setInterpolator(Interpolator interpolator)

Sets an animation interpolator.

Parameters

Name

Description

interpolator

Interpolator.