Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[configure-splash-screen] <feat>: Accomodate Android API change
Browse files Browse the repository at this point in the history
expo/expo#10294 introduces scoping to SplashScreen object used in project's MainActivity
  • Loading branch information
bbarthec committed Sep 24, 2020
1 parent 969c593 commit 8f9cf1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/configure-splash-screen/src/android/MainActivity.ts
Expand Up @@ -68,8 +68,8 @@ export default async function configureMainActivity(
// importing SplashScreen
.applyAction(content => {
const [succeeded, newContent] = replace(content, {
replacePattern: /^import expo\.modules\.splashscreen\.SplashScreen.*?\nimport expo\.modules\.splashscreen\.SplashScreenImageResizeMode.*?$/m,
replaceContent: `import expo.modules.splashscreen.SplashScreen${LE}
replacePattern: /^import expo\.modules\.splashscreen\..*SplashScreen.*?\nimport expo\.modules\.splashscreen\.SplashScreenImageResizeMode.*?$/m,
replaceContent: `import expo.modules.splashscreen.singletons.SplashScreen${LE}
import expo.modules.splashscreen.SplashScreenImageResizeMode${LE}`,
});
return [newContent, 'replacedSplashImports', succeeded];
Expand All @@ -80,7 +80,7 @@ import expo.modules.splashscreen.SplashScreenImageResizeMode${LE}`,
}
const [succeeded, newContent] = insert(content, {
insertPattern: isJava ? /(?=public class .* extends .* {.*$)/m : /(?=class .* : .* {.*$)/m,
insertContent: `import expo.modules.splashscreen.SplashScreen${LE}
insertContent: `import expo.modules.splashscreen.singletons.SplashScreen${LE}
import expo.modules.splashscreen.SplashScreenImageResizeMode${LE}
`,
Expand Down
Expand Up @@ -56,7 +56,7 @@ ${
!addSplashScreenShowWith
? ''
: `
import expo.modules.splashscreen.SplashScreen${LE}
import expo.modules.splashscreen.singletons.SplashScreen${LE}
import expo.modules.splashscreen.SplashScreenImageResizeMode${LE}
`
}
Expand Down
Expand Up @@ -7,7 +7,7 @@ import com.facebook.react.ReactActivity;
import com.facebook.react.ReactRootView;
import expo.modules.splashscreen.SplashScreen;
import expo.modules.splashscreen.singletons.SplashScreen;
import expo.modules.splashscreen.SplashScreenImageResizeMode;
public class MainActivity extends ReactActivity {
Expand Down

0 comments on commit 8f9cf1b

Please sign in to comment.