Skip to content

Commit 5d9f1fa

Browse files
committed
Upgrade example app
1 parent 6e41cde commit 5d9f1fa

15 files changed

Lines changed: 3513 additions & 2037 deletions

File tree

example/android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: "com.android.application"
22
apply plugin: "org.jetbrains.kotlin.android"
33
apply plugin: "com.facebook.react"
4+
apply plugin: "org.rnrepo.tools.prebuilds-plugin"
45

56
/**
67
* This is the configuration block to customize your React Native Android app.

example/android/app/src/main/java/com/example/MainActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.content.res.Configuration
66
import android.media.AudioManager
77
import android.os.Build
88
import android.os.Bundle
9+
import androidx.activity.enableEdgeToEdge
910
import com.facebook.react.ReactActivity
1011
import com.facebook.react.ReactActivityDelegate
1112
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
@@ -14,6 +15,14 @@ import com.google.android.gms.cast.framework.CastContext
1415

1516
class MainActivity : ReactActivity() {
1617
public override fun onCreate(bundle: Bundle?) {
18+
// Edge-to-edge is enforced on Android 15 so that the system bars are transparent or
19+
// translucent by default. On earlier versions of Android, remove opaque system bars opaque by
20+
// calling enableEdgeToEdge().
21+
// On Android 15 and later devices, or after calling enableEdgeToEdge(), gesture navigation is
22+
// transparent by default. Three-button navigation is translucent by default or opaque if it is
23+
// inside the taskbar on large screen device.
24+
// (@link https://developer.android.com/design/ui/mobile/guides/foundations/system-bars#immersive-mode}
25+
enableEdgeToEdge()
1726
super.onCreate(bundle)
1827

1928
// STREAM_MUSIC volume should be changed by the hardware volume controls.

example/android/app/src/main/java/com/example/MainApplication.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.app.Application
44
import com.facebook.react.PackageList
55
import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
7+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
78
import com.facebook.react.ReactNativeHost
89
import com.facebook.react.ReactPackage
910
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
@@ -33,10 +34,6 @@ class MainApplication : Application(), ReactApplication {
3334

3435
override fun onCreate() {
3536
super.onCreate()
36-
SoLoader.init(this, OpenSourceMergedSoMapping)
37-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
38-
// If you opted-in for the New Architecture, we load the native entry point for this app.
39-
load(bridgelessEnabled = true)
40-
}
37+
loadReactNative(this)
4138
}
4239
}

example/android/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,28 @@ buildscript {
1010
castFrameworkVersion = "22.0.0"
1111
kotlinVersion = "2.2.10"
1212
agpVersion = "8.12.3"
13+
rnrepoVersion = "0.2.1"
1314
}
1415
repositories {
1516
google()
1617
mavenCentral()
18+
maven { url "https://packages.rnrepo.org/releases" }
1719
}
1820
dependencies {
1921
classpath("com.android.tools.build:gradle:$agpVersion")
2022
classpath("com.facebook.react:react-native-gradle-plugin")
2123
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
24+
classpath("org.rnrepo.tools:prebuilds-plugin:$rnrepoVersion")
2225
}
2326
}
27+
28+
allprojects {
29+
repositories {
30+
maven { url "https://maven.theoplayer.com/releases" }
31+
google()
32+
mavenCentral()
33+
maven { url "https://packages.rnrepo.org/releases" }
34+
}
35+
}
36+
37+
apply plugin: "com.facebook.react.rootproject"

example/android/gradle.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3434
# your application. You should enable this flag either if you want
3535
# to write custom TurboModules/Fabric components OR use libraries that
3636
# are providing them.
37-
newArchEnabled=false
37+
newArchEnabled=true
3838

3939
# Use this property to enable or disable the Hermes JS engine.
4040
# If set to false, you will be using JSC instead.
@@ -43,3 +43,7 @@ hermesEnabled=true
4343
# Enable THEOplayer Extensions (default: disabled)
4444
THEOplayer_extensionGoogleIMA = true
4545
THEOplayer_extensionGoogleDAI = true
46+
47+
# Toggle whether to reparent the playerView to the top-most node of the view hierarchy when going
48+
# into PiP.
49+
THEOplayer_reparent_on_PiP = true

example/babel.config.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
const path = require('path');
2-
const pak = require('../package.json');
3-
41
module.exports = {
52
presets: ['module:@react-native/babel-preset'],
6-
plugins: [
7-
[
8-
'module-resolver',
9-
{
10-
extensions: ['.tsx', '.ts', '.js', '.json'],
11-
alias: {
12-
[pak.name]: path.join(__dirname, '..', pak.source),
13-
},
14-
},
15-
],
16-
],
3+
plugins: ['babel-plugin-react-compiler'],
174
};

0 commit comments

Comments
 (0)