目录

AlphaAnimation

Class Info

public class AlphaAnimation extends Animation

控制透明度的动画类,透明度范围为[0, 1],1为不透明,0为完全透明。

Public Constructor Summary

Constructor Name

AlphaAnimation(float fromAlpha, float toAlpha)

使用起始透明度和目标透明度创建AlphaAnimation对象。

Public Method Summary

Qualifier and Type

Method Name and Description

long

getDuration()

获取动画持续时间。

float

getFromAlpha()

获取起始透明度。

Interpolator

getInterpolator()

获取插值器。

float

getToAlpha()

获取目标透明度。

void

setDuration(long duration)

设置动画持续时间。

void

setInterpolator(Interpolator interpolator)

设置动画插值器。

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

getDuration(),setInterpolator(Interpolator interpolator)

Public Constructors

[h2]AlphaAnimation

Constructor

public AlphaAnimation(float fromAlpha, float toAlpha)

使用起始透明度和目标透明度创建AlphaAnimation对象。

Parameters

Name

Description

fromAlpha

起始透明度。

toAlpha

目标透明度。

Public Methods

[h2]getDuration

Method

public long getDuration()

获取动画持续时间。

Returns

Type

Description

long

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

[h2]getFromAlpha

Method

public float getFromAlpha()

获取起始透明度。

Returns

Type

Description

float

起始透明度,取值范围:[0, 1]。

  • 0:完全透明。
  • 1:不透明。

[h2]getInterpolator

Method

public Interpolator getInterpolator()

获取插值器。

Returns

Type

Description

Interpolator

插值器。

[h2]getToAlpha

Method

public float getToAlpha()

获取目标透明度。

Returns

Type

Description

float

目标透明度,取值范围:[0, 1]。

  • 0:完全透明。
  • 1:不透明。

[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

插值器。