Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SearchStyleSheet.swift « Theme « Core « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 86afd4aeeeefd99284c10c199ce1b870e253e1e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
class SearchStyleSheet: IStyleSheet {
  static func register(theme: Theme, colors: IColors, fonts: IFonts) {
    theme.add(styleName: "SearchInstallButton") { (s) -> (Void) in
      s.cornerRadius = 10
      s.clip = true
      s.font = fonts.medium12
      s.fontColor = colors.blackSecondaryText
      s.backgroundColor = colors.bannerBackground
    }

    theme.add(styleName: "SearchBanner") { (s) -> (Void) in
      s.backgroundColor = colors.bannerBackground
    }

    theme.add(styleName: "SearchClosedBackground") { (s) -> (Void) in
      s.cornerRadius = 4
      s.backgroundColor = colors.blackHintText
    }

    theme.add(styleName: "SearchPopularView") { (s) -> (Void) in
      s.cornerRadius = 10
      s.backgroundColor = colors.linkBlueHighlighted
    }

    theme.add(styleName: "SearchSideAvaliableMarker") { (s) -> (Void) in
      s.backgroundColor = colors.ratingGreen
    }

    theme.add(styleName: "SearchBarView") { (s) -> (Void) in
      s.backgroundColor = colors.primary
      s.shadowRadius = 2
      s.shadowColor = UIColor(0,0,0, alpha26)
      s.shadowOpacity = 1
      s.shadowOffset = CGSize.zero
    }
    
    theme.add(styleName: "SearchFilterButtonActive") { (s) -> (Void) in
      s.backgroundColor = colors.linkBlue
      s.backgroundColorHighlighted = colors.linkBlueHighlighted
      s.fontColor = colors.white
      s.cornerRadius = 4
      s.font = fonts.regular17
    }

    theme.add(styleName: "SearchFilterButtonInActive") { (s) -> (Void) in
      s.backgroundColor = colors.clear
      s.backgroundColorHighlighted = colors.clear
      s.fontColor = colors.linkBlue
      s.cornerRadius = 4
      s.font = fonts.regular17
    }

    theme.add(styleName: "SearchCancelButtonActive") { (s) -> (Void) in
      s.tintColor = colors.white
      s.image = "ic_clear_filters"
      s.coloring = MWMButtonColoring.white
    }

    theme.add(styleName: "SearchCancelButtonInActive") { (s) -> (Void) in
      s.tintColor = colors.linkBlueHighlighted
      s.image = "ic_filter"
      s.coloring = MWMButtonColoring.blue
    }

    theme.add(styleName: "SearchChangeModeView") { (s) -> (Void) in
      s.backgroundColor = colors.pressBackground
      s.shadowRadius = 2
      s.shadowColor = UIColor(0, 0, 0, 0.24);
      s.shadowOffset = CGSize.zero
      s.shadowOpacity = 1
    }

    theme.add(styleName: "SearchSearchTextField") { (s) -> (Void) in
      s.fontColor = colors.blackSecondaryText
      s.backgroundColor = colors.white
      s.tintColor = colors.blackSecondaryText
    }

    theme.add(styleName: "SearchSearchTextFieldIcon") { (s) -> (Void) in
      s.tintColor = colors.blackSecondaryText
      s.color = colors.blackSecondaryText
    }

    theme.add(styleName: "FilterRatingButton") { (s) -> (Void) in
      s.cornerRadius = 4
      s.borderWidth = 1
      s.borderColor = colors.blackDividers
    }

    theme.add(styleName: "SearchFilterTypeCell") { (s) -> (Void) in
      s.cornerRadius = 16
      s.borderColor = colors.blackDividers
      s.borderWidth = 1
    }

    theme.add(styleName: "FilterCheckButton") { (s) -> (Void) in
      s.fontColor = colors.blackPrimaryText
      s.fontColorDisabled = colors.blackDividers
      s.backgroundColor = colors.white
      s.font = fonts.regular14
      s.cornerRadius = 4
      s.borderWidth = 1
      s.borderColor = colors.blackDividers
      s.textAlignment = .natural
    }

    theme.add(styleName: "SearchCellAds", from: "TableCell") { (s) -> (Void) in
      s.backgroundColor = colors.bannerBackground
    }

    theme.add(styleName: "SearchCellAvaliable", from: "TableCell") { (s) -> (Void) in
      s.backgroundColor = colors.transparentGreen
    }
  }
}