Android ComposePathEffect - 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 ComposePathEffect class.

This code example shows how to use the following methods:setPathEffect
            dwShape[5].getPaint().setShader(SdmakeTiling);
            dwShape[6].getPaint().setColor(0x88FF8844);
             
            PathEffect pe = new DiscretePathEffect(10, 4);
            PathEffect pe2 = new CornerPathEffect(4);
            dwShape[3].getPaint().setPathEffect(
                        new ComposePathEffect(pe2, pe));
        } 
 
        protected void onDraw(Canvas canvas) {
 
            int x = 10;
            int y = 10;
            int width = 300;
            int height = 50;
 
            for (Drawable dr : dwShape) {
            	dr.setBounds(x, y, x + width, y + height);
            	dr.draw(canvas);
                y += height + 5;
5
CodeRank
This code example shows how to use the following methods:setPathEffect
            dwShape[5].getPaint().setShader(SdmakeTiling);
            dwShape[6].getPaint().setColor(0x88FF8844);
             
            PathEffect pe = new DiscretePathEffect(10, 4);
            PathEffect pe2 = new CornerPathEffect(4);
            dwShape[3].getPaint().setPathEffect(
                        new ComposePathEffect(pe2, pe));
        } 
 
        protected void onDraw(Canvas canvas) {
 
            int x = 10;
            int y = 10;
            int width = 300;
            int height = 50;
 
            for (Drawable dr : dwShape) {
            	dr.setBounds(x, y, x + width, y + height);
            	dr.draw(canvas);
                y += height + 5;
5
CodeRank
This code example shows how to use the following methods:setPathEffect
            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));
 
            MyShapeDrawable msd = (MyShapeDrawable)mDrawables[6];
            msd.getStrokePaint().setStrokeWidth(4);
        } 
 
        @Override protected void onDraw(Canvas canvas) {
 
            int x = 10;
            int y = 10;
            int width = 300;
            int height = 50;
 
            for (Drawable dr : mDrawables) {
4
CodeRank
This code example shows how to use the following methods:setPathEffect
    					null) 
    			); 
    	dr.getPaint().setColor(color);
    	PathEffect pe = new DiscretePathEffect(10, 4);
        PathEffect pe2 = new CornerPathEffect(4);
        dr.getPaint().setPathEffect(new ComposePathEffect(pe2, pe));
        return dr;
    } 
     
    /** 
     * 椭圆 
     *  
<shape xmlns:android="http://schemas.android.com/apk/res/android"  
    android:shape="oval"> 
    <solid android:color="#FFFF0000"/> 
</shape> 
     */ 
    public static final ShapeDrawable oval(){
    	final int color = 0xFF00FF00; //填充颜色
    	ShapeDrawable dr = new ShapeDrawable(new OvalShape());
4
CodeRank
This code example shows how to use the following methods:
			e[0] = null; // no effect
			e[1] = new CornerPathEffect(10);
			e[2] = new DashPathEffect(new float[] { 10, 5, 5, 5 }, phase);
			e[3] = new PathDashPathEffect(makePathDash(), 12, phase,
					PathDashPathEffect.Style.ROTATE);
			e[4] = new ComposePathEffect(e[2], e[1]);
			e[5] = new ComposePathEffect(e[3], e[1]);
		} 
 
		public SampleView(Context context) {
			super(context);
			setFocusable(true); 
			setFocusableInTouchMode(true); 
 
			mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
			mPaint.setStyle(Paint.Style.STROKE);
			mPaint.setStrokeWidth(6);
 
			mPath = makeFollowPath();
 
4
CodeRank
This code example shows how to use the following methods:
            e[1] = new CornerPathEffect(10);
            e[2] = new DashPathEffect(new float[] {10, 5, 5, 5}, phase);
            e[3] = new PathDashPathEffect(makePathDash(), 12, phase,
                                          PathDashPathEffect.Style.ROTATE);
            e[4] = new ComposePathEffect(e[2], e[1]);
            e[5] = new ComposePathEffect(e[3], e[1]);
        } 
 
        public SampleView(Context context) {
            super(context);
            setFocusable(true);
            setFocusableInTouchMode(true);
 
            mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
            mPaint.setStyle(Paint.Style.STROKE);
            mPaint.setStrokeWidth(6);
 
            mPath = makeFollowPath();
 
            mEffects = new PathEffect[6];
4
CodeRank
This code example shows how to use the following methods:
			e[2] = new DashPathEffect(new float[]
			{ 20, 10, 5, 10 }, phase);
			e[3] = new PathDashPathEffect(makeCirclePath(), 12, phase,
					PathDashPathEffect.Style.ROTATE);
 
			e[4] = new ComposePathEffect(e[2], e[1]);
			e[5] = new ComposePathEffect(e[3], e[1]);
		} 
 
		public MyView(Context context)
		{ 
			super(context);
 
 
 
			paint = new Paint();
			paint.setStyle(Paint.Style.STROKE);
			paint.setStrokeWidth(5);
 
			path = makeFollowPath();
4
CodeRank
This code example shows how to use the following methods:
            e[1] = new CornerPathEffect(10);
            e[2] = new DashPathEffect(new float[] {10, 5, 5, 5}, phase);
            e[3] = new PathDashPathEffect(makePathDash(), 12, phase,
                                          PathDashPathEffect.Style.ROTATE);
            e[4] = new ComposePathEffect(e[2], e[1]);
            e[5] = new ComposePathEffect(e[3], e[1]);
        } 
         
        @Override  
        protected void onDraw(Canvas canvas) {
            canvas.drawColor(Color.WHITE);
 
            RectF bounds = new RectF();
            path.computeBounds(bounds, false);
            canvas.translate(10 - bounds.left, 10 - bounds.top);
 
            makeEffects(pathEff, phase);
            phase += 1;
            invalidate();
 
4
CodeRank
This code example shows how to use the following methods:
			{ 20, 10, 5, 10 }, phase);
			e[3] = new PathDashPathEffect(makeCirclePath(), 12, phase,
					PathDashPathEffect.Style.ROTATE);
 
			e[4] = new ComposePathEffect(e[2], e[1]);
			e[5] = new ComposePathEffect(e[3], e[1]);
		} 
 
		public MyView(Context context)
		{ 
			super(context);
 
 
 
			paint = new Paint();
			paint.setStyle(Paint.Style.STROKE);
			paint.setStrokeWidth(5);
 
			path = makeFollowPath();
 
4
CodeRank
See Code Examples for Android ComposePathEffect Methods: