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

Commit fafb7575 authored by Roozbeh Pournader's avatar Roozbeh Pournader
Browse files

Invalidate TextView after locale change

Bug: 19294390
Change-Id: Ie0f08ab84b386ef6daa2570ea4d5203a04763b06
parent 0ade7ff3
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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();
            }
        }
    }