From 79fd4cb1edea770dab36c635e3c516192b71dbea Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ricau Date: Wed, 3 Mar 2021 16:29:17 -0800 Subject: [PATCH] Fix crash when no android x or support lib in classpath --- .../main/java/curtains/internal/WindowCallbackWrapper.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/curtains/src/main/java/curtains/internal/WindowCallbackWrapper.kt b/curtains/src/main/java/curtains/internal/WindowCallbackWrapper.kt index 9560a77..d893457 100644 --- a/curtains/src/main/java/curtains/internal/WindowCallbackWrapper.kt +++ b/curtains/src/main/java/curtains/internal/WindowCallbackWrapper.kt @@ -57,8 +57,11 @@ internal class WindowCallbackWrapper constructor( try { Class.forName("androidx.appcompat.view.WindowCallbackWrapper") } catch (ignored: Throwable) { - Class.forName("android.support.v7.view.WindowCallbackWrapper") - null + try { + Class.forName("android.support.v7.view.WindowCallbackWrapper") + } catch (ignored: Throwable) { + null + } } }