當前位置: 首頁>>代碼示例>>Java>>正文


Java NestedScrollingChild類代碼示例

本文整理匯總了Java中android.support.v4.view.NestedScrollingChild的典型用法代碼示例。如果您正苦於以下問題:Java NestedScrollingChild類的具體用法?Java NestedScrollingChild怎麽用?Java NestedScrollingChild使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NestedScrollingChild類屬於android.support.v4.view包,在下文中一共展示了NestedScrollingChild類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findScrollableViewInternal

import android.support.v4.view.NestedScrollingChild; //導入依賴的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.NestedScrollingChild; //導入依賴的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.NestedScrollingChild; //導入依賴的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.NestedScrollingChild; //導入依賴的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: findScrollingChild

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
private View findScrollingChild(View view) {
    if (view instanceof NestedScrollingChild) {
        return view;
    }
    if (view instanceof ViewGroup) {
        ViewGroup group = (ViewGroup) view;
        int count = group.getChildCount();
        for (int i = 0; i < count; i++) {
            View scrollingChild = findScrollingChild(group.getChildAt(i));
            if (scrollingChild != null) {
                return scrollingChild;
            }
        }
    }
    return null;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:BottomSheetBehavior.java

示例6: findScrollableView

import android.support.v4.view.NestedScrollingChild; //導入依賴的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

示例7: isScrollableView

import android.support.v4.view.NestedScrollingChild; //導入依賴的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

示例8: findScrollingChild

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
private View findScrollingChild(View view) {
    if (view instanceof NestedScrollingChild) {
        return view;
    }
    if (view instanceof ViewGroup) {
        ViewGroup group = (ViewGroup) view;
        for (int i = 0, count = group.getChildCount(); i < count; i++) {
            View scrollingChild = findScrollingChild(group.getChildAt(i));
            if (scrollingChild != null) {
                return scrollingChild;
            }
        }
    }
    return null;
}
 
開發者ID:alphater,項目名稱:garras,代碼行數:16,代碼來源:AnchorSheetBehavior.java

示例9: findScrollableView

import android.support.v4.view.NestedScrollingChild; //導入依賴的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

示例10: analyNestedScrollingChildViews

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
private void analyNestedScrollingChildViews() {
    View localView1 = getChildAt(0);
    if ((localView1 == null) || (!(localView1 instanceof ViewGroup)))
        throw new IllegalArgumentException("EmbeddedScrollView root child illegal");
    this.scrollingChildList = new ArrayList();
    ViewGroup localViewGroup = (ViewGroup) localView1;
    for (int i = 0; i < localViewGroup.getChildCount(); i++) {
        View localView2 = localViewGroup.getChildAt(i);
        if ((localView2 instanceof NestedScrollingChild))
            this.scrollingChildList.add(localView2);
    }
}
 
開發者ID:hanks-zyh,項目名稱:NestedScroll,代碼行數:13,代碼來源:GoldScrollView.java

示例11: findScrollingChild

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
private View findScrollingChild(View view) {
  if (view instanceof NestedScrollingChild) {
    return view;
  }
  if (view instanceof ViewGroup) {
    ViewGroup group = (ViewGroup) view;
    for (int i = 0, count = group.getChildCount(); i < count; i++) {
      View scrollingChild = findScrollingChild(group.getChildAt(i));
      if (scrollingChild != null) {
        return scrollingChild;
      }
    }
  }
  return null;
}
 
開發者ID:cesardeazevedo,項目名稱:react-native-bottom-sheet-behavior,代碼行數:16,代碼來源:RNBottomSheetBehavior.java

示例12: onFinishInflate

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
/**
 * 通過id得到相應的view
 */
@Override
protected void onFinishInflate() {

    final int childCount = getChildCount();

    if (childCount > 0) {
        mHeaderView = findViewById(R.id.refresh_header_view);
        mContentView = findViewById(R.id.recyclerview);
        mFooterView = findViewById(R.id.refresh_footer_view);
        mScrollView = findViewById(R.id.refresh_scroll_view);
    }

    if (mContentView == null) {
        throw new IllegalStateException("mContentView is null");
    }

    if (mIsCoo) {
        if (mContentView instanceof CoordinatorLayout) {

            CoordinatorLayout coo = (CoordinatorLayout) mContentView;

            mAppBar = (AppBarLayout) coo.getChildAt(0);


            setAppBarListener();

        } else {
            throw new IllegalStateException("mContentView is not CoordinatorLayout");
        }

        if (mScrollView == null) {
            throw new IllegalStateException("mScrollView is null");
        }

        if (mScrollView instanceof ViewPager) {

            mViewPager = (ViewPager) mScrollView;
            mIsViewPager = true;

        } else if (mScrollView instanceof NestedScrollingChild) {

            mIsViewPager = false;

        } else {
            throw new IllegalStateException("mScrollView is not NestedScrollingChild or ViewPager");
        }
    }

    if (mHeaderView != null && !(mHeaderView instanceof IRefresh)) {

        throw new IllegalStateException("mHeaderView  error");
    }
    if (mFooterView != null && !(mFooterView instanceof IRefresh)) {

        throw new IllegalStateException("mFooterView error");
    }

    if (mHeaderView != null) {

        getHeaderInterface().setIsHeaderOrFooter(true);
    }

    if (mFooterView != null) {

        getFooterInterface().setIsHeaderOrFooter(false);
    }


    super.onFinishInflate();


    setStyle(mHeadStyle, mFootStyle);

}
 
開發者ID:rawray,項目名稱:RRFramework-Android,代碼行數:78,代碼來源:RefreshLayout.java

示例13: create

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
/**
 * create the nested scroll helper.
 * @param target  the target view
 * @param sensitivity Multiplier for how sensitive the helper should be about detecting
 *                    the start of a drag. Larger values are more sensitive. 1.0f is normal.
 * @param scroller  the scroller
 * @param child the NestedScrollingChild.
 * @param callback the callback
 */
public static NestedScrollHelper create(View target, float sensitivity, OverScroller scroller, NestedScrollingChild child,
                                  NestedScrollHelper.NestedScrollCallback callback) {
    return new NestedScrollHelper(target , sensitivity, scroller, child , callback);
}
 
開發者ID:LightSun,項目名稱:Android-sticky-navigation-layout,代碼行數:14,代碼來源:NestedScrollFactory.java

示例14: NestedScrollHelper

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
/**
 * create the nested scroll helper. But,the target view must implements interface {@link NestedScrollingChild}.
 * @param target  the target view
 * @param scroller  the scroller
 * @param callback the callback
 */
public NestedScrollHelper(View target, OverScroller scroller, NestedScrollCallback callback) {
    this(target, 1, scroller, (NestedScrollingChild) target, callback);
}
 
開發者ID:LightSun,項目名稱:Android-sticky-navigation-layout,代碼行數:10,代碼來源:NestedScrollHelper.java

示例15: onFinishInflate

import android.support.v4.view.NestedScrollingChild; //導入依賴的package包/類
/**
 * 通過id得到相應的view
 */
@Override
protected void onFinishInflate() {

    final int childCount = getChildCount();

    if (childCount > 0) {
        mHeaderView = findViewById(com.canyinghao.canrefresh.R.id.can_refresh_header);
        mContentView = findViewById(com.canyinghao.canrefresh.R.id.can_content_view);
        mFooterView = findViewById(com.canyinghao.canrefresh.R.id.can_refresh_footer);
        mScrollView = findViewById(com.canyinghao.canrefresh.R.id.can_scroll_view);
    }

    if (mContentView == null) {
        throw new IllegalStateException("mContentView is null");
    }

    if (mIsCoo) {
        if (mContentView instanceof CoordinatorLayout) {

            CoordinatorLayout coo = (CoordinatorLayout) mContentView;

            mAppBar = (AppBarLayout) coo.getChildAt(0);


            setAppBarListener();

        } else {
            throw new IllegalStateException("mContentView is not CoordinatorLayout");
        }

        if (mScrollView == null) {
            throw new IllegalStateException("mScrollView is null");
        }

        if (!(mScrollView instanceof NestedScrollingChild)) {
            throw new IllegalStateException("mScrollView is not NestedScrollingChild");
        }
    }

    if (mHeaderView != null && !(mHeaderView instanceof CanRefresh)) {

        throw new IllegalStateException("mHeaderView  error");
    }
    if (mFooterView != null && !(mFooterView instanceof CanRefresh)) {

        throw new IllegalStateException("mFooterView error");
    }

    if (mHeaderView != null) {

        getHeaderInterface().setIsHeaderOrFooter(true);
    }

    if (mFooterView != null) {

        getFooterInterface().setIsHeaderOrFooter(false);
    }


    super.onFinishInflate();


    setStyle(mHeadStyle, mFootStyle);

}
 
開發者ID:yin450561200,項目名稱:-,代碼行數:69,代碼來源:CanRefreshLayout.java


注:本文中的android.support.v4.view.NestedScrollingChild類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。