[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2017-03-02 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-8753:
-

Commit dd9c88204c580405d423aeaf742db28895696b54 in 
cordova-plugin-splashscreen's branch refs/heads/old-ID from 
[~alex.ta...@yahoo.com]
[ 
https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-splashscreen.git;h=dd9c882
 ]

CB-8753 android: Adds `SplashMaintainAspectRatio` preference (close #43)


> 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 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.
> 
> 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2017-03-02 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-8753:
-

Commit 35272415d3b75440b1ea5fe9a5baab5e1586b3c1 in 
cordova-plugin-splashscreen's branch refs/heads/old-ID from [~agrieve]
[ 
https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-splashscreen.git;h=3527241
 ]

CB-8753 android: Fix missing import in previous commit


> 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 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.
> 
> 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-08-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user joshbuchea commented on the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#issuecomment-134765683
  
A feature like this would be a great addition to the plugin.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-04-07 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-8753:
-

Commit 35272415d3b75440b1ea5fe9a5baab5e1586b3c1 in 
cordova-plugin-splashscreen's branch refs/heads/master from [~agrieve]
[ 
https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-splashscreen.git;h=3527241
 ]

CB-8753 android: Fix missing import in previous commit


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-04-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user dblotsky commented on the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#issuecomment-90766537
  
@AlexTalis please include a missing import on [this 
line](https://github.com/apache/cordova-plugin-splashscreen/commit/dd9c88204c580405d423aeaf742db28895696b54#diff-bb81295a5f916476389a7a0213be0498L25).
 Build fails for the latest change 
[here](http://ci.apache.org/builders/cordova-android-win/builds/1014/steps/running-tests/logs/stdio).


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-04-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user asfgit closed the pull request at:

https://github.com/apache/cordova-plugin-splashscreen/pull/43


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-04-07 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-8753:
-

Commit dd9c88204c580405d423aeaf742db28895696b54 in 
cordova-plugin-splashscreen's branch refs/heads/master from 
[~alex.ta...@yahoo.com]
[ 
https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-splashscreen.git;h=dd9c882
 ]

CB-8753 android: Adds `SplashMaintainAspectRatio` preference (close #43)


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-04-03 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#issuecomment-89449833
  
@agrieve, I believe I implemented all the changes we discussed. Can you 
accept the pull request?


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27446641
  
--- Diff: src/android/SplashScreen.java ---
@@ -194,9 +263,25 @@ public void run() {
 // TODO: Use the background color of the webView's parent 
instead of using the
 // preference.
 
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
 root.setLayoutParams(new 
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
 ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
-root.setBackgroundResource(drawableId);
+
+// Use an ImageView to render the image because of its 
flexible scaling options.
+splashImageView = new ImageView(context);
+splashImageView.setImageResource(drawableId);
--- End diff --

Do you know of any other reason for setting this background color? If not, 
then I think we can take out Linear Layout.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27446516
  
--- Diff: src/android/SplashScreen.java ---
@@ -194,9 +263,25 @@ public void run() {
 // TODO: Use the background color of the webView's parent 
instead of using the
 // preference.
 
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
 root.setLayoutParams(new 
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
 ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
-root.setBackgroundResource(drawableId);
+
+// Use an ImageView to render the image because of its 
flexible scaling options.
+splashImageView = new ImageView(context);
+splashImageView.setImageResource(drawableId);
--- End diff --

Ahh, okay, that's what I thought your preference was adding, but of course, 
having it always cover the entire screen makes more sense! Great stuff!


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27445114
  
--- Diff: src/android/SplashScreen.java ---
@@ -194,9 +263,25 @@ public void run() {
 // TODO: Use the background color of the webView's parent 
instead of using the
 // preference.
 
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
 root.setLayoutParams(new 
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
 ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
-root.setBackgroundResource(drawableId);
+
+// Use an ImageView to render the image because of its 
flexible scaling options.
+splashImageView = new ImageView(context);
+splashImageView.setImageResource(drawableId);
--- End diff --

Setting ImageView background color does work. It just does not show with 
any of the current scaling options. Without "maintain aspect ratio" the image 
is stretched to fit screen, so you never see the background. With "maintain 
aspect ratio" the image covers the screen fully, so again you don't see the 
background.

If I hard-code a scaling option like FIT_CENTER, then ImageView background 
color does fill areas that are not covered by the drawable. So if the purpose 
of BG color is to simply fill areas not covered by the drawable, then we can 
take out LinearLayout. I thought that the purpose was to somehow cover up the 
WebView in background if the device is rotated, which probably wouldn't work 
anyway. Here's the test app without LinearLayout, with scale mode temporarily 
set to FIT_CENTER and BG color set to RED:


![image](https://cloud.githubusercontent.com/assets/1012600/6910105/4eb48854-d703-11e4-8d08-f5ecce5bea91.png)



> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27444623
  
--- Diff: src/android/SplashScreen.java ---
@@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) {
 }
 return null;
 }
+
+@Override
+public void onConfigurationChanged(Configuration newConfig) {
+super.onConfigurationChanged(newConfig);
+
+// Reload splash drawable when orientation changes if so 
configured.
+if (newConfig.orientation != orientation) {
+orientation = newConfig.orientation;
+reloadDrawable();
+}
+}
 
-private void removeSplashScreen() {
+private void reloadDrawable() {
+if (isReloadOnOrientationChange() && splashImageView != null) {
--- End diff --

Agreed. I'll make take out the preference.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27444238
  
--- Diff: src/android/SplashScreen.java ---
@@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) {
 }
 return null;
 }
+
+@Override
+public void onConfigurationChanged(Configuration newConfig) {
+super.onConfigurationChanged(newConfig);
+
+// Reload splash drawable when orientation changes if so 
configured.
+if (newConfig.orientation != orientation) {
+orientation = newConfig.orientation;
+reloadDrawable();
+}
+}
 
-private void removeSplashScreen() {
+private void reloadDrawable() {
+if (isReloadOnOrientationChange() && splashImageView != null) {
--- End diff --

I think a performance hit would be acceptable here given the ease of 
configuration. How often are you going to rotate your device while the splash 
screen is up? Probably close to never, or at most once.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27444149
  
--- Diff: src/android/SplashScreen.java ---
@@ -194,9 +263,25 @@ public void run() {
 // TODO: Use the background color of the webView's parent 
instead of using the
 // preference.
 
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
 root.setLayoutParams(new 
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
 ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
-root.setBackgroundResource(drawableId);
+
+// Use an ImageView to render the image because of its 
flexible scaling options.
+splashImageView = new ImageView(context);
+splashImageView.setImageResource(drawableId);
--- End diff --

Hmm, I figured the background would show for a square image when 
SplashMaintainAspectRatio is set. I think you've done due diligence to it 
though, so if it's not required, then don't even bother setting it.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27442565
  
--- Diff: src/android/SplashScreen.java ---
@@ -194,9 +263,25 @@ public void run() {
 // TODO: Use the background color of the webView's parent 
instead of using the
 // preference.
 
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
 root.setLayoutParams(new 
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
 ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
-root.setBackgroundResource(drawableId);
+
+// Use an ImageView to render the image because of its 
flexible scaling options.
+splashImageView = new ImageView(context);
+splashImageView.setImageResource(drawableId);
--- End diff --

I added a loop in JS to slow down the app. It calls console.log a bunch of 
times. I hard-coded BG color to RED and tested the app with and without the 
linear layout. I never see RED in either view hierarchy. When the app is slow, 
I just see black background when layout/painting is lagging.


![image](https://cloud.githubusercontent.com/assets/1012600/6909507/ad513bf8-d6fb-11e4-9146-e3f46a151912.png)



> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27424716
  
--- Diff: src/android/SplashScreen.java ---
@@ -194,9 +263,25 @@ public void run() {
 // TODO: Use the background color of the webView's parent 
instead of using the
 // preference.
 
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
 root.setLayoutParams(new 
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
 ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
-root.setBackgroundResource(drawableId);
+
+// Use an ImageView to render the image because of its 
flexible scaling options.
+splashImageView = new ImageView(context);
+splashImageView.setImageResource(drawableId);
--- End diff --

I am trying to test this, but I don't ever see the background color. On 
both my Samsung Galaxy S3 and on a Genymotion 4.1.1 emulator the image resizes 
too quickly to see BG. Do you have a way of testing background color?


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27423375
  
--- Diff: src/android/SplashScreen.java ---
@@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) {
 }
 return null;
 }
+
+@Override
+public void onConfigurationChanged(Configuration newConfig) {
+super.onConfigurationChanged(newConfig);
+
+// Reload splash drawable when orientation changes if so 
configured.
+if (newConfig.orientation != orientation) {
+orientation = newConfig.orientation;
+reloadDrawable();
+}
+}
 
-private void removeSplashScreen() {
+private void reloadDrawable() {
+if (isReloadOnOrientationChange() && splashImageView != null) {
--- End diff --

ImageView.setImageDrawable documentation does not say anything about how 
smart it is about reloading and repainting the drawable, so I assumed the worst 
and added an explicit preference. I originally tried using 
ImageView.setImageResource, but that does nothing if resource ID did not 
change. To fix that I used ImageView.setImageDrawable and it reloaded the 
drawable, but I can only assume that it reloads it every time.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27416895
  
--- Diff: src/android/SplashScreen.java ---
@@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) {
 }
 return null;
 }
+
+@Override
+public void onConfigurationChanged(Configuration newConfig) {
+super.onConfigurationChanged(newConfig);
+
+// Reload splash drawable when orientation changes if so 
configured.
+if (newConfig.orientation != orientation) {
+orientation = newConfig.orientation;
+reloadDrawable();
+}
+}
 
-private void removeSplashScreen() {
+private void reloadDrawable() {
+if (isReloadOnOrientationChange() && splashImageView != null) {
+final int drawableId = 
preferences.getInteger("SplashDrawableId", 0);
+if (drawableId != 0) {
+cordova.getActivity().runOnUiThread(new Runnable() {
--- End diff --

Originally (in 3.7.x) reload of the drawable was triggered from onMessage 
and I just followed the pattern I saw in the code of explicitly calling 
"runOnUiThread". You're probably right that onConfigurationChanged is always 
called on UI thread. I'll verify and remove the Runnable.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27416639
  
--- Diff: src/android/SplashScreen.java ---
@@ -37,6 +39,19 @@ Licensed to the Apache Software Foundation (ASF) under 
one
 import org.json.JSONArray;
 import org.json.JSONException;
 
+/**
+ * Splash Screen plugin. Uses the following preferences:
+ * 
+ * SplashScreen: Splash screen resource name.
+ * SplashScreenDelay: How long splash screen should be shown in 
milliseconds.
+ * SplashMaintainAspectRatio: Maintain aspect ratio of the drawable, 
like CSS
--- End diff --

Will do after we finalize the changes.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#issuecomment-87767088
  
Good stuff! A few minor comments then we're good to go I think!


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27413370
  
--- Diff: src/android/SplashScreen.java ---
@@ -194,9 +263,25 @@ public void run() {
 // TODO: Use the background color of the webView's parent 
instead of using the
 // preference.
 
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
 root.setLayoutParams(new 
LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
 ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
-root.setBackgroundResource(drawableId);
+
+// Use an ImageView to render the image because of its 
flexible scaling options.
+splashImageView = new ImageView(context);
+splashImageView.setImageResource(drawableId);
--- End diff --

If you call setBackgroundColor on the ImageView, can you omit having a 
parent LinearLayout?


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27413236
  
--- Diff: src/android/SplashScreen.java ---
@@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) {
 }
 return null;
 }
+
+@Override
+public void onConfigurationChanged(Configuration newConfig) {
+super.onConfigurationChanged(newConfig);
+
+// Reload splash drawable when orientation changes if so 
configured.
+if (newConfig.orientation != orientation) {
+orientation = newConfig.orientation;
+reloadDrawable();
+}
+}
 
-private void removeSplashScreen() {
+private void reloadDrawable() {
+if (isReloadOnOrientationChange() && splashImageView != null) {
--- End diff --

Not sure if you answered in the other PR, but why not just always reload on 
configuration changes? It'll just no-op if there's no new image.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27413145
  
--- Diff: src/android/SplashScreen.java ---
@@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) {
 }
 return null;
 }
+
+@Override
+public void onConfigurationChanged(Configuration newConfig) {
+super.onConfigurationChanged(newConfig);
+
+// Reload splash drawable when orientation changes if so 
configured.
+if (newConfig.orientation != orientation) {
+orientation = newConfig.orientation;
+reloadDrawable();
+}
+}
 
-private void removeSplashScreen() {
+private void reloadDrawable() {
+if (isReloadOnOrientationChange() && splashImageView != null) {
+final int drawableId = 
preferences.getInteger("SplashDrawableId", 0);
+if (drawableId != 0) {
+cordova.getActivity().runOnUiThread(new Runnable() {
--- End diff --

Does this not always run on the UI thread?


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on a diff in the pull request:


https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27412851
  
--- Diff: src/android/SplashScreen.java ---
@@ -37,6 +39,19 @@ Licensed to the Apache Software Foundation (ASF) under 
one
 import org.json.JSONArray;
 import org.json.JSONException;
 
+/**
+ * Splash Screen plugin. Uses the following preferences:
+ * 
+ * SplashScreen: Splash screen resource name.
+ * SplashScreenDelay: How long splash screen should be shown in 
milliseconds.
+ * SplashMaintainAspectRatio: Maintain aspect ratio of the drawable, 
like CSS
--- End diff --

Please add to the README.md as well.


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis closed the pull request at:

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


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on the pull request:

https://github.com/apache/cordova-android/pull/168#issuecomment-87089041
  
Closing this pull request in favor of this one: 
https://github.com/apache/cordova-plugin-splashscreen/pull/43


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on the pull request:

https://github.com/apache/cordova-android/pull/168#issuecomment-87086720
  
It doesn't work for me on Windows, probably because my repo structure is 
totally different from what you use. I'm not going to bug you with more 
questions - it's not that big of a deal. I can manually create the link.
  From: agrieve 
 To: apache/cordova-android  
Cc: Alex  
 Sent: Friday, March 27, 2015 1:18 PM
 Subject: Re: [cordova-android] CB-8753 Maintain splash screen aspect ratio 
(#168)
   
Install the plugin with the --link flag, and then you should be able to 
edit it in the projects and the changes will be reflected in the repo (it 
creates symlinks)—
Reply to this email directly or view it on GitHub.   

  


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on the pull request:

https://github.com/apache/cordova-android/pull/168#issuecomment-87076470
  
Install the plugin with the --link flag, and then you should be able to 
edit it in the projects and the changes will be reflected in the repo (it 
creates symlinks)


> 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 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


GitHub user AlexTalis opened a pull request:

https://github.com/apache/cordova-plugin-splashscreen/pull/43

CB-8753 Maintain splash screen aspect ratio

- Added "SplashMaintainAspectRatio” preference to maintain SplashScreen
aspect ratio instead of scaling it to dialog.
- Added “SplashReloadOnOrientationChange” preference to reload drawable
when orientation changes. It's a preference for performance reasons - do
not reload the drawable if it does not change based on orientation.

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

$ git pull https://github.com/AlexTalis/cordova-plugin-splashscreen master

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

https://github.com/apache/cordova-plugin-splashscreen/pull/43.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 #43


commit 9155b9066202716b13c72e4c5b20204eb8f20426
Author: Alex Talis 
Date:   2015-03-27T18:33:01Z

CB-8753 Maintain splash screen aspect ratio

- Added "SplashMaintainAspectRatio” preference to maintain SplashScreen
aspect ratio instead of scaling it to dialog.
- Added “SplashReloadOnOrientationChange” preference to reload drawable
when orientation changes. It's a preference for performance reasons - do
not reload the drawable if it does not change based on orientation.




> 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user AlexTalis commented on the pull request:

https://github.com/apache/cordova-android/pull/168#issuecomment-87017968
  
I'm working on a pull request for cordova-plugin-splashscreen master. The 
only way I found to set up for the plugin development was to copy 
SplashScreen.java from the repo into another project, make the changes, then 
copy it back to cordova-plugin-splashscreen repo, then push. That's because 
SplashScreen.java in cordova-plugin-splashscreen is not in the right package 
folder structure, so it can't be linked into a workspace directly. This is a 
little painful. Do you have better way of doing this?


> 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-8753:


Github user agrieve commented on the pull request:

https://github.com/apache/cordova-android/pull/168#issuecomment-86521912
  
Great questions.

The statics are meant to prevent multiple splash screens from showing if 
there is more than one CordovaWebView within a project.

`CordovaPreferences.copyIntoIntentExtras(Activity)` - it's legacy.

keep getting preferences from CordovaPreferences - because embedders can 
change these preferences during app start-up, and we want those changes to take 
effect.

New Prefs android only - yes. that's fine. Splash screen already has mostly 
platform-specific prefs :(

Overall comments:
- Randomly, an `onConfigurationChange` hook was just recently added to 
master, so you should just use that instead.
- We aren't planning on doing another release of 3.x branch, so you should 
make these changes to cordova-plugin-splashscreen, which is what will work with 
cordova-android@4.0.x (and with master branch of cordova-android)
- I don't see why anyone would want reloadOnOrientationChange=false, so 
maybe don't make that a preference?
- Might be better to get rid of the LinearLayout, and instead switch to an 
ImageView in both cases


> 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.
> 
> 



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



[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio

2015-03-25 Thread ASF GitHub Bot (JIRA)

[ 
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 
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 e02a50058749c7411f64a3cebe7ed7b9f4d2
Author: atalis 
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 
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 ori