Commit db433ca4 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF] Fixes the size of the popover for passwords

Reduces the estimated size of the row to the minimum, so it is correctly
calculated on |contentSize|.
Starts the view controller with a more appropiate size for the popover.

Bug: 912515
Change-Id: If7c2dc4a0ab2a6df445fdac2c5fc21453927a71c
Reviewed-on: https://chromium-review.googlesource.com/c/1371873
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615855}
parent f2cbf389
...@@ -68,7 +68,7 @@ initWithBaseViewController:(UIViewController*)viewController ...@@ -68,7 +68,7 @@ initWithBaseViewController:(UIViewController*)viewController
popoverPresentationController.sourceView = button; popoverPresentationController.sourceView = button;
popoverPresentationController.sourceRect = button.bounds; popoverPresentationController.sourceRect = button.bounds;
popoverPresentationController.permittedArrowDirections = popoverPresentationController.permittedArrowDirections =
UIPopoverArrowDirectionUp | UIMenuControllerArrowDown; UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown;
popoverPresentationController.delegate = self; popoverPresentationController.delegate = self;
popoverPresentationController.backgroundColor = UIColor.whiteColor; popoverPresentationController.backgroundColor = UIColor.whiteColor;
} }
......
...@@ -24,10 +24,14 @@ typedef NS_ENUM(NSInteger, SectionIdentifier) { ...@@ -24,10 +24,14 @@ typedef NS_ENUM(NSInteger, SectionIdentifier) {
namespace { namespace {
// This is the width used for |self.preferredContentSize|. // This is the width used for |self.preferredContentSize|.
constexpr float PopoverPreferredWidth = 320; constexpr CGFloat PopoverPreferredWidth = 320;
// This is the maximum height used for |self.preferredContentSize|. // This is the maximum height used for |self.preferredContentSize|.
constexpr float PopoverMaxHeight = 360; constexpr CGFloat PopoverMaxHeight = 360;
// This is the height used for |self.preferredContentSize| when showing the
// loading indicator on iPad.
constexpr CGFloat PopoverLoadingHeight = 185.5;
} // namespace } // namespace
...@@ -61,11 +65,15 @@ constexpr float PopoverMaxHeight = 360; ...@@ -61,11 +65,15 @@ constexpr float PopoverMaxHeight = 360;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.sectionHeaderHeight = 0; self.tableView.sectionHeaderHeight = 0;
self.tableView.sectionFooterHeight = 20.0; self.tableView.sectionFooterHeight = 20.0;
self.tableView.estimatedRowHeight = 200; self.tableView.estimatedRowHeight = 1;
self.tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0); self.tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
self.tableView.allowsSelection = NO; self.tableView.allowsSelection = NO;
self.definesPresentationContext = YES; self.definesPresentationContext = YES;
if (!self.tableViewModel) { if (!self.tableViewModel) {
if (IsIPadIdiom()) {
self.preferredContentSize = CGSizeMake(
PopoverPreferredWidth, AlignValueToPixel(PopoverLoadingHeight));
}
[self startLoadingIndicatorWithLoadingMessage:@""]; [self startLoadingIndicatorWithLoadingMessage:@""];
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment