- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentViewPager.java
More file actions
Latest commit
29 lines (21 loc) · 625 Bytes
/
Copy pathContentViewPager.java
File metadata and controls
29 lines (21 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package ...
importandroid.content.Context;
importandroid.support.v4.view.ViewPager;
importandroid.util.AttributeSet;
importandroid.view.MotionEvent;
publicclassContentViewPagerextendsViewPager {
privatebooleanmAllowSwipe = true;
publicContentViewPager(Contextcontext) {
super(context);
}
publicContentViewPager(Contextcontext, AttributeSetattrs) {
super(context, attrs);
}
@Override
publicbooleanonInterceptTouchEvent(MotionEventarg0) {
returnmAllowSwipe ? super.onInterceptTouchEvent(arg0) : false;
}
publicvoidsetAllowSwipe(booleanallowSwipe) {
mAllowSwipe = allowSwipe;
}
}