diff options
| author | Chris Craik <ccraik@google.com> | 2013-12-13 21:55:49 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-12-13 21:55:50 +0000 |
| commit | 18809c063b89d9b235401d080b952885a4ef9628 (patch) | |
| tree | 7a73454d7d3007b5d08032bfff6515b435947fb2 /core/java/android/view/View.java | |
| parent | f8bc964289df5ea53672df401c6d51dd47c02e53 (diff) | |
| parent | f57776b2d195f0937906eb88b777bb55ccc36967 (diff) | |
| download | frameworks_base-18809c063b89d9b235401d080b952885a4ef9628.zip frameworks_base-18809c063b89d9b235401d080b952885a4ef9628.tar.gz frameworks_base-18809c063b89d9b235401d080b952885a4ef9628.tar.bz2 | |
Merge "3d view system!"
Diffstat (limited to 'core/java/android/view/View.java')
| -rw-r--r-- | core/java/android/view/View.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 0439b50..a0e6924 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2981,6 +2981,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @ViewDebug.ExportedProperty float mTranslationY = 0f; + @ViewDebug.ExportedProperty + float mTranslationZ = 0f; + /** * The amount of scale in the x direction around the pivot point. A * value of 1 means no scaling is applied. @@ -10508,6 +10511,35 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** + * @hide + */ + @ViewDebug.ExportedProperty(category = "drawing") + public float getTranslationZ() { + return mTransformationInfo != null ? mTransformationInfo.mTranslationZ : 0; + } + + /** + * @hide + */ + public void setTranslationZ(float translationZ) { + ensureTransformationInfo(); + final TransformationInfo info = mTransformationInfo; + if (info.mTranslationZ != translationZ) { + invalidateViewProperty(true, false); + info.mTranslationZ = translationZ; + info.mMatrixDirty = true; + invalidateViewProperty(false, true); + if (mDisplayList != null) { + mDisplayList.setTranslationZ(translationZ); + } + if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) { + // View was rejected last time it was drawn by its parent; this may have changed + invalidateParentIfNeeded(); + } + } + } + + /** * Hit rectangle in parent's coordinates * * @param outRect The hit rectangle of the view. @@ -14173,6 +14205,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } displayList.setTransformationInfo(alpha, mTransformationInfo.mTranslationX, mTransformationInfo.mTranslationY, + mTransformationInfo.mTranslationZ, mTransformationInfo.mRotation, mTransformationInfo.mRotationX, mTransformationInfo.mRotationY, mTransformationInfo.mScaleX, mTransformationInfo.mScaleY); |
