Available Methods
- ViewHolder ( )
- State ( )
- LayoutManager ( )
- setAdapter ( )
- setLayoutManager ( )
- Adapter ( )
- NO_POSITION
- getChildCount ( )
- getLayoutManager ( )
- getChildAt ( )
- LayoutParams ( )
- getChildAdapterPosition ( )
- addItemDecoration ( )
- Recycler ( )
- setHasFixedSize ( )
- getPaddingLeft ( )
- getAdapter ( )
- getPaddingRight ( )
- addOnScrollListener ( )
- ItemDecoration ( )
- getHeight ( )
- getWidth ( )
- VERTICAL
- findChildViewUnder ( )
- setItemAnimator ( )
- getContext ( )
- getPaddingTop ( )
- SCROLL_STATE_IDLE
- getPaddingBottom ( )
- HORIZONTAL
- computeVerticalScrollOffset ( )
- setClipToPadding ( )
- getChildViewHolder ( )
- AdapterDataObserver ( )
- NO_ID
- setNestedScrollingEnabled ( )
- getDecoratedBoundsWithMargins ( )
- getClipToPadding ( )
- SCROLL_STATE_DRAGGING
- setBackgroundColor ( )
- OnScrollListener ( )
- getItemAnimator ( )
- ItemAnimator ( )
- removeOnScrollListener ( )
- getChildLayoutPosition ( )
- computeVerticalScrollRange ( )
- SmoothScroller ( )
- scrollToPosition ( )
- findViewHolderForAdapterPosition ( )
- RecycledViewPool ( )
- setPadding ( )
- addOnItemTouchListener ( )
- getMeasuredWidth ( )
- setVisibility ( )
- Orientation ( )
- setTag ( )
- canScrollVertically ( )
- post ( )
- getMeasuredHeight ( )
- findViewHolderForLayoutPosition ( )
- getTag ( )
- setOnTouchListener ( )
- setOverScrollMode ( )
- OnItemTouchListener ( )
- requestFocus ( )
- postDelayed ( )
- setLayoutParams ( )
- isEnabled ( )
- getViewTreeObserver ( )
- setAlpha ( )
- addOnChildAttachStateChangeListener ( )
- setId ( )
- removeOnChildAttachStateChangeListener ( )
- smoothScrollToPosition ( )
Related Classes
- android.os.Bundle
- android.content.Context
- android.view.View
- android.util.Log
- android.widget.TextView
- android.content.Intent
- android.view.ViewGroup
- android.view.LayoutInflater
- android.os.Build
- android.widget.Toast
- android.widget.ImageView
- android.graphics.Color
- android.graphics.Canvas
- android.text.TextUtils
- android.view.MotionEvent
- android.graphics.drawable.Drawable
- android.widget.LinearLayout
- android.widget.EditText
- android.content.SharedPreferences
- android.graphics.Rect
- android.annotation.SuppressLint
- android.widget.FrameLayout
- android.view.Gravity
- android.util.TypedValue
- android.animation.Animator
Java Code Examples for androidx.recyclerview.widget.RecyclerView#getViewTreeObserver()
The following examples show how to use
androidx.recyclerview.widget.RecyclerView#getViewTreeObserver() .
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: AutoColumnGridLayoutManager.java From RecyclerExt with Apache License 2.0 | 6 votes |
/** * Determines the maximum number of columns based on the width of the items. * If the <code>recyclerView</code>'s width hasn't been determined yet, this * will register for the layout that will then perform the functionality to * set the number of columns. * * @param gridItemWidth The width for the items in each column * @return The number of allowed columns */ protected int determineColumnCount(int gridItemWidth) { RecyclerView recyclerView = parent.get(); if (recyclerView == null) { return 1; } //We need to register for the layout then update the column count if (recyclerView.getWidth() == 0) { ViewTreeObserver observer = recyclerView.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new LayoutListener(recyclerView)); return 1; } //Updates the actual column count and spacing between items int columnCount = getColumnCount(recyclerView, gridItemWidth); resetRecyclerPadding(recyclerView); updateSpacing(recyclerView, gridItemWidth, columnCount); return columnCount; }
Example 2
Source File: RecyclerBinder.java From litho with Apache License 2.0 | 5 votes |
private void registerDrawListener(final RecyclerView view) { if (view instanceof HasPostDispatchDrawListener) { ((HasPostDispatchDrawListener) view) .registerPostDispatchDrawListener(mPostDispatchDrawListener); } else if (view.getViewTreeObserver() != null) { view.getViewTreeObserver().addOnPreDrawListener(mOnPreDrawListener); } }
Example 3
Source File: RecyclerBinder.java From litho with Apache License 2.0 | 5 votes |
private void unregisterDrawListener(final RecyclerView view) { if (view instanceof HasPostDispatchDrawListener) { ((HasPostDispatchDrawListener) view) .unregisterPostDispatchDrawListener(mPostDispatchDrawListener); } else if (view.getViewTreeObserver() != null) { view.getViewTreeObserver().removeOnPreDrawListener(mOnPreDrawListener); } }