本文整理汇总了Java中android.graphics.Paint.Cap方法的典型用法代码示例。如果您正苦于以下问题:Java Paint.Cap方法的具体用法?Java Paint.Cap怎么用?Java Paint.Cap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.Paint
的用法示例。
在下文中一共展示了Paint.Cap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invalidateForegroundStrokeCapAngle
import android.graphics.Paint; //导入方法依赖的package包/类
private void invalidateForegroundStrokeCapAngle() {
Paint.Cap strokeCap = mForegroundStrokePaint.getStrokeCap();
if (strokeCap == null) {
mForegroundStrokeCapAngle = 0f;
return;
}
switch (strokeCap) {
case SQUARE:
case ROUND: {
float r = mDrawRect.width() / 2f;
if (r != 0) {
mForegroundStrokeCapAngle = 90f * mForegroundStrokePaint.getStrokeWidth() / (float) Math.PI / r;
} else {
mForegroundStrokeCapAngle = 0f;
}
break;
}
case BUTT:
default: {
mForegroundStrokeCapAngle = 0f;
break;
}
}
}
示例2: strokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
@ProtoMethod(description = "Sets a stroke cap", example = "")
@ProtoMethodParam(params = {"cap"})
public PCanvas strokeCap(String cap) {
Paint.Cap c = Paint.Cap.SQUARE;
switch (cap) {
case "round":
c = Paint.Cap.ROUND;
break;
case "butt":
c = Paint.Cap.BUTT;
break;
case "square":
c = Paint.Cap.SQUARE;
break;
}
mPaintStroke.setStrokeCap(c);
return this;
}
示例3: getStrokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
@NonNull
private static Paint.Cap getStrokeCap(int value) {
switch (value) {
case 2: {
return Paint.Cap.SQUARE;
}
case 1: {
return Paint.Cap.ROUND;
}
case 0:
default: {
return Paint.Cap.BUTT;
}
}
}
示例4: setBarStrokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
/**
* @param _barStrokeCap The stroke cap of the progress bar.
*/
public void setBarStrokeCap(Paint.Cap _barStrokeCap) {
mBarStrokeCap = _barStrokeCap;
mBarPaint.setStrokeCap(_barStrokeCap);
if (mBarStrokeCap != Paint.Cap.BUTT) {
mShaderlessBarPaint = new Paint(mBarPaint);
mShaderlessBarPaint.setShader(null);
mShaderlessBarPaint.setColor(mBarColors[0]);
}
}
示例5: getLineCapFromString
import android.graphics.Paint; //导入方法依赖的package包/类
public static Paint.Cap getLineCapFromString(String value) {
switch (value) {
case "0":
return Paint.Cap.BUTT;
case "1":
return Paint.Cap.ROUND;
case "2":
return Paint.Cap.SQUARE;
default:
return Paint.Cap.BUTT;
}
}
示例6: toPaintCap
import android.graphics.Paint; //导入方法依赖的package包/类
Paint.Cap toPaintCap() {
switch (this) {
case Butt:
return Paint.Cap.BUTT;
case Round:
return Paint.Cap.ROUND;
case Unknown:
default:
return Paint.Cap.SQUARE;
}
}
示例7: getCap
import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Cap getCap() {
return mCap;
}
示例8: setCap
import android.graphics.Paint; //导入方法依赖的package包/类
public void setCap(Paint.Cap cap) {
mCap = cap;
mProgressPaint.setStrokeCap(cap);
mProgressBackgroundPaint.setStrokeCap(cap);
invalidate();
}
示例9: setStrokePaintCap
import android.graphics.Paint; //导入方法依赖的package包/类
/**
* 设置笔刷样式
*
* @param strokePaintCap 设置笔刷样式
*/
public AnimatedPieViewConfig setStrokePaintCap(@NonNull Paint.Cap strokePaintCap) {
if (strokePaintCap == null) strokePaintCap = Paint.Cap.BUTT;
this.strokePaintCap = strokePaintCap;
return setReApply(true);
}
示例10: strokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
public PaintScript strokeCap(Paint.Cap cap) {
paint.setStrokeCap(cap);
return this;
}
示例11: setForegroundStrokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
/**
* Foreground stroke cap
*/
public void setForegroundStrokeCap(@NonNull Paint.Cap cap) {
mForegroundStrokePaint.setStrokeCap(cap);
invalidateForegroundStrokeCapAngle();
invalidate();
}
示例12: strokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
public CanvasScript strokeCap(Paint.Cap cap) {
createPaintIfNull();
currentPaint.setStrokeCap(cap);
return this;
}
示例13: getSpinnerStrokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Cap getSpinnerStrokeCap() {
return mSpinnerStrokeCap;
}
示例14: setSpinnerStrokeCap
import android.graphics.Paint; //导入方法依赖的package包/类
/**
* @param _spinnerStrokeCap The stroke cap of the progress bar in spinning mode.
*/
public void setSpinnerStrokeCap(Paint.Cap _spinnerStrokeCap) {
mSpinnerStrokeCap = _spinnerStrokeCap;
mBarSpinnerPaint.setStrokeCap(_spinnerStrokeCap);
}
示例15: getStrokeLineCap
import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Cap getStrokeLineCap() {
return strokeLineCap;
}