Commit e510d699 authored by Ewann's avatar Ewann Committed by Commit Bot

[iOS][Settings] Adds IsSmallDevice method to UI Util

This CL adds a method to UI Util to identify small devices.
A device is considered as a small if its logical width is less than or
equal to 375.

Bug: 922511
Change-Id: I3308d770f2ef502a088743ede9e81dcd0cb698ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2554997
Commit-Queue: Ewann Pellé <ewannpv@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830969}
parent 75b464e6
......@@ -26,6 +26,11 @@ CGFloat CurrentScreenWidth();
// Returns true if the device is an iPhone X.
bool IsIPhoneX();
// Returns true if the device is considered as a small device.
// TODO(crbug.com/1152730): Define what is called a small device & update this
// method.
bool IsSmallDevice();
// Returns the approximate corner radius of the current device.
CGFloat DeviceCornerRadius();
......
......@@ -38,6 +38,10 @@ bool IsIPhoneX() {
(height == 2436 || height == 2688 || height == 1792));
}
bool IsSmallDevice() {
return CurrentScreenWidth() <= 375;
}
CGFloat DeviceCornerRadius() {
return IsIPhoneX() ? 40.0 : 0.0;
}
......
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