Java Code Examples for android.view.ViewGroup#isTransitionGroup()

The following examples show how to use android.view.ViewGroup#isTransitionGroup() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SharedElementUtils.java    From scene with Apache License 2.0 6 votes vote down vote up
private static void captureTransitioningViews(View view, View rootView, List<View> list) {
    if (view.getVisibility() != View.VISIBLE) {
        return;
    }
    if (view instanceof ViewGroup) {
        ViewGroup viewGroup = (ViewGroup) view;
        if (viewGroup.isTransitionGroup() && view != rootView) {
            list.add(viewGroup);
        } else {
            for (int i = 0; i < viewGroup.getChildCount(); i++) {
                captureTransitioningViews(viewGroup.getChildAt(i), rootView, list);
            }
        }
    } else {
        if (view.getVisibility() == View.VISIBLE) {
            list.add(view);
        }
    }
}
 
Example 2
Source File: FragmentTransitionCompat21.java    From adt-leanback-support with Apache License 2.0 6 votes vote down vote up
private static void captureTransitioningViews(ArrayList<View> transitioningViews, View view) {
    if (view.getVisibility() == View.VISIBLE) {
        if (view instanceof ViewGroup) {
            ViewGroup viewGroup = (ViewGroup) view;
            if (viewGroup.isTransitionGroup()) {
                transitioningViews.add(viewGroup);
            } else {
                int count = viewGroup.getChildCount();
                for (int i = 0; i < count; i++) {
                    View child = viewGroup.getChildAt(i);
                    captureTransitioningViews(transitioningViews, child);
                }
            }
        } else {
            transitioningViews.add(view);
        }
    }
}
 
Example 3
Source File: ActivityTransitionCoordinator.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public static boolean isInTransitionGroup(ViewParent viewParent, ViewGroup decor) {
    if (viewParent == decor || !(viewParent instanceof ViewGroup)) {
        return false;
    }
    ViewGroup parent = (ViewGroup) viewParent;
    if (parent.isTransitionGroup()) {
        return true;
    } else {
        return isInTransitionGroup(parent.getParent(), decor);
    }
}
 
Example 4
Source File: ViewGroupCompatApi21.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static boolean isTransitionGroup(ViewGroup group) {
    return group.isTransitionGroup();
}