cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] reidab commented on a change in pull request #210: CB-12367: Modernize styling of iOS InAppBrowser view
Date Thu, 01 Jan 1970 00:00:00 GMT
reidab commented on a change in pull request #210: CB-12367: Modernize styling of iOS InAppBrowser
view
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/210#discussion_r151920046
 
 

 ##########
 File path: src/ios/CDVInAppBrowser.m
 ##########
 @@ -539,115 +545,212 @@ -(void)dealloc {
 - (void)createViews
 {
     // We create the views in code for primarily for ease of upgrades and not requiring an
external .xib to be included
+    UIBarButtonItem* flexibleSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:nil];
+    UIBarButtonItem* fixedSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil action:nil];
+    fixedSpaceButton.width = 20;
 
-    CGRect webViewBounds = self.view.bounds;
-    BOOL toolbarIsAtBottom = ![_browserOptions.toolbarposition isEqualToString:kInAppBrowserToolbarBarPositionTop];
-    webViewBounds.size.height -= _browserOptions.location ? FOOTER_HEIGHT : TOOLBAR_HEIGHT;
-    self.webView = [[UIWebView alloc] initWithFrame:webViewBounds];
+    self.webView = [self buildWebView];
+    self.spinner = [self buildSpinner];
+    self.toolbar = [self buildToolbar];
+
+    self.addressLabel = [self buildAddressLabel];
+    self.addressBar = [self buildAddressBar:self.addressLabel];
 
-    self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
+    self.closeButton = [self buildCloseButton];
+    self.forwardButton = [self buildForwardButton];
+    self.backButton = [self buildBackButton];
+
+    [self.toolbar setItems:@[self.closeButton, flexibleSpaceButton, self.backButton, fixedSpaceButton,
self.forwardButton]];
+
+    self.view.backgroundColor = [UIColor whiteColor];
+
+    if (IsAtLeastiOSVersion(@"7.0")) {
 
 Review comment:
   I only threw in this `IsAtLeastiOSVersion` check because there are other instances of it
in this file going all the way back to iOS 6. I can remove it from this commit if you'd like,
but I feel like removing the rest of the iOS version checks from this file is probably out
of scope of this work.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message