Android翻页效果—电子书(3)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-17 14:39 点击:次
if ( (this.mTimeStep this.mMaxStep)) {
return false;
}
if (this.mPage == null) {
return false;
}
this.mDrawnTimeStep = this.mTimeStep;
View child = this.mPage.getChildAt(0);
child.getDrawingRect(this.mChildRect);
// this.mOuterOffsetX = (child.getLeft() - getLeft());
// this.mOuterOffsetY = (child.getTop() - getTop());
this.mOuterOffsetX = 0;
this.mOuterOffsetY = 0;
float width = this.mChildRect.right;
float height = this.mChildRect.bottom;
if(!mStepping){
this.mPivotX = (this.mTimeStep / 30.0f * width);
}
this.mForegroundPath = new Path();
this.mBackPagePath = new Path();
this.mBackgroundPath = new Path();
float slope = width / (this.mPivotX - width);
float y = this.mPivotX * slope;
this.mPageTurnCorner.x = 0.0F;
this.mPageTurnCorner.y = height;
this.mOppositeCorner.x = width;
this.mOppositeCorner.y = 0.0F;
float x0 = this.mPivotX;
float cornerIntersect = height * width / (height + width);
if ((this.mCorner & 0x1) != 0) {
this.mPageTurnCorner.x = width;
this.mOppositeCorner.x = 0.0F;
x0 = width - x0;
}
if ((this.mCorner & 0x2) != 0) {
this.mPageTurnCorner.y = 0.0F;
this.mOppositeCorner.y = height;
}
this.mPageDim.x = width;
this.mPageDim.y = height;
float page_slope;
if (this.mPivotX 2){
LinearGradient grad = new LinearGradient(
ex,ey,ex+(dx-ex)/4,ey+(dy-ey)/4,R.color.gray3,Color.TRANSPARENT,Shader.TileMode.CLAMP);
Paint p=new Paint();
p.setShader(grad);
// p.setAlpha(120);
canvas.drawPath(this.mBackgroundPath,p);
//end test
}
canvas.restore();
}
private void drawBackPage(Canvas canvas) {
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>