Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8753

Maintain splash screen aspect ratio

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.7.1
    • 3.8.0, 4.0.0, 3.7.1
    • cordova-android
    • None
    • Android

    Description

      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 may work, but they have to be carefully designed so that the inside can be stretched without distorting important information.

      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"/>

      Attachments

        1. new-port.png
          3.76 MB
          Alex Talis
        2. new-land.png
          3.95 MB
          Alex Talis
        3. cur-port.png
          4.01 MB
          Alex Talis
        4. cur-land.png
          3.66 MB
          Alex Talis

        Activity

          People

            Unassigned Unassigned
            alex.talis@yahoo.com Alex Talis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: