packages\apps\Launcher3\src\com\android\launcher3\PagedView.java
@Override
protected void dispatchDraw(Canvas canvas) {}
}
void drawScreenCube(Canvas canvas, int screen, long drawingTime ,int select) {
final int width = getWidth();
System.out.println("width --- " + getWidth());
final int scrollWidth = screen * width;
final int scrollX = this.getScrollX();
if(scrollWidth > scrollX + width || scrollWidth + width < scrollX) {
return;
}
final View child = getPageAt(screen);
final int faceIndex = screen;
float faceDegree ;
faceDegree = (this.getScrollX() - faceIndex *width)*180/width/2;
final float currentDegree = getScrollX() * (angle / getMeasuredWidth());
if(faceDegree > 90 || faceDegree < -90) {
return;
}
final float centerX = (scrollWidth < scrollX)?scrollWidth + width:scrollWidth;
final float centerY = getHeight()/2;
final Camera camera = mCamera;
final Matrix matrix = mMatrix;
canvas.save();
camera.save();
camera.rotateY(-faceDegree);
camera.getMatrix(matrix);
camera.restore();
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
canvas.concat(matrix);
drawChild(canvas, child, drawingTime);
canvas.restore();
}