From e50751e2cf6c5d969e2351181bdfc5b990c6b7e1 Mon Sep 17 00:00:00 2001 From: errnull Date: Thu, 9 Jan 2020 18:34:45 +0800 Subject: [PATCH] feat: Correct touch event when mvideoItem == null; --- .../main/java/com/opensource/svgaplayer/SVGAImageView.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/opensource/svgaplayer/SVGAImageView.kt b/library/src/main/java/com/opensource/svgaplayer/SVGAImageView.kt index 78852062..328bffc2 100644 --- a/library/src/main/java/com/opensource/svgaplayer/SVGAImageView.kt +++ b/library/src/main/java/com/opensource/svgaplayer/SVGAImageView.kt @@ -256,6 +256,9 @@ open class SVGAImageView : ImageView { @SuppressLint("ClickableViewAccessibility") override fun onTouchEvent(event: MotionEvent?): Boolean { + if (mVideoItem == null) { + return super.onTouchEvent(event) + } event?.let { if(event.action == MotionEvent.ACTION_DOWN){ val drawable = drawable as? SVGADrawable ?: return false @@ -267,9 +270,6 @@ open class SVGAImageView : ImageView { } } } - - - } }