Code example for RectF

0
            // this only works if we know the glow will never leave our bounds 
            invalidate();
        } else { 
            final float rx = (w * (GLOW_MAX_SCALE_FACTOR - 1.0f)) / 2.0f + 1.0f;
            final float ry = (h * (GLOW_MAX_SCALE_FACTOR - 1.0f)) / 2.0f + 1.0f;
            com.android.systemui.SwipeHelper.invalidateGlobalRegion( 
                    this,
                    new RectF(getLeft() - rx,
                              getTop() - ry,
                              getRight() + rx,
                              getBottom() + ry));
 
            // also invalidate our immediate parent to help avoid situations where nearby glows 
            // interfere 
            ((View)getParent()).invalidate();
        } 
    } 
 
    public void setPressed(boolean pressed) {
        if (mGlowBG != null) {
            if (pressed != isPressed()) {