Android ArcShape - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ArcShape class.

This code example shows how to use the following methods:
            mDrawables[3] = new ShapeDrawable(new RoundRectShape(outerR, inset,
                                                                 null)); 
            mDrawables[4] = new ShapeDrawable(new RoundRectShape(outerR, inset,
                                                                 innerR));
            mDrawables[5] = new ShapeDrawable(new PathShape(path, 100, 100));
            mDrawables[6] = new MyShapeDrawable(new ArcShape(45, -270));
 
            mDrawables[0].getPaint().setColor(0xFFFF0000);
            mDrawables[1].getPaint().setColor(0xFF00FF00);
            mDrawables[2].getPaint().setColor(0xFF0000FF);
            mDrawables[3].getPaint().setShader(makeSweep());
            mDrawables[4].getPaint().setShader(makeLinear());
            mDrawables[5].getPaint().setShader(makeTiling());
            mDrawables[6].getPaint().setColor(0x88FF8844);
 
            PathEffect pe = new DiscretePathEffect(10, 4);
            PathEffect pe2 = new CornerPathEffect(4);
            mDrawables[3].getPaint().setPathEffect(
                                                new ComposePathEffect(pe2, pe));
 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
		int randomNumber = r.nextInt(4);
		 
		// in function of the random number, we create either a ArcShape, or a RoundRectShape, or a RectShape or a OvalShape 
		if (randomNumber == 0) 
		{  
			mDrawable = new ShapeDrawable(new ArcShape(r.nextInt(360),r.nextInt(360)));
		} 
		else if (randomNumber == 1) 
		{  
			float[] roundedCorner = new float[] { r.nextInt(400), r.nextInt(400), r.nextInt(400), r.nextInt(400), 
					r.nextInt(400), r.nextInt(400), r.nextInt(400), r.nextInt(400) };
			 
			mDrawable = new ShapeDrawable(new RoundRectShape(roundedCorner, null, null));
		} 
		else if (randomNumber == 2)
		{ 
			// rectangle figure 
			mDrawable = new ShapeDrawable(new RectShape());
		} 
		else if (randomNumber == 3)
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
                d.setIntrinsicWidth(100);
                d.getPaint().setColor(Color.YELLOW);
                d.getPaint().setStyle(Paint.Style.STROKE);
                break; 
            case IDM_ARC:
                d = new ShapeDrawable(new ArcShape(0, 255));
                d.setIntrinsicHeight(100);
                d.setIntrinsicWidth(100);
                d.getPaint().setColor(Color.YELLOW);
                break; 
        } 
        mImage.setBackgroundDrawable(d);
        return true; 
    } 
} 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
            d.setIntrinsicWidth(100);
            d.getPaint().setColor(Color.YELLOW);
            d.getPaint().setStyle(Paint.Style.STROKE);
            break; 
        case IDM_ARC:
            d = new ShapeDrawable(new ArcShape(0, 255));
            d.setIntrinsicHeight(100);
            d.setIntrinsicWidth(100);
            d.getPaint().setColor(Color.YELLOW);
            break; 
        } 
        mView.setDrawable(d);
        return true; 
    } 
} 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
This code example shows how to use the following methods:
            dwShape[3] = new ShapeDrawable(
            				 new RoundRectShape(outerR, inset,null));
            dwShape[4] = new ShapeDrawable(
            				 new RoundRectShape(outerR, inset,innerR));
            dwShape[5]= new ShapeDrawable(new PathShape(path, 100, 100));
            dwShape[6] = new ShapeDrawable(new ArcShape(45, -270));
            
            SdmakeSweep=new SweepGradient(150, 25,
                new int[] { 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFF0000 }, 
                null); 
            SdmakeLinear=new LinearGradient(0, 0, 50, 50,
                new int[] { 0xFFFF0000, 0xFF00FF00, 0xFF0000FF }, 
                null, Shader.TileMode.MIRROR);
 
            int[] pixels = new int[]{0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0};
            Bitmap bm = Bitmap.createBitmap(pixels, 2, 2,
                                            Bitmap.Config.ARGB_8888);
            SdmakeTiling=new BitmapShader(bm, Shader.TileMode.REPEAT,
                                        Shader.TileMode.REPEAT);
             
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
This code example shows how to use the following methods:
package com.zauberlabs.android.api.piechart; 
 
import android.graphics.drawable.Drawable; 
import android.graphics.drawable.ShapeDrawable; 
import android.graphics.drawable.shapes.ArcShape; 
 
public class PortionFactory { 
	public static Drawable createPiePortion(float initAngle, float angle, int color){
		ShapeDrawable portion = new ShapeDrawable(new ArcShape(initAngle, angle));
		portion.setIntrinsicHeight(1000);
		portion.setIntrinsicWidth(1000);
		portion.getPaint().setColor(color);
		return portion;
	} 
} 

4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
            dwShape[3] = new ShapeDrawable(
            				 new RoundRectShape(outerR, inset,null));
            dwShape[4] = new ShapeDrawable(
            				 new RoundRectShape(outerR, inset,innerR));
            dwShape[5]= new ShapeDrawable(new PathShape(path, 100, 100));
            dwShape[6] = new ShapeDrawable(new ArcShape(45, -270));
            
            SdmakeSweep=new SweepGradient(150, 25,
                new int[] { 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0xFFFF0000 }, 
                null); 
            SdmakeLinear=new LinearGradient(0, 0, 50, 50,
                new int[] { 0xFFFF0000, 0xFF00FF00, 0xFF0000FF }, 
                null, Shader.TileMode.MIRROR);
 
            int[] pixels = new int[]{0xFFFF0000, 0xFF00FF00, 0xFF0000FF, 0};
            Bitmap bm = Bitmap.createBitmap(pixels, 2, 2,
                                            Bitmap.Config.ARGB_8888);
            SdmakeTiling=new BitmapShader(bm, Shader.TileMode.REPEAT,
                                        Shader.TileMode.REPEAT);
             
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
     */ 
    public static final ShapeDrawable arc(){
    	final float startAngle = 45; //开始角度
    	final float sweepAngle = -270; //旋转角度,正数顺时针,负数逆时针
    	final int color = 0x88FF8844; //填充颜色
    	ShapeDrawable dr = new ShapeDrawable(new ArcShape(startAngle, sweepAngle));
    	dr.getPaint().setColor(color);
    	return dr;
    } 
     
    /** 
     * 路径图形 
     */ 
    public static final ShapeDrawable path(){
    	final int color = 0xFF0000FF; //填充颜色
    	Path path = new Path();
        path.moveTo(50, 0);//路径开始
        path.lineTo(30, 0);
        path.lineTo(0, 50);
        path.lineTo(50, 100);
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ArcShape Questions & Answers:

See Code Examples for Android ArcShape Methods: