ViewGroupCompatpublic class ViewGroupCompat extends Object Helper for accessing features in {@link ViewGroup}
introduced after API level 4 in a backwards compatible fashion. |
Fields Summary |
---|
public static final int | LAYOUT_MODE_CLIP_BOUNDSThis constant is a {@link #setLayoutMode(ViewGroup, int) layoutMode}.
Clip bounds are the raw values of {@link android.view.View#getLeft() left},
{@link android.view.View#getTop() top},
{@link android.view.View#getRight() right} and {@link android.view.View#getBottom() bottom}. | public static final int | LAYOUT_MODE_OPTICAL_BOUNDSThis constant is a {@link #setLayoutMode(ViewGroup, int) layoutMode}.
Optical bounds describe where a widget appears to be. They sit inside the clip
bounds which need to cover a larger area to allow other effects,
such as shadows and glows, to be drawn. | static final ViewGroupCompatImpl | IMPL |
Constructors Summary |
---|
private ViewGroupCompat()
final int version = Build.VERSION.SDK_INT;
if (version >= 21) {
IMPL = new ViewGroupCompatApi21Impl();
} else if (version >= 18) {
IMPL = new ViewGroupCompatJellybeanMR2Impl();
} else if (version >= 14) {
IMPL = new ViewGroupCompatIcsImpl();
} else if (version >= 11) {
IMPL = new ViewGroupCompatHCImpl();
} else {
IMPL = new ViewGroupCompatStubImpl();
}
|
Methods Summary |
---|
public static int | getLayoutMode(android.view.ViewGroup group)Returns the basis of alignment during layout operations on this ViewGroup:
either {@link #LAYOUT_MODE_CLIP_BOUNDS} or {@link #LAYOUT_MODE_OPTICAL_BOUNDS}.
If no layoutMode was explicitly set, either programmatically or in an XML resource,
the method returns the layoutMode of the view's parent ViewGroup if such a parent exists,
otherwise the method returns a default value of {@link #LAYOUT_MODE_CLIP_BOUNDS}.
return IMPL.getLayoutMode(group);
| public static boolean | isTransitionGroup(android.view.ViewGroup group)Returns true if this ViewGroup should be considered as a single entity for removal
when executing an Activity transition. If this is false, child elements will move
individually during the transition.
return IMPL.isTransitionGroup(group);
| public static boolean | onRequestSendAccessibilityEvent(android.view.ViewGroup group, android.view.View child, android.view.accessibility.AccessibilityEvent event)Called when a child has requested sending an {@link AccessibilityEvent} and
gives an opportunity to its parent to augment the event.
If an {@link AccessibilityDelegateCompat} has been specified via calling
{@link ViewCompat#setAccessibilityDelegate(View, AccessibilityDelegateCompat)} its
{@link AccessibilityDelegateCompat#onRequestSendAccessibilityEvent(ViewGroup, View,
AccessibilityEvent)} is responsible for handling this call.
return IMPL.onRequestSendAccessibilityEvent(group, child, event);
| public static void | setLayoutMode(android.view.ViewGroup group, int mode)Sets the basis of alignment during the layout of this ViewGroup.
Valid values are either {@link #LAYOUT_MODE_CLIP_BOUNDS} or
{@link #LAYOUT_MODE_OPTICAL_BOUNDS}.
IMPL.setLayoutMode(group, mode);
| public static void | setMotionEventSplittingEnabled(android.view.ViewGroup group, boolean split)Enable or disable the splitting of MotionEvents to multiple children during touch event
dispatch. This behavior is enabled by default for applications that target an
SDK version of 11 (Honeycomb) or newer. On earlier platform versions this feature
was not supported and this method is a no-op.
When this option is enabled MotionEvents may be split and dispatched to different child
views depending on where each pointer initially went down. This allows for user interactions
such as scrolling two panes of content independently, chording of buttons, and performing
independent gestures on different pieces of content.
IMPL.setMotionEventSplittingEnabled(group, split);
| public static void | setTransitionGroup(android.view.ViewGroup group, boolean isTransitionGroup)Changes whether or not this ViewGroup should be treated as a single entity during
Activity Transitions.
IMPL.setTransitionGroup(group, isTransitionGroup);
|
|