framework开发:开机动画使用zip方式

1、desc.txt文件参数传解析

The system selects a boot animation zipfile from the following locations, in order:

/system/media/bootanimation-encrypted.zip (if getprop("vold.decrypt") = '1')
/system/media/bootanimation.zip
/oem/media/bootanimation.zip
zipfile layout

The bootanimation.zip archive file includes:

desc.txt - a text file //强制名称,不能修改
part0  \
part1   \  directories full of PNG frames
...     /
partN  /
desc.txt format

The first line defines the general parameters of the animation:

WIDTH HEIGHT FPS

  • WIDTH: animation width (pixels) //宽度
  • HEIGHT: animation height (pixels) //高度
  • FPS: frames per second, e.g. 60 //帧率

It is followed by a number of rows of the form:

TYPE COUNT PAUSE PATH [#RGBHEX CLOCK]

  • TYPE: a single char indicating what type of animation segment this is:
    • p – this part will play unless interrupted by the end of the boot // 将启动结束就被打断
    • c – this part will play to completion, no matter what //无论是否启动结束都不会被打断(常用)
  • COUNT: how many times to play the animation, or 0 to loop forever until boot is complete //运行多少次
  • PAUSE: number of FRAMES to delay after this part ends //动画结束后,停留几帧,0就是不停
  • PATH: directory in which to find the frames for this part (e.g. part0) //地址
  • RGBHEX: (OPTIONAL) a background color, specified as #RRGGBB //(可选)RGB 背景颜色参数
  • CLOCK: (OPTIONAL) the y-coordinate at which to draw the current time (for watches)//(可选)坐标参数 在哪个位置

There is also a special TYPE, $SYSTEM, that loads /system/media/bootanimation.zip
and plays that.

desc.txt文件示例->

1080 360 60
c 1 0 part0 #ffee00 c c
c 0 0 part1 #ffee00 c c
c 1 0 part2 #ffee00 c c
c 1 1 part3 #ffee00 c c
c 1 0 part4 #ffee00 c c

2、操作流程

在这里插入图片描述

  • 1、使用命令行(Linux下以存储方式压缩成zip文件)生成bootanimation.zip。

命令:zip -r -X -Z store bootanimation part*/* desc.txt

  • 2、将制作的bootanimation.zip拷贝到…\frameworks\base\cmds\bootanimation目录下

  • 3、在Android.mk下
    在这里插入图片描述

    4、编译

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值