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

This code example shows how to use the following methods:
 
	/** 
	 * Dashed, Red, Width=5; 
	 */ 
	public void setPaintDashed() { 
		this.mPaint.setPathEffect(new DashPathEffect(new float[]{10,5}, 0));
		this.mPaint.setStrokeWidth(5);
		this.mPaint.setColor(Color.RED);
		this.mPaint.setAntiAlias(false);
	} 
 
	/** 
	 * Dashed, Red, Width=5; 
	 */ 
	public void setPaintNormal() { 
		this.mPaint.setStrokeWidth(5);
		this.mPaint.setColor(Color.RED);
		this.mPaint.setAntiAlias(true);
	} 
 
5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
		paint.setStyle(Style.FILL);
		paint.setARGB(128, 0, 0, 255);
		canvas.drawRect(120, 10, 210, 100, paint);
		 
		// Rectangle #2 Fill 
		DashPathEffect dashEffect = new DashPathEffect(new float[]{5,5}, 1);
		paint.setStyle(Style.STROKE);
		paint.setStrokeWidth(3.0F);
		paint.setPathEffect(dashEffect);
		paint.setColor(Color.GREEN);
		canvas.drawRect(120, 10, 210, 100, paint);
		 
		paint = new Paint();
		 
		// Circle #1 Stroke 
		paint.setColor(Color.MAGENTA);
		canvas.drawCircle(50, 160, 40, paint);
		 
		// Circle #2 Stroke 
		paint.setAntiAlias(true);
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
		private String mCutText;
		 
		private final static int defaultColor=0xffF51111;
	    private final static android.graphics.Paint.Style mStyle=Paint.Style.STROKE;
		private static float[] f={10.f,5.0f};
		private static DashPathEffect dashed=new DashPathEffect(f,1.0f);
		 
	   
		 
		public LJCutSpan(String cutText,int color,int marginColor) {
			super(color,marginColor,mStyle,dashed);
			mCutText=cutText;
			 
		} 
		 
		public LJCutSpan(String cutText){
			super(-1,defaultColor,mStyle,dashed);
			 mCutText=cutText;
			 
		} 
4
CodeRank
This code example shows how to use the following methods:
		p3.setColor(Color.GRAY);
		p3.setAntiAlias(true);
		p3.setStyle(Style.STROKE);
		// p3.setStrokeWidth(5); 
		p3.setTextSize(textSizeSmall);
		p3.setPathEffect(new DashPathEffect(new float[] { 10, 20 }, 0));
		this.setBackgroundColor(Color.BLACK);
 
		GroundLevel = hh - 100;
		quad = new Quad(getContext(), GroundLevel, ww, hh);
 
	} 
 
	public void Set() { 
		this.invalidate();
	} 
 
	@Override 
	protected void onDraw(Canvas c) {
		super.onDraw(c);
4
CodeRank
This code example shows how to use the following methods:
 
		path = new Path();
		path.moveTo(0, getHeight() / 2);
		path.lineTo(getWidth(), getHeight() / 2);
 
		PathEffect effects = new DashPathEffect(new float[] { 5, 5, 5, 5 }, 1);
		paint.setPathEffect(effects);
 
	} 
 
	@Override 
	protected void onDraw(Canvas canvas) {
		// TODO Auto-generated method stub 
		super.onDraw(canvas);
		/* 
		 * Paint paint = new Paint(); paint.setStyle(Paint.Style.STROKE); 
		 * paint.setColor(getTextColors().getDefaultColor()); 
		 */ 
		/* 
		 * Path path = new Path(); path.moveTo(0, getHeight()/2); 
4
CodeRank
This code example shows how to use the following methods:
        fgPaintSel.setColor(Color.BLACK);
		fgPaintSel.setStyle(Style.STROKE);
        fgPaintSel.setStrokeWidth((float)4.0);
        fgPaintSel.setAntiAlias(true); 
        fgPaintSel.setFlags(Paint.ANTI_ALIAS_FLAG);
		fgPaintSel.setPathEffect(new DashPathEffect(new float[] {2,3}, 0));
	} 
	@Override 
	protected void onDraw(Canvas canvas) {
		if(mOrientation==0){
			canvas.drawLine(0, 0, this.getMeasuredWidth(), 0, fgPaintSel);
		} 
		else{ 
			canvas.drawLine(0, 0, 0, this.getMeasuredHeight(), fgPaintSel);
			//RelativeLayout.LayoutParams param=(RelativeLayout.LayoutParams)this.getLayoutParams(); 
			//param.leftMargin=DiaryApplication.getInstance().getScreen_w()/3; 
		} 
			 
		super.onDraw(canvas);
	} 
4
CodeRank
This code example shows how to use the following methods:
			new DashPathEffect(intervals1, 17.5f),
			new DashPathEffect(intervals1, 15f),
			new DashPathEffect(intervals1, 12.5f),
			new DashPathEffect(intervals1, 10f),
			new DashPathEffect(intervals1, 7.5f),
			new DashPathEffect(intervals1, 5f), 
    }; 
	 
	public DottedLineOverlay(WayfinderMapView ownerMap) {
		iOwnerMap = ownerMap;
		this.application = (NavigatorApplication) this.iOwnerMap.getContext().getApplicationContext();
	} 
	 
	public void draw(Canvas canvas, MapCameraInterface mapCamera, MapRenderer mapRenderer, View mapOverlay) {
		Position position = this.application.getOwnLocationInformation().getMC2Position();
        System.out.println(position.getMc2Latitude() + "," + position.getMc2Longitude());
		Paint p = new Paint();
		p.setAntiAlias(true);
		p.setColor(0xFFAAAAAA);
		p.setStrokeWidth(4);
5
CodeRank
This code example shows how to use the following methods:
        mPaint = new Paint();
        mPaint.setStrokeWidth(1);
         
        mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
        mPaint.setColor(Color.parseColor("#E0D9A7"));
        PathEffect effects = new DashPathEffect(new float[]{1,1},0);  
        mPaint.setPathEffect(effects);
    } 
 
    @Override 
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
 
        int height = this.getHeight();
        int lineHeight = this.getLineHeight();
        int lineNum = height / lineHeight;
       // L.l("line count: " + lineNum); 
        for (int i = 0; i < lineNum; i++) {
            int y = (i + 1) * lineHeight + this.getPaddingTop();
            canvas.drawLine(0, y, this.getWidth() - 1, y, mPaint);
4
CodeRank

Related Android DashPathEffect Questions & Answers:

See Code Examples for Android DashPathEffect Methods: