private Builder() {
text = "";
color = Color.GRAY;
textColor = Color.WHITE;
borderThickness = 0;
width = -1;
height = -1;
shape = new RectShape();
font = Typeface.create("sans-serif-light", Typeface.NORMAL);
fontSize = -1;
isBold = false;
toUpperCase = false;
}
java类android.graphics.drawable.shapes.RectShape的实例源码
TextDrawable.java 文件源码
项目:Hello-Music-droid
阅读 23
收藏 0
点赞 0
评论 0
NewAuthEditText.java 文件源码
项目:EasyAndroid
阅读 25
收藏 0
点赞 0
评论 0
/**
* 创建 TextView 背景 {@link android.graphics.drawable.Drawable}
*
* @return {@link ShapeDrawable}
*/
private ShapeDrawable createFrameDrawableBg()
{
ShapeDrawable shape = new ShapeDrawable(new RectShape());
Paint paint = shape.getPaint();
paint.setColor(frameColor);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(frameWidth);
return shape;
}
AuthEditText.java 文件源码
项目:EasyAndroid
阅读 21
收藏 0
点赞 0
评论 0
/**
* 初始化默认的Drawable,{@link #defaultDrawable}
*/
private void initDefaultDrawable()
{
defaultDrawable = new ShapeDrawable(new RectShape());
Paint paint = defaultDrawable.getPaint();
paint.setColor(frameColor);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(strokeWidth);
setTextViewDrawable(defaultDrawable);
}
ATableViewPlainFooterDrawable.java 文件源码
项目:ShangHanLun
阅读 20
收藏 0
点赞 0
评论 0
public ATableViewPlainFooterDrawable(ATableView tableView, int rowHeight) {
super(new RectShape());
Resources res = tableView.getResources();
mStrokeWidth = DrawableUtils.getStrokeWidth(res);
mStrokeOffset = (float) Math.ceil(rowHeight * res.getDisplayMetrics().density) + mStrokeWidth;
// stroke.
mStrokePaint = new Paint();
mStrokePaint.setStyle(Paint.Style.STROKE);
mStrokePaint.setStrokeWidth(mStrokeWidth);
mStrokePaint.setColor(DrawableUtils.getSeparatorColor(tableView));
}
TextDrawable.java 文件源码
项目:Excuser
阅读 24
收藏 0
点赞 0
评论 0
private Builder() {
text = "";
color = Color.GRAY;
textColor = Color.WHITE;
borderThickness = 0;
width = -1;
height = -1;
shape = new RectShape();
font = Typeface.create("sans-serif-light", Typeface.NORMAL);
fontSize = -1;
isBold = false;
toUpperCase = false;
}
TextDrawable.java 文件源码
项目:MusicX-music-player
阅读 20
收藏 0
点赞 0
评论 0
private Builder() {
text = "";
color = Color.GRAY;
textColor = Color.WHITE;
borderThickness = 0;
width = -1;
height = -1;
shape = new RectShape();
font = Typeface.create("sans-serif-light", Typeface.NORMAL);
fontSize = -1;
isBold = false;
toUpperCase = false;
}
TextDrawable.java 文件源码
项目:RLibrary
阅读 21
收藏 0
点赞 0
评论 0
private Builder() {
text = "";
color = Color.GRAY;
textColor = Color.WHITE;
borderThickness = 0;
width = -1;
height = -1;
shape = new RectShape();
font = Typeface.create("sans-serif-light", Typeface.NORMAL);
fontSize = -1;
isBold = false;
toUpperCase = false;
}
TabLayoutUtil.java 文件源码
项目:RLibrary
阅读 23
收藏 0
点赞 0
评论 0
public static void setCommonTabDivider(CommonTabLayout tabLayout, @ColorInt int color, int showDividers, int padding) {
LinearLayout linearLayout = (LinearLayout) tabLayout.getChildAt(0);
linearLayout.setDividerPadding(padding);
RectShape rectShape = new RectShape();
float density = tabLayout.getResources().getDisplayMetrics().density;
ShapeDrawable shapeDrawable = new ShapeDrawable(rectShape);
shapeDrawable.setIntrinsicWidth((int) density);
shapeDrawable.setIntrinsicHeight((int) density);
shapeDrawable.getPaint().setColor(color);
shapeDrawable.getPaint().setStyle(Paint.Style.STROKE);
linearLayout.setDividerDrawable(shapeDrawable);
linearLayout.setShowDividers(showDividers);
}
ContactBadge.java 文件源码
项目:templated-messaging
阅读 19
收藏 0
点赞 0
评论 0
private void initSquare(Context context) {
if (mTriangle == null) {
TypedValue typedValue = new TypedValue();
Theme theme = context.getTheme();
// triangle
Path chipPath = new Path();
chipPath.moveTo(500f, 0f);
chipPath.lineTo(500f, 500f);
chipPath.lineTo(0f, 500f);
chipPath.close();
mTriangle = new ShapeDrawable(new PathShape(chipPath, 500f, 500f));
mTriangle.setDither(true);
int triangleColor = Color.parseColor("#cc1f1f1f");
if (theme.resolveAttribute(R.attr.cp_badgeTriangleColor, typedValue, true)) {
triangleColor = typedValue.data;
}
mTriangle.getPaint().setColor(triangleColor);
// line
mLinePaint = new Paint();
int lineColor = Color.parseColor("#ffffffff");
if (theme.resolveAttribute(R.attr.cp_badgeLineColor, typedValue, true)) {
lineColor = typedValue.data;
}
mLinePaint.setColor(lineColor);
mOffset = 1.5f * mDensity;
mLinePaint.setStrokeWidth(mOffset);
}
initOverlay(context, new RectShape());
}
Gradient.java 文件源码
项目:BlendedBackground
阅读 19
收藏 0
点赞 0
评论 0
private Drawable createDrawableFrom(ShapeDrawable.ShaderFactory sf) {
PaintDrawable p = new PaintDrawable();
p.setShape(new RectShape());
p.setShaderFactory(sf);
return p;
}