OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION
_UTILS_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION
_UTILS_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 namespace content_suggestions { |
| 11 |
| 12 // Returns the maximum number of tiles fitting in |availableWidth|, limited to |
| 13 // 4. |
| 14 NSUInteger numberOfTilesForWidth(CGFloat availableWidth); |
| 15 // Returns the spacing between tiles, based on the device. |
| 16 CGFloat spacingBetweenTiles(); |
| 17 |
| 18 // iPhone landscape uses a slightly different layout for the doodle and search |
| 19 // field frame. Returns the proper frame from |frames| based on orientation, |
| 20 // centered in the view of |width|. |
| 21 CGRect getOrientationFrame(const CGRect frames[], CGFloat width); |
| 22 // Returns x-offset in order to have the tiles centered in a view with a |
| 23 // |width|. |
| 24 CGFloat centeredTilesMarginForWidth(CGFloat width); |
| 25 // Returns the proper frame for the doodle inside a view with a |width|. |
| 26 // |logoIsShowing| refers to the Google logo or the doodle. |
| 27 CGRect doodleFrame(CGFloat width, BOOL logoIsShowing); |
| 28 // Returns the proper frame for the search field inside a view with a |width|. |
| 29 // |logoIsShowing| refers to the Google logo or the doodle. |
| 30 CGRect searchFieldFrame(CGFloat width, BOOL logoIsShowing); |
| 31 // Returns the expected height of the NewTabPageHeaderView inside a view with a |
| 32 // |width|. |logoIsShowing| refers to the Google logo or the doodle. |
| 33 // |promoCanShow| represents whether a what's new promo can be displayed. |
| 34 CGFloat heightForLogoHeader(CGFloat width, |
| 35 BOOL logoIsShowing, |
| 36 BOOL promoCanShow); |
| 37 |
| 38 } // namespace content_suggestions |
| 39 |
| 40 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECT
ION_UTILS_H_ |
OLD | NEW |