public abstract class VerticalIndicatorBehavior<V extends android.view.View,CTR extends VerticalIndicatorBehaviorController> extends AnimationOffsetBehavior<V,CTR>
The header and footer behaviors are almost the same, the primary difference is that they have different coordinate system when we trace the bottom and top position of the view to which they attached respectively.
As we have record the bottom and top offset of the view within the view's default coordinate system, whose original point is the left top point of the parent view.
Now we need to trace how much the header has scroll from the top of the parent view. We need to transform the bottom position of the header view from coordinate system of the parent view to another one. This would be a affine matrix transformation below:
|1 0 height||x| | x|
|0 1 height||y| = |y + height|
|0 0 1||1| | 1|
We also need to trace how much the footer view has scrolled from the bottom of the parent view, we use top position of the view as the traced position, the coordinate system would be a affine transformation below:
|1 0 0||x| | x|
|0 -1 parentHeight||y| = |-y + parentHeight|
|0 0 1||1| | 1|
AnimationOffsetBehavior.ScrollingListenerconfiguration, controller, GOLDEN_RATIO, handler, mChild, mListeners, mParent, progressBase, TYPE_UNKNOWN| Constructor and Description |
|---|
VerticalIndicatorBehavior(android.content.Context context) |
VerticalIndicatorBehavior(android.content.Context context,
android.util.AttributeSet attrs) |
| Modifier and Type | Method and Description |
|---|---|
protected ScrollingContentBehavior |
getContentBehavior(CoordinatorLayout parent,
android.view.View child) |
protected abstract int |
getInitialOffset(CoordinatorLayout parent,
android.view.View child) |
protected abstract int |
getMaxOffset(CoordinatorLayout parent,
android.view.View child) |
protected abstract int |
getMinOffset(CoordinatorLayout parent,
android.view.View child) |
protected abstract int |
getRefreshTriggerOffset(CoordinatorLayout parent,
android.view.View child) |
boolean |
layoutDependsOn(CoordinatorLayout parent,
V child,
android.view.View dependency) |
boolean |
onDependentViewChanged(CoordinatorLayout parent,
V child,
android.view.View dependency) |
boolean |
onLayoutChild(CoordinatorLayout parent,
V child,
int layoutDirection) |
boolean |
onMeasureChild(CoordinatorLayout parent,
V child,
int parentWidthMeasureSpec,
int widthUsed,
int parentHeightMeasureSpec,
int heightUsed) |
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) |
addScrollListener, animateOffsetDeltaWithDuration, animateOffsetWithDuration, cancelAnimation, enqueuePendingActions, executePendingActions, getChild, getConfiguration, getController, getParent, handleMessage, onAttachedToLayoutParams, onDetachedFromLayoutParams, removeScrollListener, requestLayout, runOnUiThread, runWithView, setConfigurationgetLeftAndRightOffset, getTopAndBottomOffset, layoutChild, setLeftAndRightOffset, setTopAndBottomOffsetpublic VerticalIndicatorBehavior(android.content.Context context)
public VerticalIndicatorBehavior(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,CTR extends VerticalIndicatorBehaviorController>public boolean onLayoutChild(CoordinatorLayout parent,
V child,
int layoutDirection)
onLayoutChild in class AnimationOffsetBehavior<V extends android.view.View,CTR extends VerticalIndicatorBehaviorController>public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View directTargetChild,
android.view.View target,
int axes,
int type)
public void onStopNestedScroll(CoordinatorLayout coordinatorLayout,
V child,
android.view.View target,
int type)
public boolean layoutDependsOn(CoordinatorLayout parent,
V child,
android.view.View dependency)
public boolean onDependentViewChanged(CoordinatorLayout parent,
V child,
android.view.View dependency)
protected ScrollingContentBehavior getContentBehavior(CoordinatorLayout parent, android.view.View child)
protected abstract int getInitialOffset(CoordinatorLayout parent,
android.view.View child)
protected abstract int getRefreshTriggerOffset(CoordinatorLayout parent,
android.view.View child)
protected abstract int getMinOffset(CoordinatorLayout parent,
android.view.View child)
protected abstract int getMaxOffset(CoordinatorLayout parent,
android.view.View child)