forked from github/szkolny
[UI] Fix touch events on swipe refresh pages (API 32+). (#129)
* [Hotfix] Fix touch events on swipe refresh pages (API 32) * Add API SDK version check
This commit is contained in:
parent
8911ce2bc1
commit
745523c620
@ -17,6 +17,7 @@
|
||||
package pl.szczodrzynski.edziennik.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@ -83,7 +84,9 @@ public class SwipeRefreshLayoutNoIndicator extends SwipeRefreshLayout {
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
if (Build.VERSION.SDK_INT < 32) {
|
||||
ev.setSource(0x10000000);
|
||||
}
|
||||
boolean parentConsumed = parent.onInterceptTouchEvent(ev);
|
||||
boolean superConsumed = super.onInterceptTouchEvent(ev);
|
||||
return parentConsumed && superConsumed;
|
||||
|
Loading…
Reference in New Issue
Block a user