Code example for RectF

Methods: offsetsetunion

0
 
        private void computeRect(final RectF r, View view) {
            final float w = view.getWidth();
            final float h = view.getHeight();
 
            r.set(0, 0, w, h);
 
            final Matrix m = mTempMatrix;
            m.reset();
            transformMatrix(m, view);
            mTempMatrix.mapRect(r);
 
            r.offset(view.getLeft(), view.getTop());
        } 
 
        private void transformMatrix(Matrix m, View view) {
            m.postTranslate(mTranslationX, mTranslationY);
        } 
 
        private void invalidateAfterUpdate() { 
            View view = mViewRef.get();
            if (view == null || view.getParent() == null)
                return; 
 
            final RectF after = mAfter;
            computeRect(after, view);
            after.union(mBefore);
 
            ((View)view.getParent()).invalidate(
                    (int) Math.floor(after.left),
                    (int) Math.floor(after.top),
                    (int) Math.ceil(after.right),
Connect your IDE to all the code out there  Get Codota for Java