Skip to content

Commit

Permalink
修改动画播放按键都为圆角 (2017-04-15)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Apr 15, 2017
1 parent 9ee6641 commit 8580c45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,7 @@ public long getSeekOnStart() {
/**
* 从哪里开始播放
* 目前有时候前几秒有跳动问题,毫秒
* 需要在startPlayLogic之前,即播放开始之前
*/
public void setSeekOnStart(long seekOnStart) {
this.mSeekOnStart = seekOnStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.CornerPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
Expand Down Expand Up @@ -80,6 +81,7 @@ public ENPlayView(Context context, AttributeSet attrs) {
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setColor(lineColor);
mPaint.setStrokeWidth(lineWidth);
mPaint.setPathEffect(new CornerPathEffect(1));

mBgPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBgPaint.setStyle(Paint.Style.STROKE);
Expand Down Expand Up @@ -132,7 +134,8 @@ protected void onDraw(Canvas canvas) {
canvas.drawLine(mCenterX - mCircleRadius, mCenterY - 1.6f * mCircleRadius,
mCenterX - mCircleRadius, mCenterY + 1.6f * mCircleRadius, mPaint);

canvas.drawArc(mRectF, 0f, 180f / 0.3f * mFraction, false, mPaint);
if (mFraction != 0)
canvas.drawArc(mRectF, 0f, 180f / 0.3f * mFraction, false, mPaint);

canvas.drawArc(mBgRectF, -105 + 360 * mFraction, 360 * (1 - mFraction), false, mPaint);
} else if (mFraction <= 0.6) { //嗷~~ 下方曲线和三角形
Expand Down

0 comments on commit 8580c45

Please sign in to comment.