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

Side by Side Diff: ios/chrome/browser/ui/fade_truncated_label.h

Issue 2588713002: Upstream Chrome on iOS source code [4/11]. (Closed)
Patch Set: Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2014 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_FADE_TRUNCATED_LABEL_H_
6 #define IOS_CHROME_BROWSER_UI_FADE_TRUNCATED_LABEL_H_
7
8 #import <UIKit/UIKit.h>
9
10 // A label class that applies a gradient fade to the end of a label whose bounds
11 // are too small to draw the entire string. This class uses a CAGradientLayer
12 // as a mask instead of clipping the drawing context of the label.
13 @interface FadeTruncatedLabel : UILabel
14
15 // Returns a CAGadientLayer to use as a label's masking layer that will apply
16 // a fade truncation if |text| takes up more space than |bounds| when drawn
17 // with |attributes|.
18 + (CAGradientLayer*)maskLayerForText:(NSString*)text
19 withAttributes:(NSDictionary*)attributes
20 inBounds:(CGRect)bounds;
21
22 // Adds animations from |beginFrame| to |endFrame| using the provided |duration|
23 // and |timingFunction|.
24 - (void)animateFromBeginFrame:(CGRect)beginFrame
25 toEndFrame:(CGRect)endFrame
26 duration:(CFTimeInterval)duration
27 timingFunction:(CAMediaTimingFunction*)timingFunction;
28
29 // Reverses animations added by
30 // |-animateFromBeginFrame:toEndFrame:duration:timingFunction:|.
31 - (void)reverseAnimations;
32
33 // Removes animations added by
34 // |-animateFromBeginFrame:toEndFrame:duration:timingFunction:|.
35 - (void)cleanUpAnimations;
36
37 @end
38
39 #endif // IOS_CHROME_BROWSER_UI_FADE_TRUNCATED_LABEL_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/external_file_remover.mm ('k') | ios/chrome/browser/ui/fade_truncated_label.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698