Changed name of recent hasLayout() method to isLaidOut()

This new method on view reflects whether the view has been laid out
at least once since it was attached. hasLayout() seems too vague for that
meaning; every View that has a parent has a layout (since we use container,
parent, and layout interchangeably). The new version of the method
is closer to the actual meaning.

Change-Id: I519745739b6a6317faeb077aa61f994025cf81f3
This commit is contained in:
Chet Haase
2013-07-17 10:22:53 -07:00
parent 4a8baef3f5
commit 7a46dde1ae
5 changed files with 10 additions and 10 deletions

View File

@@ -26768,7 +26768,6 @@ package android.view {
method public float getY();
method public boolean hasFocus();
method public boolean hasFocusable();
method public boolean hasLayout();
method public boolean hasOnClickListeners();
method public boolean hasOverlappingRendering();
method public boolean hasTransientState();
@@ -26798,6 +26797,7 @@ package android.view {
method public boolean isInEditMode();
method public boolean isInLayout();
method public boolean isInTouchMode();
method public boolean isLaidOut();
method public boolean isLayoutDirectionResolved();
method public boolean isLayoutRequested();
method public boolean isLongClickable();

View File

@@ -2198,7 +2198,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* Flag indicating that the view has been through at least one layout since it
* was last attached to a window.
*/
static final int PFLAG3_HAS_LAYOUT = 0x4;
static final int PFLAG3_IS_LAID_OUT = 0x4;
/**
* Flag indicating that a call to measure() was skipped and should be done
@@ -6160,8 +6160,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* Returns true if this view has been through at least one layout since it
* was last attached to or detached from a window.
*/
public boolean hasLayout() {
return (mPrivateFlags3 & PFLAG3_HAS_LAYOUT) == PFLAG3_HAS_LAYOUT;
public boolean isLaidOut() {
return (mPrivateFlags3 & PFLAG3_IS_LAID_OUT) == PFLAG3_IS_LAID_OUT;
}
/**
@@ -11813,7 +11813,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mPrivateFlags &= ~PFLAG_AWAKEN_SCROLL_BARS_ON_ATTACH;
}
mPrivateFlags3 &= ~PFLAG3_HAS_LAYOUT;
mPrivateFlags3 &= ~PFLAG3_IS_LAID_OUT;
jumpDrawablesToCurrentState();
@@ -12112,7 +12112,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
protected void onDetachedFromWindow() {
mPrivateFlags &= ~PFLAG_CANCEL_NEXT_UP_EVENT;
mPrivateFlags3 &= ~PFLAG3_HAS_LAYOUT;
mPrivateFlags3 &= ~PFLAG3_IS_LAID_OUT;
removeUnsetPressCallback();
removeLongPressCallback();
@@ -14439,7 +14439,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
mPrivateFlags &= ~PFLAG_FORCE_LAYOUT;
mPrivateFlags3 |= PFLAG3_HAS_LAYOUT;
mPrivateFlags3 |= PFLAG3_IS_LAID_OUT;
}
/**

View File

@@ -320,7 +320,7 @@ public class TransitionManager {
* value of null causes the TransitionManager to use the default transition.
*/
public static void beginDelayedTransition(final ViewGroup sceneRoot, Transition transition) {
if (!sPendingTransitions.contains(sceneRoot) && sceneRoot.hasLayout()) {
if (!sPendingTransitions.contains(sceneRoot) && sceneRoot.isLaidOut()) {
if (Transition.DBG) {
Log.d(LOG_TAG, "beginDelayedTransition: root, transition = " +
sceneRoot + ", " + transition);

View File

@@ -1480,7 +1480,7 @@ public class HorizontalScrollView extends FrameLayout {
}
mChildToScrollTo = null;
if (!hasLayout()) {
if (!isLaidOut()) {
final int scrollRange = Math.max(0,
childWidth - (r - l - mPaddingLeft - mPaddingRight));
if (mSavedState != null) {

View File

@@ -1473,7 +1473,7 @@ public class ScrollView extends FrameLayout {
}
mChildToScrollTo = null;
if (!hasLayout()) {
if (!isLaidOut()) {
if (mSavedState != null) {
mScrollY = mSavedState.scrollPosition;
mSavedState = null;