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

Commit 7caa1a87 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android Git Automerger
Browse files

am a8549041: am 8c2e3a41: Merge "Optimize RTL properties resolution" into jb-mr2-dev

* commit 'a8549041':
  Optimize RTL properties resolution
parents 100ed154 a8549041
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -11764,10 +11764,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * Resolve all RTL related properties.
     *
     * @return true if resolution of RTL properties has been done
     *
     * @hide
     */
    public void resolveRtlPropertiesIfNeeded() {
        if (!needRtlPropertiesResolution()) return;
    public boolean resolveRtlPropertiesIfNeeded() {
        if (!needRtlPropertiesResolution()) return false;
        // Order is important here: LayoutDirection MUST be resolved first
        if (!isLayoutDirectionResolved()) {
@@ -11788,6 +11790,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            resolveDrawables();
        }
        onRtlPropertiesChanged(getLayoutDirection());
        return true;
    }
    /**
@@ -11840,6 +11843,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * @return true if RTL properties need resolution.
     *
     */
    private boolean needRtlPropertiesResolution() {
        return (mPrivateFlags2 & ALL_RTL_PROPERTIES_RESOLVED) != ALL_RTL_PROPERTIES_RESOLVED;
+11 −7
Original line number Diff line number Diff line
@@ -5525,8 +5525,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * @hide
     */
    @Override
    public void resolveRtlPropertiesIfNeeded() {
        super.resolveRtlPropertiesIfNeeded();
    public boolean resolveRtlPropertiesIfNeeded() {
        final boolean result = super.resolveRtlPropertiesIfNeeded();
        // We dont need to resolve the children RTL properties if nothing has changed for the parent
        if (result) {
            int count = getChildCount();
            for (int i = 0; i < count; i++) {
                final View child = getChildAt(i);
@@ -5535,6 +5537,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                }
            }
        }
        return result;
    }

    /**
     * @hide