mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix several build warnings on RN Tester Android (#41660)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41660 While working on other things, I noticed those warnings firing on console which I'm fixing here. Changelog: [Internal] [Changed] - Fix several build warnings on RN Tester Android Reviewed By: cipolleschi Differential Revision: D51589072 fbshipit-source-id: 1ddb29afd0d150f1ccbc7a8def9f27ecedb69724
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4f3094aba4
commit
25196ba24f
+2
-3
@@ -20,12 +20,11 @@ class RNTesterActivity : ReactActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
// Get remote param before calling super which uses it
|
||||
val bundle = activity.getIntent()?.getExtras()
|
||||
val bundle = activity.intent?.extras
|
||||
|
||||
if (bundle != null && bundle.containsKey(PARAM_ROUTE)) {
|
||||
val routeUri = "rntester://example/${bundle.getString(PARAM_ROUTE)}Example"
|
||||
initialProps = Bundle()
|
||||
initialProps?.putString("exampleFromAppetizeParams", routeUri)
|
||||
initialProps = Bundle().apply { putString("exampleFromAppetizeParams", routeUri) }
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
+4
-6
@@ -35,15 +35,13 @@ internal class MyLegacyViewManager(reactContext: ReactApplicationContext) :
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.COLOR)
|
||||
fun setColor(view: MyNativeView, color: String) {
|
||||
view.setBackgroundColor(Color.parseColor(color))
|
||||
fun setColor(view: MyNativeView, color: String?) {
|
||||
color?.let { view.setBackgroundColor(Color.parseColor(it)) }
|
||||
}
|
||||
|
||||
@ReactProp(name = "cornerRadius")
|
||||
fun setCornerRadius(view: MyNativeView, cornerRadius: Float) {
|
||||
if (cornerRadius !== null) {
|
||||
view.setCornerRadius(cornerRadius)
|
||||
}
|
||||
fun setCornerRadius(view: MyNativeView, cornerRadius: Float?) {
|
||||
cornerRadius?.let { view.setCornerRadius(it) }
|
||||
}
|
||||
|
||||
override fun getExportedViewConstants(): Map<String, Any> = mapOf("PI" to 3.14)
|
||||
|
||||
+1
@@ -5,6 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION") // As we want to test RCTEventEmitter here
|
||||
package com.facebook.react.uiapp.component
|
||||
|
||||
import android.graphics.Color
|
||||
|
||||
Reference in New Issue
Block a user