mirror of https://github.com/nextcloud/android
48 lines
1.3 KiB
Java
48 lines
1.3 KiB
Java
/*
|
|
* Nextcloud - Android Client
|
|
*
|
|
* SPDX-FileCopyrightText: 2018 Tobias Kaminsky <tobias@kaminsky.me>
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
package com.owncloud.android.ui.components;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.view.MotionEvent;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.viewpager.widget.ViewPager;
|
|
|
|
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;
|
|
}
|
|
}
|