本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}