diff options
| author | 2016-03-31 11:23:00 -0700 | |
|---|---|---|
| committer | 2016-03-31 11:23:00 -0700 | |
| commit | fafb7575c7f3265aa4330e23f3ad17f4a09a2d3a (patch) | |
| tree | 2e625f16d44ace5cc2efa5751f762c47325bf3bc | |
| parent | 0ade7ff3c0100d14ca2ae0319830b5210e66ed27 (diff) | |
Invalidate TextView after locale change
Bug: 19294390
Change-Id: Ie0f08ab84b386ef6daa2570ea4d5203a04763b06
| -rw-r--r-- | core/java/android/widget/TextView.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 4a68d3c4977e..7602416fa751 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -2893,6 +2893,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public void setTextLocale(@NonNull Locale locale) { mLocalesChanged = true; mTextPaint.setTextLocale(locale); + if (mLayout != null) { + nullLayouts(); + requestLayout(); + invalidate(); + } } /** @@ -2909,6 +2914,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public void setTextLocales(@NonNull @Size(min=1) LocaleList locales) { mLocalesChanged = true; mTextPaint.setTextLocales(locales); + if (mLayout != null) { + nullLayouts(); + requestLayout(); + invalidate(); + } } @Override @@ -2916,6 +2926,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener super.onConfigurationChanged(newConfig); if (!mLocalesChanged) { mTextPaint.setTextLocales(LocaleList.getDefault()); + if (mLayout != null) { + nullLayouts(); + requestLayout(); + invalidate(); + } } } |