Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade react-native & other dependencies
- Loading branch information
Showing
95 changed files
with
5,227 additions
and
5,624 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
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 |
---|---|---|
|
@@ -66,4 +66,4 @@ public void run() { | |
} | ||
} | ||
} | ||
} | ||
} |
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
60 changes: 38 additions & 22 deletions
60
example/android/app/src/main/java/org/reactnavigation/example/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,41 +1,57 @@ | ||
package org.reactnavigation.example; | ||
|
||
import android.os.Build; | ||
import android.os.Bundle; | ||
|
||
import com.facebook.react.ReactActivity; | ||
import com.facebook.react.ReactActivityDelegate; | ||
import com.facebook.react.ReactRootView; | ||
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; | ||
|
||
import expo.modules.splashscreen.singletons.SplashScreen; | ||
import expo.modules.splashscreen.SplashScreenImageResizeMode; | ||
import expo.modules.ReactActivityDelegateWrapper; | ||
|
||
public class MainActivity extends ReactActivity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
// Set the theme to AppTheme BEFORE onCreate to support | ||
// coloring the background, status bar, and navigation bar. | ||
// This is required for expo-splash-screen. | ||
setTheme(R.style.AppTheme); | ||
super.onCreate(null); | ||
// SplashScreen.show(...) has to be called after super.onCreate(...) | ||
// Below line is handled by '@expo/configure-splash-screen' command and it's discouraged to modify it manually | ||
SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, ReactRootView.class, false); | ||
} | ||
|
||
/** | ||
* Returns the name of the main component registered from JavaScript. | ||
* This is used to schedule rendering of the component. | ||
*/ | ||
@Override | ||
protected String getMainComponentName() { | ||
return "main"; | ||
} | ||
|
||
/** | ||
* Returns the name of the main component registered from JavaScript. | ||
* This is used to schedule rendering of the component. | ||
*/ | ||
@Override | ||
protected String getMainComponentName() { | ||
return "main"; | ||
} | ||
@Override | ||
protected ReactActivityDelegate createReactActivityDelegate() { | ||
return new ReactActivityDelegateWrapper(this, | ||
new ReactActivityDelegate(this, getMainComponentName()) | ||
); | ||
} | ||
|
||
@Override | ||
protected ReactActivityDelegate createReactActivityDelegate() { | ||
return new ReactActivityDelegate(this, getMainComponentName()) { | ||
@Override | ||
protected ReactRootView createRootView() { | ||
return new RNGestureHandlerEnabledRootView(MainActivity.this); | ||
} | ||
}; | ||
/** | ||
* Align the back button behavior with Android S | ||
* where moving root activities to background instead of finishing activities. | ||
* @see <a href="https://developer.android.com/reference/android/app/Activity#onBackPressed()">onBackPressed</a> | ||
*/ | ||
@Override | ||
public void invokeDefaultOnBackPressed() { | ||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) { | ||
if (!moveTaskToBack(false)) { | ||
// For non-root activities, use the default implementation to finish them. | ||
super.invokeDefaultOnBackPressed(); | ||
} | ||
return; | ||
} | ||
|
||
// Use the default back button implementation on Android S | ||
// because it's doing more than {@link Activity#moveTaskToBack} in fact. | ||
super.invokeDefaultOnBackPressed(); | ||
} | ||
} |
Oops, something went wrong.