<commit_before>//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#import "AceNavigationController.h"
#import "Utils.h"

@implementation AceNavigationController

- (id)init {
    self = [super init];

    self.NavigationMode = NavigationModeNone;
    self.InsideNativeInitiatedBackNavigation = false;

    return self;
}

- (void)viewWillLayoutSubviews {
    // This is done here rather than in AceViewController so it impacts
    // every view controller, including the default Cordova one.

    NSArray* subviews = [self.topViewController.view subviews];

    // Only resize to fullscreen if there's a single (non-TabBar) subview.
    if (subviews.count == 1) {
        ((UIView*)subviews[0]).frame = [UIScreen mainScreen].bounds;
    }
    else if (subviews.count == 2) {
        if ([subviews[0] isKindOfClass:[UITabBar class]]) {
            CGRect r = [UIScreen mainScreen].bounds;
            UITabBar* tabBar = (UITabBar*)subviews[0];
            [tabBar sizeToFit];
            tabBar.frame = CGRectMake(r.origin.x, r.size.height - tabBar.frame.size.height, r.size.width, tabBar.frame.size.height);
            ((UIView*)subviews[1]).frame = CGRectMake(r.origin.x, r.origin.y, r.size.width, r.size.height - tabBar.frame.size.height);
        }
        else if ([subviews[1] isKindOfClass:[UITabBar class]]) {
            CGRect r = [UIScreen mainScreen].bounds;
            UITabBar* tabBar = (UITabBar*)subviews[1];
            [tabBar sizeToFit];
            tabBar.frame = CGRectMake(r.origin.x, r.size.height - tabBar.frame.size.height, r.size.width, tabBar.frame.size.height);<commit_msg>iOS: Adjust page layout for AceViewController vs. MainViewController<commit_after>//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#import "AceNavigationController.h"
#import "AceViewController.h"
#import "Utils.h"

@implementation AceNavigationController

- (id)init {
    self = [super init];

    self.NavigationMode = NavigationModeNone;
    self.InsideNativeInitiatedBackNavigation = false;

    return self;
}

- (void)viewWillLayoutSubviews {
    // This is done here rather than in AceViewController so it impacts
    // every view controller, including the default Cordova one.

    NSArray* subviews = [self.topViewController.view subviews];

    // Only resize to fullscreen if there's a single (non-TabBar) subview.
    if (subviews.count == 1) {
        if ([self.topViewController isKindOfClass:[AceViewController class]]) {
            ((UIView*)subviews[0]).frame = [UIScreen mainScreen].bounds;
        }
        else {
            // Adjustment for the default Cordova view controller
            ((UIView*)subviews[0]).frame = [UIScreen mainScreen].applicationFrame;
        }
    }
    else if (subviews.count == 2) {
        if ([subviews[0] isKindOfClass:[UITabBar class]]) {
            CGRect r = [UIScreen mainScreen].bounds;
            UITabBar* tabBar = (UITabBar*)subviews[0];
            [tabBar sizeToFit];
            tabBar.frame = CGRectMake(r.origin.x, r.size.height - tabBar.frame.size.height, r.size.width, tabBar.frame.size.height);
            ((UIView*)subviews[1]).frame = CGRectMake(r.origin.x, r.origin.y, r.size.width, r.size.height - tabBar.frame.size.height);
        }
        else if ([subviews[1] isKindOfClass:[UITabBar class]]) {
            CGRect r = [UIScreen mainScreen].bounds;
            UITabBar* tabBar = (UITabBar*)subviews[1];
            [tabBar sizeToFit];
            tabBar.frame = CGRectMake(r.origin.x, r.size.height - tabBar.frame.size.height, r.size.width, tabBar.frame.size.height);
{'fraction_non_alphanumeric': 0.20888040105037, 'fraction_numerical': 0.00405824779183576, 'mean_word_length': 2.0628654970760234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3849374', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1140, 'n_words': 279}