From b6e5f11373cf769322c119067d9183f8a3f69e6f Mon Sep 17 00:00:00 2001 From: Chris Tibbs Date: Fri, 26 Oct 2018 13:54:04 -0700 Subject: [PATCH 1/7] Rename fine-tuning methods to reflect size class rather than orientation --- .../Modal/FIDModalViewController.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Firebase/InAppMessagingDisplay/Modal/FIDModalViewController.m b/Firebase/InAppMessagingDisplay/Modal/FIDModalViewController.m index 30427f1a7a8..cf1a6319fe9 100644 --- a/Firebase/InAppMessagingDisplay/Modal/FIDModalViewController.m +++ b/Firebase/InAppMessagingDisplay/Modal/FIDModalViewController.m @@ -255,7 +255,7 @@ - (struct TitleBodyButtonHeightInfo)estimateTextBtnColumnHeightWithDisplayWidth: // the following two layoutFineTunexx methods make additional adjustments for the view layout // in portrait and landscape mode respectively. They are supposed to be triggered from // viewDidLayoutSubviews since certain dimension sizes are only available there -- (void)layoutFineTuneInPortraitMode { +- (void)layoutFineTuneForCompactHorizontalSizeClass { // for tablet case, since we use a fixed card height, the reference would be just the card height // for non-tablet case, we want to use a dynamic height , so the reference would be the window // height @@ -339,7 +339,7 @@ - (void)applySmallerSpacingForInLandscapeMode { } } -- (void)layoutFineTuneInLandscapeMode { +- (void)layoutFineTuneForRegularHorizontalSizeClass { // smaller spacing threshold is applied for screens equal or larger than 4.7 inches if (self.view.window.frame.size.height <= 321) { [self applySmallerSpacingForInLandscapeMode]; @@ -405,14 +405,14 @@ - (void)layoutFineTuneInLandscapeMode { - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; - if (self.buttonBottomToContainerBottomInPortraitMode.active) { + if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact) { FIRLogDebug(kFIRLoggerInAppMessagingDisplay, @"I-FID300009", - @"Modal view rendered in portrait mode"); - [self layoutFineTuneInPortraitMode]; + @"Modal view rendered in compact horizontal size class mode"); + [self layoutFineTuneForCompactHorizontalSizeClass]; } else { FIRLogDebug(kFIRLoggerInAppMessagingDisplay, @"I-FID300010", - @"Modal view rendered in landscape mode"); - [self layoutFineTuneInLandscapeMode]; + @"Modal view rendered in regular horizontal size class mode"); + [self layoutFineTuneForRegularHorizontalSizeClass]; } // always scroll to the top in case the body area is scrollable From 679dd1c73d41b1f8df1940523c98026e22b5f91d Mon Sep 17 00:00:00 2001 From: Chris Tibbs Date: Mon, 29 Oct 2018 14:17:38 -0700 Subject: [PATCH 2/7] Modify existing constraints to de-portrait tablet layout, need a card width for tablet now --- ...IRInAppMessageDisplayStoryboard.storyboard | 92 ++++++++----------- 1 file changed, 39 insertions(+), 53 deletions(-) diff --git a/Firebase/InAppMessagingDisplay/Resources/FIRInAppMessageDisplayStoryboard.storyboard b/Firebase/InAppMessagingDisplay/Resources/FIRInAppMessageDisplayStoryboard.storyboard index dfe971e6881..9a2495540c7 100644 --- a/Firebase/InAppMessagingDisplay/Resources/FIRInAppMessageDisplayStoryboard.storyboard +++ b/Firebase/InAppMessagingDisplay/Resources/FIRInAppMessageDisplayStoryboard.storyboard @@ -1,13 +1,11 @@ - - + + - - - + @@ -20,7 +18,7 @@ - + @@ -61,11 +59,11 @@ - + - + @@ -75,14 +73,14 @@