public
class
FoldingLayout
extends
BaseFoldingLayout {
private
final
String FOLDING_VIEW_EXCEPTION_MESSAGE =
"Folding Layout can only 1 child at "
+
"most"
;
private
GestureDetector mScrollGestureDetector;
FoldingLayout that =
null
;
private
int
mTranslation =
0
;
private
int
mParentPositionY = -
1
;
private
int
mTouchSlop = -
1
;
private
boolean
mDidNotStartScroll =
true
;
public
FoldingLayout(Context context) {
super
(context);
init(context,
null
);
that =
this
;
}
public
FoldingLayout(Context context, AttributeSet attrs) {
super
(context, attrs);
init(context, attrs);
that =
this
;
}
public
FoldingLayout(Context context, AttributeSet attrs,
int
defStyle) {
super
(context, attrs, defStyle);
init(context, attrs);
that =
this
;
}
public
void
init(Context context, AttributeSet attrs) {
mScrollGestureDetector =
new
GestureDetector(context,
new
ScrollGestureDetector());
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
setAnchorFactor(
0
);
super
.init(context, attrs);
}
转载于:https://blog.51cto.com/tongfu1013/1678268