Skip to content

Commit

Permalink
Add suppression for deprecated setters and getters
Browse files Browse the repository at this point in the history
Summary:
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

Differential Revision: D57780503
  • Loading branch information
Abbondanzo authored and facebook-github-bot committed May 24, 2024
1 parent c13790f commit 673ab4f
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 673ab4f

Please sign in to comment.