diff --git a/android/app/src/main/java/io/metamask/MainActivity.java b/android/app/src/main/java/io/metamask/MainActivity.java index 6513f6fe731..2ebbf24abae 100644 --- a/android/app/src/main/java/io/metamask/MainActivity.java +++ b/android/app/src/main/java/io/metamask/MainActivity.java @@ -16,6 +16,8 @@ import androidx.annotation.NonNull; +import org.devio.rn.splashscreen.SplashScreen; + public class MainActivity extends ReactFragmentActivity { /** @@ -44,6 +46,7 @@ protected void onStart() { @Override protected void onCreate(Bundle savedInstanceState) { + SplashScreen.show(this); super.onCreate(null); } @Override diff --git a/android/app/src/main/res/drawable/diamond.png b/android/app/src/main/res/drawable/diamond.png new file mode 100644 index 00000000000..4044e364f08 Binary files /dev/null and b/android/app/src/main/res/drawable/diamond.png differ diff --git a/android/app/src/main/res/layout/launch_screen.xml b/android/app/src/main/res/layout/launch_screen.xml new file mode 100644 index 00000000000..b8e1fa80ac8 --- /dev/null +++ b/android/app/src/main/res/layout/launch_screen.xml @@ -0,0 +1,6 @@ + + + + diff --git a/app/components/Views/Entry/index.js b/app/components/Views/Entry/index.js index ef1a080383b..67ceb750914 100644 --- a/app/components/Views/Entry/index.js +++ b/app/components/Views/Entry/index.js @@ -14,6 +14,7 @@ import { colors } from '../../../styles/common'; import DeeplinkManager from '../../../core/DeeplinkManager'; import Logger from '../../../util/Logger'; import Device from '../../../util/Device'; +import SplashScreen from 'react-native-splash-screen'; /** * Entry Screen that decides which screen to show @@ -90,6 +91,7 @@ class Entry extends PureComponent { async componentDidMount() { DeeplinkManager.init(this.props.navigation); this.unsubscribeFromBranch = Branch.subscribe(this.handleDeeplinks); + SplashScreen.hide(); const existingUser = await AsyncStorage.getItem('@MetaMask:existingUser'); if (existingUser !== null) { await this.unlockKeychain(); diff --git a/ios/MetaMask/AppDelegate.m b/ios/MetaMask/AppDelegate.m index 442bd80424d..ca6a61949f4 100644 --- a/ios/MetaMask/AppDelegate.m +++ b/ios/MetaMask/AppDelegate.m @@ -71,6 +71,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( launchScreenView.frame = self.window.bounds; rootView.loadingView = launchScreenView; + //Uncomment the following line to enable the splashscreen on ios + //[RNSplashScreen show]; + return YES; } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d6c73a83f6b..3c1ea015d8a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -268,6 +268,8 @@ PODS: - React - react-native-randombytes (3.5.3): - React + - react-native-splash-screen (3.2.0): + - React - react-native-view-shot (3.1.2): - React - react-native-viewpager (3.3.0): @@ -422,6 +424,7 @@ DEPENDENCIES: - react-native-camera (from `../node_modules/react-native-camera`) - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-randombytes (from `../node_modules/react-native-randombytes`) + - react-native-splash-screen (from `../node_modules/react-native-splash-screen`) - react-native-view-shot (from `../node_modules/react-native-view-shot`) - "react-native-viewpager (from `../node_modules/@react-native-community/viewpager`)" - react-native-webview (from `../node_modules/react-native-webview`) @@ -516,6 +519,8 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/netinfo" react-native-randombytes: :path: "../node_modules/react-native-randombytes" + react-native-splash-screen: + :path: "../node_modules/react-native-splash-screen" react-native-view-shot: :path: "../node_modules/react-native-view-shot" react-native-viewpager: @@ -614,6 +619,7 @@ SPEC CHECKSUMS: react-native-camera: 5d4ee26d19ac5aa9a8d8663b50f53b1c1250597c react-native-netinfo: 0e563248a4b9a99c33ec29bd03c2d50767db22a6 react-native-randombytes: 3638d24759d67c68f6ccba60c52a7a8a8faa6a23 + react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865 react-native-view-shot: 4475fde003fe8a210053d1f98fb9e06c1d834e1c react-native-viewpager: a7b438ca32c57b2614ece2a123e7fe116f743131 react-native-webview: 174e0f8f1bf547224a134215607c75c4bb0312b7 diff --git a/package.json b/package.json index 362abce8f5d..8e7322912e8 100644 --- a/package.json +++ b/package.json @@ -148,6 +148,7 @@ "react-native-scrollable-tab-view": "^1.0.0", "react-native-search-api": "ombori/react-native-search-api#8/head", "react-native-sensors": "5.3.0", + "react-native-splash-screen": "git+ssh://git@github.com/MetaMask/react-native-splash-screen.git", "react-native-share": "^3.2.0", "react-native-svg": "9.13.3", "react-native-swipe-gestures": "1.0.3", diff --git a/yarn.lock b/yarn.lock index 507d8e2ce53..5f3c7cdebad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10535,6 +10535,10 @@ react-native-share@^3.2.0: resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-3.3.2.tgz#06d1d3f14ba8eeb95e7e94e4db6a286e9902bd29" integrity sha512-Pvkr62TiCX511RMPL+wvy9Fofre4HQnvUT5zzgPPN3vszP/C8lUb7cmFu/8x5U14t3JQg+xW/svNK5eKNebJKw== +"react-native-splash-screen@git+ssh://git@github.com/MetaMask/react-native-splash-screen.git": + version "3.2.0" + resolved "git+ssh://git@github.com/MetaMask/react-native-splash-screen.git#1f45c08c0824cd94fdc6fb699529688a73614fee" + react-native-svg@9.13.3: version "9.13.3" resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-9.13.3.tgz#6414b337d55af169ac2487ab70f3108404434446"