Available Methods
- ViewHolder ( )
- setLayoutManager ( )
- State ( )
- setAdapter ( )
- LayoutManager ( )
- LayoutParams ( )
- Adapter ( )
- getChildAt ( )
- getChildCount ( )
- getLayoutManager ( )
- Recycler ( )
- setHasFixedSize ( )
- NO_POSITION
- getChildAdapterPosition ( )
- addItemDecoration ( )
- getWidth ( )
- getPaddingRight ( )
- getPaddingLeft ( )
- SCROLL_STATE_IDLE
- getContext ( )
- getHeight ( )
- getPaddingTop ( )
- getAdapter ( )
- setItemAnimator ( )
- getPaddingBottom ( )
- addOnScrollListener ( )
- ItemDecoration ( )
- OnScrollListener ( )
- findChildViewUnder ( )
- SCROLL_STATE_DRAGGING
- ItemAnimator ( )
- setNestedScrollingEnabled ( )
- findViewHolderForAdapterPosition ( )
- RecycledViewPool ( )
- AdapterDataObserver ( )
- getTag ( )
- getChildViewHolder ( )
- SCROLL_STATE_SETTLING
- setVisibility ( )
- getChildLayoutPosition ( )
- scrollToPosition ( )
- setLayoutParams ( )
- getChildPosition ( )
- addOnItemTouchListener ( )
- setTag ( )
- setOnScrollListener ( )
- setPadding ( )
- scrollBy ( )
- VERTICAL
- postDelayed ( )
- SmoothScroller ( )
- getDecoratedBoundsWithMargins ( )
- getMeasuredHeight ( )
- getLocationOnScreen ( )
- removeItemDecoration ( )
- getMeasuredWidth ( )
- computeVerticalScrollOffset ( )
- setClipToPadding ( )
- OnItemTouchListener ( )
- NO_ID
- removeOnScrollListener ( )
- removeOnChildAttachStateChangeListener ( )
- setOnTouchListener ( )
- RecyclerListener ( )
- findViewHolderForLayoutPosition ( )
- smoothScrollBy ( )
- setBackgroundColor ( )
- getParent ( )
- setOverScrollMode ( )
- setFocusable ( )
- ViewCacheExtension ( )
- getScrollState ( )
- OnFlingListener ( )
- getClipToPadding ( )
- smoothScrollToPosition ( )
- setBackgroundResource ( )
- MarginLayoutParams ( )
- removeCallbacks ( )
- HORIZONTAL
- OnChildAttachStateChangeListener ( )
- isAttachedToWindow ( )
- getId ( )
- getRight ( )
- setLayoutAnimation ( )
- getItemDecorationCount ( )
- INVALID_TYPE
- getResources ( )
- setOnFlingListener ( )
- getHandler ( )
- getTop ( )
- invalidateItemDecorations ( )
- setVerticalScrollBarEnabled ( )
- setItemViewCacheSize ( )
- post ( )
- getItemAnimator ( )
- requestLayout ( )
- canScrollVertically ( )
- computeVerticalScrollRange ( )
- computeHorizontalScrollRange ( )
Related Classes
- android.os.Bundle
- android.content.Context
- android.view.View
- android.util.Log
- android.widget.TextView
- android.content.Intent
- android.view.ViewGroup
- android.app.Activity
- android.view.LayoutInflater
- android.os.Build
- android.widget.Toast
- android.widget.ImageView
- android.graphics.Color
- android.os.Handler
- android.net.Uri
- android.graphics.Canvas
- android.widget.Button
- android.graphics.Bitmap
- android.text.TextUtils
- android.view.MotionEvent
- android.graphics.drawable.Drawable
- android.widget.LinearLayout
- android.support.annotation.Nullable
- android.widget.EditText
- android.support.annotation.NonNull
Java Code Examples for android.support.v7.widget.RecyclerView#getTop()
The following examples show how to use
android.support.v7.widget.RecyclerView#getTop() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DividerItemDecoration.java From android-common-utils with Apache License 2.0 | 6 votes |
public void drawHorizontal(Canvas c, RecyclerView parent) { final int top = parent.getTop(); final int bottom = parent.getBottom(); final Drawable mDivider = this.getDividerManager().getDivider(); final int childCount = parent.getChildCount(); View child ; RecyclerView.LayoutParams params ; int left, right; for (int i = 0; i < childCount; i++) { child = parent.getChildAt(i); params = (RecyclerView.LayoutParams) child.getLayoutParams(); //分割线的left,right left = child.getRight() + params.rightMargin; right = left + mDivider.getIntrinsicHeight(); mDivider.setBounds(left, top, right, bottom); mDivider.draw(c); } }
Example 2
Source File: RecyclerViewBehavior.java From timecat with Apache License 2.0 | 5 votes |
@Override public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, RecyclerView child, View target, int dx, int dy, int[] consumed) { // Log.e("ldf", "onNestedPreScroll"); super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed); child.setVerticalScrollBarEnabled(true); MonthPager monthPager = (MonthPager) coordinatorLayout.getChildAt(0); if (monthPager.getPageScrollState() != ViewPager.SCROLL_STATE_IDLE) { consumed[1] = dy; Log.w("ldf", "onNestedPreScroll: MonthPager dragging"); Toast.makeText(context, "loading month data", Toast.LENGTH_SHORT).show(); return; } // 上滑,正在隐藏顶部的日历 hidingTop = dy > 0 && child.getTop() <= initOffset && child.getTop() > getMonthPager(coordinatorLayout).getCellHeight(); // 下滑,正在展示顶部的日历 showingTop = dy < 0 && !ViewCompat.canScrollVertically(target, -1); if (hidingTop || showingTop) { consumed[1] = Utils.scroll(child, dy, getMonthPager(coordinatorLayout).getCellHeight(), getMonthPager(coordinatorLayout).getViewHeight()); saveTop(child.getTop()); } }
Example 3
Source File: ViewUtils.java From MultiView with Apache License 2.0 | 5 votes |
public static View getFirstIntersectsChild(RecyclerView recyclerView) { int childCount = recyclerView.getChildCount(); if (childCount > 0) { for (int i = 0; i < childCount; i++) { View child = recyclerView.getChildAt(i); Rect rect1=new Rect(recyclerView.getLeft(),recyclerView.getTop(), recyclerView.getRight(), recyclerView.getBottom()); Rect rect2=new Rect(child.getLeft(),child.getTop(), child.getRight(), child.getBottom()); if (Rect.intersects(rect1, rect2)) { return child; } } } return null; }
Example 4
Source File: ParallaxViewController.java From BeautifulParallax with Apache License 2.0 | 5 votes |
@Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { if (recyclerView.getChildCount() > 0) { if (firstVisibleView == null) firstVisibleView = recyclerView.getChildAt(0); if (recyclerviewCenterY == -1) recyclerviewCenterY = recyclerView.getMeasuredHeight() / 2 + recyclerView.getTop(); for (int i = 0, count = imageViewList.size(); i < count; ++i) { currentImageView = imageViewList.get(i); currentImageView.getGlobalVisibleRect(rect); float yOffset = limit(-1, (recyclerviewCenterY - rect.top) / currentImageView.getHeight(), 1); ViewHelper.setTranslationY(currentImageView,(-1f + yOffset) * PARALLAX_SPEED); } } }