19648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/* 29648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Copyright (C) 2011 The Android Open Source Project 39648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 49648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Licensed under the Apache License, Version 2.0 (the "License"); 59648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * you may not use this file except in compliance with the License. 69648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * You may obtain a copy of the License at 79648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 89648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * http://www.apache.org/licenses/LICENSE-2.0 99648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Unless required by applicable law or agreed to in writing, software 119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * distributed under the License is distributed on an "AS IS" BASIS, 129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * See the License for the specific language governing permissions and 149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * limitations under the License. 159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpackage android.support.v4.view; 189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.os.Build; 209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.View; 219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.ViewGroup; 229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.accessibility.AccessibilityEvent; 239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/** 250574ca37da4619afe4e26753f5a1b4de314b6565Svetoslav Ganov * Helper for accessing features in {@link ViewGroup} 260574ca37da4619afe4e26753f5a1b4de314b6565Svetoslav Ganov * introduced after API level 4 in a backwards compatible fashion. 279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpublic class ViewGroupCompat { 299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 30b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell /** 31b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * This constant is a {@link #setLayoutMode(ViewGroup, int) layoutMode}. 32b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * Clip bounds are the raw values of {@link android.view.View#getLeft() left}, 33b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * {@link android.view.View#getTop() top}, 34b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * {@link android.view.View#getRight() right} and {@link android.view.View#getBottom() bottom}. 35b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell */ 36b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public static final int LAYOUT_MODE_CLIP_BOUNDS = 0; 37b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 38b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell /** 39b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * This constant is a {@link #setLayoutMode(ViewGroup, int) layoutMode}. 40b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * Optical bounds describe where a widget appears to be. They sit inside the clip 41b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * bounds which need to cover a larger area to allow other effects, 42b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * such as shadows and glows, to be drawn. 43b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell */ 44b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public static final int LAYOUT_MODE_OPTICAL_BOUNDS = 1; 45b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov interface ViewGroupCompatImpl { 479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean onRequestSendAccessibilityEvent(ViewGroup group, View child, 489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov AccessibilityEvent event); 491b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell 501b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell public void setMotionEventSplittingEnabled(ViewGroup group, boolean split); 51b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public int getLayoutMode(ViewGroup group); 52b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public void setLayoutMode(ViewGroup group, int mode); 530bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public void setTransitionGroup(ViewGroup group, boolean isTransitionGroup); 540bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public boolean isTransitionGroup(ViewGroup group); 559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov static class ViewGroupCompatStubImpl implements ViewGroupCompatImpl { 589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean onRequestSendAccessibilityEvent( 599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov ViewGroup group, View child, AccessibilityEvent event) { 609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return true; 619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 621b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell 631b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell public void setMotionEventSplittingEnabled(ViewGroup group, boolean split) { 641b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell // no-op, didn't exist. 651b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell } 66b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 67b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell @Override 68b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public int getLayoutMode(ViewGroup group) { 69b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell return LAYOUT_MODE_CLIP_BOUNDS; 70b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } 71b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 72b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell @Override 73b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public void setLayoutMode(ViewGroup group, int mode) { 74b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell // no-op, didn't exist. Views only support clip bounds. 75b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } 760bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu 770bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu @Override 780bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public void setTransitionGroup(ViewGroup group, boolean isTransitionGroup) { 790bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } 800bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu 810bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu @Override 820bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public boolean isTransitionGroup(ViewGroup group) { 830bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu return false; 840bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } 851b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell } 861b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell 871b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell static class ViewGroupCompatHCImpl extends ViewGroupCompatStubImpl { 881b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell @Override 891b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell public void setMotionEventSplittingEnabled(ViewGroup group, boolean split) { 901b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell ViewGroupCompatHC.setMotionEventSplittingEnabled(group, split); 911b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell } 929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 941b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell static class ViewGroupCompatIcsImpl extends ViewGroupCompatHCImpl { 959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov @Override 969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean onRequestSendAccessibilityEvent( 979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov ViewGroup group, View child, AccessibilityEvent event) { 989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return ViewGroupCompatIcs.onRequestSendAccessibilityEvent(group, child, event); 999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 102b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell static class ViewGroupCompatJellybeanMR2Impl extends ViewGroupCompatIcsImpl { 103b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell @Override 104b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public int getLayoutMode(ViewGroup group) { 105b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell return ViewGroupCompatJellybeanMR2.getLayoutMode(group); 106b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } 107b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 108b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell @Override 109b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public void setLayoutMode(ViewGroup group, int mode) { 110b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell ViewGroupCompatJellybeanMR2.setLayoutMode(group, mode); 111b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } 112b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } 113b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 1140bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu static class ViewGroupCompatApi21Impl extends ViewGroupCompatJellybeanMR2Impl { 1150bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu @Override 1160bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public void setTransitionGroup(ViewGroup group, boolean isTransitionGroup) { 1170bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu ViewGroupCompatApi21.setTransitionGroup(group, isTransitionGroup); 1180bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } 1190bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu 1200bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu @Override 1210bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public boolean isTransitionGroup(ViewGroup group) { 1220bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu return ViewGroupCompatApi21.isTransitionGroup(group); 1230bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } 1240bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } 1250bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu 1269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov static final ViewGroupCompatImpl IMPL; 1279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov static { 1281b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell final int version = Build.VERSION.SDK_INT; 129a52784195525cdb1f2bb4d8dde1b8b314f480957Chet Haase if (version >= 21) { 1300bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu IMPL = new ViewGroupCompatApi21Impl(); 1310bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } else if (version >= 18) { 132b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell IMPL = new ViewGroupCompatJellybeanMR2Impl(); 133b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } else if (version >= 14) { 1349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov IMPL = new ViewGroupCompatIcsImpl(); 1351b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell } else if (version >= 11) { 1361b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell IMPL = new ViewGroupCompatHCImpl(); 1379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } else { 1389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov IMPL = new ViewGroupCompatStubImpl(); 1399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 1429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /* 1439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Hide the constructor. 1449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 1459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov private ViewGroupCompat() { 1469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 1479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 1499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 1509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Called when a child has requested sending an {@link AccessibilityEvent} and 1519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * gives an opportunity to its parent to augment the event. 1529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * <p> 1539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * If an {@link AccessibilityDelegateCompat} has been specified via calling 1549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * {@link ViewCompat#setAccessibilityDelegate(View, AccessibilityDelegateCompat)} its 1559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * {@link AccessibilityDelegateCompat#onRequestSendAccessibilityEvent(ViewGroup, View, 1569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * AccessibilityEvent)} is responsible for handling this call. 1579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * </p> 1589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 1599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param group The group whose method to invoke. 1609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param child The child which requests sending the event. 1619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param event The event to be sent. 1629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return True if the event should be sent. 1639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 1649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public static boolean onRequestSendAccessibilityEvent(ViewGroup group, View child, 1659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov AccessibilityEvent event) { 1669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return IMPL.onRequestSendAccessibilityEvent(group, child, event); 1679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1681b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell 1691b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell /** 1701b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * Enable or disable the splitting of MotionEvents to multiple children during touch event 1711b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * dispatch. This behavior is enabled by default for applications that target an 1721b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * SDK version of 11 (Honeycomb) or newer. On earlier platform versions this feature 1731b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * was not supported and this method is a no-op. 1741b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * 1751b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * <p>When this option is enabled MotionEvents may be split and dispatched to different child 1761b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * views depending on where each pointer initially went down. This allows for user interactions 1771b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * such as scrolling two panes of content independently, chording of buttons, and performing 1781b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * independent gestures on different pieces of content. 1791b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * 1801b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * @param group ViewGroup to modify 1811b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * @param split <code>true</code> to allow MotionEvents to be split and dispatched to multiple 1821b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * child views. <code>false</code> to only allow one child view to be the target of 1831b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell * any MotionEvent received by this ViewGroup. 1841b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell */ 1851b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell public static void setMotionEventSplittingEnabled(ViewGroup group, boolean split) { 1861b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell IMPL.setMotionEventSplittingEnabled(group, split); 1871b8262b87426b2f766b40d6ab4eaeac296d5c2feAdam Powell } 188b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 189b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell /** 190b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * Returns the basis of alignment during layout operations on this ViewGroup: 191b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * either {@link #LAYOUT_MODE_CLIP_BOUNDS} or {@link #LAYOUT_MODE_OPTICAL_BOUNDS}. 192b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * <p> 193b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * If no layoutMode was explicitly set, either programmatically or in an XML resource, 194b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * the method returns the layoutMode of the view's parent ViewGroup if such a parent exists, 195b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * otherwise the method returns a default value of {@link #LAYOUT_MODE_CLIP_BOUNDS}. 196b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * 197b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * @return the layout mode to use during layout operations 198b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * 199b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * @see #setLayoutMode(ViewGroup, int) 200b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell */ 201b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public static int getLayoutMode(ViewGroup group) { 202b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell return IMPL.getLayoutMode(group); 203b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } 204b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell 205b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell /** 206b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * Sets the basis of alignment during the layout of this ViewGroup. 207b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * Valid values are either {@link #LAYOUT_MODE_CLIP_BOUNDS} or 208b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * {@link #LAYOUT_MODE_OPTICAL_BOUNDS}. 209b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * 210b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * @param mode the layout mode to use during layout operations 211b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * 212b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell * @see #getLayoutMode(ViewGroup) 213b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell */ 214b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell public static void setLayoutMode(ViewGroup group, int mode) { 215b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell IMPL.setLayoutMode(group, mode); 216b12ba0547b2fad1c4dfc12dec36c5e7893974e67Adam Powell } 2170bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu 2180bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu /** 2190bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * Changes whether or not this ViewGroup should be treated as a single entity during 2200bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * Activity Transitions. 2210bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * @param isTransitionGroup Whether or not the ViewGroup should be treated as a unit 2220bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * in Activity transitions. If false, the ViewGroup won't transition, 2230bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * only its children. If true, the entire ViewGroup will transition 2240bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * together. 2250bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu */ 2260bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public static void setTransitionGroup(ViewGroup group, boolean isTransitionGroup) { 2270bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu IMPL.setTransitionGroup(group, isTransitionGroup); 2280bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } 2290bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu 2300bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu /** 2310bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * Returns true if this ViewGroup should be considered as a single entity for removal 2320bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * when executing an Activity transition. If this is false, child elements will move 2330bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu * individually during the transition. 2340bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu */ 2350bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu public static boolean isTransitionGroup(ViewGroup group) { 2360bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu return IMPL.isTransitionGroup(group); 2370bf2af5f2d3034e7c8e4aadb076d258122906e1dDake Gu } 2389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov} 239