[ 
https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381366#comment-14381366
 ] 

ASF GitHub Bot commented on CB-8753:
------------------------------------

GitHub user AlexTalis opened a pull request:

    https://github.com/apache/cordova-android/pull/168

    CB-8753 Maintain splash screen aspect ratio

    This pull request implements https://issues.apache.org/jira/browse/CB-8753. 
Apologies for multiple commits. I was trying to edit the commit message to 
include CB-8753 in the summary and ended up with three commits instead of one. 
I'm new to Git and Github.
    
    There are some things about existing code that I did not completely 
understand. I want to list them here to help in the review process. If you know 
what I didn't understand it may help you find problems with my code changes.
    
    - Is there a reason why most fields in SplashScreenInternal are static? It 
seems like they could just be private instance fields.
    
    - What is the purpose of adding preferences to activity's intent extras in 
CordovaPreferences.copyIntoIntentExtras(Activity)? Not all preferences are 
copied and I did not add my new preferences either. Should I?
    
    - Why does SplashScreenInternal keep getting preferences from 
CordovaPreferences object instead of just storing them in instance fields 
during initialization? For example, drawableId is retrieved like this 
throughout the class:
    
        int drawableId = preferences.getInteger("SplashDrawableId", 0);
    
    Why not just have a drawableId instance variable and store the value in it 
once during initialization?
    
    - Is it OK that the new preferences are only supported on Android?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/AlexTalis/cordova-android 3.7.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/168.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #168
    
----
commit e572f95eb794461ad8bb7459175fd3b034b5202e
Author: atalis <alex.ta...@yahoo.com>
Date:   2015-03-25T20:47:56Z

    Added "SplashMaintainAspectRatio” boolean preference to maintain Splash
    Screen aspect ratio instead of scaling it to dialog.
    Added “SplashReloadOnOrientationChange” boolean preference to reload
    drawable when orientation changes.
    Notify plugins of orientation changes by posting "orientationChanged"
    message.

commit e02a50058749c7411f64a3cebe75555ed7b9f4d2
Author: atalis <alex.ta...@yahoo.com>
Date:   2015-03-25T20:47:56Z

    CB-8753 Maintain splash screen aspect ratio
    - Added "SplashMaintainAspectRatio” preference to maintain Splash Screen
    aspect ratio instead of scaling it to dialog.
    - Added “SplashReloadOnOrientationChange” boolean preference to reload
    drawable when orientation changes.
    - Notify plugins of orientation changes by posting "orientationChanged"
    message.

commit 1ca3ed211d296c26712c1acdf9428cd7756fc4f4
Author: atalis <alex.ta...@yahoo.com>
Date:   2015-03-26T04:24:24Z

    CB-8753 Maintain splash screen aspect ratio
        - Added "SplashMaintainAspectRatio” preference to maintain Splash
    Screen aspect ratio instead of scaling it to dialog.
        - Added “SplashReloadOnOrientationChange” boolean preference to
    reload drawable when orientation changes.
        - Notify plugins of orientation changes by posting
    "orientationChanged" message.

----


> Maintain splash screen aspect ratio
> -----------------------------------
>
>                 Key: CB-8753
>                 URL: https://issues.apache.org/jira/browse/CB-8753
>             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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to