mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Convert WindowOverlayCompat to Kotlin (#43749)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43749 Convert Java to Kotlin: `react/devsupport/WindowOverlayCompat.java` Changelog: [Internal] internal Reviewed By: rshest Differential Revision: D55604746 fbshipit-source-id: 413bf28c8f692e85150a04de05dc7bae324ddd26
This commit is contained in:
committed by
Facebook GitHub Bot
parent
477611c8db
commit
e5db122924
-27
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.devsupport;
|
||||
|
||||
import android.os.Build;
|
||||
import android.view.WindowManager;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
|
||||
/**
|
||||
* Compatibility wrapper for apps targeting API level 26 or later. See
|
||||
* https://developer.android.com/about/versions/oreo/android-8.0-changes.html#cwt
|
||||
*/
|
||||
/* package */ @Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
class WindowOverlayCompat {
|
||||
|
||||
private static final int TYPE_APPLICATION_OVERLAY = 2038;
|
||||
|
||||
static final int TYPE_SYSTEM_OVERLAY =
|
||||
Build.VERSION.SDK_INT < Build.VERSION_CODES.O
|
||||
? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY
|
||||
: TYPE_APPLICATION_OVERLAY;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.devsupport
|
||||
|
||||
import android.os.Build
|
||||
import android.view.WindowManager
|
||||
|
||||
/**
|
||||
* Compatibility wrapper for apps targeting API level 26 or later. See
|
||||
* https://developer.android.com/about/versions/oreo/android-8.0-changes.html#cwt
|
||||
*/
|
||||
internal object WindowOverlayCompat {
|
||||
|
||||
private const val TYPE_APPLICATION_OVERLAY = 2038
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@JvmField
|
||||
val TYPE_SYSTEM_OVERLAY: Int =
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
|
||||
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY
|
||||
else TYPE_APPLICATION_OVERLAY
|
||||
}
|
||||
Reference in New Issue
Block a user