public class ScrollingContentBehavior<V extends android.view.View> extends AnimationOffsetBehavior<V,ContentBehaviorController>
CoordinatorLayout.
It's attach to the nested scrolling target view, such as
android.support.v4.widget.NestedScrollView,
android.support.v7.widget.RecyclerView
which implement android.support.v4.view.NestedScrollingChild.
View with this behavior must be a direct child of CoordinatorLayout.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ScrollingContentBehavior.SavedState |
AnimationOffsetBehavior.ScrollingListenerconfiguration, controller, GOLDEN_RATIO, handler, mChild, mListeners, mParent, progressBase, TYPE_UNKNOWN| Constructor and Description |
|---|
ScrollingContentBehavior(android.content.Context context) |
ScrollingContentBehavior(android.content.Context context,
android.util.AttributeSet attrs) |
| Modifier and Type | Method and Description |
|---|---|
BehaviorConfiguration |
createIndicatorConfig() |
ContentBehaviorController |
getController() |
BehaviorConfiguration |
getFooterConfig() |
BehaviorConfiguration |
getHeaderConfig() |
boolean |
isMinOffsetReached() |
protected float |
onConsumeOffset(int current,
int max,
int delta) |
boolean |
onLayoutChild(CoordinatorLayout parent,
V child,
int layoutDirection) |
boolean |
onMeasureChild(CoordinatorLayout parent,
V child,
int parentWidthMeasureSpec,
int widthUsed,
int parentHeightMeasureSpec,
int heightUsed) |
boolean |
onNestedPreFling(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
float velocityX,
float velocityY) |
void |
onNestedPreScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
int dx,
int dy,
int[] consumed,
int type) |
void |
onNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
int dxConsumed,
int dyConsumed,
int dxUnconsumed,
int dyUnconsumed,
int type) |
void |
onRestoreInstanceState(CoordinatorLayout parent,
V child,
android.os.Parcelable state) |
android.os.Parcelable |
onSaveInstanceState(CoordinatorLayout parent,
V child) |
boolean |
onStartNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View directTargetChild,
android.view.View target,
int axes,
int type) |
void |
onStopNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
int type) |
void |
refreshFooter(long animationDuration) |
void |
refreshHeader(long animateDuration) |
void |
reset(long animateDuration)
This will reset the header or footer view to it's original position when it's laid out for the first time.
|
void |
setContentTopAndBottomOffset(CoordinatorLayout coordinatorLayout,
V child,
int offset,
int type) |
void |
setFooterConfig(BehaviorConfiguration footerConfig) |
void |
setHeaderConfig(BehaviorConfiguration headerConfig) |
void |
showFooter(long animationDuration)
Make the footer entirely visible.
|
void |
showHeader(long animateDuration)
Make the header view entirely visible.
|
void |
stopScroll(boolean holdOn)
If view has scroll to a invalid position, reset it, otherwise do nothing.
|
addScrollListener, animateOffsetDeltaWithDuration, animateOffsetWithDuration, cancelAnimation, enqueuePendingActions, executePendingActions, getChild, getConfiguration, getParent, handleMessage, onAttachedToLayoutParams, onDetachedFromLayoutParams, removeScrollListener, requestLayout, runOnUiThread, runWithView, setConfigurationgetLeftAndRightOffset, getTopAndBottomOffset, layoutChild, setLeftAndRightOffset, setTopAndBottomOffsetpublic ScrollingContentBehavior(android.content.Context context)
public ScrollingContentBehavior(android.content.Context context,
android.util.AttributeSet attrs)
public boolean onMeasureChild(CoordinatorLayout parent,
V child,
int parentWidthMeasureSpec,
int widthUsed,
int parentHeightMeasureSpec,
int heightUsed)
onMeasureChild in class AnimationOffsetBehavior<V extends android.view.View,ContentBehaviorController>public boolean onLayoutChild(CoordinatorLayout parent,
V child,
int layoutDirection)
onLayoutChild in class AnimationOffsetBehavior<V extends android.view.View,ContentBehaviorController>public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View directTargetChild,
android.view.View target,
int axes,
int type)
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
int dx,
int dy,
int[] consumed,
int type)
public void onNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
int dxConsumed,
int dyConsumed,
int dxUnconsumed,
int dyUnconsumed,
int type)
public void onStopNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
int type)
public boolean onNestedPreFling(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
float velocityX,
float velocityY)
protected float onConsumeOffset(int current,
int max,
int delta)
public void setContentTopAndBottomOffset(CoordinatorLayout coordinatorLayout,
V child,
int offset,
int type)
public void stopScroll(boolean holdOn)
holdOn - public void reset(long animateDuration)
public void refreshHeader(long animateDuration)
public void showHeader(long animateDuration)
public void refreshFooter(long animationDuration)
public void showFooter(long animationDuration)
animationDuration - public boolean isMinOffsetReached()
public BehaviorConfiguration createIndicatorConfig()
public void setHeaderConfig(BehaviorConfiguration headerConfig)
public void setFooterConfig(BehaviorConfiguration footerConfig)
public ContentBehaviorController getController()
getController in class AnimationOffsetBehavior<V extends android.view.View,ContentBehaviorController>public BehaviorConfiguration getHeaderConfig()
public BehaviorConfiguration getFooterConfig()
public android.os.Parcelable onSaveInstanceState(CoordinatorLayout parent,
V child)
public void onRestoreInstanceState(CoordinatorLayout parent,
V child,
android.os.Parcelable state)