本文整理汇总了Java中android.graphics.Paint.Join.MITER属性的典型用法代码示例。如果您正苦于以下问题:Java Join.MITER属性的具体用法?Java Join.MITER怎么用?Java Join.MITER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.graphics.Paint.Join
的用法示例。
在下文中一共展示了Join.MITER属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStrokeLineJoin
private Join getStrokeLineJoin(int id, Join defValue) {
switch (id) {
case 0:
return Join.MITER;
case 1:
return Join.ROUND;
case 2:
return Join.BEVEL;
default:
return defValue;
}
}
示例2: C0015o
public C0015o() {
this.f34a = 0;
this.f35b = 0.0f;
this.f36c = 0;
this.f37d = 1.0f;
this.f39f = 1.0f;
this.f40g = 0.0f;
this.f41h = 1.0f;
this.f42i = 0.0f;
this.f43j = Cap.BUTT;
this.f44k = Join.MITER;
this.f45l = 4.0f;
}
示例3: m42a
private Join m42a(int i, Join join) {
switch (i) {
case C0243l.View_android_theme /*0*/:
return Join.MITER;
case C0243l.View_android_focusable /*1*/:
return Join.ROUND;
case C0243l.View_paddingStart /*2*/:
return Join.BEVEL;
default:
return join;
}
}
示例4: convertJoin
private Join convertJoin(Canvas.LineJoin join) {
switch (join) {
case BEVEL:
return Join.BEVEL;
case MITER:
return Join.MITER;
case ROUND:
return Join.ROUND;
}
return Join.MITER;
}
示例5: Stroke
public Stroke(int color)
{
mCap = Cap.BUTT;
mJoin = Join.MITER;
mMiter = 4;
mIntervals = null;
this.color = color == 0 ? 0xFF49AEBE : color;
}
示例6: PXStroke
/**
* Constructs a new PX stroke.
*/
public PXStroke() {
this.type = PXStrokeType.CENTER;
this.width = 1.0f;
this.dashOffset = 0;
this.lineCap = Cap.BUTT;
this.lineJoin = Join.MITER;
this.miterLimit = 4.0f; // What is a reasonable default here?
}
示例7: lineJoinFromString
private static Join lineJoinFromString(String value) {
if (value == null) {
return Join.MITER;
}
Join join = Join.valueOf(value.toUpperCase(Locale.US));
if (join == null) {
PXLog.e(TAG, "Unrecognized line join: " + value);
}
return join;
}
示例8: init
public void init(AttributeSet attrs){
outerShadows = new ArrayList<Shadow>();
innerShadows = new ArrayList<Shadow>();
if(canvasStore == null){
canvasStore = new WeakHashMap<String, Pair<Canvas, Bitmap>>();
}
if(attrs != null){
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.MagicTextView);
if(a.hasValue(R.styleable.MagicTextView_foreground)){
Drawable foreground = a.getDrawable(R.styleable.MagicTextView_foreground);
if(foreground != null){
this.setForegroundDrawable(foreground);
}else{
this.setTextColor(a.getColor(R.styleable.MagicTextView_foreground, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_background)){
Drawable background = a.getDrawable(R.styleable.MagicTextView_background);
if(background != null){
this.setBackgroundDrawable(background);
}else{
this.setBackgroundColor(a.getColor(R.styleable.MagicTextView_background, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_innerShadowColor)){
this.addInnerShadow(a.getFloat(R.styleable.MagicTextView_innerShadowRadius, 0),
a.getFloat(R.styleable.MagicTextView_innerShadowDx, 0),
a.getFloat(R.styleable.MagicTextView_innerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_innerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_outerShadowColor)){
this.addOuterShadow(a.getFloat(R.styleable.MagicTextView_outerShadowRadius, 0),
a.getFloat(R.styleable.MagicTextView_outerShadowDx, 0),
a.getFloat(R.styleable.MagicTextView_outerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_outerShadowColor, 0xff000000));
}
Log.d("MagicText", "Check a.hasValue(R.styleable.MagicTextView_strokeColor)");
if(a.hasValue(R.styleable.MagicTextView_strokeColor)){
Log.d("MagicText", "a.hasValue(R.styleable.MagicTextView_strokeColor)");
float strokeWidth = a.getFloat(R.styleable.MagicTextView_strokeWidth, 1);
int strokeColor = a.getColor(R.styleable.MagicTextView_strokeColor, 0xff000000);
float strokeMiter = a.getFloat(R.styleable.MagicTextView_strokeMiter, 10);
Join strokeJoin = null;
switch(a.getInt(R.styleable.MagicTextView_strokeJoinStyle, 0)){
case(0): strokeJoin = Join.MITER; break;
case(1): strokeJoin = Join.BEVEL; break;
case(2): strokeJoin = Join.ROUND; break;
}
this.setStroke(strokeWidth, strokeColor, strokeJoin, strokeMiter);
}
if(a.hasValue(R.styleable.MagicTextView_gradientTop) && a.hasValue(R.styleable.MagicTextView_gradientBottom)) {
this.gradientTopColor = a.getColor(R.styleable.MagicTextView_gradientTop, 0xff000000);
this.gradientBottomColor = a.getColor(R.styleable.MagicTextView_gradientBottom, 0xff000000);
}
}
}
示例9: init
public void init(AttributeSet attrs){
outerShadows = new ArrayList<Shadow>();
innerShadows = new ArrayList<Shadow>();
if(canvasStore == null){
canvasStore = new WeakHashMap<String, Pair<Canvas, Bitmap>>();
}
if(attrs != null){
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.MagicTextView);
String typefaceName = a.getString( R.styleable.MagicTextView_typeface);
if(typefaceName != null) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), String.format("fonts/%s.ttf", typefaceName));
setTypeface(tf);
}
if(a.hasValue(R.styleable.MagicTextView_foreground)){
Drawable foreground = a.getDrawable(R.styleable.MagicTextView_foreground);
if(foreground != null){
this.setForegroundDrawable(foreground);
}else{
this.setTextColor(a.getColor(R.styleable.MagicTextView_foreground, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_mbackground)){
Drawable background = a.getDrawable(R.styleable.MagicTextView_mbackground);
if(background != null){
this.setBackgroundDrawable(background);
}else{
this.setBackgroundColor(a.getColor(R.styleable.MagicTextView_mbackground, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_innerShadowColor)){
this.addInnerShadow(a.getDimensionPixelSize(R.styleable.MagicTextView_innerShadowRadius, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_innerShadowDx, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_innerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_innerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_outerShadowColor)){
this.addOuterShadow(a.getDimensionPixelSize(R.styleable.MagicTextView_outerShadowRadius, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_outerShadowDx, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_outerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_outerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_strokeColor)){
float strokeWidth = a.getDimensionPixelSize(R.styleable.MagicTextView_strokeWidth, 1);
int strokeColor = a.getColor(R.styleable.MagicTextView_strokeColor, 0xff000000);
float strokeMiter = a.getDimensionPixelSize(R.styleable.MagicTextView_strokeMiter, 10);
Join strokeJoin = null;
switch(a.getInt(R.styleable.MagicTextView_strokeJoinStyle, 0)){
case(0): strokeJoin = Join.MITER; break;
case(1): strokeJoin = Join.BEVEL; break;
case(2): strokeJoin = Join.ROUND; break;
}
this.setStroke(strokeWidth, strokeColor, strokeJoin, strokeMiter);
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
&& ( innerShadows.size() > 0
|| foregroundDrawable != null
)
){
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
}
示例10: init
@SuppressLint("Recycle")
@SuppressWarnings("deprecation")
public void init(AttributeSet attrs){
outerShadows = new ArrayList<Shadow>();
innerShadows = new ArrayList<Shadow>();
if(canvasStore == null){
canvasStore = new WeakHashMap<String, Pair<Canvas, Bitmap>>();
}
if(attrs != null){
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.MagicTextView);
String typefaceName = a.getString( R.styleable.MagicTextView_typeface);
if(typefaceName != null) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), String.format("fonts/%s.ttf", typefaceName));
setTypeface(tf);
}
if(a.hasValue(R.styleable.MagicTextView_foreground)){
Drawable foreground = a.getDrawable(R.styleable.MagicTextView_foreground);
if(foreground != null){
this.setForegroundDrawable(foreground);
}else{
this.setTextColor(a.getColor(R.styleable.MagicTextView_foreground, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_bgc)){
Drawable background = a.getDrawable(R.styleable.MagicTextView_bgc);
if(background != null){
this.setBackgroundDrawable(background);
}else{
this.setBackgroundColor(a.getColor(R.styleable.MagicTextView_bgc, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_innerShadowColor)){
this.addInnerShadow(a.getDimensionPixelSize(R.styleable.MagicTextView_innerShadowRadius, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_innerShadowDx, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_innerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_innerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_outerShadowColor)){
this.addOuterShadow(a.getDimensionPixelSize(R.styleable.MagicTextView_outerShadowRadius, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_outerShadowDx, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_outerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_outerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_strokeColor)){
float strokeWidth = a.getDimensionPixelSize(R.styleable.MagicTextView_strokeWidth, 1);
int strokeColor = a.getColor(R.styleable.MagicTextView_strokeColor, 0xff000000);
float strokeMiter = a.getDimensionPixelSize(R.styleable.MagicTextView_strokeMiter, 10);
Join strokeJoin = null;
switch(a.getInt(R.styleable.MagicTextView_strokeJoinStyle, 0)){
case(0): strokeJoin = Join.MITER; break;
case(1): strokeJoin = Join.BEVEL; break;
case(2): strokeJoin = Join.ROUND; break;
}
this.setStroke(strokeWidth, strokeColor, strokeJoin, strokeMiter);
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
&& ( innerShadows.size() > 0
|| foregroundDrawable != null
)
){
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
}
示例11: init
public void init(AttributeSet attrs){
outerShadows = new ArrayList<>();
innerShadows = new ArrayList<>();
if(canvasStore == null){
canvasStore = new WeakHashMap<>();
}
if(attrs != null){
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.MagicTextView);
String typefaceName = a.getString( R.styleable.MagicTextView_typeface);
if(typefaceName != null) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), String.format("fonts/%s.ttf", typefaceName));
setTypeface(tf);
}
if(a.hasValue(R.styleable.MagicTextView_foreground)){
Drawable foreground = a.getDrawable(R.styleable.MagicTextView_foreground);
if(foreground != null){
this.setForegroundDrawable(foreground);
}else{
this.setTextColor(a.getColor(R.styleable.MagicTextView_foreground, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_background)){
Drawable background = a.getDrawable(R.styleable.MagicTextView_background);
if(background != null){
this.setBackgroundDrawable(background);
}else{
this.setBackgroundColor(a.getColor(R.styleable.MagicTextView_background, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_innerShadowColor)){
this.addInnerShadow(a.getDimensionPixelSize(R.styleable.MagicTextView_innerShadowRadius, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_innerShadowDx, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_innerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_innerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_outerShadowColor)){
this.addOuterShadow(a.getDimensionPixelSize(R.styleable.MagicTextView_outerShadowRadius, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_outerShadowDx, 0),
a.getDimensionPixelOffset(R.styleable.MagicTextView_outerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_outerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_strokeColor)){
float strokeWidth = a.getDimensionPixelSize(R.styleable.MagicTextView_strokeWidth, 1);
int strokeColor = a.getColor(R.styleable.MagicTextView_strokeColor, 0xff000000);
float strokeMiter = a.getDimensionPixelSize(R.styleable.MagicTextView_strokeMiter, 10);
Join strokeJoin = null;
switch(a.getInt(R.styleable.MagicTextView_strokeJoinStyle, 0)){
case(0): strokeJoin = Join.MITER; break;
case(1): strokeJoin = Join.BEVEL; break;
case(2): strokeJoin = Join.ROUND; break;
}
this.setStroke(strokeWidth, strokeColor, strokeJoin, strokeMiter);
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
&& ( innerShadows.size() > 0
|| foregroundDrawable != null
)
){
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
}
示例12: init
public void init(AttributeSet attrs){
outerShadows=new ArrayList<Shadow>();
innerShadows=new ArrayList<Shadow>();
if(canvasStore==null){
canvasStore=new WeakHashMap<String,Pair<Canvas,Bitmap>>();
}
if(attrs!=null){
TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.TextGlow);
String typefaceName=a.getString(R.styleable.TextGlow_typeface);
if(typefaceName!=null){
Typeface tf=Typeface.createFromAsset(getContext().getAssets(),String.format("fonts/%s.ttf",typefaceName));
setTypeface(tf);
}
if(a.hasValue(R.styleable.TextGlow_foreground)){
Drawable foreground=a.getDrawable(R.styleable.TextGlow_foreground);
if(foreground!=null){
this.setForegroundDrawable(foreground);
}else{
this.setTextColor(a.getColor(R.styleable.TextGlow_foreground,0xff000000));
}
}
if(a.hasValue(R.styleable.TextGlow_background)){
Drawable background=a.getDrawable(R.styleable.TextGlow_background);
if(background!=null){
this.setBackgroundDrawable(background);
}else{
this.setBackgroundColor(a.getColor(R.styleable.TextGlow_background,0xff000000));
}
}
if(a.hasValue(R.styleable.TextGlow_innerShadowColor)){
this.addInnerShadow(a.getFloat(R.styleable.TextGlow_innerShadowRadius,0),a.getFloat(R.styleable.TextGlow_innerShadowDx,0),a.getFloat(R.styleable.TextGlow_innerShadowDy,0),a.getColor(R.styleable.TextGlow_innerShadowColor,0xff000000));
}
if(a.hasValue(R.styleable.TextGlow_outerShadowColor)){
this.addOuterShadow(a.getFloat(R.styleable.TextGlow_outerShadowRadius,0),a.getFloat(R.styleable.TextGlow_outerShadowDx,0),a.getFloat(R.styleable.TextGlow_outerShadowDy,0),a.getColor(R.styleable.TextGlow_outerShadowColor,0xff000000));
}
if(a.hasValue(R.styleable.TextGlow_strokeColor)){
float strokeWidth=a.getFloat(R.styleable.TextGlow_strokeWidth,1);
int strokeColor=a.getColor(R.styleable.TextGlow_strokeColor,0xff000000);
float strokeMiter=a.getFloat(R.styleable.TextGlow_strokeMiter,10);
Join strokeJoin=null;
switch(a.getInt(R.styleable.TextGlow_strokeJoinStyle,0)){
case(0): strokeJoin=Join.MITER;
break;
case(1): strokeJoin=Join.BEVEL;
break;
case(2): strokeJoin=Join.ROUND;
break;
}
this.setStroke(strokeWidth,strokeColor,strokeJoin,strokeMiter);
}
}
}
示例13: init
public void init(AttributeSet attrs){
outerShadows = new ArrayList<Shadow>();
innerShadows = new ArrayList<Shadow>();
if(canvasStore == null){
canvasStore = new WeakHashMap<String, Pair<Canvas, Bitmap>>();
}
if(attrs != null){
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.MagicTextView);
String typefaceName = a.getString( R.styleable.MagicTextView_typeface);
if(typefaceName != null) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), String.format("fonts/%s.ttf", typefaceName));
setTypeface(tf);
}
if(a.hasValue(R.styleable.MagicTextView_foreground)){
Drawable foreground = a.getDrawable(R.styleable.MagicTextView_foreground);
if(foreground != null){
this.setForegroundDrawable(foreground);
}else{
this.setTextColor(a.getColor(R.styleable.MagicTextView_foreground, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_backgrounds)){
Drawable background = a.getDrawable(R.styleable.MagicTextView_backgrounds);
if(background != null){
this.setBackgroundDrawable(background);
}else{
this.setBackgroundColor(a.getColor(R.styleable.MagicTextView_backgrounds, 0xff000000));
}
}
if(a.hasValue(R.styleable.MagicTextView_innerShadowColor)){
this.addInnerShadow(a.getFloat(R.styleable.MagicTextView_innerShadowRadius, 0),
a.getFloat(R.styleable.MagicTextView_innerShadowDx, 0),
a.getFloat(R.styleable.MagicTextView_innerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_innerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_outerShadowColor)){
this.addOuterShadow(a.getFloat(R.styleable.MagicTextView_outerShadowRadius, 0),
a.getFloat(R.styleable.MagicTextView_outerShadowDx, 0),
a.getFloat(R.styleable.MagicTextView_outerShadowDy, 0),
a.getColor(R.styleable.MagicTextView_outerShadowColor, 0xff000000));
}
if(a.hasValue(R.styleable.MagicTextView_strokeColor)){
float strokeWidth = a.getFloat(R.styleable.MagicTextView_strokeWidth, 1);
int strokeColor = a.getColor(R.styleable.MagicTextView_strokeColor, 0xff000000);
float strokeMiter = a.getFloat(R.styleable.MagicTextView_strokeMiter, 10);
Join strokeJoin = null;
switch(a.getInt(R.styleable.MagicTextView_strokeJoinStyle, 0)){
case(0): strokeJoin = Join.MITER; break;
case(1): strokeJoin = Join.BEVEL; break;
case(2): strokeJoin = Join.ROUND; break;
}
this.setStroke(strokeWidth, strokeColor, strokeJoin, strokeMiter);
}
}
}