#Android Training# Animations

add subtle visual cues

Animations are especially useful when the screen changes state, such as when content loads or new actions become avaiable.

add a polished look


Crossfade animation(dissolve)


Set up Animation:

1. Create member variables for the views;

2.For the view that is being faded in, set its visibility to GONE.

  this prevents the view from taking up layout space and omits it from layout calculations, speeding up processing.

3.Cache the  config_shortAnimTime system property

   This property defines a standard "short" duration for animation.

   This duration is ideal for subtle animations or animations that occur very frequently.

    config_longAnimTime and config_mediumAnimTime are also avaiable is you wish to use them.


Crossfade the views:

1.For the view that is fading in, set the alpha value to 0 and visibility to VISIBLE.

2.For the view that is fading in, animate its alpha value from 0 to 1.

At the same time, for the view that is fading out, animate its alpha value from 1 to 0;



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值