diff options
author | Chris Craik <ccraik@google.com> | 2013-12-19 13:31:15 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2013-12-20 15:15:01 -0800 |
commit | d863a10b2870ca27f631b2ec69f3e13faed1d02a (patch) | |
tree | 5f5abd6d5dee7c6665c6f2bf62be8b1296b5566b /core/java/android/view/ViewGroup.java | |
parent | 3c8a529b3c2a0bb1eceb3c1ec7afa58634ace044 (diff) | |
download | frameworks_base-d863a10b2870ca27f631b2ec69f3e13faed1d02a.zip frameworks_base-d863a10b2870ca27f631b2ec69f3e13faed1d02a.tar.gz frameworks_base-d863a10b2870ca27f631b2ec69f3e13faed1d02a.tar.bz2 |
Add initial APIs for 3d view manipulation.
Change-Id: I6de00bc577d5b3a1fbc9ca3a3b3668fcfa32b867
Diffstat (limited to 'core/java/android/view/ViewGroup.java')
-rw-r--r-- | core/java/android/view/ViewGroup.java | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 3ee3057..241b1a7 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -355,6 +355,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager private static final int FLAG_LAYOUT_MODE_WAS_EXPLICITLY_SET = 0x800000; /** + * When true, indicates that all 3d composited descendents are contained within this group, and + * will not be interleaved with other 3d composited content. + */ + static final int FLAG_IS_CONTAINED_VOLUME = 0x1000000; + + /** * Indicates which types of drawing caches are to be kept in memory. * This field should be made private, so it is hidden from the SDK. * {@hide} @@ -486,6 +492,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mGroupFlags |= FLAG_ANIMATION_DONE; mGroupFlags |= FLAG_ANIMATION_CACHE; mGroupFlags |= FLAG_ALWAYS_DRAWN_WITH_CACHE; + mGroupFlags |= FLAG_IS_CONTAINED_VOLUME; if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.HONEYCOMB) { mGroupFlags |= FLAG_SPLIT_MOTION_EVENTS; @@ -3104,7 +3111,44 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } /** - * Returns whether ths group's children are clipped to their bounds before drawing. + * Returns whether this group's descendents are drawn in their own + * independent Z volume. Views drawn in one contained volume will not + * interleave with views in another, even if their Z values are interleaved. + * The default value is true. + * @see #setIsContainedVolume(boolean) + * + * @return True if the ViewGroup is a contained volume. + * + * @hide + */ + public boolean isContainedVolume() { + return ((mGroupFlags & FLAG_IS_CONTAINED_VOLUME) != 0); + } + + /** + * By default, only direct children of a group can interleave with + * interleaved Z values. Set to false on individual groups to enable Z + * interleaving of views that aren't direct siblings. + * + * @return True if the group should be a contained volume with its own Z + * ordering space, false if its decendents should join the current Z + * ordering volume. + * @attr ref android.R.styleable#ViewGroup_isContainedVolume + * + * @hide + */ + public void setIsContainedVolume(boolean isContainedVolume) { + boolean previousValue = (mGroupFlags & FLAG_IS_CONTAINED_VOLUME) == FLAG_IS_CONTAINED_VOLUME; + if (isContainedVolume != previousValue) { + setBooleanFlag(FLAG_IS_CONTAINED_VOLUME, isContainedVolume); + if (mDisplayList != null) { + mDisplayList.setIsContainedVolume(isContainedVolume); + } + } + } + + /** + * Returns whether this group's children are clipped to their bounds before drawing. * The default value is true. * @see #setClipChildren(boolean) * |