Skip to content

Commit 2ee4ff9

Browse files
erisumosabab
andauthored
doc(android): various improvements including size specs (#280)
* Add size specs for Android Splash Screens * doc(android): add splashscreen details Co-authored-by: Mosab A <[email protected]>
1 parent 050f29c commit 2ee4ff9

File tree

1 file changed

+55
-2
lines changed

1 file changed

+55
-2
lines changed

README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ This plugin displays and hides a splash screen while your web application is lau
3434
- [Supported Platforms](#supported-platforms)
3535
- [Platform Splash Screen Image Configuration](#platform-splash-screen-image-configuration)
3636
- [Example Configuration](#example-configuration)
37+
- [Android-specific Information](#android-specific-information)
38+
- [Image Layout](#image-layout)
39+
- [`density`](#density)
40+
- [Image Sizing Table](#image-sizing-table)
41+
- [Example Android Configuration](#example-android-configuration)
3742
- [iOS-specific Information](#ios-specific-information)
3843
- [Launch Storyboard Images](#launch-storyboard-images)
3944
- [Designing Launch Storyboard Images](#designing-launch-storyboard-images)
@@ -100,7 +105,6 @@ projectRoot
100105

101106
```xml
102107
<platform name="android">
103-
<!-- you can use any density that exists in the Android project -->
104108
<splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi" />
105109
<splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi" />
106110
<splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi" />
@@ -126,7 +130,6 @@ projectRoot
126130
<splash src="res/screen/ios/Default@3x~universal~anyany.png" />
127131
<splash src="res/screen/ios/Default@3x~universal~anycom.png" />
128132
<splash src="res/screen/ios/Default@3x~universal~comany.png" />
129-
130133
</platform>
131134

132135
<!-- Configuration using MRT concept (Recommended, see "Windows-specific information" section for details): -->
@@ -144,6 +147,56 @@ projectRoot
144147
<preference name="SplashScreenDelay" value="10000" />
145148
```
146149

150+
### Android-specific Information
151+
152+
To effectively create your Android SplashScreen assets, it is important to understand the idiom and sizes used for the assets.
153+
154+
Android defined its assets by the image's layout and `density`.
155+
156+
#### Image Layout
157+
158+
- `land` short for landscape mode
159+
- `port` short for portrait mode
160+
161+
#### `density`
162+
163+
The image's density refers to the number of pixels per square inch. Android, interchangeably refers to this as DPI.
164+
165+
Not all devices have the same pixel size so it is important to create images for all DPI to ensure that the quality of the image for each device is great.
166+
167+
If not all DPI images are considered, some devices might not show a SplashScreen or will use an incorrect DPI image that can result in a blurry scaled image.
168+
169+
#### Image Sizing Table
170+
171+
| size | portrait | landscape |
172+
| :-----: | :-------: | :-------: |
173+
| ldpi | 200x320 | 320x200 |
174+
| mdpi | 320x480 | 480x320 |
175+
| hdpi | 480x800 | 800x480 |
176+
| xhdpi | 720x1280 | 1280x720 |
177+
| xxhdpi | 960x1600 | 1600x960 |
178+
| xxxhdpi | 1280x1920 | 1920x1280 |
179+
180+
#### Example Android Configuration
181+
182+
```xml
183+
<platform name="android">
184+
<splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi" />
185+
<splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi" />
186+
<splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi" />
187+
<splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi" />
188+
<splash src="res/screen/android/splash-land-xxhdpi.png" density="land-xxhdpi" />
189+
<splash src="res/screen/android/splash-land-xxxhdpi.png" density="land-xxxhdpi" />
190+
191+
<splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi" />
192+
<splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi" />
193+
<splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi" />
194+
<splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi" />
195+
<splash src="res/screen/android/splash-port-xxhdpi.png" density="port-xxhdpi" />
196+
<splash src="res/screen/android/splash-port-xxxhdpi.png" density="port-xxxhdpi" />
197+
</platform>
198+
```
199+
147200
### iOS-specific Information
148201

149202
Launch storyboard images are sized based on scale, idiom, and size classes. It supports all devices, and can be used with split-screen/slide-over multitasking.

0 commit comments

Comments
 (0)