Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: ios/chrome/share_extension/ui_util.mm

Issue 2617993002: Animate IOS Share extension button. (Closed)
Patch Set: feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/share_extension/ui_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <UIKit/UIKit.h> 5 #import <UIKit/UIKit.h>
6 6
7 #include "ios/chrome/share_extension/ui_util.h" 7 #include "ios/chrome/share_extension/ui_util.h"
8 8
9 #if !defined(__has_feature) || !__has_feature(objc_arc) 9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support." 10 #error "This file requires ARC support."
11 #endif 11 #endif
12 12
13 namespace ui_util { 13 namespace ui_util {
14 14
15 const CGFloat kAnimationDuration = 0.3;
16
15 CGFloat AlignValueToPixel(CGFloat value) { 17 CGFloat AlignValueToPixel(CGFloat value) {
16 CGFloat scale = [[UIScreen mainScreen] scale]; 18 CGFloat scale = [[UIScreen mainScreen] scale];
17 return floor(value * scale) / scale; 19 return floor(value * scale) / scale;
18 } 20 }
19 21
20 void ConstrainAllSidesOfViewToView(UIView* container, UIView* filler) { 22 void ConstrainAllSidesOfViewToView(UIView* container, UIView* filler) {
21 [NSLayoutConstraint activateConstraints:@[ 23 [NSLayoutConstraint activateConstraints:@[
22 [filler.leadingAnchor constraintEqualToAnchor:container.leadingAnchor], 24 [filler.leadingAnchor constraintEqualToAnchor:container.leadingAnchor],
23 [filler.trailingAnchor constraintEqualToAnchor:container.trailingAnchor], 25 [filler.trailingAnchor constraintEqualToAnchor:container.trailingAnchor],
24 [filler.topAnchor constraintEqualToAnchor:container.topAnchor], 26 [filler.topAnchor constraintEqualToAnchor:container.topAnchor],
25 [filler.bottomAnchor constraintEqualToAnchor:container.bottomAnchor], 27 [filler.bottomAnchor constraintEqualToAnchor:container.bottomAnchor],
26 ]]; 28 ]];
27 } 29 }
28 30
29 } // namespace ui_util 31 } // namespace ui_util
OLDNEW
« no previous file with comments | « ios/chrome/share_extension/ui_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698