当前位置: 首页>>代码示例>>Java>>正文


Java Paint.Cap方法代码示例

本文整理汇总了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;
        }
    }
}
 
开发者ID:yuriy-budiyev,项目名称:circular-progress-bar,代码行数:25,代码来源:CircularProgressBar.java

示例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;
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:26,代码来源:PCanvas.java

示例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;
        }
    }
}
 
开发者ID:yuriy-budiyev,项目名称:circular-progress-bar,代码行数:16,代码来源:CircularProgressBar.java

示例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]);
    }
}
 
开发者ID:VRLoser,项目名称:greendao_expand,代码行数:13,代码来源:CircleProgressView.java

示例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;
    }
}
 
开发者ID:harjot-oberai,项目名称:VectorMaster,代码行数:13,代码来源:Utils.java

示例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;
  }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:12,代码来源:ShapeStroke.java

示例7: getCap

import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Cap getCap() {
    return mCap;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:CircleProgressBar.java

示例8: setCap

import android.graphics.Paint; //导入方法依赖的package包/类
public void setCap(Paint.Cap cap) {
    mCap = cap;
    mProgressPaint.setStrokeCap(cap);
    mProgressBackgroundPaint.setStrokeCap(cap);
    invalidate();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:CircleProgressBar.java

示例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);
}
 
开发者ID:razerdp,项目名称:AnimatedPieView,代码行数:11,代码来源:AnimatedPieViewConfig.java

示例10: strokeCap

import android.graphics.Paint; //导入方法依赖的package包/类
public PaintScript strokeCap(Paint.Cap cap) {
    paint.setStrokeCap(cap);
    return this;
}
 
开发者ID:52inc,项目名称:CanvasScript,代码行数:5,代码来源:PaintScript.java

示例11: setForegroundStrokeCap

import android.graphics.Paint; //导入方法依赖的package包/类
/**
 * Foreground stroke cap
 */
public void setForegroundStrokeCap(@NonNull Paint.Cap cap) {
    mForegroundStrokePaint.setStrokeCap(cap);
    invalidateForegroundStrokeCapAngle();
    invalidate();
}
 
开发者ID:yuriy-budiyev,项目名称:circular-progress-bar,代码行数:9,代码来源:CircularProgressBar.java

示例12: strokeCap

import android.graphics.Paint; //导入方法依赖的package包/类
public CanvasScript strokeCap(Paint.Cap cap) {
    createPaintIfNull();
    currentPaint.setStrokeCap(cap);
    return this;
}
 
开发者ID:52inc,项目名称:CanvasScript,代码行数:6,代码来源:CanvasScript.java

示例13: getSpinnerStrokeCap

import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Cap getSpinnerStrokeCap() {
    return mSpinnerStrokeCap;
}
 
开发者ID:VRLoser,项目名称:greendao_expand,代码行数:4,代码来源:CircleProgressView.java

示例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);
}
 
开发者ID:VRLoser,项目名称:greendao_expand,代码行数:8,代码来源:CircleProgressView.java

示例15: getStrokeLineCap

import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Cap getStrokeLineCap() {
    return strokeLineCap;
}
 
开发者ID:harjot-oberai,项目名称:VectorMaster,代码行数:4,代码来源:PathModel.java


注:本文中的android.graphics.Paint.Cap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。