Available Methods
- postInvalidateOnAnimation ( )
- canScrollVertically ( )
- setAlpha ( )
- setTranslationX ( )
- postOnAnimation ( )
- setElevation ( )
- setScaleY ( )
- setTranslationY ( )
- SCROLL_AXIS_VERTICAL
- setScaleX ( )
- setImportantForAccessibility ( )
- canScrollHorizontally ( )
- getTranslationY ( )
- LAYOUT_DIRECTION_RTL
- setAccessibilityDelegate ( )
- setPivotY ( )
- setPivotX ( )
- setBackground ( )
- setTransitionName ( )
- setLayerType ( )
- getLayoutDirection ( )
- getImportantForAccessibility ( )
- getTranslationX ( )
- setRotationY ( )
- getFitsSystemWindows ( )
- isAttachedToWindow ( )
- offsetTopAndBottom ( )
- IMPORTANT_FOR_ACCESSIBILITY_AUTO
- LAYER_TYPE_NONE
- setRotationX ( )
- setFitsSystemWindows ( )
- setChildrenDrawingOrderEnabled ( )
- LAYER_TYPE_HARDWARE
- getAlpha ( )
- setRotation ( )
- offsetLeftAndRight ( )
- setOnApplyWindowInsetsListener ( )
- animate ( )
- setOverScrollMode ( )
- isLaidOut ( )
- getScaleX ( )
- getParentForAccessibility ( )
- setLayoutDirection ( )
- setTranslationZ ( )
- setBackgroundTintList ( )
- IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
- getOverScrollMode ( )
- setLayerPaint ( )
- getLayerType ( )
- isNestedScrollingEnabled ( )
- stopNestedScroll ( )
- ScrollAxis ( )
- LAYOUT_DIRECTION_LTR
- setNestedScrollingEnabled ( )
- MEASURED_STATE_TOO_SMALL
- OVER_SCROLL_IF_CONTENT_SCROLLS
- requestApplyInsets ( )
- hasOnClickListeners ( )
- onInitializeAccessibilityNodeInfo ( )
- MEASURED_STATE_MASK
- hasTransientState ( )
- setPaddingRelative ( )
- NestedScrollType ( )
- MEASURED_SIZE_MASK
- dispatchApplyWindowInsets ( )
- getMinimumHeight ( )
- isOpaque ( )
- getY ( )
- performAccessibilityAction ( )
- getMeasuredWidthAndState ( )
- OVER_SCROLL_ALWAYS
- getPaddingEnd ( )
- setAccessibilityLiveRegion ( )
- getX ( )
- resolveSizeAndState ( )
- getMeasuredHeightAndState ( )
- getElevation ( )
- getScaleY ( )
- postOnAnimationDelayed ( )
- combineMeasuredStates ( )
- OVER_SCROLL_NEVER
- hasOverlappingRendering ( )
- setY ( )
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.util.AttributeSet
- android.widget.ImageView
- android.graphics.Color
- android.graphics.Canvas
- android.text.TextUtils
- android.view.MotionEvent
- android.graphics.drawable.Drawable
- android.widget.LinearLayout
- android.content.res.TypedArray
- android.support.annotation.Nullable
- android.support.annotation.NonNull
- android.graphics.Rect
- android.view.WindowManager
- android.content.res.Resources
- android.widget.FrameLayout
Java Code Examples for android.support.v4.view.ViewCompat#OVER_SCROLL_IF_CONTENT_SCROLLS
The following examples show how to use
android.support.v4.view.ViewCompat#OVER_SCROLL_IF_CONTENT_SCROLLS .
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: NestedScrollView.java From MyBlogDemo with Apache License 2.0 | 5 votes |
@Override public void computeScroll() { if (mScroller.computeScrollOffset()) { int oldX = getScrollX(); int oldY = getScrollY(); int x = mScroller.getCurrX(); int y = mScroller.getCurrY(); if (oldX != x || oldY != y) { final int range = getScrollRange(); final int overscrollMode = ViewCompat.getOverScrollMode(this); final boolean canOverscroll = overscrollMode == ViewCompat.OVER_SCROLL_ALWAYS || (overscrollMode == ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS && range > 0); overScrollByCompat(x - oldX, y - oldY, oldX, oldY, 0, range, 0, 0, false); if (canOverscroll) { ensureGlows(); if (y <= 0 && oldY > 0) { mEdgeGlowTop.onAbsorb((int) mScroller.getCurrVelocity()); } else if (y >= range && oldY < range) { mEdgeGlowBottom.onAbsorb((int) mScroller.getCurrVelocity()); } } } } }
Example 2
Source File: NestedScrollView.java From MyBlogDemo with Apache License 2.0 | 4 votes |
boolean overScrollByCompat(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent) { final int overScrollMode = ViewCompat.getOverScrollMode(this); final boolean canScrollHorizontal = computeHorizontalScrollRange() > computeHorizontalScrollExtent(); final boolean canScrollVertical = computeVerticalScrollRange() > computeVerticalScrollExtent(); final boolean overScrollHorizontal = overScrollMode == ViewCompat.OVER_SCROLL_ALWAYS || (overScrollMode == ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS && canScrollHorizontal); final boolean overScrollVertical = overScrollMode == ViewCompat.OVER_SCROLL_ALWAYS || (overScrollMode == ViewCompat.OVER_SCROLL_IF_CONTENT_SCROLLS && canScrollVertical); int newScrollX = scrollX + deltaX; if (!overScrollHorizontal) { maxOverScrollX = 0; } int newScrollY = scrollY + deltaY; if (!overScrollVertical) { maxOverScrollY = 0; } // Clamp values if at the limits and record final int left = -maxOverScrollX; final int right = maxOverScrollX + scrollRangeX; final int top = -maxOverScrollY; final int bottom = maxOverScrollY + scrollRangeY; boolean clampedX = false; if (newScrollX > right) { newScrollX = right; clampedX = true; } else if (newScrollX < left) { newScrollX = left; clampedX = true; } boolean clampedY = false; if (newScrollY > bottom) { newScrollY = bottom; clampedY = true; } else if (newScrollY < top) { newScrollY = top; clampedY = true; } if (clampedY) { // mScroller.springBack(newScrollX, newScrollY, 0, 0, 0, getScrollRange()); } onOverScrolled(newScrollX, newScrollY, clampedX, clampedY); return clampedX || clampedY; }