Skip to content

Commit 9dcf5f7

Browse files
authored
chore: update example app rn version, make android work with 0.82 (#174)
1 parent 611a5fc commit 9dcf5f7

12 files changed

Lines changed: 683 additions & 358 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ We can help you build your next dream product –
4646
## Prerequisites
4747

4848
- `react-native-enriched` currently supports only Android and iOS platforms
49-
- It works only with [the React Native New Architecture (Fabric)](https://reactnative.dev/architecture/landing-page) and supports the 3 latest stable React Native releases, currently `0.79`, `0.80` and `0.81`
49+
- It works only with [the React Native New Architecture (Fabric)](https://reactnative.dev/architecture/landing-page) and supports following React Native releases: `0.79`, `0.80`, `0.81` and `0.82`
5050

5151
## Installation
5252

android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace facebook::react {
1111
class EnrichedTextInputMeasurementManager {
1212
public:
1313
EnrichedTextInputMeasurementManager(
14-
const ContextContainer::Shared& contextContainer)
14+
const std::shared_ptr<const ContextContainer>& contextContainer)
1515
: contextContainer_(contextContainer) {}
1616

1717
Size measure(
@@ -20,7 +20,7 @@ namespace facebook::react {
2020
LayoutConstraints layoutConstraints) const;
2121

2222
private:
23-
const ContextContainer::Shared contextContainer_;
23+
const std::shared_ptr<const ContextContainer> contextContainer_;
2424
};
2525

2626
} // namespace facebook::react

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:allowBackup="false"
1111
android:theme="@style/AppTheme"
12+
android:usesCleartextTraffic="${usesCleartextTraffic}"
1213
android:supportsRtl="true">
1314
<activity
1415
android:name=".MainActivity"

example/android/app/src/main/java/swmansion/enriched/example/MainApplication.kt

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,18 @@ import com.facebook.react.PackageList
55
import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
77
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
8-
import com.facebook.react.ReactNativeHost
9-
import com.facebook.react.ReactPackage
108
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11-
import com.facebook.react.defaults.DefaultReactNativeHost
129

1310
class MainApplication : Application(), ReactApplication {
14-
15-
override val reactNativeHost: ReactNativeHost =
16-
object : DefaultReactNativeHost(this) {
17-
override fun getPackages(): List<ReactPackage> =
18-
PackageList(this).packages.apply {
19-
// Packages that cannot be autolinked yet can be added manually here, for example:
20-
// add(MyReactNativePackage())
21-
}
22-
23-
override fun getJSMainModuleName(): String = "index"
24-
25-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
26-
27-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
28-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
29-
}
30-
31-
override val reactHost: ReactHost
32-
get() = getDefaultReactHost(applicationContext, reactNativeHost)
11+
override val reactHost: ReactHost by lazy {
12+
getDefaultReactHost(
13+
context = applicationContext,
14+
packageList = PackageList(this).packages.apply {
15+
// Packages that cannot be autolinked yet can be added manually here, for example:
16+
// add(MyReactNativePackage())
17+
},
18+
)
19+
}
3320

3421
override fun onCreate() {
3522
super.onCreate()
1.65 KB
Binary file not shown.

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/android/gradlew

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/EnrichedTextInputExample/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>en</string>
79
<key>CFBundleDisplayName</key>

example/ios/Podfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ target 'EnrichedTextInputExample' do
3232
end
3333

3434
post_install do |installer|
35-
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
3635
react_native_post_install(
3736
installer,
3837
config[:reactNativePath],

0 commit comments

Comments
 (0)