{"id":4033,"url":"https://github.com/remobile/react-native-splashscreen","last_synced_at":"2025-04-05T12:04:45.566Z","repository":{"id":57340323,"uuid":"46019919","full_name":"remobile/react-native-splashscreen","owner":"remobile","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-04T17:56:53.000Z","size":2165,"stargazers_count":373,"open_issues_count":32,"forks_count":103,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-25T00:51:18.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remobile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-12T00:53:48.000Z","updated_at":"2024-04-25T00:51:18.949Z","dependencies_parsed_at":"2022-08-29T16:20:30.696Z","dependency_job_id":null,"html_url":"https://github.com/remobile/react-native-splashscreen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-splashscreen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-splashscreen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-splashscreen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-splashscreen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remobile","download_url":"https://codeload.github.com/remobile/react-native-splashscreen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332602,"owners_count":20921853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:59.076Z","updated_at":"2025-04-05T12:04:45.540Z","avatar_url":"https://github.com/remobile.png","language":"Java","funding_links":[],"categories":["Components","组件","Libraries","Java"],"sub_categories":["UI","Splash Screen"],"readme":"# React Native SplashScreen (remobile)\nA splashscreen for react-native, hide when application loaded\n\n## Installation\n```sh\nnpm install @remobile/react-native-splashscreen --save\n```\n### Installation (iOS)\n* Drag RCTSplashScreen.xcodeproj to your project on Xcode.\n* Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag libRCTSplashScreen.a from the Products folder inside the RCTSplashScreen.xcodeproj.\n\n* In AppDelegate.m\n```objc\n...\n#import \"RCTSplashScreen.h\" //\u003c--- import\n...\nRCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation\n                                                      moduleName:@\"KitchenSink\"\n                                               initialProperties:nil\n                                                   launchOptions:launchOptions];\n  [RCTSplashScreen show:rootView]; //\u003c--- add show SplashScreen\n\n  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n  UIViewController *rootViewController = [[UIViewController alloc] init];\n  rootViewController.view = rootView;\n  self.window.rootViewController = rootViewController;\n  [self.window makeKeyAndVisible];\n  return YES;\n```\n\n\n### Installation (Android)\n```gradle\n...\ninclude ':react-native-splashscreen'\nproject(':react-native-splashscreen').projectDir = new File(settingsDir, '../node_modules/@remobile/react-native-splashscreen/android')\n```\n\n* In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n    ...\n    compile project(':react-native-splashscreen')\n}\n```\n\n* register module (in MainApplication.java)\n\n```java\n......\nimport com.remobile.splashscreen.RCTSplashScreenPackage;  // \u003c--- import\n\n......\n\n@Override\nprotected List\u003cReactPackage\u003e getPackages() {\n   ......\n   new RCTSplashScreenPackage(MainActivity.activity, true),            // \u003c------ add here [the seconde params is translucent]\n   ......\n}\n\n```\n\n* register module (in MainActivity.java)\n\n```java\npublic class MainActivity extends ReactActivity {\n    public static Activity activity;           // \u003c------ add here\n    ......\n    @Override\n    protected String getMainComponentName() {\n        activity = this;           // \u003c------ add here\n        ......\n    }\n}\n```\n\n### Screencasts\n![gif](https://github.com/remobile/react-native-splashscreen/blob/master/screencasts/splash.gif)\n\n## Usage\n\n### Example\n```js\n'use strict';\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n    AppRegistry,\n    View,\n    Text,\n} = ReactNative;\nvar SplashScreen = require('@remobile/react-native-splashscreen');\n\nvar KitchenSink = React.createClass({\n    componentDidMount: function() {\n        SplashScreen.hide();\n    },\n    render() {\n        return(\n            \u003cView\u003e\n                \u003cText\u003e\n                    fangyunjiang is a good developer!\n                \u003c/Text\u003e\n            \u003c/View\u003e\n        );\n    }\n});\n\nAppRegistry.registerComponent('KitchenSink', () =\u003e KitchenSink);\n```\n\n### constants\n- `translucent` is translucent enable\n### methods\n- `hide()` hide SplashScreen\n\n### genarate splash with ffmpeg\n* you must install ffmpeg first\n\n```sh\n#!/bin/bash\n\nsrc=\"${1-./img/splash.png}\"\n\nffmpeg -i ${src} -s 640x1136 ../ios/CardC/splash/Default-568h@2x~iphone.png -y\nffmpeg -i ${src} -s 750x1334 ../ios/CardC/splash/Default-667h.png -y\nffmpeg -i ${src} -s 1242x2208 ../ios/CardC/splash/Default-736h.png -y\nffmpeg -i ${src} -s 640x960 ../ios/CardC/splash/Default@2x~iphone.png -y\nffmpeg -i ${src} -s 320x480 ../ios/CardC/splash/Default~iphone.png -y\nffmpeg -i ${src} -s 320x568 ../ios/CardC/splash/splash.png -y\nmkdir -p ../android/app/src/main/res/drawable\ncp ../ios/CardC/splash/splash.png ../android/app/src/main/res/drawable/splash.png\n```\n* you can also see https://github.com/remobile/react-native-template/blob/master/project/tools\n\n### see detail use\n* https://github.com/remobile/react-native-template\n\n### the best way use SplashScreen in splash.js in [example](https://github.com/remobile/react-native-splashscreen/blob/master/examples/splash.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremobile%2Freact-native-splashscreen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremobile%2Freact-native-splashscreen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremobile%2Freact-native-splashscreen/lists"}