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


Java Shape.draw方法代码示例

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


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

示例1: onDraw

import android.graphics.drawable.shapes.Shape; //导入方法依赖的package包/类
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
    // V1
    shape.draw(canvas, fillpaint);
    shape.draw(canvas, strokepaint);

    // V2
    // shape.resize(canvas.getClipBounds().right,
    // canvas.getClipBounds().bottom);
    // shape.draw(canvas, fillpaint);
    //
    // Matrix matrix = new Matrix();
    // matrix.setRectToRect(new RectF(0, 0,
    // canvas.getClipBounds().right, canvas.getClipBounds().bottom), new
    // RectF(strokeWidth / 2, strokeWidth / 2,
    // canvas.getClipBounds().right - strokeWidth
    // / 2, canvas.getClipBounds().bottom - strokeWidth / 2),
    // Matrix.ScaleToFit.FILL);
    // canvas.concat(matrix);
    //
    // shape.draw(canvas, strokepaint);
}
 
开发者ID:gabuzomeu,项目名称:geoPingProject,代码行数:22,代码来源:PersonColorDrawableHelper.java

示例2: onDraw

import android.graphics.drawable.shapes.Shape; //导入方法依赖的package包/类
@Override
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
    canvas.save();
    Rect bounds = canvas.getClipBounds();

    // bottom etched line.
    if (mBottomEtchedPaint != null) shape.draw(canvas, mBottomEtchedPaint);
    canvas.restore();
    canvas.save();

    // separator.
    canvas.concat(getSeparatorPaintMatrix(bounds));
    shape.draw(canvas, mSeparatorPaint);
    canvas.restore();
    canvas.save();

    // top etched line.
    canvas.concat(getTopEtchedPaintMatrix(bounds));
    if (mTopEtchedPaint != null) shape.draw(canvas, mTopEtchedPaint);
    canvas.restore();
    canvas.save();

    // background.
    canvas.concat(getBackgroundPaintMatrix(bounds));
    shape.draw(canvas, mBackgroundPaint);
    canvas.restore();
    canvas.save();

    // selected.
    canvas.concat(getSelectedPaintMatrix(bounds));
    if (mSelectedPaint != null) {

        // we'll set the selected color on onDraw event since we don't know drawable height up to here.
        Shader shader = new LinearGradient(0, 0, 0, mRowHeight, mStartColor, mEndColor, Shader.TileMode.MIRROR);
        mSelectedPaint.setShader(shader);

        shape.draw(canvas, mSelectedPaint);
    }
}
 
开发者ID:hh-in-zhuzhou,项目名称:ShangHanLun,代码行数:40,代码来源:ATableViewCellDrawable.java

示例3: onDraw

import android.graphics.drawable.shapes.Shape; //导入方法依赖的package包/类
@Override
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
    shape.draw(canvas, fillpaint);
    canvas.drawLine(0, shape.getHeight(), shape.getWidth(), shape.getHeight(), strokepaint);   
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:DefaultSectionAdapter.java

示例4: onDraw

import android.graphics.drawable.shapes.Shape; //导入方法依赖的package包/类
@Override
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
    shape.draw(canvas, fillpaint);
    shape.draw(canvas, strokepaint);
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:6,代码来源:PopOverFragment.java

示例5: onDraw

import android.graphics.drawable.shapes.Shape; //导入方法依赖的package包/类
@Override
protected void onDraw(Shape shape, Canvas canvas, Paint fillpaint) {
    shape.draw(canvas, fillpaint);
    shape.draw(canvas, strokepaint);
}
 
开发者ID:denisk20,项目名称:bullshit-bingo-champion,代码行数:6,代码来源:CustomShapeDrawable.java


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