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.