当前位置: 首页>>代码示例>>Java>>正文


Java NestedScrollingParent类代码示例

本文整理汇总了Java中android.support.v4.view.NestedScrollingParent的典型用法代码示例。如果您正苦于以下问题:Java NestedScrollingParent类的具体用法?Java NestedScrollingParent怎么用?Java NestedScrollingParent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NestedScrollingParent类属于android.support.v4.view包,在下文中一共展示了NestedScrollingParent类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findScrollableViewInternal

import android.support.v4.view.NestedScrollingParent; //导入依赖的package包/类
protected 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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:RefreshContentWrapper.java

示例2: setPrimaryItem

import android.support.v4.view.NestedScrollingParent; //导入依赖的package包/类
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
    super.setPrimaryItem(container, position, object);
    if (object instanceof View) {
        mScrollableView = ((View) object);
    } else if (object instanceof Fragment) {
        mScrollableView = ((Fragment) object).getView();
    }
    if (mScrollableView != null) {
        mScrollableView = findScrollableViewInternal(mScrollableView, true);
        if (mScrollableView instanceof NestedScrollingParent
                && !(mScrollableView instanceof NestedScrollingChild)) {
            mScrollableView = findScrollableViewInternal(mScrollableView, false);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:RefreshContentWrapper.java

示例3: findScrollableView

import android.support.v4.view.NestedScrollingParent; //导入依赖的package包/类
protected void findScrollableView(View content, RefreshKernel kernel) {
    mScrollableView = null;
    while (mScrollableView == null || (mScrollableView instanceof NestedScrollingParent
            && !(mScrollableView instanceof NestedScrollingChild))) {
        content = findScrollableViewInternal(content, mScrollableView == null);
        if (content == mScrollableView) {
            break;
        }
        try {//try 不能删除,不然会出现兼容性问题
            if (content instanceof CoordinatorLayout) {
                kernel.getRefreshLayout().setEnableNestedScroll(false);
                wrapperCoordinatorLayout(((CoordinatorLayout) content), kernel.getRefreshLayout());
            }
        } catch (Throwable ignored) {
        }
        mScrollableView = content;
    }
}
 
开发者ID:penghuanliang,项目名称:Rxjava2.0Demo,代码行数:19,代码来源:RefreshContentWrapper.java

示例4: findScrollableViewInternal

import android.support.v4.view.NestedScrollingParent; //导入依赖的package包/类
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;
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:25,代码来源:RefreshContentWrapper.java

示例5: findScrollableView

import android.support.v4.view.NestedScrollingParent; //导入依赖的package包/类
protected void findScrollableView(View content, RefreshKernel kernel) {
    mScrollableView = null;
    while (mScrollableView == null || (mScrollableView instanceof NestedScrollingParent
            && !(mScrollableView instanceof NestedScrollingChild))) {
        content = findScrollableViewInternal(content, mScrollableView == null);
        if (content == mScrollableView) {
            break;
        }
        try {//try 不能删除,不然会出现兼容性问题
            if (content instanceof CoordinatorLayout) {
                kernel.getRefreshLayout().setEnableNestedScroll(false);
                wrapperCoordinatorLayout(((ViewGroup) content), kernel.getRefreshLayout());
            }
        } catch (Throwable ignored) {
        }
        mScrollableView = content;
    }
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:19,代码来源:RefreshContentWrapper.java

示例6: isScrollableView

import android.support.v4.view.NestedScrollingParent; //导入依赖的package包/类
protected boolean isScrollableView(View view) {
    return view instanceof AbsListView
            || view instanceof ScrollView
            || view instanceof ScrollingView
            || view instanceof NestedScrollingChild
            || view instanceof NestedScrollingParent
            || view instanceof WebView
            || view instanceof ViewPager;
}
 
开发者ID:penghuanliang,项目名称:Rxjava2.0Demo,代码行数:10,代码来源:RefreshContentWrapper.java

示例7: findScrollableView

import android.support.v4.view.NestedScrollingParent; //导入依赖的package包/类
private void findScrollableView(View content) {
    mScrollableView = findScrollableViewInternal(content, true);
    if (mScrollableView instanceof NestedScrollingParent
            && !(mScrollableView instanceof NestedScrollingChild)) {
        mScrollableView = findScrollableViewInternal(mScrollableView, false);
    }
    if (mScrollableView instanceof ViewPager) {
        wrapperViewPager((ViewPager) this.mScrollableView);
    }
    if (mScrollableView == null) {
        mScrollableView = content;
    }
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:14,代码来源:RefreshContentWrapper.java


注:本文中的android.support.v4.view.NestedScrollingParent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。