From 745523c620e3cc79f2bf5b3244f77cfa71aacd55 Mon Sep 17 00:00:00 2001 From: Sylwester Zinkiewicz Date: Mon, 18 Apr 2022 11:28:34 +0200 Subject: [PATCH] [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 --- .../edziennik/utils/SwipeRefreshLayoutNoIndicator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoIndicator.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoIndicator.java index 75192eec..b81123ec 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoIndicator.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoIndicator.java @@ -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) { - ev.setSource(0x10000000); + if (Build.VERSION.SDK_INT < 32) { + ev.setSource(0x10000000); + } boolean parentConsumed = parent.onInterceptTouchEvent(ev); boolean superConsumed = super.onInterceptTouchEvent(ev); return parentConsumed && superConsumed;