资源简介
android 幻灯片效果,android 幻灯片效果

代码片段和文件信息
package com.open.turnpage;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.Rect;
import android.view.SurfaceHolder;
/**
*
* @author yanglonghui
*
*/
public class BlackSquareFadeAway implements ITurnPage {
private int duration=850;//动画持续时间
private final int leafNum=5;
private PaintFlagsDrawFilter pdf=new PaintFlagsDrawFilter(0 Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG);
public BlackSquareFadeAway() {
// TODO Auto-generated constructor stub
}
@Override
public void onCreate() {
// TODO Auto-generated method stub
}
@Override
public void onTurnPageDraw(SurfaceHolder holder Bitmap[] bitmap
int maxWidth int maxHeight) {
int dx=(maxWidth-bitmap[0].getWidth())/2;
int dy=(maxHeight-bitmap[0].getHeight())/2;
int perWidth=maxWidth/leafNum;
int row=maxHeight/perWidth;
int perHeight=maxHeight/row;
Rect[][] array=new Rect[row][leafNum];
for(int i=0;i {
for(int j=0;j {
array[i][j]=new Rect();
array[i][j].set(j*perWidth i*perHeight (j+1)*perWidth (i+1)*perHeight);
if(j==array[i].length-1)
{
array[i][j].set(maxWidth-perWidth array[i][j].top maxWidth array[i][j].bottom);
}
if(i==array.length-1)
{
array[i][j].set(array[i][j].left maxHeight-perHeight array[i][j].right maxHeight);
}
}
}
long start=System.currentTimeMillis();
long runMills=0;
Paint mRectPaint=new Paint();
mRectPaint.setColor(Color.BLACK);
Rect drawRect=new Rect();
Canvas canvas=null;
boolean isRunning=true;
while(isRunning)
{
isRunning=((runMills=(System.currentTimeMillis()-start)) if(!isRunning)
{
runMills=duration;
}
try {
canvas=holder.lockCanvas(null);
canvas.setDrawFilter(pdf);
canvas.drawColor(Color.BLACK);// 清除画布
if(!isRunning)
{
canvas.drawBitmap(bitmap[0] dx dy null);
}
else
{
canvas.save();
canvas.translate(dx dy);
for(int i=0;i {
for(int j=0;j {
drawRect.set(array[i][j]);
int _dx = drawRect.width()/2-(int)(((float)runMills/(float)duration)*drawRect.width()/2);
int _dy = drawRect.height()/2-(int)(((float)runMills/(float)duration)*drawRect.height()/2);
drawRect.inset(_dx _dy);
canvas.drawBitmap(bitmap[0] drawRect drawRect null);
}
}
canvas.restore();
}
} catch (Exception e) {
e.printStackTrace();
}finally{
if(null!=canvas)
{
holder.unlockCanvasAndPost(canvas);
}
else
{
break;
}
if(!isRunning)
{
break;
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-12-14 15:24 android-turnpage-master\
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\
文件 475 2013-12-14 15:24 android-turnpage-master\git_turnpage\.classpath
文件 848 2013-12-14 15:24 android-turnpage-master\git_turnpage\.project
文件 481 2013-12-14 15:24 android-turnpage-master\git_turnpage\AndroidManifest.xm
文件 781 2013-12-14 15:24 android-turnpage-master\git_turnpage\proguard-project.txt
文件 584 2013-12-14 15:24 android-turnpage-master\git_turnpage\project.properties
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\drawable-hdpi\
文件 9397 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\drawable-hdpi\ic_launcher.png
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\drawable-mdpi\
文件 5237 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\drawable-mdpi\ic_launcher.png
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\drawable-xhdpi\
文件 14383 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\drawable-xhdpi\ic_launcher.png
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\values-v11\
文件 334 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\values-v11\st
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\values-v14\
文件 391 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\values-v14\st
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\values\
文件 82 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\values\strings.xm
文件 697 2013-12-14 15:24 android-turnpage-master\git_turnpage\res\values\st
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\
目录 0 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\turnpage\
文件 3108 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\turnpage\BlackSquareFadeAway.java
文件 2898 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\turnpage\BlackSquareZoomIn.java
文件 381 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\turnpage\ITurnPage.java
文件 2064 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\turnpage\ShutterDown2Up.java
文件 2194 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\turnpage\ShutterLeft2Right.java
文件 1992 2013-12-14 15:24 android-turnpage-master\git_turnpage\src\com\open\turnpage\ShutterRight2Left.java
............此处省略38个文件信息
- 上一篇:C#调用Java接口演示
- 下一篇:Java版终端 Demo
相关资源
- android带百分比进度条的文件上传,使
- 美食天下项目Android版源码和Web版源码
- Android之自定义ToggleButton使用
- Android非常漂亮的登录界面
- pc与android通过usb socket实现手机通信
- android毕业设计
- 百度地图自定义Markerandroid
- Android分区工具包
- android-support-v4.jar已打包进去源代码
- u-blox_Android_GNSS_Driver_v3.10驱动源码+中
- 个人根据Android移动开发案例详解手写
- android 视频播放器 项目和原码
- Android【动画】【特效】 17种动画特效
- 基于Android智能家居详细设计(经典)
- android通过JDBC连接Mysql数据库
- Android通讯录的源代码
- android 瀑布流Demo
- 指纹传感器FPC1080在android下的驱动
- delphi xe5 android 调用照相机摄像头拍照
- Android手机连连看游戏源码
- android-sdk-windows v2.3离线完整版
- android 底部弹出菜单(带透明背景)
- Android工程模式简介.rar
- Android蓝牙和Cors网络开发源码
- Android powermanger wakelock
- Android v7的一些jar包
- 最新android supportV7包
- android图片压缩工具类分享
- 单机搭建Android(解决Network is unreach
- Android上监听收到的短信(SMS)
评论
共有 条评论