Skip to content

Commit b9cc615

Browse files
authored
Fix tablet layout for in-app messaging (#2032)
* Rename fine-tuning methods to reflect size class rather than orientation * Modify existing constraints to de-portrait tablet layout, need a card width for tablet now * Further constraint tinkering, add identifiers for better auto layout debugging * More constraints for "landscape" appearance in tablet. Looks good for every case except Thin Image, which blows up the height of the message card * Fix fine tune layout methods to correctly fine tune for compact height and width * Update layout constraint identifiers to match titles in document outline for easier debugging * Revert superfluous method name changes for layout fine tuning methods
1 parent 4e19ebe commit b9cc615

File tree

2 files changed

+87
-100
lines changed

2 files changed

+87
-100
lines changed

Firebase/InAppMessagingDisplay/Modal/FIDModalViewController.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,15 @@ - (void)layoutFineTuneInLandscapeMode {
405405
- (void)viewDidLayoutSubviews {
406406
[super viewDidLayoutSubviews];
407407

408-
if (self.buttonBottomToContainerBottomInPortraitMode.active) {
409-
FIRLogDebug(kFIRLoggerInAppMessagingDisplay, @"I-FID300009",
410-
@"Modal view rendered in portrait mode");
411-
[self layoutFineTuneInPortraitMode];
412-
} else {
408+
if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular ||
409+
self.traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact) {
413410
FIRLogDebug(kFIRLoggerInAppMessagingDisplay, @"I-FID300010",
414411
@"Modal view rendered in landscape mode");
415412
[self layoutFineTuneInLandscapeMode];
413+
} else {
414+
FIRLogDebug(kFIRLoggerInAppMessagingDisplay, @"I-FID300009",
415+
@"Modal view rendered in portrait mode");
416+
[self layoutFineTuneInPortraitMode];
416417
}
417418

418419
// always scroll to the top in case the body area is scrollable

0 commit comments

Comments
 (0)