Skip to content

Commit 78e8fa0

Browse files
authored
feat(android)!: remove platform from plugin (#337)
* feat(android): drop source code * feat(android): remove from docs * feat(android): remove ci * feat(android): remove dependency requirements * feat(android): remove from config.xml * feat(android): revert removal of android version requirements * feat(anroid): do not install on 7.0.0 or above
1 parent 1b23804 commit 78e8fa0

File tree

6 files changed

+8
-737
lines changed

6 files changed

+8
-737
lines changed

.github/workflows/android.yml

Lines changed: 0 additions & 137 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ description: Control the splash screen for your app.
2323

2424
# cordova-plugin-splashscreen
2525

26-
[![Android Testsuite](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/android.yml/badge.svg)](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/android.yml) [![Chrome Testsuite](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/chrome.yml/badge.svg)](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/chrome.yml) [![Lint Test](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/lint.yml/badge.svg)](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/lint.yml)
26+
[![Chrome Testsuite](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/chrome.yml/badge.svg)](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/chrome.yml) [![Lint Test](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/lint.yml/badge.svg)](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/lint.yml)
2727

2828
This plugin displays and hides a splash screen while your web application is launching. Using its methods you can also show and hide the splash screen manually.
2929

@@ -32,17 +32,10 @@ This plugin displays and hides a splash screen while your web application is lau
3232
- [Supported Platforms](#supported-platforms)
3333
- [Platform Splash Screen Image Configuration](#platform-splash-screen-image-configuration)
3434
- [Example Configuration](#example-configuration)
35-
- [Android-specific Information](#android-specific-information)
36-
- [Image Layout](#image-layout)
37-
- [`density`](#density)
38-
- [Image Sizing Table](#image-sizing-table)
39-
- [Dark Mode (API 28+)](#dark-mode-api-28)
40-
- [Example Android Configuration](#example-android-configuration)
4135
- [Windows-specific Information](#windows-specific-information)
4236
- [Preferences](#preferences)
4337
- [config.xml](#configxml)
4438
- [Quirks](#quirks)
45-
- [Android Quirks](#android-quirks)
4639
- [Browser Quirks](#browser-quirks)
4740
- [Windows Quirks](#windows-quirks)
4841
- [Methods](#methods)
@@ -59,12 +52,8 @@ This plugin displays and hides a splash screen while your web application is lau
5952

6053
## Supported Platforms
6154

62-
- Android
63-
__Note__: Android implementation has been moved to the core framework.
64-
If using `[email protected]` or earlier, use `[email protected]`
65-
If using `[email protected]` or later and exclusively developing for Android, this plugin can be uninstalled.
6655
- Windows (`cordova-windows` version >= 4.4.0 is required)
67-
__Note__: Extended splashscreen does not require the plugin on Windows (as opposed to Android) in case you don't use the plugin API, i.e. programmatic hide/show.
56+
__Note__: Extended splashscreen does not require the plugin on Windows in case you don't use the plugin API, i.e. programmatic hide/show.
6857
- Browser
6958

7059
## Platform Splash Screen Image Configuration
@@ -88,27 +77,10 @@ projectRoot
8877
js
8978
res
9079
screen
91-
android
9280
windows
9381
```
9482

9583
```xml
96-
<platform name="android">
97-
<splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi" />
98-
<splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi" />
99-
<splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi" />
100-
<splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi" />
101-
<splash src="res/screen/android/splash-land-xxhdpi.png" density="land-xxhdpi" />
102-
<splash src="res/screen/android/splash-land-xxxhdpi.png" density="land-xxxhdpi" />
103-
104-
<splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi" />
105-
<splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi" />
106-
<splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi" />
107-
<splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi" />
108-
<splash src="res/screen/android/splash-port-xxhdpi.png" density="port-xxhdpi" />
109-
<splash src="res/screen/android/splash-port-xxxhdpi.png" density="port-xxxhdpi" />
110-
</platform>
111-
11284
<!-- Configuration using MRT concept (Recommended, see "Windows-specific information" section for details): -->
11385
<platform name="windows">
11486
<splash src="res/screen/windows/splashscreen.png" target="SplashScreen"/>
@@ -124,92 +96,6 @@ projectRoot
12496
<preference name="SplashScreenDelay" value="10000" />
12597
```
12698

127-
### Android-specific Information
128-
129-
To effectively create your Android SplashScreen assets, it is important to understand the idiom and sizes used for the assets.
130-
131-
Android defined its assets by the image's layout and `density`.
132-
133-
#### Image Layout
134-
135-
- `land` short for landscape mode
136-
- `port` short for portrait mode
137-
138-
#### `density`
139-
140-
The image's density refers to the number of pixels per square inch. Android, interchangeably refers to this as DPI.
141-
142-
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.
143-
144-
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.
145-
146-
#### Image Sizing Table
147-
148-
| size | portrait | landscape |
149-
| :-----: | :-------: | :-------: |
150-
| ldpi | 200x320 | 320x200 |
151-
| mdpi | 320x480 | 480x320 |
152-
| hdpi | 480x800 | 800x480 |
153-
| xhdpi | 720x1280 | 1280x720 |
154-
| xxhdpi | 960x1600 | 1600x960 |
155-
| xxxhdpi | 1280x1920 | 1920x1280 |
156-
157-
#### Dark Mode (API 28+)
158-
159-
You can optionally provide an extra SplashScreen image to be used in dark/night mode when enabled on supported devices.
160-
To do this, add the `-night` keyword in between the **layout** and **size** keywords of the image's `density` attribute value. E.g.: `land-night-hdpi`
161-
162-
For more examples, please see [the Example Configuration](#example-android-configuration) section.
163-
164-
#### Example Android Configuration
165-
166-
```xml
167-
<platform name="android">
168-
<!-- Default
169-
Note: You should specify default resources for each density.
170-
-- For instance, if the device(hdpi) is in landscape orientation and [density="land-hdpi"]
171-
-- does not exists, [density="hdpi"] will be selected
172-
If you do not declare this you will get MissingDefaultResource lint check errors.
173-
-->
174-
<splash src="res/screen/android/splash-port-hdpi.png" density="hdpi"/>
175-
<splash src="res/screen/android/splash-port-ldpi.png" density="ldpi"/>
176-
<splash src="res/screen/android/splash-port-mdpi.png" density="mdpi"/>
177-
<splash src="res/screen/android/splash-port-xhdpi.png" density="xhdpi"/>
178-
<splash src="res/screen/android/splash-port-xxhdpi.png" density="xxhdpi"/>
179-
180-
<!-- Landscape -->
181-
<splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi" />
182-
<splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi" />
183-
<splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi" />
184-
<splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi" />
185-
<splash src="res/screen/android/splash-land-xxhdpi.png" density="land-xxhdpi" />
186-
<splash src="res/screen/android/splash-land-xxxhdpi.png" density="land-xxxhdpi" />
187-
188-
<!-- Portrait -->
189-
<splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi" />
190-
<splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi" />
191-
<splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi" />
192-
<splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi" />
193-
<splash src="res/screen/android/splash-port-xxhdpi.png" density="port-xxhdpi" />
194-
<splash src="res/screen/android/splash-port-xxxhdpi.png" density="port-xxxhdpi" />
195-
196-
<!-- Dark Mode -->
197-
<splash src="res/screen/android/splash-land-night-hdpi.png" density="land-night-hdpi" />
198-
<splash src="res/screen/android/splash-land-night-ldpi.png" density="land-night-ldpi" />
199-
<splash src="res/screen/android/splash-land-night-mdpi.png" density="land-night-mdpi" />
200-
<splash src="res/screen/android/splash-land-night-xhdpi.png" density="land-night-xhdpi" />
201-
<splash src="res/screen/android/splash-land-night-xxhdpi.png" density="land-night-xxhdpi" />
202-
<splash src="res/screen/android/splash-land-night-xxxhdpi.png" density="land-night-xxxhdpi" />
203-
204-
<splash src="res/screen/android/splash-port-night-hdpi.png" density="port-night-hdpi" />
205-
<splash src="res/screen/android/splash-port-night-ldpi.png" density="port-night-ldpi" />
206-
<splash src="res/screen/android/splash-port-night-mdpi.png" density="port-night-mdpi" />
207-
<splash src="res/screen/android/splash-port-night-xhdpi.png" density="port-night-xhdpi" />
208-
<splash src="res/screen/android/splash-port-night-xxhdpi.png" density="port-night-xxhdpi" />
209-
<splash src="res/screen/android/splash-port-night-xxxhdpi.png" density="port-night-xxxhdpi" />
210-
</platform>
211-
```
212-
21399
### Windows-specific Information
214100

215101
Splash screen images can be defined using the [MRT](https://cordova.apache.org/docs/en/dev/config_ref/images.html#windows) concept.
@@ -304,24 +190,6 @@ __Note__: You may need to reopen Visual Studio solution after changing the image
304190

305191
### Quirks
306192

307-
#### Android Quirks
308-
309-
In your `config.xml`, you can add the following preferences:
310-
311-
```xml
312-
<preference name="SplashMaintainAspectRatio" value="true|false" />
313-
<preference name="SplashShowOnlyFirstTime" value="true|false" />
314-
<preference name="SplashScreenSpinnerColor" value="white" />
315-
```
316-
317-
`SplashMaintainAspectRatio` preference is optional. If set to `true`, the splash screen drawable is not stretched to fit the full screen, but instead simply "covers" the screen, like CSS "background-size:cover". This is very useful when splash screen images cannot be distorted in any way, for example when they contain scenery or text. This setting works best with images that have large margins (safe areas) that can be safely cropped on screens with different aspect ratios.
318-
319-
The splash screen plugin reloads the splash screen whenever the orientation changes so that you can specify different splash screen images for portrait and landscape orientations.
320-
321-
`SplashShowOnlyFirstTime` preference is optional and defaults to `true`. When set to `true` the splash screen will only appear on application launch. However, if you plan to use `navigator.app.exitApp()` to close the application and force the splash screen appear on the application's next launch, you should set this property to `false` (this also applies to closing the application with the Back button).
322-
323-
`SplashScreenSpinnerColor` preference is also optional and is ignored when not set. Setting it to a valid color name or HEX color code will change the color of the spinner on Android 5.0+ devices.
324-
325193
#### Browser Quirks
326194

327195
You can use the following preferences in your `config.xml`:

package-lock.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"cordova": {
77
"id": "cordova-plugin-splashscreen",
88
"platforms": [
9-
"android",
109
"windows",
1110
"browser"
1211
]
@@ -17,7 +16,6 @@
1716
"cordova",
1817
"splashscreen",
1918
"ecosystem:cordova",
20-
"cordova-android",
2119
"cordova-windows",
2220
"cordova-browser"
2321
],
@@ -41,6 +39,9 @@
4139
"cordova-android": ">=3.6.0 <11.0.0",
4240
"cordova-windows": ">=4.4.0"
4341
},
42+
"<7.0.0": {
43+
"cordova-android": ">=3.6.0 <11.0.0"
44+
},
4445
"8.0.0": {
4546
"cordova": ">100"
4647
}

plugin.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,9 @@
2929
<issue>https://github.com/apache/cordova-plugin-splashscreen/issues</issue>
3030

3131
<engines>
32-
<engine name="cordova-android" version=">=3.6.0 <11.0.0" /><!-- Requires CordovaPlugin.preferences -->
3332
<engine name="cordova-windows" version=">=4.4.0" />
3433
</engines>
3534

36-
<!-- android -->
37-
<platform name="android">
38-
<config-file target="res/xml/config.xml" parent="/*">
39-
<feature name="SplashScreen">
40-
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen"/>
41-
<param name="onload" value="true"/>
42-
</feature>
43-
</config-file>
44-
45-
<source-file src="src/android/SplashScreen.java" target-dir="src/org/apache/cordova/splashscreen" />
46-
47-
<js-module src="www/splashscreen.js" name="SplashScreen">
48-
<clobbers target="navigator.splashscreen" />
49-
</js-module>
50-
</platform>
51-
5235
<!-- windows -->
5336
<platform name="windows">
5437
<js-module src="src/windows/SplashScreenProxy.js" name="SplashScreenProxy">

0 commit comments

Comments
 (0)