目录

AlphaAnimation

Class Info

public class AlphaAnimation extends Animation

An animation class that controls the transparency. The transparency value ranges from 0 to 1. The value 1 indicates opaque and the value 0 indicates complete transparent.

Public Constructor Summary

Constructor Name

AlphaAnimation(float fromAlpha, float toAlpha)

Creates an AlphaAnimation object using the initial transparency and target transparency.

Public Method Summary

Qualifier and Type

Method Name and Description

long

getDuration()

Obtains the animation duration.

float

getFromAlpha()

Obtains the initial transparency.

Interpolator

getInterpolator()

Obtains an interpolator.

float

getToAlpha()

Obtains the target transparency.

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

getDuration(), setInterpolator(Interpolator interpolator)

Public Constructors

[h2]AlphaAnimation

Constructor

public AlphaAnimation(float fromAlpha, float toAlpha)

Creates an AlphaAnimation object using the initial transparency and target transparency.

Parameters

Name

Description

fromAlpha

Initial transparency.

toAlpha

Target transparency.

Public Methods

[h2]getDuration

Method

public long getDuration()

Obtains the animation duration.

Returns

Type

Description

long

Animation duration, in milliseconds.

[h2]getFromAlpha

Method

public float getFromAlpha()

Obtains the initial transparency.

Returns

Type

Description

float

Initial transparency. The value ranges from 0 to 1.

  • 0: transparent
  • 1: opaque

[h2]getInterpolator

Method

public Interpolator getInterpolator()

Obtains an interpolator.

Returns

Type

Description

Interpolator

Interpolator.

[h2]getToAlpha

Method

public float getToAlpha()

Obtains the target transparency.

Returns

Type

Description

float

Target transparency. The value ranges from 0 to 1.

  • 0: transparent
  • 1: opaque

[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.