fix(android): update ui manager getter (#3634)
This commit is contained in:
parent
0fa0086a39
commit
e87c14a437
@ -7,7 +7,8 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|||||||
import com.facebook.react.bridge.ReactMethod
|
import com.facebook.react.bridge.ReactMethod
|
||||||
import com.facebook.react.bridge.ReadableMap
|
import com.facebook.react.bridge.ReadableMap
|
||||||
import com.facebook.react.bridge.UiThreadUtil
|
import com.facebook.react.bridge.UiThreadUtil
|
||||||
import com.facebook.react.uimanager.UIManagerModule
|
import com.facebook.react.uimanager.UIManagerHelper
|
||||||
|
import com.facebook.react.uimanager.common.UIManagerType
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
class VideoManagerModule(reactContext: ReactApplicationContext?) : ReactContextBaseJavaModule(reactContext) {
|
class VideoManagerModule(reactContext: ReactApplicationContext?) : ReactContextBaseJavaModule(reactContext) {
|
||||||
@ -17,14 +18,12 @@ class VideoManagerModule(reactContext: ReactApplicationContext?) : ReactContextB
|
|||||||
|
|
||||||
private fun performOnPlayerView(reactTag: Int, callback: (ReactExoplayerView?) -> Unit) {
|
private fun performOnPlayerView(reactTag: Int, callback: (ReactExoplayerView?) -> Unit) {
|
||||||
UiThreadUtil.runOnUiThread {
|
UiThreadUtil.runOnUiThread {
|
||||||
val view = if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
val uiManager = UIManagerHelper.getUIManager(
|
||||||
reactApplicationContext.fabricUIManager?.resolveView(
|
reactApplicationContext,
|
||||||
reactTag
|
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) UIManagerType.FABRIC else UIManagerType.DEFAULT
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
val uiManager = reactApplicationContext.getNativeModule(UIManagerModule::class.java)
|
val view = uiManager?.resolveView(reactTag)
|
||||||
uiManager?.resolveView(reactTag)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (view is ReactExoplayerView) {
|
if (view is ReactExoplayerView) {
|
||||||
callback(view)
|
callback(view)
|
||||||
|
Loading…
Reference in New Issue
Block a user