A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Code Examples of ShapeDrawable


     * @param newRect the new rect
     */
    protected void drawEnclosure(Canvas canvas, Rect newRect) {
    	NumberFormat nf= NumberFormat.getInstance();
		nf.setMaximumFractionDigits(2);
    	ShapeDrawable mDrawable1 = new ShapeDrawable();
    	mDrawable1.getPaint().setColor(Color.MAGENTA);
     	canvas.drawLine(newRect.left-MARGIN2,newRect.bottom+MARGIN2,newRect.right+MARGIN2,newRect.bottom+MARGIN2,mDrawable1.getPaint());
    	canvas.drawLine(newRect.left-MARGIN2,newRect.bottom+MARGIN2,newRect.left-MARGIN2,newRect.top-MARGIN2,mDrawable1.getPaint());
    	canvas.drawLine(newRect.left-MARGIN2,newRect.top-MARGIN2,newRect.right+MARGIN2,newRect.top-MARGIN2,mDrawable1.getPaint());
    	canvas.drawLine(newRect.right+MARGIN2,newRect.top-MARGIN2,newRect.right+MARGIN2,newRect.bottom+MARGIN2,mDrawable1.getPaint());
    	int incr = newRect.height()/NUMPRICE;
    	
    	/*Draw prices */
    	canvas.drawText(Double.toString(getMaxHigh()),newRect.right-MARGIN3+10,newRect.top, mDrawable1.getPaint());
    	canvas.drawText(Double.toString(getMinLow()),newRect.right-MARGIN3+10,newRect.bottom, mDrawable1.getPaint());
    	for (int i=0;i<=NUMPRICE;i++){
    		canvas.drawLine(newRect.right+MARGIN2,newRect.top+incr*i, newRect.right+MARGIN2-5,newRect.top+incr*i,mDrawable1.getPaint());
    		if (i>0 &&i<NUMPRICE& (i%2==0)){
    			double price=getMaxHigh() - (getMaxHigh()-getMinLow())*i/NUMPRICE;
    			canvas.drawText(nf.format(price),newRect.right-MARGIN3+10 ,newRect.top+incr*i, mDrawable1.getPaint());
    		}
    	}
    }
    
    /**

View Full Code Here



        int cornerRadius = 10;
        float[] outerR = new float[]{cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius};
        RectF inset = new RectF(2, 2, 2, 2);
        float[] innerR = new float[]{cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius, cornerRadius};
        ShapeDrawable circle = new ShapeDrawable(new RoundRectShape(outerR, inset, innerR));
        circle.setPadding(6, 0, 6, 0);

        GradientDrawable gradient = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{Color.BLUE, Color.RED});
        gradient.setCornerRadius(cornerRadius);
        gradient.setBounds(circle.getBounds());

        LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{gradient, circle});
        tv.setBackgroundDrawable(layerDrawable);

        if (tabWidget.getChildAt(i) instanceof RelativeLayout) {

View Full Code Here


        x = 10;
        y = 200;
        width = 10;
        height = 100;

        mDrawable1 = new ShapeDrawable();//new OvalShape());
        mDrawable1.getPaint().setColor(0xff74AC23);
        mDrawable1.setBounds(x, y, x + width, y + height);
        mDrawable2 = new ShapeDrawable();//new OvalShape());
        mDrawable2.getPaint().setColor(0xFFFF0000);
        mDrawable2.setBounds(x+15, y+5, x + 15+ width, y +5+height);
        
    }
    public List<CandleData> getDummyCandleData(){	

View Full Code Here


	private static final String tag = "VUPHONE";
	private static final String pre = "RouteOverlay: ";

	private PinController pc_;
	public RouteOverlay(PinController pc){
		super(new ShapeDrawable(new OvalShape()));
		pc_ = pc;
		populate();
	}

	/**

View Full Code Here


	private static final String tag = VUphone.tag;

	private Context context_ = null;

	public WreckOverlay(Context context, PinController c) {
		super(new ShapeDrawable(new OvalShape()));

		pc_ = c;
		context_ = context;

		populate();

View Full Code Here


	private static final String tag = "VUPHONE";
	private static final String pre = "RouteOverlay: ";

	private PinController pc_;
	public RouteOverlay(PinController pc){
		super(new ShapeDrawable(new OvalShape()));
		pc_ = pc;
		populate();
	}

	/**

View Full Code Here


	private static final String tag = VUphone.tag;

	private Context context_ = null;

	public WreckOverlay(Context context, PinController c) {
		super(new ShapeDrawable(new OvalShape()));

		pc_ = c;
		context_ = context;

		populate();

View Full Code Here

TOP

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

TOP