Skip to content

Commit f463367

Browse files
authored
Merge pull request #70 from AmitM30/dev
Android Launch Screen configurtation
2 parents d896ec1 + eaa714a commit f463367

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ 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)
58+
- [iOS Launch Screen](#ios-launch-screen)
59+
- [Android Launch Screen](#android-launch-screen)
5960
- [Contributing](#contributing)
6061
- [TODO](#todo)
6162

@@ -160,6 +161,14 @@ Change the 3 images here to set the new launch screen for iOS.
160161

161162
![Launch Screen](./src/view/assets/images/sample/splash-image.png "Launch Screen")
162163

164+
#### Android Launch Screen
165+
166+
```shell
167+
`./android/app/src/main/res/drawable-*` folders
168+
```
169+
170+
Change the images the `drawable-*` folders to set the new launch screen for Android.
171+
163172
#### Single Screen vs Tabbed Based Navigation
164173

165174
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.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package com.fridayapp;
22

3+
import android.view.View;
34
import com.reactnativenavigation.NavigationActivity;
45

56
public class MainActivity extends NavigationActivity {
6-
7+
@Override
8+
protected void addDefaultSplashLayout() {
9+
View view = getLayoutInflater().inflate(R.layout.layout_splash, null);
10+
setContentView(view);
11+
}
712
}
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent" android:layout_height="match_parent">
4+
5+
<ImageView
6+
android:layout_width="match_parent"
7+
android:layout_height="wrap_content"
8+
android:layout_centerInParent="true"
9+
android:scaleType="center"
10+
android:src="@drawable/launchscreen" />
11+
</RelativeLayout>

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.4",
12+
"version": "0.4.5",
1313
"author": {
1414
"name": "Amit Mangal",
1515
"email": "[email protected]",

0 commit comments

Comments
 (0)