mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Deprecate MapBuilder and remove Kotlin usages (#45743)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45743 This is a Java-centric class that can be replaced by Kotlin's map extensions. Changelog: [Android][Deprecated] Deprecate MapBuilder Reviewed By: cortinico Differential Revision: D60309106 fbshipit-source-id: 4a764fa1d59993dc735b2181a2270dc79a0e0396
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a778979ed6
commit
a696d2ed6b
+15
-14
@@ -10,7 +10,6 @@ package com.facebook.react.osslibraryexample
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import com.facebook.react.bridge.ReadableArray
|
||||
import com.facebook.react.common.MapBuilder
|
||||
import com.facebook.react.module.annotations.ReactModule
|
||||
import com.facebook.react.uimanager.SimpleViewManager
|
||||
import com.facebook.react.uimanager.ThemedReactContext
|
||||
@@ -52,19 +51,21 @@ internal class SampleNativeComponentViewManager :
|
||||
override fun getExportedViewConstants(): Map<String, Any> = mapOf("PI" to 3.14)
|
||||
|
||||
override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any> {
|
||||
return MapBuilder.builder<String, Any>()
|
||||
.put(
|
||||
"onColorChanged",
|
||||
MapBuilder.of(
|
||||
"phasedRegistrationNames",
|
||||
MapBuilder.of("bubbled", "onColorChanged", "captured", "onColorChangedCapture")))
|
||||
.put(
|
||||
"topIntArrayChanged",
|
||||
MapBuilder.of(
|
||||
"phasedRegistrationNames",
|
||||
MapBuilder.of(
|
||||
"bubbled", "topIntArrayChanged", "captured", "topIntArrayChangedCapture")))
|
||||
.build()
|
||||
return mapOf(
|
||||
"onColorChanged" to
|
||||
mapOf(
|
||||
"phasedRegistrationNames" to
|
||||
mapOf(
|
||||
"bubbled" to "onColorChanged",
|
||||
"captured" to "onColorChangedCapture",
|
||||
)),
|
||||
"topIntArrayChanged" to
|
||||
mapOf(
|
||||
"phasedRegistrationNames" to
|
||||
mapOf(
|
||||
"bubbled" to "topIntArrayChanged",
|
||||
"captured" to "topIntArrayChangedCapture",
|
||||
)))
|
||||
}
|
||||
|
||||
@SuppressLint("BadMethodUse-android.view.View.setBackgroundColor")
|
||||
|
||||
Reference in New Issue
Block a user