Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update example to react-native 0.70
- Loading branch information
Андрей Непеин
committed
Dec 16, 2022
1 parent
831df86
commit d5a5c1a
Showing
32 changed files
with
2,527 additions
and
1,660 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.reactnativeinappupdate"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application | ||
android:name=".MainApplication" | ||
<application android:name=".MainApplication" | ||
android:label="@string/app_name" | ||
android:icon="@mipmap/ic_launcher" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:allowBackup="false" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity" | ||
android:label="@string/app_name" | ||
android:icon="@mipmap/ic_launcher" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:allowBackup="false" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:label="@string/app_name" | ||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" | ||
android:launchMode="singleTask" | ||
android:windowSoftInputMode="adjustResize"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> | ||
</application> | ||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" | ||
android:launchMode="singleTask" | ||
android:windowSoftInputMode="adjustResize" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> | ||
</application> | ||
|
||
</manifest> |
50 changes: 42 additions & 8 deletions
50
example/android/app/src/main/java/com/example/reactnativeinappupdate/MainActivity.java
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 |
---|---|---|
@@ -1,15 +1,49 @@ | ||
package com.example.reactnativeinappupdate; | ||
|
||
import com.facebook.react.ReactActivity; | ||
import com.facebook.react.ReactActivityDelegate; | ||
import com.facebook.react.ReactRootView; | ||
|
||
public class MainActivity extends ReactActivity { | ||
|
||
/** | ||
* Returns the name of the main component registered from JavaScript. This is used to schedule | ||
* rendering of the component. | ||
*/ | ||
@Override | ||
protected String getMainComponentName() { | ||
return "InAppUpdateExample"; | ||
} | ||
/** | ||
* Returns the name of the main component registered from JavaScript. This is used to schedule | ||
* rendering of the component. | ||
*/ | ||
@Override | ||
protected String getMainComponentName() { | ||
return "InAppUpdateExample"; | ||
} | ||
|
||
|
||
/** | ||
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and | ||
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer | ||
* (Paper). | ||
*/ | ||
@Override | ||
protected ReactActivityDelegate createReactActivityDelegate() { | ||
return new MainActivityDelegate(this, getMainComponentName()); | ||
} | ||
|
||
public static class MainActivityDelegate extends ReactActivityDelegate { | ||
public MainActivityDelegate(ReactActivity activity, String mainComponentName) { | ||
super(activity, mainComponentName); | ||
} | ||
|
||
@Override | ||
protected ReactRootView createRootView() { | ||
ReactRootView reactRootView = new ReactRootView(getContext()); | ||
// If you opted-in for the New Architecture, we enable the Fabric Renderer. | ||
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); | ||
return reactRootView; | ||
} | ||
|
||
@Override | ||
protected boolean isConcurrentRootEnabled() { | ||
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). | ||
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html | ||
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; | ||
} | ||
} | ||
} |
Oops, something went wrong.