android 机器人动画,Android 5.X与Android4.X版本机器人动画的区别以及制作动画的方法...

今天翻了下墙,解决了一直以来的疑惑问题:

为什么Android5.0以及6.0的recovery版本,机器人动画怎么就只有一张图片?

这个问题,我百思不得其解,看了很多网文,也只是有了个概念。

请参考以下文档,这是我从谷歌Android开源网拉下来的原文:

https://source.android.com/devices/tech/ota/device_code

Recovery UI images

Android 5.x

The recovery user interface consists images. Ideally, users never interact with the UI: During a normal update, the phone boots into recovery, fills the installation progress bar, and boots back into the new system without input from the user. In the event of a system update problem, the only user action that can be taken is to call customer care.

An image-only interface obviates the need for localization. However, as of Android 5.x the update can display a string of text (e.g. "Installing system update...") along with the image. For details, see Localized recovery text.

b04e63a5e55876e37b2db628c2e29076.png

The installing animation is represented as a single PNG image with different frames of the animation interlaced by row (which is why Figure 2 appears squished). For example, for a 200x200 seven-frame animation, create a single 200x1400 image where first frame is rows 0, 7, 14, 21, ...; the second frame is rows 1, 8, 15, 22, ...; etc. The combined image includes a text chunk that indicates the number of animation frames and the number of frames per second (FPS). The toolbootable/recovery/interlace-frames.pytakes a set of input frames and combines them into the necessary composite image used by recovery.

efault images are available in different densities and are located inbootable/recovery/res$DENSITY/images(e.g.,bootable/recovery/res-hdpi/images). To use a static image during installation, you need only provide the icon_installing.png image and set the number of frames in the animation to 0 (the error icon is not animated; it is always a static image).

以上文档意思就是说,Android5.x以上的版本,机器人的动画是PNG图片和帧动画组成的,我们可以使用recovery目录下的interlace-frames.py这个python脚本来进行合成,具体的合成方法可以参考这位新浪网友的文章,亲身试过,问题已经解决,那么,既然可以这么来合成,我就可以把android原生态的动画给换了,因为这个机器人实在是丑。

Android 4.x and earlier

The Android 4.x and earlier recovery UI uses the error image (shown above) and the installing animation plus several overlay images:

35005913621f07cef5bd35442c470153.png

During installation, the on-screen display is constructed by drawing the icon_installing.png image, then drawing one of the overlay frames on top of it at the proper offset. Here, a red box is superimposed to highlight where the overlay is placed on top of the base image:

77fa9469a9c53a34104e1da1b05869ea.png

Subsequent frames are displayed by drawing only the next overlay image atop what's already there; the base image is not redrawn.

The number of frames in the animation, desired speed, and x- and y-offsets of the overlay relative to the base are set by member variables of the ScreenRecoveryUI class. When using custom images instead of default images, override the Init() method in your subclass to change these values for your custom images (for details, see ScreenRecoveryUI). The script bootable/recovery/make-overlay.py can assist in converting a set of image frames to the "base image + overlay images" form needed by recovery, including computing of the necessary offsets.

Default images are located in bootable/recovery/res/images. To use a static image during installation, you need only provide the icon_installing.png image and set the number of frames in the animation to 0 (the error icon is not animated; it is always a static image).

上面说了这么多,其实也是把这上面的图片通过make-overlay.py这个python脚本来对4.x以及早期版本的android recovery的图片进行合成,中间让我们看到的转转转那个overlay的效果就是上面这些组图合成的,合成最终的图片存放在bootable/recovery/res/images这个路径下。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值