-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4675 from wix/feat/4175-new-arch
android(feat):new arch support
- Loading branch information
Showing
59 changed files
with
789 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
.buildkite/jobs/pipeline.android_rn_75.yml → .../jobs/pipeline.android_rn_76_old_arch.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
detox/android/detox/src/full/java/com/wix/detox/reactnative/ReactApplicationExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.wix.detox.reactnative | ||
|
||
import android.annotation.SuppressLint | ||
import com.facebook.react.ReactApplication | ||
import com.facebook.react.ReactInstanceManager | ||
import com.facebook.react.bridge.ReactContext | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint | ||
|
||
|
||
fun ReactApplication.getInstanceManagerSafe(): ReactInstanceManager { | ||
return reactNativeHost.reactInstanceManager | ||
?: throw RuntimeException("ReactInstanceManager is null!") | ||
} | ||
|
||
@SuppressLint("VisibleForTests") | ||
fun ReactApplication.getCurrentReactContext(): ReactContext? { | ||
return if (isFabricEnabled()) { | ||
reactHost?.currentReactContext | ||
} else { | ||
getInstanceManagerSafe().currentReactContext | ||
} | ||
} | ||
|
||
fun ReactApplication.getCurrentReactContextSafe(): ReactContext { | ||
return getCurrentReactContext() | ||
?: throw RuntimeException("ReactContext is null!") | ||
} | ||
|
||
/** | ||
* A method to check if Fabric is enabled in the React Native application. | ||
*/ | ||
fun isFabricEnabled(): Boolean { | ||
return DefaultNewArchitectureEntryPoint.fabricEnabled | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.