diff --git a/android/src/main/java/com/reactnativekeyboardcontroller/extensions/View.kt b/android/src/main/java/com/reactnativekeyboardcontroller/extensions/View.kt index dd777cba6..7ebc1c567 100644 --- a/android/src/main/java/com/reactnativekeyboardcontroller/extensions/View.kt +++ b/android/src/main/java/com/reactnativekeyboardcontroller/extensions/View.kt @@ -2,6 +2,7 @@ package com.reactnativekeyboardcontroller.extensions import android.graphics.Rect import android.os.Build +import android.util.Log import android.view.View import androidx.annotation.RequiresApi @@ -37,15 +38,12 @@ private val tmpIntArr = IntArray(2) */ @RequiresApi(Build.VERSION_CODES.KITKAT) fun View.copyBoundsInWindow(rect: Rect) { - if (isLaidOut && isAttachedToWindow) { + if (isAttachedToWindow) { rect.set(0, 0, width, height) getLocationInWindow(tmpIntArr) rect.offset(tmpIntArr[0], tmpIntArr[1]) } else { - throw IllegalArgumentException( - "Can not copy bounds as view is not laid out" + - " or attached to window", - ) + Log.w("View.copyBoundsInWindow", "Can not copy bounds as view is not attached to window") } }