Skip to content

Commit

Permalink
Add suppression for deprecated setters and getters (#44676)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #44676

Some of the setters and getters in these functions, like [`getStatusBarColor`](https://developer.android.com/reference/android/view/Window#getStatusBarColor), have been marked as deprecated in [`VANILLA_ICE_CREAM`](https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM). This change suppresses deprecation warnings until we can move to newer alternatives.

## Changelog

[Android] [Changed] - Added suppression for deprecated getter/setter usage in StatusBarModule

Reviewed By: sumkit

Differential Revision: D57780503

fbshipit-source-id: 6201f7a3e597fef420de0f80dd2243bee78bc583
  • Loading branch information
Abbondanzo authored and facebook-github-bot committed May 24, 2024
1 parent 06461c4 commit ac51dee
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.facebook.react.uimanager.PixelUtil
public class StatusBarModule(reactContext: ReactApplicationContext?) :
NativeStatusBarManagerAndroidSpec(reactContext) {

@Suppress("DEPRECATION")
override fun getTypedExportedConstants(): Map<String, Any> {
val context = getReactApplicationContext()
val heightResId = context.resources.getIdentifier("status_bar_height", "dimen", "android")
Expand All @@ -53,6 +54,7 @@ public class StatusBarModule(reactContext: ReactApplicationContext?) :
)
}

@Suppress("DEPRECATION")
override fun setColor(colorDouble: Double, animated: Boolean) {
val color = colorDouble.toInt()
val activity = getCurrentActivity()
Expand Down

0 comments on commit ac51dee

Please sign in to comment.