|
@@ -0,0 +1,40 @@
|
|
|
+package com.owncloud.android.ui.components;
|
|
|
+
|
|
|
+import android.annotation.SuppressLint;
|
|
|
+import android.content.Context;
|
|
|
+import android.support.annotation.NonNull;
|
|
|
+import android.support.annotation.Nullable;
|
|
|
+import android.support.v4.view.ViewPager;
|
|
|
+import android.util.AttributeSet;
|
|
|
+import android.view.MotionEvent;
|
|
|
+
|
|
|
+public class CustomViewPager extends ViewPager {
|
|
|
+ public CustomViewPager(@NonNull Context context) {
|
|
|
+ super(context);
|
|
|
+ }
|
|
|
+
|
|
|
+ public CustomViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
|
|
|
+ super(context, attrs);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressLint("ClickableViewAccessibility")
|
|
|
+ @Override
|
|
|
+ public boolean onTouchEvent(MotionEvent ev) {
|
|
|
+ try {
|
|
|
+ return super.onTouchEvent(ev);
|
|
|
+ } catch (IllegalArgumentException ex) {
|
|
|
+ // no logging as this might flood log and we cannot do anything
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean onInterceptTouchEvent(MotionEvent ev) {
|
|
|
+ try {
|
|
|
+ return super.onInterceptTouchEvent(ev);
|
|
|
+ } catch (IllegalArgumentException ex) {
|
|
|
+ // no logging as this might flood log and we cannot do anything
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+}
|