• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ScrollingView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: findScrollView

import android.support.v4.view.ScrollingView; //导入依赖的package包/类
/**
 * 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;
            }
        }
    }
}
 
开发者ID:drakeet,项目名称:rebase-android,代码行数:22,代码来源:SwipeBackLayout.java


示例2: findScrollableViewInternal

import android.support.v4.view.ScrollingView; //导入依赖的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


示例3: findScrollableViewInternal

import android.support.v4.view.ScrollingView; //导入依赖的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


示例4: findOffset

import android.support.v4.view.ScrollingView; //导入依赖的package包/类
private void findOffset(ViewGroup root) {
  for (int index = 0; index < root.getChildCount(); index++) {
    View child = root.getChildAt(index);
    if (child instanceof ScrollView || child instanceof ScrollingView || child instanceof AbsListView || child instanceof WebView) {
      int widSpec = View.MeasureSpec.makeMeasureSpec(originalWidth, View.MeasureSpec.EXACTLY);
      int heightSpec = View.MeasureSpec.makeMeasureSpec(BIG_ENOUGH_HEIGHT, View.MeasureSpec.AT_MOST);
      child.measure(widSpec, heightSpec);

      if (child.getMeasuredHeight() == BIG_ENOUGH_HEIGHT) {
        heightSpec = View.MeasureSpec.makeMeasureSpec(BIG_ENOUGH_HEIGHT, View.MeasureSpec.UNSPECIFIED);
        child.measure(widSpec, heightSpec);
      }
      updateOffset(child.getHeight(), child.getMeasuredHeight(), child);
    } else if (child instanceof ZoomPanLayout) {
      updateOffset(child.getHeight(), ((ZoomPanLayout) child).getScaledHeight(), child);
    } else if (child instanceof ViewGroup) {
      findOffset((ViewGroup) child);
    }
  }
}
 
开发者ID:tushardhole,项目名称:ScrollShot,代码行数:21,代码来源:ScrollShotReceiver.java


示例5: isAlmostBottom

import android.support.v4.view.ScrollingView; //导入依赖的package包/类
/**
 * @return {@code true} if child view almost scroll to bottom.
 */
public boolean isAlmostBottom() {
    if (null == mTarget) {
        return false;
    }

    if (mTarget instanceof AbsListView) {
        final AbsListView absListView = (AbsListView) mTarget;
        return absListView.getLastVisiblePosition() >= absListView.getCount() - 1;
    } else if (mTarget instanceof ScrollingView) {
        final ScrollingView scrollingView = (ScrollingView) mTarget;
        final int offset = scrollingView.computeVerticalScrollOffset();
        final int range = scrollingView.computeVerticalScrollRange() -
                scrollingView.computeVerticalScrollExtent();
        return offset >= range;
    } else {
        return !ViewCompat.canScrollVertically(mTarget, 1);
    }
}
 
开发者ID:seven332,项目名称:RefreshLayout,代码行数:22,代码来源:RefreshLayout.java


示例6: onNestedFling

import android.support.v4.view.ScrollingView; //导入依赖的package包/类
@Override
public boolean onNestedFling(final CoordinatorLayout coordinatorLayout, final AppBarLayout child, final View target,
  final float velocityX, float velocityY, boolean consumed) {
  if (velocityY > 0 && !isPositive || velocityY < 0 && isPositive) {
    velocityY = velocityY * -1;
  }

  if (target instanceof SwipeRefreshLayout) {
    consumed = consumed((SwipeRefreshLayout) target, consumed);
  } else if (target instanceof RecyclerView) {
    consumed = consumed((RecyclerView) target);
  } else if (target instanceof ScrollingView) {
    consumed = target.getScrollY() < 0;
  }

  return super.onNestedFling(coordinatorLayout, child, target, velocityX, velocityY, consumed);
}
 
开发者ID:Shopify,项目名称:mobile-buy-sdk-android,代码行数:18,代码来源:FlingBehavior.java


示例7: inListView

import android.support.v4.view.ScrollingView; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:tcking,项目名称:GiraffePlayer2,代码行数:13,代码来源:VideoView.java


示例8: isScrollableView

import android.support.v4.view.ScrollingView; //导入依赖的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


示例9: run

import android.support.v4.view.ScrollingView; //导入依赖的package包/类
@Override
public void run() {
    if (mScroller.computeScrollOffset()) {
        int dy = mScroller.getCurrY() - mLastFlingY;

        final int selfOffset = getTopAndBottomOffset();
        final int newSelfOffset = Math.max(mMinOffset, Math.min(mMaxOffset, selfOffset - dy));
        final int skipped = newSelfOffset - selfOffset + dy;

        final boolean selfFinished = !setTopAndBottomOffset(newSelfOffset);

        final int targetOffset;
        final boolean targetFinished;
        if (mTargetView instanceof ScrollingView) {
            targetOffset = ((ScrollingView) mTargetView).computeVerticalScrollOffset();
            mTargetView.scrollBy(0, skipped);
            targetFinished = (targetOffset == ((ScrollingView) mTargetView).computeVerticalScrollOffset());
        } else {
            targetOffset = mTargetView.getScrollY();
            mTargetView.scrollBy(0, skipped);
            targetFinished = (targetOffset == mTargetView.getScrollY());
        }

        final boolean scrollerFinished = mScroller.isFinished();

        if (scrollerFinished || (selfFinished && targetFinished)) {
            return;
        }

        mCoordinatorLayout.postOnAnimation(this);

        mLastFlingY = mScroller.getCurrY();
    }
}
 
开发者ID:mugku,项目名称:CoordinatorLayoutHelper,代码行数:35,代码来源:HeaderLayoutBehavior.java


示例10: consumed

import android.support.v4.view.ScrollingView; //导入依赖的package包/类
private boolean consumed(final SwipeRefreshLayout swipeRefreshLayout, final boolean defaultValue) {
  if (swipeRefreshLayout.getChildCount() > 0) {
    if (swipeRefreshLayout.getChildAt(0) instanceof RecyclerView) {
      return consumed((RecyclerView) swipeRefreshLayout.getChildAt(0));
    } else if (swipeRefreshLayout.getChildAt(0) instanceof ScrollingView) {
      return swipeRefreshLayout.getScrollY() < 0;
    }
  }
  return defaultValue;
}
 
开发者ID:Shopify,项目名称:mobile-buy-sdk-android,代码行数:11,代码来源:FlingBehavior.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SerializedFormBuilder类代码示例发布时间:2022-05-21
下一篇:
Java ExtensionLoader类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap