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


Java RecyclerView.computeVerticalScrollRange方法代碼示例

本文整理匯總了Java中android.support.v7.widget.RecyclerView.computeVerticalScrollRange方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.computeVerticalScrollRange方法的具體用法?Java RecyclerView.computeVerticalScrollRange怎麽用?Java RecyclerView.computeVerticalScrollRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.widget.RecyclerView的用法示例。


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

示例1: fireScrollEvent

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void fireScrollEvent(RecyclerView recyclerView, int offsetX, int offsetY) {
  int contentWidth = recyclerView.getMeasuredWidth() + recyclerView.computeHorizontalScrollRange();
  int contentHeight = recyclerView.computeVerticalScrollRange();

  Map<String, Object> event = new HashMap<>(2);
  Map<String, Object> contentSize = new HashMap<>(2);
  Map<String, Object> contentOffset = new HashMap<>(2);

  contentSize.put(Constants.Name.WIDTH, WXViewUtils.getWebPxByWidth(contentWidth, getInstance().getInstanceViewPortWidth()));
  contentSize.put(Constants.Name.HEIGHT, WXViewUtils.getWebPxByWidth(contentHeight, getInstance().getInstanceViewPortWidth()));

  contentOffset.put(Constants.Name.X, - WXViewUtils.getWebPxByWidth(offsetX, getInstance().getInstanceViewPortWidth()));
  contentOffset.put(Constants.Name.Y, - WXViewUtils.getWebPxByWidth(offsetY, getInstance().getInstanceViewPortWidth()));
  event.put(Constants.Name.CONTENT_SIZE, contentSize);
  event.put(Constants.Name.CONTENT_OFFSET, contentOffset);

  fireEvent(Constants.Event.SCROLL, event);
}
 
開發者ID:weexext,項目名稱:ucar-weex-core,代碼行數:19,代碼來源:BasicListComponent.java

示例2: onScrolled

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
	if (bubble == null || handle.isSelected())
		return;
	int verticalScrollOffset = recyclerView.computeVerticalScrollOffset();
	int verticalScrollRange = recyclerView.computeVerticalScrollRange();
	float proportion = (float) verticalScrollOffset / ((float) verticalScrollRange - height);
	setBubbleAndHandlePosition(height * proportion);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:FastScroller.java

示例3: isSlideToBottom

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
/**
 * 判斷是否到底部了
 * @param recyclerView
 * @return
 */
protected boolean isSlideToBottom(RecyclerView recyclerView) {
    if (recyclerView == null) return false;
    if(mOrientation == LinearLayoutManager.VERTICAL) {
        if (recyclerView.computeVerticalScrollExtent() + recyclerView.computeVerticalScrollOffset() >= recyclerView.computeVerticalScrollRange())
            return true;
    }
    else
    {
        if (recyclerView.computeHorizontalScrollExtent() + recyclerView.computeHorizontalScrollOffset() >= recyclerView.computeHorizontalScrollRange())
            return true;
    }
    return false;
}
 
開發者ID:wanliyang1990,項目名稱:RecyclerViewHeaderAndFooter,代碼行數:19,代碼來源:WapHeaderAndFooterAdapter.java

示例4: onScrolled

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onScrolled(final RecyclerView recyclerView, final int dx, final int dy) {
  if (handle.isSelected()) return;
  final int   offset      = recyclerView.computeVerticalScrollOffset();
  final int   range       = recyclerView.computeVerticalScrollRange();
  final int   extent      = recyclerView.computeVerticalScrollExtent();
  final int   offsetRange = Math.max(range - extent, 1);
  setBubbleAndHandlePosition((float) Util.clamp(offset, 0, offsetRange) / offsetRange);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:10,代碼來源:RecyclerViewFastScroller.java

示例5: isMaxScrollReached

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
static private boolean isMaxScrollReached(RecyclerView recyclerView) {
    int maxScroll = recyclerView.computeVerticalScrollRange();

    int currentScroll = recyclerView.computeVerticalScrollOffset() + recyclerView.computeVerticalScrollExtent();

    android.util.Log.d(TAG, maxScroll + ", " + currentScroll);
    if (maxScroll == 0)
        return false;
    return currentScroll >= maxScroll;
}
 
開發者ID:AppHero2,項目名稱:Raffler-Android,代碼行數:11,代碼來源:ChatFragment.java

示例6: rvPullUpIntercept

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public boolean rvPullUpIntercept(View child) {
    boolean intercept = false;

    RecyclerView recyclerChild = (RecyclerView) child;
    if (recyclerChild.computeVerticalScrollExtent() + recyclerChild.computeVerticalScrollOffset()
            >= recyclerChild.computeVerticalScrollRange())
        intercept = true;

    return intercept;
}
 
開發者ID:funnyzhaov,項目名稱:Tribe,代碼行數:11,代碼來源:InterceptLayout.java

示例7: onScrolled

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
    if (scrollerView.isSelected()) return;
    int verticalScrollOffset = recyclerView.computeVerticalScrollOffset();
    int verticalScrollRange = recyclerView.computeVerticalScrollRange();
    float proportion = (float) verticalScrollOffset / ((float) verticalScrollRange - height);
    setScrollerHeight(height * proportion);
}
 
開發者ID:duyp,項目名稱:mvvm-template,代碼行數:8,代碼來源:RecyclerViewFastScroller.java


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