android.support.v4.view.ScrollingView Java Examples

The following examples show how to use android.support.v4.view.ScrollingView. 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: RefreshContentWrapper.java    From CollapsingRefresh with Apache License 2.0 6 votes vote down vote up
private View findScrollableViewInternal(View content, boolean selfable) {
    View scrollableView = null;
    Queue<View> views = new LinkedBlockingQueue<>(Collections.singletonList(content));
    while (!views.isEmpty() && scrollableView == null) {
        View view = views.poll();
        if (view != null) {
            if ((selfable || view != content) && (view instanceof AbsListView
                    || view instanceof ScrollView
                    || view instanceof ScrollingView
                    || view instanceof NestedScrollingChild
                    || view instanceof NestedScrollingParent
                    || view instanceof WebView
                    || view instanceof ViewPager)) {
                scrollableView = view;
            } else if (view instanceof ViewGroup) {
                ViewGroup group = (ViewGroup) view;
                for (int j = 0; j < group.getChildCount(); j++) {
                    views.add(group.getChildAt(j));
                }
            }
        }
    }
    return scrollableView;
}
 
Example #2
Source File: SwipeBackLayout.java    From Readhub with Apache License 2.0 6 votes vote down vote up
/**
 * Find out the scrollable child view from a ViewGroup.
 */
private void findScrollView(ViewGroup viewGroup) {
    scrollChild = viewGroup;
    if (viewGroup.getChildCount() > 0) {
        int count = viewGroup.getChildCount();
        View child;
        for (int i = 0; i < count; i++) {
            child = viewGroup.getChildAt(i);
            if (child instanceof ScrollingView ||
                child instanceof AbsListView ||
                child instanceof ScrollView ||
                child instanceof ViewPager ||
                child instanceof WebView) {
                scrollChild = child;
                return;
            }
        }
    }
}
 
Example #3
Source File: VideoView.java    From GiraffePlayer2 with Apache License 2.0 5 votes vote down vote up
/**
 * is video controllerView in 'list' controllerView
 *
 * @return
 */
public boolean inListView() {
    for (ViewParent vp = getParent(); vp != null; vp = vp.getParent()) {
        if (vp instanceof AbsListView || vp instanceof ScrollingView || vp instanceof ScrollView) {
            return true;
        }
    }
    return false;
}