小米3是否支持camera window dslrwindow

小米系统用不了google camera_百度知道
小米系统用不了google camera
我有更好的答案
小米手机版本更新后会导致谷歌商店登陆不正常,包括详细的图文教程,找到属于自己手机型号的板块,现在大部分手机厂商不在预装谷歌商店!里面有解决方案,解决方案请登陆小米论坛谷歌退出中国市场以后
采纳率:61%
com/miui" target="_blank">更多MIUI技巧和优惠活动可以关注MIUI官方微博<a title="http://weibo.com/miui" href="play&nbsp你好。由于谷歌之前已经退出中国大陆市场。下载地址
你的小米系统安卓版不够。
为您推荐:
其他类似问题
google的相关知识
&#xe675;换一换
回答问题,赢新手礼包&#xe6b9;
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。小米3手机照的相片怎么电脑上看不到?_百度知道
小米3手机照的相片怎么电脑上看不到?
把手机连接电脑,打开计算机,有可移动存储,但是文件夹dcim~camera,也没有照片,这是为什么?
我有更好的答案
用文件管理把DICM下的Camera改成Camera1,然后新建一个Camera目录,重启手机照一张相连上电脑就可以看见了。
采纳率:100%
受限于数据线传输速度
关键是你是不是用系统自带相机拍摄的
建议在电脑上安装小米手机助手来查看。
其他1条回答
为您推荐:
其他类似问题
空空如也的相关知识
&#xe675;换一换
回答问题,赢新手礼包&#xe6b9;
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。行家说说如何把小米3手机照片导入电脑
输入手机号码,报价结果将发送到您手机
装修顾问-馨馨
4年行业经验,24h可咨询
10秒闪电通过好友
报价短信已发送到您的手机
因材料品牌及工程量不同,具体报价以量房实测为准
稍候装修管家将回电您,免费提供装修咨询服务
您的装修预算约
*装修管家将回电您,免费提供装修咨询服务
*装修管家将回电您,免费提供装修咨询服务
*因材料品牌及工程量不同,具体报价以量房实测为准
装修顾问 -馨馨
(四年装修行业经验)
微信扫一扫
3.&您家小区名称 :&&
请选择您家的装修时间
行家说说如何把小米3手机照片导入电脑
提问者:凌歌韵| 地点:
| 浏览次数:
1396| 时间:
我来帮他解答
还可以输入1500字
已有4条回答
回答数:6727
| 被采纳数:3
1、在电脑与小米3上都登陆自己的QQ。
2、登陆之后在手机QQ页面的最下方的选项中点击动态选项。
3、在动态选项页面中下方有一个文件/照片助手,点击进入。
4、进入后的页面有几个选项我们既可以将文件传输到电脑,还能够将手机中的文件备份到云端。
5、选择第一个选项,点击并进入。
6、在显示的页面下方找到最后一个文件选项,如果没有使用QQ下载任何东西的话这个页面就是空白页面。
7、然后点击最左上方的“本地文件”,显示的就是手机中所有的文件/照片了,选择好自己需呀传输的文件/照片后点击发送就可以了。
回答数:121452
| 被采纳数:217
你好!很高兴为你解答,小米手机有个&文件管理&,下面有个&远程管理&,打开,然后就可以用你的电脑访问小米手机了。方便吧。支持小米。懒人做法。手机登入qq 电脑登入qq然后可以利用qq传文件。下载小米手机电脑客户端。然后连接手机就可以批量导入照片,希望对你有帮助。
回答数:55339
| 被采纳数:126
用手机登录QQ,同时在电脑上登录同一个QQ。
在手机的联系人界面,找到“我的设备”,点击打开。
点击“我的电脑”,进入后,点击左下角的图片图标。然后选中你想要发送到电脑上的图片并点击右下角的“发送”就会发送到电脑上。
接着电脑收到图片后,右键单击该图片,选中“另存为”,就会保存在电脑上了。
回答数:60209
| 被采纳数:45
把小米3手机照片导入电脑的方法:
一丶连接电脑:
1.进入【设置】。
2.进入【开发人员选项】。
3.打开【USB调试】。
4.然后数据线连接电脑。(切记一定要用原装数据线)
5.连接上电脑以后再看手机屏幕,点击打开USB(MTP媒体)即可。
二丶找到照片位置,并将照片拉到电脑上即可。
1.进入【DCIM】。
2.进入【Camera】,里面即是视频和照片。
3.右击照片,点选剪切或者复制,黏贴到桌面即可。Android中利用Camera与Matrix实现3D效果详解 - 简书
Android中利用Camera与Matrix实现3D效果详解
本文行文目录:
一、Camera与Matrix初步认识
二、Camera与Matrix旋转效果拆分介绍
三、Camera与Matrix实现立体3D切换效果
【本文简书地址:】
一、Camera与Matrix初步认识
android中一共有两个Camera,分别为:
android.graphics.Camera
android.hardware.Camera
今天我们要说的是第一个Camera,第二个主要应用在相机开发中。
首先看下这个类的官方介绍:
A camera instance can be used to compute 3D transformations and generate a matrix that can be applied, for instance, on a.
一个照相机实例可以被用于计算3D变换,生成一个可以被使用的Matrix矩阵,一个实例,用在画布上。
Camera内部机制实际上还是opengl,不过大大简化了使用。有了感性的认识之后,我们再来看下它的常用API定义:
Camera() 创建一个没有任何转换效果的新的Camera实例
applyToCanvas(Canvas canvas) 根据当前的变换计算出相应的矩阵,然后应用到制定的画布上
getLocationX() 获取Camera的x坐标
getLocationY() 获取Camera的y坐标
getLocationZ() 获取Camera的z坐标
getMatrix(Matrixmatrix) 获取转换效果后的Matrix对象
restore() 恢复保存的状态
rotate(float x, float y, float z) 沿X、Y、Z坐标进行旋转
rotateX(float deg)
rotateY(float deg)
rotateZ(float deg)
save() 保存状态
setLocation(float x, float y, float z)
translate(float x, float y, float z)沿X、Y、Z轴进行平移
不得不说下Matrix,它是Android提供的一个矩阵工具类,是一个3x3的矩阵,一般要实现2D的旋转(绕z轴旋转)、缩放、平移、倾斜用这个作用于画布,这四种操作的内部实现过程都是通过matrix.setValues(…)来设置矩阵的值来达到变换的效果。
setTranslate(floatdx,floatdy):控制Matrix进行平移
setSkew(floatkx,floatky,floatpx,floatpy):控制Matrix以px,py为轴心进行倾斜,kx,ky为X,Y方向上的倾斜距离
setRotate(floatdegress):控制Matrix进行旋转,degress控制旋转的角度
setRorate(floatdegress,floatpx,floatpy):设置以px,py为轴心进行旋转,degress控制旋转角度
setScale(floatsx,floatsy):设置Matrix进行缩放,sx,sy控制X,Y方向上的缩放比例
setScale(floatsx,floatsy,floatpx,floatpy):设置Matrix以px,py为轴心进行缩放,sx,sy控制X,Y方向上的缩放比例
API提供了set、post和pre三种操作,下面这个重点看下,之后效果会用到
post是后乘,当前的矩阵乘以参数给出的矩阵。可以连续多次使用post,来完成所需的整个变换。
pre是前乘,参数给出的矩阵乘以当前的矩阵。所以操作是在当前矩阵的最前面发生的。
好了,上面基本方法先简单了解下,现在让我们看看能做出什么效果,之后回头再重新看看会有更深的理解。
二、Camera与Matrix旋转效果拆分介绍
Camera坐标系研究
Camera的坐标系是左手坐标系。当手机平整的放在桌面上,X轴是手机的水平方向,Y轴是手机的竖直方向,Z轴是垂直于手机向里的那个方向。
左手坐标系
camera位于坐标点(0,0),也就是视图的左上角;
camera.translate(10,50,-180)的意思是把观察物体右移(+x)10,上移(+y)50,向-z轴移180(即让物体接近camera,这样物体将会变大);
public class CameraTestView extends View{
public CameraTestView(Context context, AttributeSet attrs) {
super(context, attrs);
camera = new Camera();
matrix = new Matrix();
setBackgroundColor(Color.parseColor("#3f51b5"));
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setStyle(Style.FILL);
paint.setColor(Color.parseColor("#ff4081"));
protected void onDraw(Canvas canvas) {
canvas.drawCircle(60, 60, 60, paint);
&RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
tools:context=".MainActivity" &
&com.example.matrixcamera.CameraTestView
android:layout_width="200dp"
android:layout_height="200dp"
&/RelativeLayout&
protected void onDraw(Canvas canvas) {
matrix.reset();
camera.save();
camera.translate(10, 50, -180);
camera.getMatrix(matrix);
camera.restore();
canvas.concat(matrix);
canvas.drawCircle(60, 60, 60, paint);
translate(10, 50, -180)
camera.rotateX(60)的意思是绕X轴顺时针旋转60度。举例来说,如果物体中间线和X轴重合的话,绕X轴顺时针旋转60度就是指物体上半部分向里翻转,下半部分向外翻转;
protected void onDraw(Canvas canvas) {
Options option = new Options();
option.inJustDecodeBounds =
BitmapFactory.decodeResource(getResources(), R.drawable.aa,option);
option.inSampleSize = calculateInSampleSize(option, getWidth()/2, getHeight()/2);
option.inJustDecodeBounds =
canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.aa,option), matrix, paint);
private int calculateInSampleSize(BitmapFactory.Options options,
int reqWidth, int reqHeight) {
final int height = options.outH
final int width = options.outW
int inSampleSize = 1;
if (height & reqHeight || width & reqWidth) {
final int halfHeight = height / 2;
final int halfWidth = width / 2;
while ((halfHeight / inSampleSize) & reqHeight
&& (halfWidth / inSampleSize) & reqWidth) {
inSampleSize *= 2;
return inSampleS
未旋转图片
protected void onDraw(Canvas canvas) {
matrix.reset();
camera.save();
camera.rotateX(60);
camera.getMatrix(matrix);
camera.restore();
matrix.preTranslate(-getWidth()/2, -getHeight()/2);
matrix.postTranslate(getWidth()/2, getHeight()/2);
Options option = new Options();
option.inJustDecodeBounds =
BitmapFactory.decodeResource(getResources(), R.drawable.aa,option);
option.inSampleSize = calculateInSampleSize(option, getWidth()/2, getHeight()/2);
option.inJustDecodeBounds =
canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.aa,option), matrix, paint);
绕X轴顺时针旋转60度
camera.rotateY(60)的意思是绕Y轴顺时针旋转60度。举例来说,如果物体中间线和Y轴重合的话,绕Y轴顺时针旋转60度就是指物体左半部分向外翻转,右半部分向里翻转;
protected void onDraw(Canvas canvas) {
camera.rotateY(60);
绕Y轴顺时针旋转60度
camera.rotateZ(60)的意思是绕Z轴逆时针旋转60度。举例来说,如果物体中间线和Z轴重合的话,绕Z轴顺时针旋转60度就是物体上半部分向左翻转,下半部分向右翻转。
protected void onDraw(Canvas canvas) {
camera.rotateZ(60);
绕Z轴逆时针旋转60度
注意:下面两行代码的意思是先将旋转中心移动到(0,0)点,因为Matrix总是用0,0点作为旋转点,旋转之后将视图放回原来的位置。
matrix.preTranslate(-getWidth()/2, -getHeight()/2);
matrix.postTranslate(getWidth()/2, getHeight()/2);
API DEMOS中的例子,大家可以看下效果加深理解:
* An animation that rotates the view on the Y axis between two specified angles.
* This animation also adds a translation on the Z axis (depth) to improve the effect.
public class Rotate3dAnimation extends Animation {
private final float mFromD
private final float mToD
private final float mCenterX;
private final float mCenterY;
private final float mDepthZ;
private final boolean mR
private Camera mC
* Creates a new 3D rotation on the Y axis. The rotation is defined by its
* start angle and its end angle. Both angles are in degrees. The rotation
* is performed around a center point on the 2D space, definied by a pair
* of X and Y coordinates, called centerX and centerY. When the animation
* starts, a translation on the Z axis (depth) is performed. The length
* of the translation can be specified, as well as whether the translation
* should be reversed in time.
* @param fromDegrees the start angle of the 3D rotation
* @param toDegrees the end angle of the 3D rotation
* @param centerX the X center of the 3D rotation
* @param centerY the Y center of the 3D rotation
* @param reverse true if the translation should be reversed, false otherwise
public Rotate3dAnimation(float fromDegrees, float toDegrees,
float centerX, float centerY, float depthZ, boolean reverse) {
mFromDegrees = fromD
mToDegrees = toD
mCenterX = centerX;
mCenterY = centerY;
mDepthZ = depthZ;
mReverse =
public void initialize(int width, int height, int parentWidth, int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
mCamera = new Camera();
protected void applyTransformation(float interpolatedTime, Transformation t) {
final float fromDegrees = mFromD
float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);
final float centerX = mCenterX;
final float centerY = mCenterY;
final Camera camera = mC
final Matrix matrix = t.getMatrix();
camera.save();
if (mReverse) {
camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
camera.rotateY(degrees);
camera.getMatrix(matrix);
camera.restore();
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
iv.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
int width = getWindowManager().getDefaultDisplay().getWidth();
int height = getWindowManager().getDefaultDisplay().getHeight();
Rotate3dAnimation animation = new Rotate3dAnimation(0, 360, width/2, height/2,0, true);
animation.setInterpolator(new AccelerateDecelerateInterpolator());
animation.setDuration(2000);
animation.setFillAfter(true);
iv.startAnimation(animation);
三、Camera与Matrix实现立体3D切换效果
最后我们要实现的效果(录得图像有点渣。。。):
OK,有了前面的铺垫,我们开始实现下这个效果吧。
我们分三步来实现下:
1、首先,初始化控件,进行测量和布局。
这里我们整个容器继承自ViewGroup,来看看吧,初始化Camera和Matrix,因为涉及到滚动,我们用个辅助工具Scroller:
private void init() {
mCamera = new Camera();
mMatrix = new Matrix();
if (mScroller == null){
mScroller = new Scroller(getContext(),new LinearInterpolator());
测量控件自身以及子控件:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int measureWidth = MeasureSpec.getSize(widthMeasureSpec);
int measureHeight = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(measureWidth,measureHeight);
MarginLayoutParams params = (MarginLayoutParams) this.getLayoutParams();
int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
measureWidth- (params.leftMargin + params.rightMargin), MeasureSpec.EXACTLY);
int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
measureHeight - (params.topMargin + params.bottomMargin), MeasureSpec.EXACTLY);
measureChildren(childWidthMeasureSpec,childHeightMeasureSpec);
mHeight = getMeasuredHeight();
scrollTo(0,mStartScreen * mHeight);
布局子控件:
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
MarginLayoutParams params = (MarginLayoutParams) this.getLayoutParams();
int childTop = 0;
for (int i = 0; i &getChildCount() ; i++) {
View child = getChildAt(i);
if (child.getVisibility() != GONE){
if (i==0){
childTop+=params.topM
child.layout(params.leftMargin, childTop,
child.getMeasuredWidth() + params.leftMargin, childTop + child.getMeasuredHeight());
childTop = childTop + child.getMeasuredHeight();
到这里,我们初始化的过程就完成了,各个子控件从上到下依次排列,而整个控件大小是一定的,界面上也就只显示一个子控件,在整个控件滚动的时候形成界面切换效果。
2、重写dispatchDraw方法,实现3D界面切换效果
在dispatchDraw方法中,重新对各个子控件用Camera和Matrix进行矩阵转换,以此在滚动中实现立体效果,这也是我们今天要了解的重点,根据我们之前了解的,我们将Camera沿着X轴进行一定的角度旋转,两个控件在滚动过程中就会形成一个夹角,从而出现立体效果,当然,一定要注意的是要将控件中心点移至0,0点,否则会看不到效果:
protected void dispatchDraw(Canvas canvas) {
for (int i = 0;i&getChildCount();i++){
drawScreen(canvas,i,getDrawingTime());
private void drawScreen(Canvas canvas, int screen, long drawingTime) {
// 得到当前子View的高度
final int height = getHeight();
final int scrollHeight = screen *
final int scrollY = this.getScrollY();
// 偏移量不足的时
if (scrollHeight & scrollY + height || scrollHeight + height & scrollY) {
final View child = getChildAt(screen);
final int faceIndex =
final float currentDegree = getScrollY() * (angle / getMeasuredHeight());
final float faceDegree = currentDegree - faceIndex *
if (faceDegree & 90 || faceDegree & -90) {
final float centerY = (scrollHeight & scrollY) ? scrollHeight + height
final float centerX = getWidth() / 2;
final Camera camera = mC
final Matrix matrix = mM
canvas.save();
camera.save();
camera.rotateX(faceDegree);
camera.getMatrix(matrix);
camera.restore();
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
canvas.concat(matrix);
drawChild(canvas, child, drawingTime);
canvas.restore();
3、重写onInterceptTouchEvent和onTouchEvent方法实现手指滑动界面切换
在onTouchEvent方法中,根据手指移动的距离,调用ScrollBy()方法进行持续的滚动,在手指抬起的时候,判断当前的速率,如果大于一定值或超过子控件的1/2时,转换当前状态进行界面切换,否则回滚回当前页面。这里在onInterceptTouchEvent简单的拦截了当前事件,而如果我们需要子控件处理事件时还需要进行处理。
public boolean onTouchEvent(MotionEvent event) {
if (mTracker == null){
mTracker = VelocityTracker.obtain();
mTracker.addMovement(event);
float y = event.getY();
switch (event.getAction()){
case MotionEvent.ACTION_DOWN:
if (!mScroller.isFinished()){
mScroller.setFinalY(mScroller.getCurrY());
mScroller.abortAnimation();
scrollTo(0,getScrollY());
MotionEvent.ACTION_MOVE:
= (int) (mDownY - y);
if (mScroller.isFinished()){
recycleMove(disY);
case MotionEvent.ACTION_UP:
mTracker.computeCurrentVelocity(1000);
float velocitY = mTracker.getYVelocity();
//滑动的速度大于规定的速度,或者向上滑动时,上一页页面展现出的高度超过1/2。则设定状态为STATE_PRE
if(velocitY & standerSpeed || ((getScrollY() + mHeight / 2) / mHeight & mStartScreen)){
STATE_PRE;
}else if(velocitY & -standerSpeed
|| ((getScrollY() + mHeight / 2) / mHeight & mStartScreen)){
//滑动的速度大于规定的速度,或者向下滑动时,下一页页面展现出的高度超过1/2。则设定状态为STATE_NEXT
STATE_NEXT;
STATE_NORMAL;
//根据STATE进行相应的变化
changeByState();
if (mTracker != null){
mTracker.recycle();
mTracker =
//返回true,消耗点击事件
四、最后,附上源码
public class Custom3DView extends ViewGroup{
private Camera mC
private Matrix mM
private int mStartScreen = 1;//开始时的item位置
private float mDownY = 0;
private static final int standerSpeed = 2000;
private int mCurScreen = 1;//当前item的位置
int mHeight = 0;//控件的高
private VelocityTracker mT
private Scroller mS
// 旋转的角度,可以进行修改来观察效果
private float angle = 90;
//三种状态
private static final int STATE_PRE = 0;
private static final int STATE_NEXT = 1;
private static final int STATE_NORMAL = 2;
private int STATE = -1;
private float resistance = 1.6f;//滑动阻力
public Custom3DView(Context context) {
this(context,null);
public Custom3DView(Context context, AttributeSet attrs) {
this(context, attrs,0);
public Custom3DView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
private void init() {
mCamera = new Camera();
mMatrix = new Matrix();
if (mScroller == null){
mScroller = new Scroller(getContext(),new LinearInterpolator());
protected LayoutParams generateDefaultLayoutParams() {
return new MarginLayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
protected LayoutParams generateLayoutParams(LayoutParams p) {
return new MarginLayoutParams(p);
public LayoutParams generateLayoutParams(AttributeSet attrs) {
return new MarginLayoutParams(getContext(), attrs);
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int measureWidth = MeasureSpec.getSize(widthMeasureSpec);
int measureHeight = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(measureWidth,measureHeight);
MarginLayoutParams params = (MarginLayoutParams) this.getLayoutParams();
int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
measureWidth- (params.leftMargin + params.rightMargin), MeasureSpec.EXACTLY);
int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
measureHeight - (params.topMargin + params.bottomMargin), MeasureSpec.EXACTLY);
measureChildren(childWidthMeasureSpec,childHeightMeasureSpec);
mHeight = getMeasuredHeight();
scrollTo(0,mStartScreen * mHeight);
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
MarginLayoutParams params = (MarginLayoutParams) this.getLayoutParams();
int childTop = 0;
for (int i = 0; i &getChildCount() ; i++) {
View child = getChildAt(i);
if (child.getVisibility() != GONE){
if (i==0){
childTop+=params.topM
child.layout(params.leftMargin, childTop,
child.getMeasuredWidth() + params.leftMargin, childTop + child.getMeasuredHeight());
childTop = childTop + child.getMeasuredHeight();
protected void dispatchDraw(Canvas canvas) {
for (int i = 0;i&getChildCount();i++){
drawScreen(canvas,i,getDrawingTime());
public boolean onInterceptTouchEvent(MotionEvent ev) {
switch (ev.getAction()){
case MotionEvent.ACTION_DOWN:
public boolean onTouchEvent(MotionEvent event) {
if (mTracker == null){
mTracker = VelocityTracker.obtain();
mTracker.addMovement(event);
float y = event.getY();
switch (event.getAction()){
case MotionEvent.ACTION_DOWN:
if (!mScroller.isFinished()){
mScroller.setFinalY(mScroller.getCurrY());
mScroller.abortAnimation();
scrollTo(0,getScrollY());
MotionEvent.ACTION_MOVE:
= (int) (mDownY - y);
if (mScroller.isFinished()){
recycleMove(disY);
case MotionEvent.ACTION_UP:
mTracker.computeCurrentVelocity(1000);
float velocitY = mTracker.getYVelocity();
//滑动的速度大于规定的速度,或者向上滑动时,上一页页面展现出的高度超过1/2。则设定状态为STATE_PRE
if(velocitY & standerSpeed || ((getScrollY() + mHeight / 2) / mHeight & mStartScreen)){
STATE_PRE;
}else if(velocitY & -standerSpeed
|| ((getScrollY() + mHeight / 2) / mHeight & mStartScreen)){
//滑动的速度大于规定的速度,或者向下滑动时,下一页页面展现出的高度超过1/2。则设定状态为STATE_NEXT
STATE_NEXT;
STATE_NORMAL;
//根据STATE进行相应的变化
changeByState();
if (mTracker != null){
mTracker.recycle();
mTracker =
//返回true,消耗点击事件
private void changeByState() {
switch (STATE) {
case STATE_NORMAL:
toNormalAction();
case STATE_PRE:
toPrePager();
case STATE_NEXT:
toNextPager();
invalidate();
private void toNormalAction() {
int startY;
STATE = STATE_NORMAL;
startY = getScrollY();
delta = mHeight * mStartScreen - getScrollY();
duration = (Math.abs(delta)) * 4;
mScroller.startScroll(0, startY, 0, delta, duration);
private void toPrePager() {
int startY;
STATE = STATE_PRE;
//增加新的页面
//mScroller开始的坐标
startY = getScrollY() + mH
setScrollY(startY);
//mScroller移动的距离
delta = -(startY - mStartScreen * mHeight);
duration = (Math.abs(delta)) * 2;
mScroller.startScroll(0, startY, 0, delta, duration);
private void toNextPager() {
int startY;
STATE = STATE_NEXT;
setNext();
startY = getScrollY() - mH
setScrollY(startY);
delta = mHeight * mStartScreen - startY;
duration = (Math.abs(delta)) * 2;
mScroller.startScroll(0, startY, 0, delta, duration);
private void setNext(){
mCurScreen = (mCurScreen + 1) % getChildCount();
int childCount = getChildCount();
View view = getChildAt(0);
removeViewAt(0);
addView(view, childCount - 1);
private void setPre(){
mCurScreen = ((mCurScreen - 1) + getChildCount()) % getChildCount();
int childCount = getChildCount();
View view = getChildAt(childCount - 1);
removeViewAt(childCount - 1);
addView(view, 0);
private void recycleMove(int delta) {
delta = delta % mH
delta = (int) (delta / resistance);
if (Math.abs(delta) & mHeight / 4) {
if (getScrollY() &= 0 && mCurScreen &= 0
&& delta&=0){
if (mHeight*mCurScreen &= getScrollY()
&& mCurScreen == getChildCount()-1 && delta&= 0){
scrollBy(0, delta);
if (getScrollY() & 8 && mCurScreen != 0) {
scrollBy(0, mHeight);
} else if (getScrollY() & (getChildCount() - 1) * mHeight - 8) {
setNext();
scrollBy(0, -mHeight);
public void computeScroll() {
if (mScroller.computeScrollOffset()) {
scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
postInvalidate();
* 画单个页面
* @param canvas
* @param screen
* @param drawingTime
private void drawScreen(Canvas canvas, int screen, long drawingTime) {
// 得到当前子View的高度
final int height = getHeight();
final int scrollHeight = screen *
final int scrollY = this.getScrollY();
// 偏移量不足的时
if (scrollHeight & scrollY + height || scrollHeight + height & scrollY) {
final View child = getChildAt(screen);
final int faceIndex =
final float currentDegree = getScrollY() * (angle / getMeasuredHeight());
final float faceDegree = currentDegree - faceIndex *
if (faceDegree & 90 || faceDegree & -90) {
final float centerY = (scrollHeight & scrollY) ? scrollHeight + height
final float centerX = getWidth() / 2;
final Camera camera = mC
final Matrix matrix = mM
canvas.save();
camera.save();
camera.rotateX(faceDegree);
camera.getMatrix(matrix);
camera.restore();
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
canvas.concat(matrix);
drawChild(canvas, child, drawingTime);
canvas.restore();
&com.example.matrixcamera.Custom3DView
android:layout_height="250dp"
android:layout_width="250dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_centerInParent="true"
&ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/aa"
&ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/bb"
&ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/cc"
&ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/dd"
&/com.example.matrixcamera.Custom3DView&
程序员一枚,专注移动开发,热爱分享,喜欢学习,努力进步。个人首页:http://zkcoding.top
CSDN:http://blog.csdn.net/zhangke3016
github:https://github.com/zhangke3016
Matrix的数学原理 在Android中,如果你用Matrix进行过图像处理,那么一定知道Matrix这个类。Android中的Matrix是一个3 x 3的矩阵,其内容如下: 从字面上理解,矩阵中的MSCALE用于处理缩放变换,MSKEW用于处理错切变换,MTRANS用...
前言 前段时间读到一篇文章,作者通过自定义View实现了一个高仿小米时钟,其中的3D效果很是吸引我,于是抽时间学习了一下,现在总结出来,和大家分享。 正文 想要在Android上实现3D效果,其实并没有想象中那么复杂,我们需要运用两样东西:Camera和Matrix,这里的...
1、引子 笔者刚开始工作时,做的第一个模块是手机中的launcher,launcher可自由选择滑屏效果,甚至还有三D效果,酷炫的动画让人震惊同时也感到非常迷惑,这动画效果怎么实现的呢?帧动画?补间动画还是属性动画,都不能实现以上效果。它们都与本文中提到的Camera相关 ...
1 3D图形仿射变换 OpenGL中模型的平移、选择和缩放操作都可以通过一个仿射矩阵和该模型的所有顶点列向量相乘获得。iOS中GLKit提供矩阵的初始化和计算方法,不必手写各个分量,但是深入理解其原理对学习3D图形变换很有帮助。 1.1 单位矩阵(Identity Matr...
CSDN博客 img cquwentao android matrix 最全方法详解与进阶(完整篇) 发表于 16:43:27 1385人阅读 分类: android绘制 1 概述 这里我们会详细讲解matrix的各个方法,以及它的用法。matrix叫做矩...
花季少女为何闷闷不乐?原因竟然是。。。 本人是大三的妹子,饱受多年便秘的折磨,今天把我的经验分享给大家,跟便秘战斗已经有两年多了,现在差不多一两天就拉一次粑粑。以前都是一周那样。以前喝中药,但是不喝就会恢复原样,不经常吃一些含有芦荟之类的肠清茶,医生说那些东西吃多了肠子要变...
今日有幸在群里遇见了一位少年,风华正茂意气风发,颇有几分我年少时的神色。无奈其一进群就指点江山、激昂文字,多少有些轻狂。恰好当时我人正无聊,和他聊了几句,他却是受不得自认为的“委屈”退群了。 其实我个人对那少年倒没有多大的反感,年轻人有点锐气很正常。只是作为一个群的管理,群...
他向我抖搂了行业秘密,玩老虎机,就是一种与老千博弈的过程。所有老虎机的赔率都是可以调节的,由机房操控。 全民故事计划的第200个故事 一 认识秦辉是在1992年。当时,我6岁,秦辉8岁,都是第一天上小学。他的母亲拉着他的手,我的母亲拉着我的手。 二位母亲打招呼,我和秦辉注视...
朋友们晚上好,看到这个标题我相信有很多父母愤愤不平,说自己明明为了孩子牺牲了太多,自己辛苦工作,省吃俭用,让孩子吃好的喝好的,孩子的健康问题还有教育问题怎么能都怪到自己头上了呢?其实,我也是这么认为的,从我自身考虑,我的父母!是什么样的,但是细细想来,父母辛辛苦苦二十余载,...

我要回帖

更多关于 camerawindow 的文章

 

随机推荐