Android examples for Graphics:Rectangle
adjust Rectangle Radius
//package com.java2s; import android.graphics.Rect; public class Main { public static Rect adjustRadius(Rect rect, int radius) { return of(rect.centerX(), rect.centerY(), radius); }/*from w ww . j av a 2 s .com*/ public static Rect of(int centerX, int centerY, int radius) { return new Rect(centerX - radius, centerY - radius, centerX + radius, centerY + radius); } }