From 09ecb255a6d37567c8ce43dcd01bfb7ed7488a5d Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Fri, 3 May 2013 16:51:55 -0700 Subject: Optimize RTL properties resolution - dont bother children about resolving RTL properties if the ViewGroup parent has not done anything Change-Id: Iedf8a337097e04e1ab0054d59fc347e06b347ea7 --- core/java/android/view/View.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/java/android/view/View.java') diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 0938bb3..c47e111 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -11749,10 +11749,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()) { @@ -11773,6 +11775,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, resolveDrawables(); } onRtlPropertiesChanged(getLayoutDirection()); + return true; } /** @@ -11825,6 +11828,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; -- cgit v1.1