Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf923ebb authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

More fixes about padding

- take care of overridig setPaddingRelative() too in TextView subclasses

Change-Id: If2057247cfcac919d777846def4adfeb5a682d51
parent 3bef5e9f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -160,6 +160,12 @@ public class CheckedTextView extends TextView implements Checkable {
        mBasePadding = mPaddingRight;
    }

    @Override
    public void setPaddingRelative(int start, int top, int end, int bottom) {
        super.setPaddingRelative(start, top, end, bottom);
        mBasePadding = getPaddingEnd();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
+14 −0
Original line number Diff line number Diff line
@@ -2079,6 +2079,20 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        invalidate();
    }

    @Override
    public void setPaddingRelative(int start, int top, int end, int bottom) {
        if (start != getPaddingStart() ||
            end != getPaddingEnd() ||
            top != mPaddingTop ||
            bottom != mPaddingBottom) {
            nullLayouts();
        }

        // the super call will requestLayout()
        super.setPaddingRelative(start, top, end, bottom);
        invalidate();
    }

    /**
     * Gets the autolink mask of the text.  See {@link
     * android.text.util.Linkify#ALL Linkify.ALL} and peers for