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


Java ObservableScrollView.setTouchInterceptionViewGroup方法代码示例

本文整理汇总了Java中com.github.ksoichiro.android.observablescrollview.ObservableScrollView.setTouchInterceptionViewGroup方法的典型用法代码示例。如果您正苦于以下问题:Java ObservableScrollView.setTouchInterceptionViewGroup方法的具体用法?Java ObservableScrollView.setTouchInterceptionViewGroup怎么用?Java ObservableScrollView.setTouchInterceptionViewGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.ksoichiro.android.observablescrollview.ObservableScrollView的用法示例。


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

示例1: registerScrollView

import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
public void registerScrollView(final ObservableScrollView scrollView) {
    scrolls.add(scrollView);

    if (scrollView.getParent() != null && scrollView.getParent().getParent() != null && scrollView.getParent().getParent() instanceof ViewGroup)
        scrollView.setTouchInterceptionViewGroup((ViewGroup) scrollView.getParent().getParent());

    scrollView.setScrollViewCallbacks(new ObservableScrollViewCallbacks() {
        @Override
        public void onScrollChanged(int i, boolean b, boolean b1) {
            onScroll(scrollView, i);
        }

        @Override
        public void onDownMotionEvent() {

        }

        @Override
        public void onUpOrCancelMotionEvent(ScrollState scrollState) {

        }
    });
}
 
开发者ID:florent37,项目名称:HollyViewPager,代码行数:24,代码来源:HollyViewPagerAnimator.java

示例2: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scrollview_noheader, container, false);

    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    Fragment parentFragment = getParentFragment();
    ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
    if (viewGroup != null) {
        scrollView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
        if (parentFragment instanceof ObservableScrollViewCallbacks) {
            scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
        }
    }
    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:16,代码来源:ViewPagerTabFragmentScrollViewFragment.java

示例3: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scrollview_noheader, container, false);

    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    Activity parentActivity = getActivity();
    scrollView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:13,代码来源:ViewPagerTab2ScrollViewFragment.java

示例4: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scrollview, container, false);

    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    Activity parentActivity = getActivity();
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        // Scroll to the specified offset after layout
        Bundle args = getArguments();
        if (args != null && args.containsKey(ARG_SCROLL_Y)) {
            final int scrollY = args.getInt(ARG_SCROLL_Y, 0);
            ScrollUtils.addOnGlobalLayoutListener(scrollView, new Runnable() {
                @Override
                public void run() {
                    scrollView.scrollTo(0, scrollY);
                }
            });
        }

        // TouchInterceptionViewGroup should be a parent view other than ViewPager.
        // This is a workaround for the issue #117:
        // https://github.com/ksoichiro/Android-ObservableScrollView/issues/117
        scrollView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.root));

        scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:29,代码来源:ViewPagerTabScrollViewFragment.java

示例5: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_flexiblespacewithimagescrollview, container, false);

    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    // TouchInterceptionViewGroup should be a parent view other than ViewPager.
    // This is a workaround for the issue #117:
    // https://github.com/ksoichiro/Android-ObservableScrollView/issues/117
    scrollView.setTouchInterceptionViewGroup((ViewGroup) view.findViewById(R.id.fragment_root));

    // Scroll to the specified offset after layout
    Bundle args = getArguments();
    if (args != null && args.containsKey(ARG_SCROLL_Y)) {
        final int scrollY = args.getInt(ARG_SCROLL_Y, 0);
        ScrollUtils.addOnGlobalLayoutListener(scrollView, new Runnable() {
            @Override
            public void run() {
                scrollView.scrollTo(0, scrollY);
            }
        });
        updateFlexibleSpace(scrollY, view);
    } else {
        updateFlexibleSpace(0, view);
    }

    scrollView.setScrollViewCallbacks(this);

    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:30,代码来源:FlexibleSpaceWithImageScrollViewFragment.java

示例6: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_setting_scroll_view, container, false);

    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    // TouchInterceptionViewGroup should be a parent view other than ViewPager.
    // This is a workaround for the issue #117:
    // https://github.com/ksoichiro/Android-ObservableScrollView/issues/117
    scrollView.setTouchInterceptionViewGroup((ViewGroup) view.findViewById(R.id.fragment_root));

    // Scroll to the specified offset after layout
    Bundle args = getArguments();
    if (args != null && args.containsKey(ARG_SCROLL_Y)) {
        final int scrollY = args.getInt(ARG_SCROLL_Y, 0);
        ScrollUtils.addOnGlobalLayoutListener(scrollView, new Runnable() {
            @Override
            public void run() {
                scrollView.scrollTo(0, scrollY);
            }
        });
        updateFlexibleSpace(scrollY, view);
    } else {
        updateFlexibleSpace(0, view);
    }

    scrollView.setScrollViewCallbacks(this);

    return view;
}
 
开发者ID:DuongNTdev,项目名称:StudyMovie,代码行数:30,代码来源:FlexibleSpaceWithImageScrollViewFragment.java

示例7: onCreateView

import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_scrollviewwithfab, container, false);
    mFab = view.findViewById(R.id.fab);
    mFabMargin = getResources().getDimensionPixelSize(R.dimen.margin_standard);
    mFabIsShown = true;

    // Translate FAB
    ScrollUtils.addOnGlobalLayoutListener(mFab, new Runnable() {
        @Override
        public void run() {
            float fabTranslationY = view.getHeight() - mFabMargin - mFab.getHeight();
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
                // On pre-honeycomb, ViewHelper.setTranslationX/Y does not set margin,
                // which causes FAB's OnClickListener not working.
                FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mFab.getLayoutParams();
                lp.leftMargin = view.getWidth() - mFabMargin - mFab.getWidth();
                lp.topMargin = (int) fabTranslationY;
                mFab.requestLayout();
            } else {
                ViewHelper.setTranslationX(mFab, view.getWidth() - mFabMargin - mFab.getWidth());
                ViewHelper.setTranslationY(mFab, fabTranslationY);
            }
        }
    });

    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    Activity parentActivity = getActivity();
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        // Scroll to the specified offset after layout
        Bundle args = getArguments();
        if (args != null && args.containsKey(ARG_SCROLL_Y)) {
            final int scrollY = args.getInt(ARG_SCROLL_Y, 0);
            ScrollUtils.addOnGlobalLayoutListener(scrollView, new Runnable() {
                @Override
                public void run() {
                    scrollView.scrollTo(0, scrollY);
                }
            });
        }

        // TouchInterceptionViewGroup should be a parent view other than ViewPager.
        // This is a workaround for the issue #117:
        // https://github.com/ksoichiro/Android-ObservableScrollView/issues/117
        scrollView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.root));
    }
    scrollView.setScrollViewCallbacks(this);

    return view;
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:51,代码来源:ViewPagerTabScrollViewWithFabFragment.java


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