Fix bug #6427629 Clean up layout direction APIs
- remove onPaddingChanged(int) and fold it into onRtlPropertiesChanged(int)
Change-Id: I1d7f02d2b4538c6c991bd4285501bbc73e6aa5c3
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index f9ff865..f8ebd61 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -11560,7 +11560,7 @@
}
requestLayout();
invalidate(true);
- onRtlPropertiesChanged();
+ onRtlPropertiesChanged(getLayoutDirection());
}
// Reset resolution of all RTL related properties.
@@ -11622,8 +11622,13 @@
* resolved layout direction, or to inform child views that inherit their layout direction.
*
* The default implementation does nothing.
+ *
+ * @param layoutDirection the direction of the layout
+ *
+ * @see #LAYOUT_DIRECTION_LTR
+ * @see #LAYOUT_DIRECTION_RTL
*/
- public void onRtlPropertiesChanged() {
+ public void onRtlPropertiesChanged(int layoutDirection) {
}
/**
@@ -11768,7 +11773,7 @@
internalSetPadding(mUserPaddingLeft, mPaddingTop, mUserPaddingRight,
mUserPaddingBottom);
- onPaddingChanged(resolvedLayoutDirection);
+ onRtlPropertiesChanged(resolvedLayoutDirection);
}
mPrivateFlags2 |= PFLAG2_PADDING_RESOLVED;
@@ -11784,19 +11789,6 @@
}
/**
- * Resolve padding depending on the layout direction. Subclasses that care about
- * padding resolution should override this method. The default implementation does
- * nothing.
- *
- * @param layoutDirection the direction of the layout
- *
- * @see #LAYOUT_DIRECTION_LTR
- * @see #LAYOUT_DIRECTION_RTL
- */
- public void onPaddingChanged(int layoutDirection) {
- }
-
- /**
* This is called when the view is detached from a window. At this point it
* no longer has a surface for drawing.
*
@@ -11827,7 +11819,7 @@
mCurrentAnimation = null;
resetRtlProperties();
- onRtlPropertiesChanged();
+ onRtlPropertiesChanged(LAYOUT_DIRECTION_DEFAULT);
resetAccessibilityStateChanged();
}
@@ -16618,7 +16610,7 @@
// Do resolution
resolveTextDirection();
// Notify change
- onRtlPropertiesChanged();
+ onRtlPropertiesChanged(getLayoutDirection());
// Refresh
requestLayout();
invalidate(true);
@@ -16812,7 +16804,7 @@
// Do resolution
resolveTextAlignment();
// Notify change
- onRtlPropertiesChanged();
+ onRtlPropertiesChanged(getLayoutDirection());
// Refresh
requestLayout();
invalidate(true);