设为首页 加入收藏

TOP

Android Gallery 3D效果(有图有真相)(二)
2014-11-24 11:45:26 来源: 作者: 【 】 浏览:1
Tags:Android Gallery 效果 真相
reflectionImage,
// 0,
// height
// + reflectionGap,
// null);
// Paint paint = new Paint();
// LinearGradient shader = new LinearGradient(
// 0,
// originalImage
// .getHeight(),
// 0,
// bitmapWithReflection
// .getHeight()
// + reflectionGap,
// 0x70ffffff,
// 0x00ffffff,
// TileMode.CLAMP);
// paint.setShader(shader);
// paint.setXfermode(new PorterDuffXfermode(
// Mode.DST_IN));
// canvas.drawRect(
// 0,
// height,
// width,
// bitmapWithReflection
// .getHeight()
// + reflectionGap,
// paint);
// ImageView imageView = new ImageView(
// context);
// imageView
// .setImageBitmap(bitmapWithReflection);
// // imageView.setLayoutParams(new GalleryFlow.LayoutParams(180,
// // 240));
// imageView
// .setLayoutParams(new DetialGallery.LayoutParams(
// 170,
// 200));
// imageView.setScaleType(ScaleType.FIT_XY);
// mImages[index++] = imageView;
// }
// return true;
// }


@Override
public int getCount() {
// TODO Auto-generated method stub
// return Integer.MAX_VALUE;
return Integer.MAX_VALUE;


}


@Override
public Object getItem(
int position) {
// TODO Auto-generated method stub


return position;
//
// return position;
// return position;


}


@Override
public long getItemId(
int position) {
// TODO Auto-generated method stub
return position;
}


@Override
public View getView(int arg0,
View arg1,
ViewGroup arg2) {
// TODO Auto-generated method stub
ImageView imageView = new ImageView(
context);
imageView
.setImageResource(imgResId[arg0
% imgResId.length]);
imageView
.setScaleType(ImageView.ScaleType.FIT_XY);
imageView
.setLayoutParams(new DetialGallery.LayoutParams(
175, 200));


return imageView;


}


}
}



-----------------------.java DetialGallery


package gongzibai.co.cc;


import android.content.Context;
import android.graphics.Camera;
import android.graphics.Matrix;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Transformation;
import android.widget.Gallery;
import android.widget.ImageView;


public class DetialGallery extends
Gallery {
private Camera mCamera = new Camera();
private int mMaxRotationAngle = 45;
private int mMaxZoom = -120;
private int mCoveflowCenter;


public DetialGallery(
Context context,
AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}


public int getMaxRotationAngle() {
return mMaxRotationAngle;
}


public void setMaxRotationAngle(
int maxRotationAngle) {
mMaxRotationAngle = maxRotationAngle;
}


public int getMaxZoom() {
return mMaxZoom;
}


public void setMaxZoom(int maxZoom) {
mMaxZoom = maxZoom;
}


private int getCenterOfCoverflow() {
return (getWidth()
- getPaddingLeft() - getPaddingRight())
/ 2 + getPaddingLeft();
}


private static int getCenterOfView(
View view) {
return view.getLeft()
+ view.getWidth() / 2;
}


protected boolean getChildStaticTransformation(
View child, Transformation t) {
final int childCenter = getCenterOfView(child);
final int childWidth = child
.getWidth();
int rotationAngle = 0;
t.clear();
t.setTransformationType(Transformation.

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux 内核级后门的原理和简单实战 下一篇Linux shell编程之变量_01

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Linux_百度百科 (2025-12-26 12:51:52)
·Shell 流程控制 | 菜 (2025-12-26 12:51:49)
·TCP/UDP协议_百度百科 (2025-12-26 12:20:11)
·什么是TCP和UDP协议 (2025-12-26 12:20:09)
·TCP和UDP详解 (非常 (2025-12-26 12:20:06)