File tree 1 file changed +9
-9
lines changed
OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import android.os.Build
8
8
import android.telephony.TelephonyManager
9
9
import android.util.DisplayMetrics
10
10
import android.view.View
11
- import android.view.WindowInsets
12
11
import androidx.core.view.WindowInsetsCompat
13
12
import java.lang.ref.WeakReference
14
13
@@ -31,14 +30,15 @@ object DeviceUtils {
31
30
window.windowManager.defaultDisplay.getMetrics(metrics)
32
31
}
33
32
if (view != null ) {
34
- isOpen = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .R ) {
35
- val imeInsets = view.rootWindowInsets.getInsets(WindowInsetsCompat .Type .ime())
36
- // ensure input method size is 0
37
- ! (imeInsets.left == 0 && imeInsets.top == 0 && imeInsets.right == 0 && imeInsets.bottom == 0 )
38
- } else {
39
- val heightDiff = metrics.heightPixels - visibleBounds.bottom
40
- heightDiff > MARGIN_ERROR_PX_SIZE
41
- }
33
+ isOpen =
34
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .R ) {
35
+ val imeInsets = view.rootWindowInsets.getInsets(WindowInsetsCompat .Type .ime())
36
+ // ensure input method size is 0
37
+ ! (imeInsets.left == 0 && imeInsets.top == 0 && imeInsets.right == 0 && imeInsets.bottom == 0 )
38
+ } else {
39
+ val heightDiff = metrics.heightPixels - visibleBounds.bottom
40
+ heightDiff > MARGIN_ERROR_PX_SIZE
41
+ }
42
42
}
43
43
return isOpen
44
44
}
You can’t perform that action at this time.
0 commit comments