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

This code example shows how to use the following methods:
This code example shows how to use the following methods:
      return System.currentTimeMillis();
   } 
    
   public static PaintDrawable getPaintDrawable(int startX, int endX){
      PaintDrawable drawable = new PaintDrawable();
      drawable.setShape(new RectShape());
      drawable.setShaderFactory(getShaderFactory(startX, endX));
      return drawable;
   } 
 
   public static ShapeDrawable.ShaderFactory
   getShaderFactory(final int startX, final int endX){
      return new ShapeDrawable.ShaderFactory(){
 
         @Override 
         public Shader resize(int width, int height) {
            return new LinearGradient(startX, 0, endX, 0,
                  new int[]{ 0xFFDCDAD5, 0xFFFDFDF4, 
                  0xFFFFFFFF, 0xFFFDFBEF }, 
                  new float[]{ 0, 0.18f, 0.48f, 1 }, 
6
CodeRank
This code example shows how to use the following methods:resize
        drawable.getPaint().set(paint);
        drawable.setBounds(125, 225, 275, 375);
        drawables.add(drawable); // Add it to our list!
 
        /* Setup Rectangle */ 
        shape = new RectShape();
        shape.resize(50, 50);
 
        drawable = new ShapeDrawable(shape);
        drawable.getPaint().set(paint);
        drawable.setBounds(475, 225, 625, 375);
        drawables.add(drawable); // Add it to our list!
 
        setContentView(new MyView(this));
    } 
 
    /* Our custom view which will draw the drawables in list */ 
    private class MyView extends View {
 
        public MyView(Context context) {
6
CodeRank
This code example shows how to use the following methods:
        init(); 
    } 
 
    private void init() 
    { 
        drawable = new ShapeDrawable(new RectShape());
        drawable.setBounds(0,0, 50, 50);
    } 
 
    @Override 
    protected void onDraw(Canvas canvas)
    { 
        if (drawable != null)
            drawable.draw(canvas);
    } 
 
    public int getColor() 
    { 
        return drawable.getPaint().getColor();
    } 
5
CodeRank
This code example shows how to use the following methods:draw, resize
 
	protected void onDraw(Canvas g)
	{ 
		float SCALE = Math.min(g.getWidth(), g.getHeight()) / (float) 1000;
		g.scale(SCALE*2, SCALE*2);
		RectShape mybackground = new RectShape();
		artist.setColor(new Color().BLACK);
		mybackground.resize((float) 480.0, (float) 725.0);
		mybackground.draw(g, artist);
		artist.setColor(new Color().WHITE);
		artist.setTextSize(40);
		g.drawText(myscore,0,myscore.length() - 1,100,200,artist);
	} 
} 
5
CodeRank
This code example shows how to use the following methods:
 
		this.bars.add(newBar(x, y, width, height, Color.RED));
	} 
 
	private ShapeDrawable newBar(int x, int y, int width, int height, int color) {
		ShapeDrawable bar = new ShapeDrawable(new RectShape());
		bar.getPaint().setColor(color);
		bar.setBounds(x, y, x + width, y + height);
		return bar;
	} 
 
	@Override 
	protected void onDraw(Canvas canvas) {
		for (ShapeDrawable bar : this.bars) {
			bar.draw(canvas);
		} 
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	private Timer feedback_clear_;
 
	public FeedbackRuler(Context context) {
		super(context);
 
		drawable_ = new ShapeDrawable(new RectShape());
		deactivate(); 
	} 
 
	public void deactivate() { 
		drawable_.getPaint().setColor(0xff0000ff);
	} 
 
	public void activate(boolean good) {
		if(good)
			drawable_.getPaint().setColor(0xff00ff00);
		else 
			drawable_.getPaint().setColor(0xffff0000);
	} 
 
4
CodeRank
This code example shows how to use the following methods:
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Paint paint = new Paint();
        paint.setAntiAlias(true);
        paint.setColor(R.color.black);
        ShapeDrawable sdTitleLine = new ShapeDrawable(new RectShape());
//        sdTitleLine.getPaint(); 
//        sdTitleLine.setBounds(this.getLeft(), this.getTop()+30, this.getRight(), this.getTop()+31); 
//        sdTitleLine.draw(canvas); 
        ShapeDrawable sdBaseLine = new ShapeDrawable(new RectShape());
//        sdBaseLine.getPaint(); 
//        sdBaseLine.setBounds(this.getLeft()+15, this.getBottom()/2+12, this.getRight()-15, this.getBottom()/2+13); 
//        sdBaseLine.draw(canvas); 
    } 
} 
4
CodeRank

Related Android RectShape Questions & Answers:

See Code Examples for Android RectShape Methods: