-
Notifications
You must be signed in to change notification settings - Fork 1
/
Meteoconcs.cs
239 lines (214 loc) · 7.8 KB
/
Meteoconcs.cs
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
namespace Mikepenz.Typeface
{
using System;
using System.Collections.Generic;
using System.Linq;
using Android.Util;
using Mikepenz.Iconics.Typeface;
public class Meteoconcs : Java.Lang.Object, ITypeface
{
const string TtfFile = "meteocons.ttf";
static Android.Graphics.Typeface _typeface = null;
static Dictionary<string, Java.Lang.Character> _chars;
public IIcon GetIcon(string key)
{
return Icon.Values.ToList().Find(icon => icon.Name.Equals(key));
}
public IDictionary<string, Java.Lang.Character> Characters {
get {
return _chars ?? (_chars = Icon.Values.ToDictionary(icon => icon.Name, icon => new Java.Lang.Character(icon.Character)));
}
}
public string MappingPrefix {
get {
return "met";
}
}
public string FontName {
get {
return "Meteocons";
}
}
public string Version {
get {
return "1.1.1";
}
}
public int IconCount {
get {
return _chars.Count;
}
}
public ICollection<string> Icons {
get {
return Icon.Values.Select(icon => icon.Name).ToList();
}
}
public string Author {
get {
return "Alessio Atzeni";
}
}
public string Url {
get {
return "http://www.alessioatzeni.com/meteocons/";
}
}
public string Description {
get {
return "Meteocons is a set of weather icons, it containing 40+ icons available in PSD, CSH, EPS, SVG, Desktop font and Web font. All icon and updates are free and always will be.";
}
}
public string License {
get {
return "";
}
}
public string LicenseUrl {
get {
return "";
}
}
public Android.Graphics.Typeface GetTypeface(Android.Content.Context context)
{
if(_typeface == null) {
try {
_typeface = Android.Graphics.Typeface.CreateFromAsset(context.Assets, "fonts/" + TtfFile);
} catch(Exception e) {
var message = string.Format("Failed to load font file : {0} for {1} typeface. Reason: {2}", TtfFile, FontName, e.Message);
Log.Error("Iconics", message);
}
}
return _typeface;
}
public class Icon : Java.Lang.Object, IIcon
{
readonly char character;
readonly string name;
static ITypeface _typeFace;
public Icon(char character, string name)
{
this.character = character;
this.name = name;
}
public char Character {
get {
return this.character;
}
}
public string FormattedName {
get {
return "{" + this.name + "}";
}
}
public string Name {
get {
return this.name;
}
}
public ITypeface Typeface {
get {
return _typeFace ?? (_typeFace = new Meteoconcs());
}
}
public static readonly Icon MetWindyRainInv = new Icon('\ue800', "met_windy_rain_inv");
public static readonly Icon MetSnowInv = new Icon('\ue801', "met_snow_inv");
public static readonly Icon MetSnowHeavyInv = new Icon('\ue802', "met_snow_heavy_inv");
public static readonly Icon MetHailInv = new Icon('\ue803', "met_hail_inv");
public static readonly Icon MetCloudsInv = new Icon('\ue804', "met_clouds_inv");
public static readonly Icon MetCloudsFlashInv = new Icon('\ue805', "met_clouds_flash_inv");
public static readonly Icon MetTemperature = new Icon('\ue806', "met_temperature");
public static readonly Icon MetCompass = new Icon('\ue807', "met_compass");
public static readonly Icon MetNa = new Icon('\ue808', "met_na");
public static readonly Icon MetCelcius = new Icon('\ue809', "met_celcius");
public static readonly Icon MetFahrenheit = new Icon('\ue80a', "met_fahrenheit");
public static readonly Icon MetCloudsFlashAlt = new Icon('\ue80b', "met_clouds_flash_alt");
public static readonly Icon MetSunInv = new Icon('\ue80c', "met_sun_inv");
public static readonly Icon MetMoonInv = new Icon('\ue80d', "met_moon_inv");
public static readonly Icon MetCloudSunInv = new Icon('\ue80e', "met_cloud_sun_inv");
public static readonly Icon MetCloudMoonInv = new Icon('\ue80f', "met_cloud_moon_inv");
public static readonly Icon MetCloudInv = new Icon('\ue810', "met_cloud_inv");
public static readonly Icon MetCloudFlashInv = new Icon('\ue811', "met_cloud_flash_inv");
public static readonly Icon MetDrizzleInv = new Icon('\ue812', "met_drizzle_inv");
public static readonly Icon MetRainInv = new Icon('\ue813', "met_rain_inv");
public static readonly Icon MetWindyInv = new Icon('\ue814', "met_windy_inv");
public static readonly Icon MetSunrise = new Icon('\ue815', "met_sunrise");
public static readonly Icon MetSun = new Icon('\ue816', "met_sun");
public static readonly Icon MetMoon = new Icon('\ue817', "met_moon");
public static readonly Icon MetEclipse = new Icon('\ue818', "met_eclipse");
public static readonly Icon MetMist = new Icon('\ue819', "met_mist");
public static readonly Icon MetWind = new Icon('\ue81a', "met_wind");
public static readonly Icon MetSnowflake = new Icon('\ue81b', "met_snowflake");
public static readonly Icon MetCloudSun = new Icon('\ue81c', "met_cloud_sun");
public static readonly Icon MetCloudMoon = new Icon('\ue81d', "met_cloud_moon");
public static readonly Icon MetFogSun = new Icon('\ue81e', "met_fog_sun");
public static readonly Icon MetFogMoon = new Icon('\ue81f', "met_fog_moon");
public static readonly Icon MetFogCloud = new Icon('\ue820', "met_fog_cloud");
public static readonly Icon MetFog = new Icon('\ue821', "met_fog");
public static readonly Icon MetCloud = new Icon('\ue822', "met_cloud");
public static readonly Icon MetCloudFlash = new Icon('\ue823', "met_cloud_flash");
public static readonly Icon MetCloudFlashAlt = new Icon('\ue824', "met_cloud_flash_alt");
public static readonly Icon MetDrizzle = new Icon('\ue825', "met_drizzle");
public static readonly Icon MetRain = new Icon('\ue826', "met_rain");
public static readonly Icon MetWindy = new Icon('\ue827', "met_windy");
public static readonly Icon MetWindyRain = new Icon('\ue828', "met_windy_rain");
public static readonly Icon MetSnow = new Icon('\ue829', "met_snow");
public static readonly Icon MetSnowAlt = new Icon('\ue82a', "met_snow_alt");
public static readonly Icon MetSnowHeavy = new Icon('\ue82b', "met_snow_heavy");
public static readonly Icon MetHail = new Icon('\ue82c', "met_hail");
public static readonly Icon MetClouds = new Icon('\ue82d', "met_clouds");
public static readonly Icon MetCloudsFlash = new Icon('\ue82e', "met_clouds_flash");
public static IEnumerable<Icon> Values {
get {
yield return MetWindyRainInv;
yield return MetSnowInv;
yield return MetSnowHeavyInv;
yield return MetHailInv;
yield return MetCloudsInv;
yield return MetCloudsFlashInv;
yield return MetTemperature;
yield return MetCompass;
yield return MetNa;
yield return MetCelcius;
yield return MetFahrenheit;
yield return MetCloudsFlashAlt;
yield return MetSunInv;
yield return MetMoonInv;
yield return MetCloudSunInv;
yield return MetCloudMoonInv;
yield return MetCloudInv;
yield return MetCloudFlashInv;
yield return MetDrizzleInv;
yield return MetRainInv;
yield return MetWindyInv;
yield return MetSunrise;
yield return MetSun;
yield return MetMoon;
yield return MetEclipse;
yield return MetMist;
yield return MetWind;
yield return MetSnowflake;
yield return MetCloudSun;
yield return MetCloudMoon;
yield return MetFogSun;
yield return MetFogMoon;
yield return MetFogCloud;
yield return MetFog;
yield return MetCloud;
yield return MetCloudFlash;
yield return MetCloudFlashAlt;
yield return MetDrizzle;
yield return MetRain;
yield return MetWindy;
yield return MetWindyRain;
yield return MetSnow;
yield return MetSnowAlt;
yield return MetSnowHeavy;
yield return MetHail;
yield return MetClouds;
yield return MetCloudsFlash;
}
}
}
}
}