Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25857

Android: Prevent stretching splash screen

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: Release 7.1.0
    • Fix Version/s: None
    • Component/s: Android, Tooling
    • Environment:

      TiSDK 7.1.0.GA
      Alloy 1.11
      Android

    • Story Points:
      13
    • Sprint:
      2018 Sprint 06 SDK

      Description

      Right now for splash screens on android we add an activity in front of the app that displays the image. However, this image is fixed in size and when a photo is to be used as a splash screen a 9-patch image is not a solution.

      Instead, the image should not be stretching as was also asked on StackOverflow: https://stackoverflow.com/a/37616137/249710

      The solution there is to change the activity with an ImageView and use the center-crop method. This will prevent stretching of the image.

      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent">
       
          <ImageView
              android:layout_width="match_parent"
              android:layout_height="match_parent" 
              android:src="@drawable/splash_bg"
              android:scaleType="centerCrop"
              />
      </RelativeLayout>
      

      Expected Result
      The image should not stretch but center crop instead. This will prevent any stretching and will allow the user to use photos as splash screens.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              topener Rene Pot
            • Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration