Java tutorial
//package com.java2s; import android.graphics.RectF; public class Main { public static RectF getRectWithPadding(float paddingLeft, float paddingTop, float paddingRight, float paddingBottom, int screenW, int screenH) { RectF rect = new RectF(paddingLeft, paddingTop, screenW - paddingRight, screenH - paddingBottom); return rect; } }