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


Java Paint.Style方法代码示例

本文整理汇总了Java中android.graphics.Paint.Style方法的典型用法代码示例。如果您正苦于以下问题:Java Paint.Style方法的具体用法?Java Paint.Style怎么用?Java Paint.Style使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.graphics.Paint的用法示例。


在下文中一共展示了Paint.Style方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: withDrawnDivider

import android.graphics.Paint; //导入方法依赖的package包/类
/**
 * Procedure meant to set the value for {@link #mDrawnDivider} optional parameter.
 * @param color the divider's target {@link Color} value.
 *              See {@link Paint#setColor(int)} for more information.
 * @param thickness the divider's target line thickness value. This value must be greater or equal than 0.
 *                  See {@link Paint#setStrokeWidth(float)} for more information.
 * @param style the divider's target {@link Paint.Style}.
 *              See {@link Paint#setStyle(Paint.Style)} for more information.
 * @param pathEffect the divider's target {@link PathEffect}.
 *                   See {@link Paint#setPathEffect(PathEffect)} for more information.
 * @return the same object builder object after setting the optional attribute.
 */
@NonNull
public DecorationSpecBuilder withDrawnDivider(@ColorInt int color,
                                              @FloatRange(from = 0, fromInclusive = false) float thickness,
                                              @Nullable final Paint.Style style,
                                              @Nullable final PathEffect pathEffect) {
    mDrawnDivider = new Paint();
    mDrawnDivider.setColor(color);
    mDrawnDivider.setStrokeWidth(thickness);
    if (style != null) {
        mDrawnDivider.setStyle(style);
    }
    if (pathEffect != null) {
        mDrawnDivider.setPathEffect(pathEffect);
    }
    return this;
}
 
开发者ID:Simdea,项目名称:gmlrva,代码行数:29,代码来源:SimpleDividerItemDecorationSpec.java

示例2: draw

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
public void draw(@NonNull final Canvas canvas, final CharSequence text,
                 @IntRange(from = 0) final int start,
                 @IntRange(from = 0) final int end,
                 final float x, final int top, final int y, final int bottom,
                 @NonNull final Paint paint) {
    Paint.Style style = paint.getStyle();
    int color = paint.getColor();

    paint.setStyle(Paint.Style.FILL);
    paint.setColor(this.color);

    canvas.drawRect(x, top, x + width, bottom, paint);

    paint.setStyle(style);
    paint.setColor(color);
}
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:18,代码来源:SpanUtils.java

示例3: drawLeadingMargin

import android.graphics.Paint; //导入方法依赖的package包/类
public void drawLeadingMargin(Canvas c, Paint p, int x, int dir,
                              int top, int baseline, int bottom,
                              CharSequence text, int start, int end,
                              boolean first, Layout layout) {
    Paint.Style style = p.getStyle();
    int color = p.getColor();

    p.setStyle(Paint.Style.FILL);
    p.setColor(this.color);

    c.drawRect(x, top, x + dir * stripeWidth, bottom, p);

    p.setStyle(style);
    p.setColor(color);
}
 
开发者ID:pan2yong22,项目名称:AndroidUtilCode-master,代码行数:16,代码来源:SpanUtils.java

示例4: drawFilledPath

import android.graphics.Paint; //导入方法依赖的package包/类
/**
 * Draws the provided path in filled mode with the provided color and alpha.
 * Special thanks to Angelo Suzuki (https://github.com/tinsukE) for this.
 *
 * @param c
 * @param filledPath
 * @param fillColor
 * @param fillAlpha
 */
protected void drawFilledPath(Canvas c, Path filledPath, int fillColor, int fillAlpha) {

    int color = (fillAlpha << 24) | (fillColor & 0xffffff);

    if (clipPathSupported()) {

        int save = c.save();

        c.clipPath(filledPath);

        c.drawColor(color);
        c.restoreToCount(save);
    } else {

        // save
        Paint.Style previous = mRenderPaint.getStyle();
        int previousColor = mRenderPaint.getColor();

        // set
        mRenderPaint.setStyle(Paint.Style.FILL);
        mRenderPaint.setColor(color);

        c.drawPath(filledPath, mRenderPaint);

        // restore
        mRenderPaint.setColor(previousColor);
        mRenderPaint.setStyle(previous);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:39,代码来源:LineRadarRenderer.java

示例5: draw

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
public void draw(@NonNull Canvas canvas) {

    final Paint.Style style;
    final int color;

    if (isChecked) {
        style = Paint.Style.FILL_AND_STROKE;
        color = checkedFillColor;
    } else {
        style = Paint.Style.STROKE;
        color = normalOutlineColor;
    }
    paint.setStyle(style);
    paint.setColor(color);

    final Rect bounds = getBounds();

    final float left = (bounds.width() - rectF.width()) / 2;
    final float top = (bounds.height() - rectF.height()) / 2;

    final float radius = rectF.width() / 8;

    final int save = canvas.save();
    try {

        canvas.translate(left, top);

        canvas.drawRoundRect(rectF, radius, radius, paint);

        if (isChecked) {
            canvas.drawPath(checkMarkPath, checkMarkPaint);
        }
    } finally {
        canvas.restoreToCount(save);
    }
}
 
开发者ID:noties,项目名称:Markwon,代码行数:38,代码来源:TaskListDrawable.java

示例6: CandlestickValue

import android.graphics.Paint; //导入方法依赖的package包/类
public CandlestickValue(float high, float low, float open, float close, Paint.Style mPaintStyle,
    int color) {
  this.high = high;
  this.low = low;
  this.open = open;
  this.close = close;
  this.mPaintStyle = mPaintStyle;
  this.color = color;
}
 
开发者ID:donglua,项目名称:JZAndroidChart,代码行数:10,代码来源:CandlestickValue.java

示例7: getPaint

import android.graphics.Paint; //导入方法依赖的package包/类
public static Paint getPaint(Paint.Style style, int color) {
    Paint mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setStyle(style);
    mPaint.setColor(color);
    mPaint.setTextSize(30);
    return mPaint;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:BaseUtils.java

示例8: drawLeadingMargin

import android.graphics.Paint; //导入方法依赖的package包/类
public void drawLeadingMargin(final Canvas c, final Paint p, final int x, final int dir,
                              final int top, final int baseline, final int bottom,
                              final CharSequence text, final int start, final int end,
                              final boolean first, final Layout layout) {
    Paint.Style style = p.getStyle();
    int color = p.getColor();

    p.setStyle(Paint.Style.FILL);
    p.setColor(this.color);

    c.drawRect(x, top, x + dir * stripeWidth, bottom, p);

    p.setStyle(style);
    p.setColor(color);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:SpanUtils.java

示例9: drawLeadingMargin

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
public void drawLeadingMargin(Canvas c, Paint p, int x, int dir, int top, int baseline, int bottom,
                              CharSequence text, int start, int end, boolean first, Layout layout) {
    Paint.Style style = p.getStyle();
    int paintColor = p.getColor();

    p.setStyle(Paint.Style.FILL);
    p.setColor(stripeColor);

    c.drawRect(x, top, x + dir * stripeWidth, bottom, p);

    p.setStyle(style);
    p.setColor(paintColor);
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:15,代码来源:CustomQuoteSpan.java

示例10: getHourHandStyle

import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Style getHourHandStyle() {
    return hourHandStyle;
}
 
开发者ID:devMadrit,项目名称:MKClockView,代码行数:4,代码来源:MKAnalogClockView.java

示例11: getDecreasingPaintStyle

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
public Paint.Style getDecreasingPaintStyle() {
    return mDecreasingPaintStyle;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:CandleDataSet.java

示例12: setStyle

import android.graphics.Paint; //导入方法依赖的package包/类
public void setStyle(Paint.Style style) {
  paint.setStyle(style);
}
 
开发者ID:nntuyen,项目名称:mkloader,代码行数:4,代码来源:GraphicObject.java

示例13: setIncreasingPaintStyle

import android.graphics.Paint; //导入方法依赖的package包/类
public void setIncreasingPaintStyle(Paint.Style increasingPaintStyle) {
  this.mIncreasingPaintStyle = increasingPaintStyle;
}
 
开发者ID:donglua,项目名称:JZAndroidChart,代码行数:4,代码来源:CandlestickDataSet.java

示例14: BarValue

import android.graphics.Paint; //导入方法依赖的package包/类
public BarValue(float value1, float value2, int color, Paint.Style paintStyle) {
    this.yValues = new float[] {value1, value2};
    this.mColor = color;
    this.mPaintStyle = paintStyle;
}
 
开发者ID:donglua,项目名称:JZAndroidChart,代码行数:6,代码来源:BarValue.java

示例15: getSecondHandStyle

import android.graphics.Paint; //导入方法依赖的package包/类
public Paint.Style getSecondHandStyle() {
    return secondHandStyle;
}
 
开发者ID:devMadrit,项目名称:MKClockView,代码行数:4,代码来源:MKAnalogClockView.java


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