[jira] [Commented] (CB-11578) InAppBrowser doesn't open on Android 4.0.4 (regression)

2016-07-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11578:
-

Github user asfgit closed the pull request at:

https://github.com/apache/cordova-plugin-inappbrowser/pull/170


> InAppBrowser doesn't open on Android 4.0.4 (regression)
> ---
>
> Key: CB-11578
> URL: https://issues.apache.org/jira/browse/CB-11578
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 1.4.0
> Environment: Likely affects all pre-Jelly Bean Android devices.  
> Tested on Android 4.0.4 with a Samsung Galaxy phone (Samsung-SGH-I437).
>Reporter: Andrew
>
> Some changes made as part of the 1.4.0 release prevent the InAppBrowser from 
> opening on my Android 4.0.4 test device.  I traced the problem to some code 
> that appears to have been refactored/removed when it shouldn't have been 
> (setBackground/setBackgroundDrawable calls) and a call to getAdjustViewBounds 
> which doesn't appear to serve any purpose but it is a method that was only 
> made available at API level 16 (Jelly Bean).  
> I made the following changes to the latest code in the repository to fix this 
> problem:
> {noformat}
> diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
> index 30915dc..f1e8222 100644
> --- a/src/android/InAppBrowser.java
> +++ b/src/android/InAppBrowser.java
> @@ -579,11 +579,18 @@ public class InAppBrowser extends CordovaPlugin {
>  Resources activityRes = cordova.getActivity().getResources();
>  int backResId = 
> activityRes.getIdentifier("ic_action_previous_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable backIcon = activityRes.getDrawable(backResId);
> -back.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +back.setBackgroundDrawable(null);
> +}
> +else
> +{
> +back.setBackground(null);
> +}
>  back.setImageDrawable(backIcon);
>  back.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -back.getAdjustViewBounds();
>  
>  back.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -600,11 +607,18 @@ public class InAppBrowser extends CordovaPlugin {
>  forward.setId(Integer.valueOf(3));
>  int fwdResId = 
> activityRes.getIdentifier("ic_action_next_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable fwdIcon = activityRes.getDrawable(fwdResId);
> -forward.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +forward.setBackgroundDrawable(null);
> +}
> +else
> +{
> +forward.setBackground(null);
> +}
>  forward.setImageDrawable(fwdIcon);
>  forward.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  forward.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -forward.getAdjustViewBounds();
>  
>  forward.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -644,11 +658,18 @@ public class InAppBrowser extends CordovaPlugin {
>  close.setId(Integer.valueOf(5));
>  int closeResId = 
> activityRes.getIdentifier("ic_action_remove", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable closeIcon = activityRes.getDrawable(closeResId);
> -close.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +close.setBackgroundDrawable(null);
> +}
> +else
> +{
> +close.setBackground(null);
> +}
>  close.setImageDrawable(closeIcon);
>  close.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -close.getAdjustViewBounds();
>  
>  close.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> {noformat}

[jira] [Commented] (CB-11578) InAppBrowser doesn't open on Android 4.0.4 (regression)

2016-07-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11578:
-

Github user jcesarmobile commented on the issue:

https://github.com/apache/cordova-plugin-inappbrowser/pull/170
  
As it's a small fix I'm going to merge it without the ICLA, but you should 
consider filling the Apache's Contributor License Agreement 
http://www.apache.org/licenses/#clas for future contributions


> InAppBrowser doesn't open on Android 4.0.4 (regression)
> ---
>
> Key: CB-11578
> URL: https://issues.apache.org/jira/browse/CB-11578
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 1.4.0
> Environment: Likely affects all pre-Jelly Bean Android devices.  
> Tested on Android 4.0.4 with a Samsung Galaxy phone (Samsung-SGH-I437).
>Reporter: Andrew
>
> Some changes made as part of the 1.4.0 release prevent the InAppBrowser from 
> opening on my Android 4.0.4 test device.  I traced the problem to some code 
> that appears to have been refactored/removed when it shouldn't have been 
> (setBackground/setBackgroundDrawable calls) and a call to getAdjustViewBounds 
> which doesn't appear to serve any purpose but it is a method that was only 
> made available at API level 16 (Jelly Bean).  
> I made the following changes to the latest code in the repository to fix this 
> problem:
> {noformat}
> diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
> index 30915dc..f1e8222 100644
> --- a/src/android/InAppBrowser.java
> +++ b/src/android/InAppBrowser.java
> @@ -579,11 +579,18 @@ public class InAppBrowser extends CordovaPlugin {
>  Resources activityRes = cordova.getActivity().getResources();
>  int backResId = 
> activityRes.getIdentifier("ic_action_previous_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable backIcon = activityRes.getDrawable(backResId);
> -back.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +back.setBackgroundDrawable(null);
> +}
> +else
> +{
> +back.setBackground(null);
> +}
>  back.setImageDrawable(backIcon);
>  back.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -back.getAdjustViewBounds();
>  
>  back.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -600,11 +607,18 @@ public class InAppBrowser extends CordovaPlugin {
>  forward.setId(Integer.valueOf(3));
>  int fwdResId = 
> activityRes.getIdentifier("ic_action_next_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable fwdIcon = activityRes.getDrawable(fwdResId);
> -forward.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +forward.setBackgroundDrawable(null);
> +}
> +else
> +{
> +forward.setBackground(null);
> +}
>  forward.setImageDrawable(fwdIcon);
>  forward.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  forward.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -forward.getAdjustViewBounds();
>  
>  forward.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -644,11 +658,18 @@ public class InAppBrowser extends CordovaPlugin {
>  close.setId(Integer.valueOf(5));
>  int closeResId = 
> activityRes.getIdentifier("ic_action_remove", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable closeIcon = activityRes.getDrawable(closeResId);
> -close.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +close.setBackgroundDrawable(null);
> +}
> +else
> +{
> +close.setBackground(null);
> +}
>  close.setImageDrawable(closeIcon);
>  close.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this

[jira] [Commented] (CB-11578) InAppBrowser doesn't open on Android 4.0.4 (regression)

2016-07-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11578:
-

Github user jcesarmobile commented on the issue:

https://github.com/apache/cordova-plugin-inappbrowser/pull/170
  
Thanks. I forgot one thing, before we can merge it though, you need to sign 
Apache's Contributor License Agreement (can be done online): 
http://www.apache.org/licenses/#clas

And if you squash the 2 commits into one that will be perfect.


> InAppBrowser doesn't open on Android 4.0.4 (regression)
> ---
>
> Key: CB-11578
> URL: https://issues.apache.org/jira/browse/CB-11578
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 1.4.0
> Environment: Likely affects all pre-Jelly Bean Android devices.  
> Tested on Android 4.0.4 with a Samsung Galaxy phone (Samsung-SGH-I437).
>Reporter: Andrew
>
> Some changes made as part of the 1.4.0 release prevent the InAppBrowser from 
> opening on my Android 4.0.4 test device.  I traced the problem to some code 
> that appears to have been refactored/removed when it shouldn't have been 
> (setBackground/setBackgroundDrawable calls) and a call to getAdjustViewBounds 
> which doesn't appear to serve any purpose but it is a method that was only 
> made available at API level 16 (Jelly Bean).  
> I made the following changes to the latest code in the repository to fix this 
> problem:
> {noformat}
> diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
> index 30915dc..f1e8222 100644
> --- a/src/android/InAppBrowser.java
> +++ b/src/android/InAppBrowser.java
> @@ -579,11 +579,18 @@ public class InAppBrowser extends CordovaPlugin {
>  Resources activityRes = cordova.getActivity().getResources();
>  int backResId = 
> activityRes.getIdentifier("ic_action_previous_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable backIcon = activityRes.getDrawable(backResId);
> -back.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +back.setBackgroundDrawable(null);
> +}
> +else
> +{
> +back.setBackground(null);
> +}
>  back.setImageDrawable(backIcon);
>  back.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -back.getAdjustViewBounds();
>  
>  back.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -600,11 +607,18 @@ public class InAppBrowser extends CordovaPlugin {
>  forward.setId(Integer.valueOf(3));
>  int fwdResId = 
> activityRes.getIdentifier("ic_action_next_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable fwdIcon = activityRes.getDrawable(fwdResId);
> -forward.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +forward.setBackgroundDrawable(null);
> +}
> +else
> +{
> +forward.setBackground(null);
> +}
>  forward.setImageDrawable(fwdIcon);
>  forward.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  forward.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -forward.getAdjustViewBounds();
>  
>  forward.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -644,11 +658,18 @@ public class InAppBrowser extends CordovaPlugin {
>  close.setId(Integer.valueOf(5));
>  int closeResId = 
> activityRes.getIdentifier("ic_action_remove", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable closeIcon = activityRes.getDrawable(closeResId);
> -close.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +close.setBackgroundDrawable(null);
> +}
> +else
> +{
> +close.setBackground(null);
> +}
>  close.setImageDrawable(closeIcon);
>  close.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  b

[jira] [Commented] (CB-11578) InAppBrowser doesn't open on Android 4.0.4 (regression)

2016-07-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11578:
-

Github user cordova-qa commented on the issue:

https://github.com/apache/cordova-plugin-inappbrowser/pull/170
  
Cordova CI Build has completed successfully.

**Commit** - 
[Link](https://github.com/apache/cordova-plugin-inappbrowser/pull/170/commits/e98085c17d02f252273fada13f28c3b83e21378c)
**Dashboard** - 
[Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55/)

| Builder Name  | Console Output | Test Report | Device Logs  |
| :---: | :---:  |   :---: | :---:|
| [Windows 8.1 Store]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-store/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-store/console)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-store/testReport/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-store/artifact/)
 |
| [Windows 10  Store]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-10-store/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-10-store/console)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-10-store/testReport/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-10-store/artifact/)
 |
| [Windows 8.1 Phone]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-phone/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-phone/console)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-phone/testReport/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=windows-8.1-phone/artifact/)
 |
| [iOS]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=ios/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=ios/console)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=ios/testReport/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=ios/artifact/)
 |
| [Android]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=android/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=android/console)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=android/testReport/)
 | [Link]( 
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-inappbrowser-pr/55//PLATFORM=android/artifact/)
 |
 



> InAppBrowser doesn't open on Android 4.0.4 (regression)
> ---
>
> Key: CB-11578
> URL: https://issues.apache.org/jira/browse/CB-11578
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 1.4.0
> Environment: Likely affects all pre-Jelly Bean Android devices.  
> Tested on Android 4.0.4 with a Samsung Galaxy phone (Samsung-SGH-I437).
>Reporter: Andrew
>
> Some changes made as part of the 1.4.0 release prevent the InAppBrowser from 
> opening on my Android 4.0.4 test device.  I traced the problem to some code 
> that appears to have been refactored/removed when it shouldn't have been 
> (setBackground/setBackgroundDrawable calls) and a call to getAdjustViewBounds 
> which doesn't appear to serve any purpose but it is a method that was only 
> made available at API level 16 (Jelly Bean).  
> I made the following changes to the latest code in the repository to fix this 
> problem:
> {noformat}
> diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
> index 30915dc..f1e8222 100644
> --- a/src/android/InAppBrowser.java
> +++ b/src/android/InAppBrowser.java
> @@ -579,11 +579,18 @@ public class InAppBrowser extends CordovaPlugin {
>  Resources activityRes = cordova.getActivity().getResources();
>  int backResId = 
> activityRes.getIdentifier("ic_action_previous_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable backIcon = activityRes.getDrawable(backResId);
> -back.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 

[jira] [Commented] (CB-11578) InAppBrowser doesn't open on Android 4.0.4 (regression)

2016-07-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11578:
-

Github user DrMoriarty commented on the issue:

https://github.com/apache/cordova-plugin-inappbrowser/pull/170
  
@jcesarmobile   done


> InAppBrowser doesn't open on Android 4.0.4 (regression)
> ---
>
> Key: CB-11578
> URL: https://issues.apache.org/jira/browse/CB-11578
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 1.4.0
> Environment: Likely affects all pre-Jelly Bean Android devices.  
> Tested on Android 4.0.4 with a Samsung Galaxy phone (Samsung-SGH-I437).
>Reporter: Andrew
>
> Some changes made as part of the 1.4.0 release prevent the InAppBrowser from 
> opening on my Android 4.0.4 test device.  I traced the problem to some code 
> that appears to have been refactored/removed when it shouldn't have been 
> (setBackground/setBackgroundDrawable calls) and a call to getAdjustViewBounds 
> which doesn't appear to serve any purpose but it is a method that was only 
> made available at API level 16 (Jelly Bean).  
> I made the following changes to the latest code in the repository to fix this 
> problem:
> {noformat}
> diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
> index 30915dc..f1e8222 100644
> --- a/src/android/InAppBrowser.java
> +++ b/src/android/InAppBrowser.java
> @@ -579,11 +579,18 @@ public class InAppBrowser extends CordovaPlugin {
>  Resources activityRes = cordova.getActivity().getResources();
>  int backResId = 
> activityRes.getIdentifier("ic_action_previous_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable backIcon = activityRes.getDrawable(backResId);
> -back.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +back.setBackgroundDrawable(null);
> +}
> +else
> +{
> +back.setBackground(null);
> +}
>  back.setImageDrawable(backIcon);
>  back.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -back.getAdjustViewBounds();
>  
>  back.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -600,11 +607,18 @@ public class InAppBrowser extends CordovaPlugin {
>  forward.setId(Integer.valueOf(3));
>  int fwdResId = 
> activityRes.getIdentifier("ic_action_next_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable fwdIcon = activityRes.getDrawable(fwdResId);
> -forward.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +forward.setBackgroundDrawable(null);
> +}
> +else
> +{
> +forward.setBackground(null);
> +}
>  forward.setImageDrawable(fwdIcon);
>  forward.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  forward.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -forward.getAdjustViewBounds();
>  
>  forward.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -644,11 +658,18 @@ public class InAppBrowser extends CordovaPlugin {
>  close.setId(Integer.valueOf(5));
>  int closeResId = 
> activityRes.getIdentifier("ic_action_remove", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable closeIcon = activityRes.getDrawable(closeResId);
> -close.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +close.setBackgroundDrawable(null);
> +}
> +else
> +{
> +close.setBackground(null);
> +}
>  close.setImageDrawable(closeIcon);
>  close.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -close.getAdjustViewBounds();
>  
>  close.setOnClickListener(new View.OnClickListener() {
>  public void on

[jira] [Commented] (CB-11578) InAppBrowser doesn't open on Android 4.0.4 (regression)

2016-07-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-11578:
-

Github user jcesarmobile commented on the issue:

https://github.com/apache/cordova-plugin-inappbrowser/pull/170
  
Thanks for the PR, looks good, but I've added a few comments. 
Can you add the modifications and change the title to start with CB-11578 
so it's linked with the JIRA issue?

Thanks


> InAppBrowser doesn't open on Android 4.0.4 (regression)
> ---
>
> Key: CB-11578
> URL: https://issues.apache.org/jira/browse/CB-11578
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 1.4.0
> Environment: Likely affects all pre-Jelly Bean Android devices.  
> Tested on Android 4.0.4 with a Samsung Galaxy phone (Samsung-SGH-I437).
>Reporter: Andrew
>
> Some changes made as part of the 1.4.0 release prevent the InAppBrowser from 
> opening on my Android 4.0.4 test device.  I traced the problem to some code 
> that appears to have been refactored/removed when it shouldn't have been 
> (setBackground/setBackgroundDrawable calls) and a call to getAdjustViewBounds 
> which doesn't appear to serve any purpose but it is a method that was only 
> made available at API level 16 (Jelly Bean).  
> I made the following changes to the latest code in the repository to fix this 
> problem:
> {noformat}
> diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
> index 30915dc..f1e8222 100644
> --- a/src/android/InAppBrowser.java
> +++ b/src/android/InAppBrowser.java
> @@ -579,11 +579,18 @@ public class InAppBrowser extends CordovaPlugin {
>  Resources activityRes = cordova.getActivity().getResources();
>  int backResId = 
> activityRes.getIdentifier("ic_action_previous_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable backIcon = activityRes.getDrawable(backResId);
> -back.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +back.setBackgroundDrawable(null);
> +}
> +else
> +{
> +back.setBackground(null);
> +}
>  back.setImageDrawable(backIcon);
>  back.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -back.getAdjustViewBounds();
>  
>  back.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -600,11 +607,18 @@ public class InAppBrowser extends CordovaPlugin {
>  forward.setId(Integer.valueOf(3));
>  int fwdResId = 
> activityRes.getIdentifier("ic_action_next_item", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable fwdIcon = activityRes.getDrawable(fwdResId);
> -forward.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +forward.setBackgroundDrawable(null);
> +}
> +else
> +{
> +forward.setBackground(null);
> +}
>  forward.setImageDrawable(fwdIcon);
>  forward.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  forward.setPadding(0, this.dpToPixels(10), 0, 
> this.dpToPixels(10));
> -forward.getAdjustViewBounds();
>  
>  forward.setOnClickListener(new View.OnClickListener() {
>  public void onClick(View v) {
> @@ -644,11 +658,18 @@ public class InAppBrowser extends CordovaPlugin {
>  close.setId(Integer.valueOf(5));
>  int closeResId = 
> activityRes.getIdentifier("ic_action_remove", "drawable", 
> cordova.getActivity().getPackageName());
>  Drawable closeIcon = activityRes.getDrawable(closeResId);
> -close.setBackground(null);
> +
> +if(android.os.Build.VERSION.SDK_INT < 
> android.os.Build.VERSION_CODES.JELLY_BEAN)
> +{
> +close.setBackgroundDrawable(null);
> +}
> +else
> +{
> +close.setBackground(null);
> +}
>  close.setImageDrawable(closeIcon);
>  close.setScaleType(ImageView.ScaleType.FIT_CENTER);
>  back.setPadding(0, this.dpToPixels(10), 0, 
> this.dpTo