cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Talis (JIRA)" <>
Subject [jira] [Updated] (CB-8753) Maintain splash screen aspect ratio
Date Thu, 26 Mar 2015 03:04:53 GMT


Alex Talis updated CB-8753:
    Attachment: new-port.png

Here are some screen shots of Samsung Galaxy S3 emulator with current and new behavior.

cur-port.png is when app is started in portrait orientation, so portrait drawable is loaded.
cur-land.png shows what happens when device is rotated - the image is stretched, which is
unacceptable with this type of splash screen.

new-port.png shows the app with both preferences turned on, started in portrait orientation.
When device is rotated, the landscape drawable is loaded. This looks much better. Also notice
the safe margins around the image that ensure that "My Company" text remains fully visible
on devices with different screen aspect ratios.

The important thing here is that with this functionality is very easy to use compared to trying
to create a 9-patch drawable.

> Maintain splash screen aspect ratio
> -----------------------------------
>                 Key: CB-8753
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>    Affects Versions: 3.7.1
>         Environment: Android
>            Reporter: Alex Talis
>             Fix For: 3.8.0, 4.0.0, 3.7.1
>         Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png
> I will be submitting a pull request for this enhancement shortly.
> Current splash screen scales images non-uniformly to fit into splash dialog. This approach
does not work well for many typical splash screen images that contain scenery or text and
look bad when aspect ratio is not preserved. 9-patch images work, but they have to be carefully
designed so that the edges can be stretched without producing undesired effects.
> The purpose of this enhancement is to allow use of non-9-patch images without stretching,
similar to CSS "background-size:cover" capability. For this to work, splash images have to
have large safe area all around that can be safely cropped off.
> With this type of splash screen, it is usually necessary to use different images for
portrait and landscape orientations, so a second part of this enhancement is to add an option
to reload the drawable when orientation changes.
> Examples of the two preferences are shown below. Both are optional and default to False
to maintain current splash screen behavior.
> <preference name="SplashMaintainAspectRatio" value="true"/>
> <preference name="SplashReloadOnOrientationChange" value="true"/>

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message