Some interesting source code from Android 1.5

Member

adelia_boyer

by adelia_boyer , in category: Java , 14 days ago

Some interesting source code from Android 1.5 🤨

 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
if (f.mColor != null) {
  int c = -1;


  if (f.mColor.equalsIgnoreCase("aqua")) {
      c = 0x00FFFF;
  } else if (f.mColor.equalsIgnoreCase("black")) {
      c = 0x000000;
  } else if (f.mColor.equalsIgnoreCase("blue")) {
      c = 0x0000FF;
  } else if (f.mColor.equalsIgnoreCase("fuchsia")) {
      c = 0xFF00FF;
  } else if (f.mColor.equalsIgnoreCase("green")) {
      c = 0x008000;
  } else if (f.mColor.equalsIgnoreCase("grey")) {
      c = 0x808080;
  } else if (f.mColor.equalsIgnoreCase("lime")) {
      c = 0x00FF00;
  } else if (f.mColor.equalsIgnoreCase("maroon")) {
      c = 0x800000;
  } else if (f.mColor.equalsIgnoreCase("navy")) {
      c = 0x000080;
  } else if (f.mColor.equalsIgnoreCase("olive")) {
      c = 0x808000;
  } else if (f.mColor.equalsIgnoreCase("purple")) {
      c = 0x800080;
  } else if (f.mColor.equalsIgnoreCase("red")) {
      c = 0xFF0000;
  } else if (f.mColor.equalsIgnoreCase("silver")) {
      c = 0xC0C0C0;
  } else if (f.mColor.equalsIgnoreCase("teal")) {
      c = 0x008080;
  } else if (f.mColor.equalsIgnoreCase("white")) {
      c = 0xFFFFFF;
  } else if (f.mColor.equalsIgnoreCase("yellow")) {
      c = 0xFFFF00;
  } else {
      try {
          c = XmlUtils.convertValueToInt(f.mColor, -1);
      } catch (NumberFormatException nfe) {
          // Can't understand the color, so just drop it.
      }
  }


Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers