Loading api/current.xml +44 −48 Original line number Original line Diff line number Diff line Loading @@ -189429,6 +189429,28 @@ visibility="public" visibility="public" > > </method> </method> <method name="getTranslationX" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTranslationY" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getVerticalFadingEdgeLength" <method name="getVerticalFadingEdgeLength" return="int" return="int" abstract="false" abstract="false" Loading Loading @@ -189531,7 +189553,7 @@ </parameter> </parameter> </method> </method> <method name="getX" <method name="getX" return="int" return="float" abstract="false" abstract="false" native="false" native="false" synchronized="false" synchronized="false" Loading @@ -189542,7 +189564,7 @@ > > </method> </method> <method name="getY" <method name="getY" return="int" return="float" abstract="false" abstract="false" native="false" native="false" synchronized="false" synchronized="false" Loading Loading @@ -190947,19 +190969,6 @@ <parameter name="resid" type="int"> <parameter name="resid" type="int"> </parameter> </parameter> </method> </method> <method name="setBottom" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="bottom" type="int"> </parameter> </method> <method name="setClickable" <method name="setClickable" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -191168,19 +191177,6 @@ <parameter name="params" type="android.view.ViewGroup.LayoutParams"> <parameter name="params" type="android.view.ViewGroup.LayoutParams"> </parameter> </parameter> </method> </method> <method name="setLeft" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="left" type="int"> </parameter> </method> <method name="setLongClickable" <method name="setLongClickable" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -191423,19 +191419,6 @@ <parameter name="pressed" type="boolean"> <parameter name="pressed" type="boolean"> </parameter> </parameter> </method> </method> <method name="setRight" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="right" type="int"> </parameter> </method> <method name="setRotation" <method name="setRotation" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -191594,20 +191577,20 @@ <parameter name="tag" type="java.lang.Object"> <parameter name="tag" type="java.lang.Object"> </parameter> </parameter> </method> </method> <method name="setTop" <method name="setTouchDelegate" return="void" return="void" abstract="false" abstract="false" native="false" native="false" synchronized="false" synchronized="false" static="false" static="false" final="true" final="false" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="top" type="int"> <parameter name="delegate" type="android.view.TouchDelegate"> </parameter> </parameter> </method> </method> <method name="setTouchDelegate" <method name="setTranslationX" return="void" return="void" abstract="false" abstract="false" native="false" native="false" Loading @@ -191617,7 +191600,20 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="delegate" type="android.view.TouchDelegate"> <parameter name="translationX" type="float"> </parameter> </method> <method name="setTranslationY" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="translationY" type="float"> </parameter> </parameter> </method> </method> <method name="setVerticalFadingEdgeEnabled" <method name="setVerticalFadingEdgeEnabled" Loading Loading @@ -191695,7 +191691,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="x" type="int"> <parameter name="x" type="float"> </parameter> </parameter> </method> </method> <method name="setY" <method name="setY" Loading @@ -191708,7 +191704,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="y" type="int"> <parameter name="y" type="float"> </parameter> </parameter> </method> </method> <method name="showContextMenu" <method name="showContextMenu" core/java/android/view/View.java +93 −158 Original line number Original line Diff line number Diff line Loading @@ -1632,6 +1632,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility @ViewDebug.ExportedProperty @ViewDebug.ExportedProperty private float mRotation = 0f; private float mRotation = 0f; /** * The amount of translation of the object away from its left property (post-layout). */ @ViewDebug.ExportedProperty private float mTranslationX = 0f; /** * The amount of translation of the object away from its top property (post-layout). */ @ViewDebug.ExportedProperty private float mTranslationY = 0f; /** /** * The amount of scale in the x direction around the pivot point. A * The amount of scale in the x direction around the pivot point. A * value of 1 means no scaling is applied. * value of 1 means no scaling is applied. Loading Loading @@ -4885,7 +4897,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility // transform-related properties have changed since the last time someone // transform-related properties have changed since the last time someone // asked for the matrix; recalculate it with the current values // asked for the matrix; recalculate it with the current values mMatrix.reset(); mMatrix.reset(); mMatrix.setRotate(mRotation, mPivotX, mPivotY); mMatrix.setTranslate(mTranslationX, mTranslationY); mMatrix.preRotate(mRotation, mPivotX, mPivotY); mMatrix.preScale(mScaleX, mScaleY, mPivotX, mPivotY); mMatrix.preScale(mScaleX, mScaleY, mPivotX, mPivotY); mMatrixDirty = false; mMatrixDirty = false; mMatrixIsIdentity = mMatrix.isIdentity(); mMatrixIsIdentity = mMatrix.isIdentity(); Loading Loading @@ -5107,43 +5120,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mTop; return mTop; } } /** * Sets the top position of this view relative to its parent. * * @param top The top of this view, in pixels. */ public final void setTop(int top) { if (top != mTop) { if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int minTop; int yLoc; if (top < mTop) { minTop = top; yLoc = top - mTop; } else { minTop = mTop; yLoc = 0; } r.set(0, yLoc, mRight - mLeft, mBottom - minTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } mTop = top; if (!mMatrixIsIdentity) { mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * Bottom position of this view relative to its parent. * Bottom position of this view relative to its parent. * * Loading @@ -5154,40 +5130,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mBottom; return mBottom; } } /** * Sets the bottom position of this view relative to its parent. * * @param bottom The bottom of this view, in pixels. */ public final void setBottom(int bottom) { if (bottom != mBottom) { if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int maxBottom; if (bottom < mBottom) { maxBottom = mBottom; } else { maxBottom = bottom; } r.set(0, 0, mRight - mLeft, maxBottom - mTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } mBottom = bottom; if (!mMatrixIsIdentity) { mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * Left position of this view relative to its parent. * Left position of this view relative to its parent. * * Loading @@ -5198,43 +5140,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mLeft; return mLeft; } } /** * Sets the left position of this view relative to its parent. * * @param left The bottom of this view, in pixels. */ public final void setLeft(int left) { if (left != mLeft) { if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int minLeft; int xLoc; if (left < mLeft) { minLeft = left; xLoc = left - mLeft; } else { minLeft = mLeft; xLoc = 0; } r.set(xLoc, 0, mRight - minLeft, mBottom - mTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } mLeft = left; if (!mMatrixIsIdentity) { mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * Right position of this view relative to its parent. * Right position of this view relative to its parent. * * Loading @@ -5246,79 +5151,109 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } } /** /** * Sets the right position of this view relative to its parent. * The visual x position of this view, in pixels. This is equivalent to the * {@link #setTranslationX(float) translationX} property plus the current * {@link #getLeft() left} property. * * * @param right The bottom of this view, in pixels. * @return The visual x position of this view, in pixels. */ */ public final void setRight(int right) { public float getX() { if (right != mRight) { return mLeft + mTranslationX; if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int maxRight; if (right < mRight) { maxRight = mRight; } else { maxRight = right; } r.set(0, 0, maxRight - mLeft, mBottom - mTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } } mRight = right; /** * Sets the visual x position of this view, in pixels. This is equivalent to setting the if (!mMatrixIsIdentity) { * {@link #setTranslationX(float) translationX} property to be the difference between mPrivateFlags |= DRAWN; // force another invalidation with the new orientation * the x value passed in and the current {@link #getLeft() left} property. invalidate(); * * @param x The visual x position of this view, in pixels. */ public void setX(float x) { setTranslationX(x - mLeft); } } /** * The visual y position of this view, in pixels. This is equivalent to the * {@link #setTranslationY(float) translationY} property plus the current * {@link #getTop() top} property. * * @return The visual y position of this view, in pixels. */ public float getY() { return mTop + mTranslationY; } } /** * Sets the visual y position of this view, in pixels. This is equivalent to setting the * {@link #setTranslationY(float) translationY} property to be the difference between * the y value passed in and the current {@link #getTop() top} property. * * @param y The visual y position of this view, in pixels. */ public void setY(float y) { setTranslationY(y - mTop); } } /** /** * The horizontal location of this view relative to its parent. This value is equivalent to the * The horizontal location of this view relative to its {@link #getLeft() left} position. * {@link #getLeft() left} property. * This position is post-layout, in addition to wherever the object's * layout placed it. * * * @return The horizontal position of this view, in pixels. * @return The horizontal position of this view relative to its left position, in pixels. */ */ public int getX() { public float getTranslationX() { return mLeft; return mTranslationX; } } /** /** * Sets the horizontal location of this view relative to its parent. Setting this value will * Sets the horizontal location of this view relative to its {@link #getLeft() left} position. * affect both the {@link #setLeft(int) left} and {@link #setRight(int) right} properties * This effectively positions the object post-layout, in addition to wherever the object's * of this view. * layout placed it. * * * @param x The horizontal position of this view, in pixels. * @param translationX The horizontal position of this view relative to its left position, * in pixels. */ */ public void setX(int x) { public void setTranslationX(float translationX) { offsetLeftAndRight(x - mLeft); if (mTranslationX != translationX) { // Double-invalidation is necessary to capture view's old and new areas invalidate(); mTranslationX = translationX; mMatrixDirty = true; mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * The vertical location of this view relative to its parent. This value is equivalent to the * The horizontal location of this view relative to its {@link #getTop() top} position. * {@link #getTop() left} property. * This position is post-layout, in addition to wherever the object's * layout placed it. * * * @return The vertical position of this view, in pixels. * @return The vertical position of this view relative to its top position, * in pixels. */ */ public int getY() { public float getTranslationY() { return mTop; return mTranslationY; } } /** /** * Sets the vertical location of this view relative to its parent. Setting this value will * Sets the vertical location of this view relative to its {@link #getTop() top} position. * affect both the {@link #setTop(int) left} and {@link #setBottom(int) right} properties * This effectively positions the object post-layout, in addition to wherever the object's * of this view. * layout placed it. * * * @param y The vertical position of this view, in pixels. * @param translationY The vertical position of this view relative to its top position, * in pixels. */ */ public void setY(int y) { public void setTranslationY(float translationY) { offsetTopAndBottom(y - mTop); if (mTranslationY != translationY) { // Double-invalidation is necessary to capture view's old and new areas invalidate(); mTranslationY = translationY; mMatrixDirty = true; mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** Loading core/java/android/view/ViewGroup.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1580,6 +1580,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } } } concatMatrix |= !child.hasIdentityMatrix(); // Sets the flag as early as possible to allow draw() implementations // Sets the flag as early as possible to allow draw() implementations // to call invalidate() successfully when doing animations // to call invalidate() successfully when doing animations child.mPrivateFlags |= DRAWN; child.mPrivateFlags |= DRAWN; Loading Loading @@ -1744,6 +1746,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final View[] children = mChildren; final View[] children = mChildren; final int count = mChildrenCount; final int count = mChildrenCount; for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) { children[i].setSelected(selected); children[i].setSelected(selected); } } } } Loading Loading
api/current.xml +44 −48 Original line number Original line Diff line number Diff line Loading @@ -189429,6 +189429,28 @@ visibility="public" visibility="public" > > </method> </method> <method name="getTranslationX" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTranslationY" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getVerticalFadingEdgeLength" <method name="getVerticalFadingEdgeLength" return="int" return="int" abstract="false" abstract="false" Loading Loading @@ -189531,7 +189553,7 @@ </parameter> </parameter> </method> </method> <method name="getX" <method name="getX" return="int" return="float" abstract="false" abstract="false" native="false" native="false" synchronized="false" synchronized="false" Loading @@ -189542,7 +189564,7 @@ > > </method> </method> <method name="getY" <method name="getY" return="int" return="float" abstract="false" abstract="false" native="false" native="false" synchronized="false" synchronized="false" Loading Loading @@ -190947,19 +190969,6 @@ <parameter name="resid" type="int"> <parameter name="resid" type="int"> </parameter> </parameter> </method> </method> <method name="setBottom" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="bottom" type="int"> </parameter> </method> <method name="setClickable" <method name="setClickable" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -191168,19 +191177,6 @@ <parameter name="params" type="android.view.ViewGroup.LayoutParams"> <parameter name="params" type="android.view.ViewGroup.LayoutParams"> </parameter> </parameter> </method> </method> <method name="setLeft" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="left" type="int"> </parameter> </method> <method name="setLongClickable" <method name="setLongClickable" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -191423,19 +191419,6 @@ <parameter name="pressed" type="boolean"> <parameter name="pressed" type="boolean"> </parameter> </parameter> </method> </method> <method name="setRight" return="void" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <parameter name="right" type="int"> </parameter> </method> <method name="setRotation" <method name="setRotation" return="void" return="void" abstract="false" abstract="false" Loading Loading @@ -191594,20 +191577,20 @@ <parameter name="tag" type="java.lang.Object"> <parameter name="tag" type="java.lang.Object"> </parameter> </parameter> </method> </method> <method name="setTop" <method name="setTouchDelegate" return="void" return="void" abstract="false" abstract="false" native="false" native="false" synchronized="false" synchronized="false" static="false" static="false" final="true" final="false" deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="top" type="int"> <parameter name="delegate" type="android.view.TouchDelegate"> </parameter> </parameter> </method> </method> <method name="setTouchDelegate" <method name="setTranslationX" return="void" return="void" abstract="false" abstract="false" native="false" native="false" Loading @@ -191617,7 +191600,20 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="delegate" type="android.view.TouchDelegate"> <parameter name="translationX" type="float"> </parameter> </method> <method name="setTranslationY" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="translationY" type="float"> </parameter> </parameter> </method> </method> <method name="setVerticalFadingEdgeEnabled" <method name="setVerticalFadingEdgeEnabled" Loading Loading @@ -191695,7 +191691,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="x" type="int"> <parameter name="x" type="float"> </parameter> </parameter> </method> </method> <method name="setY" <method name="setY" Loading @@ -191708,7 +191704,7 @@ deprecated="not deprecated" deprecated="not deprecated" visibility="public" visibility="public" > > <parameter name="y" type="int"> <parameter name="y" type="float"> </parameter> </parameter> </method> </method> <method name="showContextMenu" <method name="showContextMenu"
core/java/android/view/View.java +93 −158 Original line number Original line Diff line number Diff line Loading @@ -1632,6 +1632,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility @ViewDebug.ExportedProperty @ViewDebug.ExportedProperty private float mRotation = 0f; private float mRotation = 0f; /** * The amount of translation of the object away from its left property (post-layout). */ @ViewDebug.ExportedProperty private float mTranslationX = 0f; /** * The amount of translation of the object away from its top property (post-layout). */ @ViewDebug.ExportedProperty private float mTranslationY = 0f; /** /** * The amount of scale in the x direction around the pivot point. A * The amount of scale in the x direction around the pivot point. A * value of 1 means no scaling is applied. * value of 1 means no scaling is applied. Loading Loading @@ -4885,7 +4897,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility // transform-related properties have changed since the last time someone // transform-related properties have changed since the last time someone // asked for the matrix; recalculate it with the current values // asked for the matrix; recalculate it with the current values mMatrix.reset(); mMatrix.reset(); mMatrix.setRotate(mRotation, mPivotX, mPivotY); mMatrix.setTranslate(mTranslationX, mTranslationY); mMatrix.preRotate(mRotation, mPivotX, mPivotY); mMatrix.preScale(mScaleX, mScaleY, mPivotX, mPivotY); mMatrix.preScale(mScaleX, mScaleY, mPivotX, mPivotY); mMatrixDirty = false; mMatrixDirty = false; mMatrixIsIdentity = mMatrix.isIdentity(); mMatrixIsIdentity = mMatrix.isIdentity(); Loading Loading @@ -5107,43 +5120,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mTop; return mTop; } } /** * Sets the top position of this view relative to its parent. * * @param top The top of this view, in pixels. */ public final void setTop(int top) { if (top != mTop) { if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int minTop; int yLoc; if (top < mTop) { minTop = top; yLoc = top - mTop; } else { minTop = mTop; yLoc = 0; } r.set(0, yLoc, mRight - mLeft, mBottom - minTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } mTop = top; if (!mMatrixIsIdentity) { mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * Bottom position of this view relative to its parent. * Bottom position of this view relative to its parent. * * Loading @@ -5154,40 +5130,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mBottom; return mBottom; } } /** * Sets the bottom position of this view relative to its parent. * * @param bottom The bottom of this view, in pixels. */ public final void setBottom(int bottom) { if (bottom != mBottom) { if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int maxBottom; if (bottom < mBottom) { maxBottom = mBottom; } else { maxBottom = bottom; } r.set(0, 0, mRight - mLeft, maxBottom - mTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } mBottom = bottom; if (!mMatrixIsIdentity) { mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * Left position of this view relative to its parent. * Left position of this view relative to its parent. * * Loading @@ -5198,43 +5140,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mLeft; return mLeft; } } /** * Sets the left position of this view relative to its parent. * * @param left The bottom of this view, in pixels. */ public final void setLeft(int left) { if (left != mLeft) { if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int minLeft; int xLoc; if (left < mLeft) { minLeft = left; xLoc = left - mLeft; } else { minLeft = mLeft; xLoc = 0; } r.set(xLoc, 0, mRight - minLeft, mBottom - mTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } mLeft = left; if (!mMatrixIsIdentity) { mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * Right position of this view relative to its parent. * Right position of this view relative to its parent. * * Loading @@ -5246,79 +5151,109 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } } /** /** * Sets the right position of this view relative to its parent. * The visual x position of this view, in pixels. This is equivalent to the * {@link #setTranslationX(float) translationX} property plus the current * {@link #getLeft() left} property. * * * @param right The bottom of this view, in pixels. * @return The visual x position of this view, in pixels. */ */ public final void setRight(int right) { public float getX() { if (right != mRight) { return mLeft + mTranslationX; if (hasIdentityMatrix()) { final ViewParent p = mParent; if (p != null && mAttachInfo != null) { final Rect r = mAttachInfo.mTmpInvalRect; int maxRight; if (right < mRight) { maxRight = mRight; } else { maxRight = right; } r.set(0, 0, maxRight - mLeft, mBottom - mTop); p.invalidateChild(this, r); } } else { // Double-invalidation is necessary to capture view's old and new areas invalidate(); } } mRight = right; /** * Sets the visual x position of this view, in pixels. This is equivalent to setting the if (!mMatrixIsIdentity) { * {@link #setTranslationX(float) translationX} property to be the difference between mPrivateFlags |= DRAWN; // force another invalidation with the new orientation * the x value passed in and the current {@link #getLeft() left} property. invalidate(); * * @param x The visual x position of this view, in pixels. */ public void setX(float x) { setTranslationX(x - mLeft); } } /** * The visual y position of this view, in pixels. This is equivalent to the * {@link #setTranslationY(float) translationY} property plus the current * {@link #getTop() top} property. * * @return The visual y position of this view, in pixels. */ public float getY() { return mTop + mTranslationY; } } /** * Sets the visual y position of this view, in pixels. This is equivalent to setting the * {@link #setTranslationY(float) translationY} property to be the difference between * the y value passed in and the current {@link #getTop() top} property. * * @param y The visual y position of this view, in pixels. */ public void setY(float y) { setTranslationY(y - mTop); } } /** /** * The horizontal location of this view relative to its parent. This value is equivalent to the * The horizontal location of this view relative to its {@link #getLeft() left} position. * {@link #getLeft() left} property. * This position is post-layout, in addition to wherever the object's * layout placed it. * * * @return The horizontal position of this view, in pixels. * @return The horizontal position of this view relative to its left position, in pixels. */ */ public int getX() { public float getTranslationX() { return mLeft; return mTranslationX; } } /** /** * Sets the horizontal location of this view relative to its parent. Setting this value will * Sets the horizontal location of this view relative to its {@link #getLeft() left} position. * affect both the {@link #setLeft(int) left} and {@link #setRight(int) right} properties * This effectively positions the object post-layout, in addition to wherever the object's * of this view. * layout placed it. * * * @param x The horizontal position of this view, in pixels. * @param translationX The horizontal position of this view relative to its left position, * in pixels. */ */ public void setX(int x) { public void setTranslationX(float translationX) { offsetLeftAndRight(x - mLeft); if (mTranslationX != translationX) { // Double-invalidation is necessary to capture view's old and new areas invalidate(); mTranslationX = translationX; mMatrixDirty = true; mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** * The vertical location of this view relative to its parent. This value is equivalent to the * The horizontal location of this view relative to its {@link #getTop() top} position. * {@link #getTop() left} property. * This position is post-layout, in addition to wherever the object's * layout placed it. * * * @return The vertical position of this view, in pixels. * @return The vertical position of this view relative to its top position, * in pixels. */ */ public int getY() { public float getTranslationY() { return mTop; return mTranslationY; } } /** /** * Sets the vertical location of this view relative to its parent. Setting this value will * Sets the vertical location of this view relative to its {@link #getTop() top} position. * affect both the {@link #setTop(int) left} and {@link #setBottom(int) right} properties * This effectively positions the object post-layout, in addition to wherever the object's * of this view. * layout placed it. * * * @param y The vertical position of this view, in pixels. * @param translationY The vertical position of this view relative to its top position, * in pixels. */ */ public void setY(int y) { public void setTranslationY(float translationY) { offsetTopAndBottom(y - mTop); if (mTranslationY != translationY) { // Double-invalidation is necessary to capture view's old and new areas invalidate(); mTranslationY = translationY; mMatrixDirty = true; mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(); } } } /** /** Loading
core/java/android/view/ViewGroup.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1580,6 +1580,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } } } concatMatrix |= !child.hasIdentityMatrix(); // Sets the flag as early as possible to allow draw() implementations // Sets the flag as early as possible to allow draw() implementations // to call invalidate() successfully when doing animations // to call invalidate() successfully when doing animations child.mPrivateFlags |= DRAWN; child.mPrivateFlags |= DRAWN; Loading Loading @@ -1744,6 +1746,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final View[] children = mChildren; final View[] children = mChildren; final int count = mChildrenCount; final int count = mChildrenCount; for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) { children[i].setSelected(selected); children[i].setSelected(selected); } } } } Loading