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

This code example shows how to use the following methods:draw
		width = w;
		height = h;
	} 
 
	public void drawNinepath(Canvas c, Rect r1) {
		NinePatch patch = new NinePatch(bmp, bmp.getNinePatchChunk(), null);
		patch.draw(c, r1);
	} 
 
	public void setpro() { 
		int len = (int) Math.round(getProgress() / 100f * width);
		rect = new Rect(0, 0, len, height);
	} 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:draw
	@Override 
	protected void onDraw(Canvas canvas) 
    { 
		if(indicatorBitmap != null)
		{ 
		    ninePatch.draw(canvas, rectD);			    
		} 
		/*if(getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) 
		{ 
			//use topY 
			if(indicatorBitmap != null) 
			{ 
			    //canvas.drawBitmap(indicatorBitmap, 0, topY, null); 
			    ninePatch.draw(canvas, rectD);			     
			} 
		} 
		else 
		{ 
			//use topX 
			if(indicatorBitmap != null) 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:draw
	@Override 
	protected void onDraw(Canvas canvas) 
    { 
		if(indicatorBitmap != null)
		{ 
		    ninePatch.draw(canvas, rectD);			    
		} 
		/*if(getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) 
		{ 
			//use topY 
			if(indicatorBitmap != null) 
			{ 
			    //canvas.drawBitmap(indicatorBitmap, 0, topY, null); 
			    ninePatch.draw(canvas, rectD);			     
			} 
		} 
		else 
		{ 
			//use topX 
			if(indicatorBitmap != null) 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:draw
	@Override 
	protected void onDraw(Canvas canvas) 
    { 
		if(indicatorBitmap != null)
		{ 
		    ninePatch.draw(canvas, rectD);			    
		} 
		/*if(getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) 
		{ 
			//use topY 
			if(indicatorBitmap != null) 
			{ 
			    //canvas.drawBitmap(indicatorBitmap, 0, topY, null); 
			    ninePatch.draw(canvas, rectD);			     
			} 
		} 
		else 
		{ 
			//use topX 
			if(indicatorBitmap != null) 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:draw
	@Override 
	protected void onDraw(Canvas canvas) 
    { 
		if(indicatorBitmap != null)
		{ 
		    ninePatch.draw(canvas, rectD);			    
		} 
		/*if(getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) 
		{ 
			//use topY 
			if(indicatorBitmap != null) 
			{ 
			    //canvas.drawBitmap(indicatorBitmap, 0, topY, null); 
			    ninePatch.draw(canvas, rectD);			     
			} 
		} 
		else 
		{ 
			//use topX 
			if(indicatorBitmap != null) 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:draw
	@Override 
	protected void onDraw(Canvas canvas) 
    { 
		if(indicatorBitmap != null)
		{ 
		    ninePatch.draw(canvas, rectD);			    
		} 
		/*if(getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) 
		{ 
			//use topY 
			if(indicatorBitmap != null) 
			{ 
			    //canvas.drawBitmap(indicatorBitmap, 0, topY, null); 
			    ninePatch.draw(canvas, rectD);			     
			} 
		} 
		else 
		{ 
			//use topX 
			if(indicatorBitmap != null) 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:draw
		else 
		{ 
			//use topX 
			if(indicatorBitmap != null)
			{ 
				ninePatch.draw(canvas, rectD);
				//canvas.drawBitmap(indicatorBitmap, new Rect(0,0,indicatorBitmap.getWidth(), indicatorBitmap.getHeight()), new Rect(leftX, 0, leftX+lp.width, lp.height),  null); 
			} 
		} 
    } 
	 
	 
	/** 
	 * @param width  raw image width 
	 * @param height raw image height 
	 * @param screenWidth   
	 * @param pageIndex 
	 * @param pageCount 
	 */ 
	public void refreshPosition(int width, int height, int screenWidth, int screenHeight, int pageIndex, int pageCount){
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        } 
        { 
            Bitmap bitmap = new BitmapHelper(activity)
                    .getBitmapFromAssets("zoom_popup_button_pressed.9.png"); 
 
            mNinePatch = new NinePatch(bitmap, bitmap.getNinePatchChunk(), null);
        } 
        mPoint = new Point();
        mRectF = new RectF();
    } 
 
    private Paint mPaint;
 
    private NinePatch mNinePatch;
 
    private float mFontHeight;
    private float[] mTextWidths;
 
    private int mTextHeight;
    private int mTextWidth;
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
     * @return 可自由放大缩小的drawable对象 
     */ 
    @Override 
    public NinePatchDrawable createScalableDrawable(Bitmap pic) {
        byte[] chunk = pic.getNinePatchChunk();
        NinePatch np = new NinePatch(pic, chunk, "");
        return new NinePatchDrawable(np);
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:draw
		else 
		{ 
			//use topX 
			if(indicatorBitmap != null)
			{ 
				ninePatch.draw(canvas, rectD);
			} 
		} 
    } 
	 
	 
	public void refreshProcess(int width, int height, float process){
		leftX = 0;
		lp.width  = (int)(width * process);
		lp.height = (int)(6*getContext().getResources().getDisplayMetrics().density);
 
		rectD.left = leftX;
		rectD.top  = topY;
		rectD.right= leftX+lp.width;
		rectD.bottom = topY+lp.height;
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android NinePatch Questions & Answers:

See Code Examples for Android NinePatch Methods: