[jira] [Comment Edited] (CB-13835) iOS InAppBrowser changing toolbar position to top doesn't alter position webpage

2018-02-23 Thread Tom Saul (JIRA)

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

Tom Saul edited comment on CB-13835 at 2/24/18 12:37 AM:
-

I am not familiar with this development framework, but I suspect I see the 
problem(s) in the source code.  The first is that is is assuming the statusBar 
is present (not guaranteed), and is a fixed height (line 30 - #define    
STATUSBAR_HEIGHT 20.0) - the height is no longer fixed in IOS (it can vary on 
iPhone 10), so this would need to be factored in.  The second issue is in the 
showToolBar method (line 735).  For clarity I would suggest reorganizing this 
where the top level block is a test for bar position (top or bottom).  The 
location bar is not relevant for when this is at the top, and the logic will 
get a bit convoluted as-is.  Perhaps something like

 
{code:java}
if (show)
{
    self.toolbar.hidden = NO;
    CGRect webViewBounds = self.view.bounds;

    int statusBarSize = getStatusBarSize(); // Note this needs to reflect the 
actual size, not a constant.  Could be zero, the old fixed size, of the new 
iPhone 10 size
    
    webViewBounds.size.height -= TOOLBAR_HEIGHT;
    if ([toolbarPosition isEqualToString:kInAppBrowserToolbarBarPositionTop])
    {
        toolbarFrame.origin.y = statusBarSize;  
        webViewBounds.origin.y += toolbarFrame.size.height + statusBarSize;
    }
    else
    {
    int locationBarHeight = 0;
        if (locationbarVisible)
        {
            webViewBounds.size.height -= LOCATIONBAR_HEIGHT;
            locationbarFrame.origin.y = webViewBounds.size.height;
            self.addressLabel.frame = locationbarFrame;
            locationBarHeight = LOCATIONBAR_HEIGHT;
        }
        toolbarFrame.origin.y = (webViewBounds.size.height + locationBarHeight);
    }
    self.toolbar.frame = toolbarFrame;
    [self setWebViewFrame:webViewBounds];

}
else
{
    self.toolbar.hidden = YES;
...
{code}


was (Author: tomsaul):
I am not familiar with this development framework, but I suspect I see the 
problem(s) in the source code.  The first is that is is assuming the statusBar 
is present (not guaranteed), and is a fixed height (line 30 - #define    
STATUSBAR_HEIGHT 20.0) - the height is no longer fixed in IOS (it can vary on 
iPhone 10), so this would need to be factored in.  The second issue is in the 
showToolBar method (line 735).  For clarity I would suggest reorganizing this 
where the top level block is a test for bar position (top or bottom).  The 
location bar is not relevant for when this is at the top, and the logic will 
get a bit convoluted as-is.  Perhaps something like

 
{code:java}
if (show)
{
    self.toolbar.hidden = NO;
    CGRect webViewBounds = self.view.bounds;

    int statusBarSize = getStatusBarSize(); // Note this needs to reflect the 
actual size, not a constant.  Could be zero, the old fixed size, of the new 
iPhone 10 size
    
    webViewBounds.size.height -= TOOLBAR_HEIGHT;
    if ([toolbarPosition isEqualToString:kInAppBrowserToolbarBarPositionTop])
    {
        toolbarFrame.origin.y = statusBarSize;  
        webViewBounds.origin.y += toolbarFrame.size.height + statusBarSize;
    }
    else
    {
        if (locationbarVisible)
        {
            webViewBounds.size.height -= LOCATIONBAR_HEIGHT;
            locationbarFrame.origin.y = webViewBounds.size.height;
            self.addressLabel.frame = locationbarFrame;
        } else
        {
            CGRect webViewBounds = self.view.bounds;
        }
        toolbarFrame.origin.y = (webViewBounds.size.height + 
LOCATIONBAR_HEIGHT);
    }
    self.toolbar.frame = toolbarFrame;
    [self setWebViewFrame:webViewBounds];

}
else
{
    self.toolbar.hidden = YES;
...
{code}

> iOS InAppBrowser changing toolbar position to top doesn't alter position 
> webpage
> 
>
> Key: CB-13835
> URL: https://issues.apache.org/jira/browse/CB-13835
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Corneel den Hartogh
>Priority: Major
> Attachments: Screenshot 2018-01-26 11.25.02.jpg, Screenshot 
> 2018-01-26 11.28.24.jpg
>
>
> Within the InAppBrowser  you can set for iOS the toolbarposition on bottom or 
> top (bottom is default). When I make it top, the position of the loaded url 
> (a map in my case) isn't changed. The result is that the toolbar is in front 
> of the url (where the search box is blocked out of view as can be seen in the 
> screenshots). 
> I updated Ionic / Cordova / InAppBrowser but it didn't change anything.
> I tried some workaround myself but I was unable to figure it out. Any 
> suggestions here?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CB-13835) iOS InAppBrowser changing toolbar position to top doesn't alter position webpage

2018-02-23 Thread Tom Saul (JIRA)

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

Tom Saul commented on CB-13835:
---

I am not familiar with this development framework, but I suspect I see the 
problem(s) in the source code.  The first is that is is assuming the statusBar 
is present (not guaranteed), and is a fixed height (line 30 - #define    
STATUSBAR_HEIGHT 20.0) - the height is no longer fixed in IOS (it can vary on 
iPhone 10), so this would need to be factored in.  The second issue is in the 
showToolBar method (line 735).  For clarity I would suggest reorganizing this 
where the top level block is a test for bar position (top or bottom).  The 
location bar is not relevant for when this is at the top, and the logic will 
get a bit convoluted as-is.  Perhaps something like

 
{code:java}
if (show)
{
    self.toolbar.hidden = NO;
    CGRect webViewBounds = self.view.bounds;

    int statusBarSize = getStatusBarSize(); // Note this needs to reflect the 
actual size, not a constant.  Could be zero, the old fixed size, of the new 
iPhone 10 size
    
    webViewBounds.size.height -= TOOLBAR_HEIGHT;
    if ([toolbarPosition isEqualToString:kInAppBrowserToolbarBarPositionTop])
    {
        toolbarFrame.origin.y = statusBarSize;  
        webViewBounds.origin.y += toolbarFrame.size.height + statusBarSize;
    }
    else
    {
        if (locationbarVisible)
        {
            webViewBounds.size.height -= LOCATIONBAR_HEIGHT;
            locationbarFrame.origin.y = webViewBounds.size.height;
            self.addressLabel.frame = locationbarFrame;
        } else
        {
            CGRect webViewBounds = self.view.bounds;
        }
        toolbarFrame.origin.y = (webViewBounds.size.height + 
LOCATIONBAR_HEIGHT);
    }
    self.toolbar.frame = toolbarFrame;
    [self setWebViewFrame:webViewBounds];

}
else
{
    self.toolbar.hidden = YES;
...
{code}

> iOS InAppBrowser changing toolbar position to top doesn't alter position 
> webpage
> 
>
> Key: CB-13835
> URL: https://issues.apache.org/jira/browse/CB-13835
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Corneel den Hartogh
>Priority: Major
> Attachments: Screenshot 2018-01-26 11.25.02.jpg, Screenshot 
> 2018-01-26 11.28.24.jpg
>
>
> Within the InAppBrowser  you can set for iOS the toolbarposition on bottom or 
> top (bottom is default). When I make it top, the position of the loaded url 
> (a map in my case) isn't changed. The result is that the toolbar is in front 
> of the url (where the search box is blocked out of view as can be seen in the 
> screenshots). 
> I updated Ionic / Cordova / InAppBrowser but it didn't change anything.
> I tried some workaround myself but I was unable to figure it out. Any 
> suggestions here?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CB-13835) iOS InAppBrowser changing toolbar position to top doesn't alter position webpage

2018-02-22 Thread Tom Saul (JIRA)

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

Tom Saul commented on CB-13835:
---

The problem exists for the plugin in the phoneGap Build NPM and when pulling 
the master (2.0.3) from GIT.  I see it on both IOS 9 and 11.  It works fine 
when the bar is on the bottom (page is shrunk to proper size), but no resizing 
is done when it is on the top.

 

> iOS InAppBrowser changing toolbar position to top doesn't alter position 
> webpage
> 
>
> Key: CB-13835
> URL: https://issues.apache.org/jira/browse/CB-13835
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: cordova-plugin-inappbrowser
>Reporter: Corneel den Hartogh
>Priority: Major
> Attachments: Screenshot 2018-01-26 11.25.02.jpg, Screenshot 
> 2018-01-26 11.28.24.jpg
>
>
> Within the InAppBrowser  you can set for iOS the toolbarposition on bottom or 
> top (bottom is default). When I make it top, the position of the loaded url 
> (a map in my case) isn't changed. The result is that the toolbar is in front 
> of the url (where the search box is blocked out of view as can be seen in the 
> screenshots). 
> I updated Ionic / Cordova / InAppBrowser but it didn't change anything.
> I tried some workaround myself but I was unable to figure it out. Any 
> suggestions here?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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