找回密码
 立即注册
Asinclasscombao | android开发 2022-10-29 72 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
双缓冲是为了避免动画闪耀而实现的一种多线程使用,首要原理:当一个动画抢先显示时,程序又在改动它,前面还没显示完,程序又恳求从头制作,屏幕就会不断闪耀。Android的SurfaceView类其实就是一个双缓冲机制。关于VIEW,一般先setBitMap()将制作内容制作到BITMAP上,然后用drawBitMap方法制作BITMAP,就避免了闪耀现象。我通过SurfaceView以及自定义VIEW双缓冲来比较功能,发现效率差不多,详见附件代码。本资料共包括以下附件:
Asin\bin\com\bao\asin\AsinActivity.class
Asin\bin\com\bao\asin\AsinSurfaceView$ShowThread.class
Asin\bin\com\bao\asin\AsinSurfaceView.class
Asin\bin\com\bao\asin\AsinView$ShowThread.class
Asin\bin\com\bao\asin\AsinView.class
Asin\bin\com\bao\asin\R$attr.class
Asin\bin\com\bao\asin\R$drawable.class
Asin\bin\com\bao\asin\R$layout.class
Asin\bin\com\bao\asin\R$string.class
Asin\bin\com\bao\asin\R.class
Asin\bin\Asin.apk
Asin\bin\classes.dex
Asin\bin\resources.ap_
Asin\gen\com\bao\asin\R.java
Asin\res\drawable-hdpi\icon.png
Asin\res\drawable-ldpi\icon.png
Asin\res\drawable-mdpi\icon.png
Asin\res\layout\main.xml
Asin\res\values\strings.xml
Asin\src\com\bao\asin\AsinActivity.java
Asin\src\com\bao\asin\AsinSurfaceView.java
Asin\src\com\bao\asin\AsinView.java
Asin\.classpath
Asin\.project
Asin\AndroidManifest.xml
Asin\default.properties

(Double buffering is a multi-threaded use to avoid flashing animation. The first principle is that when an animation is displayed first, the program is changing it. Before the previous display is finished, the program pleads to make it from scratch, and the screen will keep flashing. The Android SurfaceView class is actually a double buffering mechanism. For VIEW, generally, setBitMap() is used to make the content to BITMAP, and then drawBitMap is used to make BITMAP. I compared the functions through SurfaceView and the customized VIEW double buffer, and found that the efficiency was similar. See the attachment code for details. This document includes the following annexes:
Asin\bin\com\bao\asin\AsinActivity.class
Asin\bin\com\bao\asin\AsinSurfaceView$ShowThread.class
Asin\bin\com\bao\asin\AsinSurfaceView.class
Asin\bin\com\bao\asin\AsinView$ShowThread.class
Asin\bin\com\bao\asin\AsinView.class
Asin\bin\com\bao\asin\R$attr.class
Asin\bin\com\bao\asin\R$drawable.class
Asin\bin\com\bao\asin\R$layout.class
Asin\bin\com\bao\asin\R$string.class
Asin\bin\com\bao\asin\R.class
Asin\bin\Asin.apk
Asin\bin\classes.dex
Asin\bin\resources.ap_
Asin\gen\com\bao\asin\R.java
Asin\res\drawable-hdpi\icon.png
Asin\res\drawable-ldpi\icon.png
Asin\res\drawable-mdpi\icon.png
Asin\res\layout\main.xml
Asin\res\values\strings.xml
Asin\src\com\bao\asin\AsinActivity.java
Asin\src\com\bao\asin\AsinSurfaceView.java
Asin\src\com\bao\asin\AsinView.java
Asin\.classpath
Asin\.project
Asin\AndroidManifest.xml
Asin\default.properties)

[下载]15482348496.rar




上一篇:4种不同的 ListView 代码下载
下一篇:Android Sqlite轻量级数据库框架