Skip to content

Commit 1884102

Browse files
committed
Fixed code comments, Format the code according to the java/kotlin guidelines
1 parent ee3a105 commit 1884102

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

docs/new-architecture-app-modules-android.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,27 +202,27 @@ protected constructor(
202202
reactApplicationContext: ReactApplicationContext,
203203
packages: List<ReactPackage>
204204
) : ReactPackageTurboModuleManagerDelegate(reactApplicationContext, packages) {
205+
205206
override protected external fun initHybrid(): HybridData?
206207
class Builder : ReactPackageTurboModuleManagerDelegate.Builder() {
207208
override protected fun build(
208209
context: ReactApplicationContext,
209210
packages: List<ReactPackage>
210-
): MyApplicationTurboModuleManagerDelegate {
211-
return MyApplicationTurboModuleManagerDelegate(context, packages)
212-
}
211+
): MyApplicationTurboModuleManagerDelegate =
212+
MyApplicationTurboModuleManagerDelegate(context, packages)
213213
}
214214

215215
@Synchronized
216216
override protected fun maybeLoadOtherSoLibraries() {
217217
// Prevents issues with initializer interruptions.
218-
if (!sIsSoLibraryLoaded) {
218+
if (!isSoLibraryLoaded) {
219219
SoLoader.loadLibrary("myapplication_appmodules")
220-
sIsSoLibraryLoaded = true
220+
isSoLibraryLoaded = true
221221
}
222222
}
223223

224224
companion object {
225-
@Volatile private var sIsSoLibraryLoaded = false
225+
@Volatile private var isSoLibraryLoaded = false
226226
}
227227
}
228228
```
@@ -246,7 +246,7 @@ Once you located it, you need to add the `getReactPackageTurboModuleManagerDeleg
246246
```java
247247
public class MyApplication extends Application implements ReactApplication {
248248

249-
private final ReactNativeHost reactNativeHost =
249+
private final ReactNativeHost mReactNativeHost =
250250
new ReactNativeHost(this) {
251251
@Override
252252
public boolean getUseDeveloperSupport() { /* ... */ }
@@ -287,10 +287,8 @@ class MyApplication : Application(), ReactApplication {
287287
}
288288

289289
@NonNull
290-
override fun getReactPackageTurboModuleManagerDelegateBuilder():
291-
ReactPackageTurboModuleManagerDelegate.Builder? {
292-
return Builder()
293-
}
290+
override fun getReactPackageTurboModuleManagerDelegateBuilder() =
291+
ReactPackageTurboModuleManagerDelegate.Builder()
294292
}
295293
}
296294
```
@@ -308,7 +306,7 @@ Still on the `ReactNativeHost` , we need to extend the the `getPackages()` metho
308306
```java
309307
public class MyApplication extends Application implements ReactApplication {
310308

311-
private final ReactNativeHost reactNativeHost =
309+
private final ReactNativeHost mReactNativeHost =
312310
new ReactNativeHost(this) {
313311
@Override
314312
public boolean getUseDeveloperSupport() { /* ... */ }

0 commit comments

Comments
 (0)