-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1936 from artsy/ashfurrow-fair-search
Re-applies fair search design
- Loading branch information
Showing
8 changed files
with
119 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Artsy/View_Controllers/Search/ARSearchViewControllerStyling.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#import <UIKit/UIKit.h> | ||
|
||
typedef NS_ENUM(NSInteger, ARSearchViewControllerStylingMode) { | ||
ARSearchViewControllerStylingModeMainScreen, | ||
ARSearchViewControllerStylingModeFair | ||
}; | ||
|
||
@interface ARSearchViewControllerStyling : NSObject | ||
|
||
- (NSString *)topLayoutConstraintForStyleMode:(ARSearchViewControllerStylingMode)styleMode; | ||
- (NSString *)searchIconLeadingConstraintForStyleMode:(ARSearchViewControllerStylingMode)styleMode; | ||
- (UIColor *)searchIconTintColorForStyleMode:(ARSearchViewControllerStylingMode)styleMode; | ||
- (NSAttributedString *)closeButtonAttribtedTextForStyleMode:(ARSearchViewControllerStylingMode)styleMode; | ||
- (void)constrainTableView:(UITableView *)tableView toContentView:(UIView *)contentView forStyleMode:(ARSearchViewControllerStylingMode)styleMode; | ||
|
||
@end |
67 changes: 67 additions & 0 deletions
67
Artsy/View_Controllers/Search/ARSearchViewControllerStyling.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#import "ARSearchViewControllerStyling.h" | ||
#import "UIDevice-Hardware.h" | ||
|
||
@import FLKAutoLayout; | ||
@import Artsy_UIFonts; | ||
@import Artsy_UIColors; | ||
|
||
@implementation ARSearchViewControllerStyling | ||
|
||
- (NSString *)topLayoutConstraintForStyleMode:(ARSearchViewControllerStylingMode)styleMode { | ||
switch (styleMode) { | ||
case ARSearchViewControllerStylingModeMainScreen: | ||
return @"70"; | ||
case ARSearchViewControllerStylingModeFair: | ||
return @"24"; | ||
} | ||
} | ||
|
||
- (NSString *)searchIconLeadingConstraintForStyleMode:(ARSearchViewControllerStylingMode)styleMode { | ||
switch (styleMode) { | ||
case ARSearchViewControllerStylingModeMainScreen: | ||
return @"30"; | ||
case ARSearchViewControllerStylingModeFair: | ||
return @"10"; | ||
} | ||
} | ||
|
||
- (UIColor *)searchIconTintColorForStyleMode:(ARSearchViewControllerStylingMode)styleMode { | ||
switch (styleMode) { | ||
case ARSearchViewControllerStylingModeMainScreen: | ||
return [UIColor whiteColor]; | ||
case ARSearchViewControllerStylingModeFair: | ||
return [UIColor artsyGraySemibold]; | ||
} | ||
} | ||
|
||
- (NSAttributedString *)closeButtonAttribtedTextForStyleMode:(ARSearchViewControllerStylingMode)styleMode { | ||
UIColor *textColor; | ||
|
||
switch (styleMode) { | ||
case ARSearchViewControllerStylingModeMainScreen: | ||
textColor = [UIColor whiteColor]; | ||
break; | ||
case ARSearchViewControllerStylingModeFair: | ||
textColor = [UIColor artsyGraySemibold]; | ||
break; | ||
} | ||
|
||
return [[NSAttributedString alloc] initWithString:@"CLOSE" attributes:@{ | ||
NSKernAttributeName : @1, | ||
NSFontAttributeName : [UIFont sansSerifFontWithSize:[UIDevice isPad] ? 13 : 10], | ||
NSForegroundColorAttributeName : textColor, | ||
}]; | ||
} | ||
|
||
- (void)constrainTableView:(UITableView *)tableView toContentView:(UIView *)contentView forStyleMode:(ARSearchViewControllerStylingMode)styleMode { | ||
switch (styleMode) { | ||
case ARSearchViewControllerStylingModeMainScreen: | ||
[tableView alignTop:@"10" leading:@"10" bottom:@"0" trailing:@"10" toView:contentView]; | ||
break; | ||
case ARSearchViewControllerStylingModeFair: | ||
[tableView alignToView:contentView]; | ||
break; | ||
} | ||
} | ||
|
||
@end |
Binary file modified
BIN
-343 Bytes
(99%)
...enceImages/ARFairViewControllerSpec/with_a_map_search_view_looks_correct@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters