use of android.graphics.PathEffect in project WoWoViewPager by Nightonke.
the class WoWoPathView method onDraw.
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
PathEffect pathEffect = new DashPathEffect(new float[] { mPathLength, mPathLength }, (mPathLength - mPathLength * mProgress));
mPaint.setPathEffect(pathEffect);
canvas.save();
canvas.translate(getPaddingLeft(), getPaddingTop());
canvas.drawPath(mPath, mPaint);
if (headImageId != 0) {
mPathMeasure.getPosTan(mPathLength * mProgress, mBitmapPosition, mBitmapTan);
mMatrix.reset();
float degrees = (float) (Math.atan2(mBitmapTan[1], mBitmapTan[0]) * 180.0 / Math.PI);
mMatrix.postRotate(degrees, mBitmapOffsetX, mBitmapOffsetY);
mMatrix.postTranslate(mBitmapPosition[0] - mBitmapOffsetX, mBitmapPosition[1] - mBitmapOffsetY);
canvas.drawBitmap(mBitmap, mMatrix, null);
}
canvas.restore();
}
use of android.graphics.PathEffect in project UltimateAndroid by cymcsg.
the class DiscrollvablePathLayout method onDraw.
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
makeAndMeasurePath();
if (!isInEditMode()) {
// Apply the dash effect
float length = mPathMeasure.getLength();
PathEffect effect = new DashPathEffect(new float[] { length, length }, length * (1 - mRatio));
mPaint.setPathEffect(effect);
}
canvas.drawPath(mPath, mPaint);
}
use of android.graphics.PathEffect in project assertj-android by square.
the class AbstractPaintAssert method hasPathEffect.
public S hasPathEffect(PathEffect effect) {
isNotNull();
PathEffect actualEffect = actual.getPathEffect();
//
assertThat(actualEffect).overridingErrorMessage("Expected path effect <%s> but was <%s>.", effect, //
actualEffect).isSameAs(effect);
return myself;
}
Aggregations