diff options
| author | Fabrice Di Meglio <fdimeglio@google.com> | 2012-03-08 12:26:22 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-08 12:26:22 -0800 |
| commit | bbd8226e97650e0f0aa558bd71d4b421394ef3e1 (patch) | |
| tree | e44d06b504767714a99eba2f295afe9db8a3689f /core/java | |
| parent | 940fcbddd35996b46136e47de365cac9b6a52cae (diff) | |
| parent | bf923ebb250a112266bd9bcae106cb84f42b6f15 (diff) | |
Merge "More fixes about padding"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/CheckedTextView.java | 6 | ||||
| -rw-r--r-- | core/java/android/widget/TextView.java | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java index 603cea1cdef9..19fb7b17794c 100644 --- a/core/java/android/widget/CheckedTextView.java +++ b/core/java/android/widget/CheckedTextView.java @@ -161,6 +161,12 @@ public class CheckedTextView extends TextView implements Checkable { } @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); diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 47e10cca358c..5ee739290c0d 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -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 |
