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


Java Join.BEVEL属性代码示例

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


在下文中一共展示了Join.BEVEL属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:VectorDrawableCompat.java

示例2: 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;
    }
}
 
开发者ID:Qwaz,项目名称:solved-hacking-problem,代码行数:12,代码来源:C0015o.java

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

示例4: 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);
		}
	}
}
 
开发者ID:WowWeeLabs,项目名称:RoboSapien-Blue-RoboRaptor-Blue-Android-SDK,代码行数:65,代码来源:MagicTextView.java

示例5: 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);
       }
}
 
开发者ID:NuChwezi,项目名称:KIZINA,代码行数:69,代码来源:MagicTextView.java

示例6: 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);
       }
}
 
开发者ID:abartmatozu,项目名称:forum-fiend-osp,代码行数:71,代码来源:MagicTextView.java

示例7: 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);
	}
}
 
开发者ID:FauDroids,项目名称:BoxClub,代码行数:69,代码来源:MagicTextView.java

示例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.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);
		}
		
	}
	
}
 
开发者ID:DAM2-GOW,项目名称:FCM,代码行数:61,代码来源:TextGlow.java

示例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_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);
		}
	}
}
 
开发者ID:kyleivey,项目名称:QueenCityBusChaser,代码行数:62,代码来源:MagicTextView.java


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