Skip to content

Commit d896ec1

Browse files
authored
Merge pull request #68 from AmitM30/dev
Support for iOS Launch Screen
2 parents 1858fb1 + 5d8e651 commit d896ec1

File tree

11 files changed

+172
-132
lines changed

11 files changed

+172
-132
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Jumpstart building robust apps using React Native and TypeScript with most commo
5555
- [Cheat Sheet](#cheat-sheet)
5656
- [Single Screen vs Tabbed Based Navigation](#single-screen-vs-tabbed-based-navigation)
5757
- [Renaming the App](#renaming-the-app)
58+
- [iOS Launch Screen](#iOS-launch-screen)
5859
- [Contributing](#contributing)
5960
- [TODO](#todo)
6061

@@ -149,6 +150,16 @@ yarn android
149150

150151
### Cheat Sheet
151152

153+
#### iOS Launch Screen
154+
155+
```shell
156+
XCode -> Project Folder -> Click on `Images.xcassets` -> Click on `LaunchScreen`
157+
```
158+
159+
Change the 3 images here to set the new launch screen for iOS.
160+
161+
![Launch Screen](./src/view/assets/images/sample/splash-image.png "Launch Screen")
162+
152163
#### Single Screen vs Tabbed Based Navigation
153164

154165
The application launches with a splash screen, and then moves to a tabbed based navigation. Splash screen is a good place to fetch data / build application launch logic like getting user token from API or Async Store, load persist state etc.

android/gradlew.bat

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
1-
@if "%DEBUG%" == "" @echo off
2-
@rem ##########################################################################
3-
@rem
4-
@rem Gradle startup script for Windows
5-
@rem
6-
@rem ##########################################################################
7-
8-
@rem Set local scope for the variables with windows NT shell
9-
if "%OS%"=="Windows_NT" setlocal
10-
11-
set DIRNAME=%~dp0
12-
if "%DIRNAME%" == "" set DIRNAME=.
13-
set APP_BASE_NAME=%~n0
14-
set APP_HOME=%DIRNAME%
15-
16-
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
17-
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
18-
19-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
20-
set DEFAULT_JVM_OPTS=
21-
22-
@rem Find java.exe
23-
if defined JAVA_HOME goto findJavaFromJavaHome
24-
25-
set JAVA_EXE=java.exe
26-
%JAVA_EXE% -version >NUL 2>&1
27-
if "%ERRORLEVEL%" == "0" goto init
28-
29-
echo.
30-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
31-
echo.
32-
echo Please set the JAVA_HOME variable in your environment to match the
33-
echo location of your Java installation.
34-
35-
goto fail
36-
37-
:findJavaFromJavaHome
38-
set JAVA_HOME=%JAVA_HOME:"=%
39-
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
40-
41-
if exist "%JAVA_EXE%" goto init
42-
43-
echo.
44-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
45-
echo.
46-
echo Please set the JAVA_HOME variable in your environment to match the
47-
echo location of your Java installation.
48-
49-
goto fail
50-
51-
:init
52-
@rem Get command-line arguments, handling Windows variants
53-
54-
if not "%OS%" == "Windows_NT" goto win9xME_args
55-
56-
:win9xME_args
57-
@rem Slurp the command line arguments.
58-
set CMD_LINE_ARGS=
59-
set _SKIP=2
60-
61-
:win9xME_args_slurp
62-
if "x%~1" == "x" goto execute
63-
64-
set CMD_LINE_ARGS=%*
65-
66-
:execute
67-
@rem Setup the command line
68-
69-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
70-
71-
@rem Execute Gradle
72-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
73-
74-
:end
75-
@rem End local scope for the variables with windows NT shell
76-
if "%ERRORLEVEL%"=="0" goto mainEnd
77-
78-
:fail
79-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
80-
rem the _cmd.exe /c_ return code!
81-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
82-
exit /b 1
83-
84-
:mainEnd
85-
if "%OS%"=="Windows_NT" endlocal
86-
87-
:omega
1+
@if "%DEBUG%" == "" @echo off
2+
@rem ##########################################################################
3+
@rem
4+
@rem Gradle startup script for Windows
5+
@rem
6+
@rem ##########################################################################
7+
8+
@rem Set local scope for the variables with windows NT shell
9+
if "%OS%"=="Windows_NT" setlocal
10+
11+
set DIRNAME=%~dp0
12+
if "%DIRNAME%" == "" set DIRNAME=.
13+
set APP_BASE_NAME=%~n0
14+
set APP_HOME=%DIRNAME%
15+
16+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
17+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
18+
19+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
20+
set DEFAULT_JVM_OPTS=
21+
22+
@rem Find java.exe
23+
if defined JAVA_HOME goto findJavaFromJavaHome
24+
25+
set JAVA_EXE=java.exe
26+
%JAVA_EXE% -version >NUL 2>&1
27+
if "%ERRORLEVEL%" == "0" goto init
28+
29+
echo.
30+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
31+
echo.
32+
echo Please set the JAVA_HOME variable in your environment to match the
33+
echo location of your Java installation.
34+
35+
goto fail
36+
37+
:findJavaFromJavaHome
38+
set JAVA_HOME=%JAVA_HOME:"=%
39+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
40+
41+
if exist "%JAVA_EXE%" goto init
42+
43+
echo.
44+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
45+
echo.
46+
echo Please set the JAVA_HOME variable in your environment to match the
47+
echo location of your Java installation.
48+
49+
goto fail
50+
51+
:init
52+
@rem Get command-line arguments, handling Windows variants
53+
54+
if not "%OS%" == "Windows_NT" goto win9xME_args
55+
56+
:win9xME_args
57+
@rem Slurp the command line arguments.
58+
set CMD_LINE_ARGS=
59+
set _SKIP=2
60+
61+
:win9xME_args_slurp
62+
if "x%~1" == "x" goto execute
63+
64+
set CMD_LINE_ARGS=%*
65+
66+
:execute
67+
@rem Setup the command line
68+
69+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
70+
71+
@rem Execute Gradle
72+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
73+
74+
:end
75+
@rem End local scope for the variables with windows NT shell
76+
if "%ERRORLEVEL%"=="0" goto mainEnd
77+
78+
:fail
79+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
80+
rem the _cmd.exe /c_ return code!
81+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
82+
exit /b 1
83+
84+
:mainEnd
85+
if "%OS%"=="Windows_NT" endlocal
86+
87+
:omega

ios/FridayApp/Images.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,52 @@
22
"images" : [
33
{
44
"idiom" : "iphone",
5-
"size" : "29x29",
6-
"scale" : "2x"
5+
"scale" : "2x",
6+
"size" : "20x20"
77
},
88
{
99
"idiom" : "iphone",
10-
"size" : "29x29",
11-
"scale" : "3x"
10+
"scale" : "3x",
11+
"size" : "20x20"
1212
},
1313
{
1414
"idiom" : "iphone",
15-
"size" : "40x40",
16-
"scale" : "2x"
15+
"scale" : "2x",
16+
"size" : "29x29"
1717
},
1818
{
1919
"idiom" : "iphone",
20-
"size" : "40x40",
21-
"scale" : "3x"
20+
"scale" : "3x",
21+
"size" : "29x29"
2222
},
2323
{
2424
"idiom" : "iphone",
25-
"size" : "60x60",
26-
"scale" : "2x"
25+
"scale" : "2x",
26+
"size" : "40x40"
2727
},
2828
{
2929
"idiom" : "iphone",
30-
"size" : "60x60",
31-
"scale" : "3x"
30+
"scale" : "3x",
31+
"size" : "40x40"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"scale" : "2x",
36+
"size" : "60x60"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"scale" : "3x",
41+
"size" : "60x60"
42+
},
43+
{
44+
"idiom" : "ios-marketing",
45+
"scale" : "1x",
46+
"size" : "1024x1024"
3247
}
3348
],
3449
"info" : {
35-
"version" : 1,
36-
"author" : "xcode"
50+
"author" : "xcode",
51+
"version" : 1
3752
}
38-
}
53+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info" : {
3-
"version" : 1,
4-
"author" : "xcode"
3+
"author" : "xcode",
4+
"version" : 1
55
}
66
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "launchscreen.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "[email protected]",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "[email protected]",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}
1.66 KB
Loading
3.92 KB
Loading
6.83 KB
Loading

ios/FridayApp/LaunchScreen.storyboard

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3-
<device id="retina4_7" orientation="portrait" appearance="light"/>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -13,46 +13,37 @@
1313
<objects>
1414
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
1515
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16-
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
16+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
1717
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1818
<subviews>
1919
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
20-
<rect key="frame" x="0.0" y="647" width="375" height="0.0"/>
20+
<rect key="frame" x="207" y="876" width="0.0" height="0.0"/>
2121
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2222
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2323
<nil key="highlightedColor"/>
2424
</label>
25-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Friday App" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
26-
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
27-
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
28-
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
29-
<nil key="highlightedColor"/>
30-
</label>
31-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
32-
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
33-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
34-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
35-
<nil key="highlightedColor"/>
36-
</label>
25+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen" translatesAutoresizingMaskIntoConstraints="NO" id="Ic3-7w-0jQ">
26+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
27+
</imageView>
3728
</subviews>
29+
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
3830
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3931
<constraints>
40-
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
41-
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
42-
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
43-
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="SfN-ll-jLj"/>
44-
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
45-
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
46-
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
47-
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
48-
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
32+
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
33+
<constraint firstItem="Ic3-7w-0jQ" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="LbG-1z-18E"/>
34+
<constraint firstAttribute="bottom" secondItem="Ic3-7w-0jQ" secondAttribute="bottom" id="Trg-8M-k6P"/>
35+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="trailing" secondItem="Ic3-7w-0jQ" secondAttribute="trailing" id="VQe-hP-lyK"/>
36+
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" symbolic="YES" id="Y44-ml-fuU"/>
37+
<constraint firstItem="Ic3-7w-0jQ" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="ZgJ-bf-ly5"/>
4938
</constraints>
50-
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
5139
</view>
5240
</viewController>
5341
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
5442
</objects>
5543
<point key="canvasLocation" x="52.173913043478265" y="375"/>
5644
</scene>
5745
</scenes>
46+
<resources>
47+
<image name="LaunchScreen" width="414" height="896"/>
48+
</resources>
5849
</document>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"react native navigation",
1010
"boilerplate"
1111
],
12-
"version": "0.4.3",
12+
"version": "0.4.4",
1313
"author": {
1414
"name": "Amit Mangal",
1515
"email": "[email protected]",

0 commit comments

Comments
 (0)