From bad90f3408cbc5df575ae86cbeb7c5a6fee51710 Mon Sep 17 00:00:00 2001 From: mcarare Date: Fri, 24 Apr 2020 16:03:53 +0300 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/10180: Add extension to remove touch delegate from parent. --- app/src/main/java/org/mozilla/fenix/ext/View.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/ext/View.kt b/app/src/main/java/org/mozilla/fenix/ext/View.kt index 3588040489..a58669a5b5 100644 --- a/app/src/main/java/org/mozilla/fenix/ext/View.kt +++ b/app/src/main/java/org/mozilla/fenix/ext/View.kt @@ -22,3 +22,10 @@ fun View.increaseTapArea(extraDps: Int) { parent.touchDelegate = TouchDelegate(touchRect, this) } } + +fun View.removeTouchDelegate() { + val parent = this.parent as View + parent.post { + parent.touchDelegate = null + } +}