當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。