Update 'added in' text to handle multiple decimals
and say 'version' instead of 'api level' if there is a decimal.
Previously, it assumed that any string that didn't parse as
a number was a codename letter, so this was showing the 'preview'
message for support lib versions that have multiple decimals.
bug: 36489051

Change-Id: Id0fdb0094822069c849d547c8dbe807568640713
diff --git a/res/assets/templates/macros.cs b/res/assets/templates/macros.cs
index eae1d8d..dd46a55 100644
--- a/res/assets/templates/macros.cs
+++ b/res/assets/templates/macros.cs
@@ -249,8 +249,14 @@
 # print the API Level ?><?cs
 def:since_tags(obj) ?><?cs
 if:reference.apilevels && obj.since ?><?cs
-  if:obj.since > 0 ?>
-    added in <a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level <?cs var:obj.since ?></a><?cs
+  if:string.slice(obj.since,0,1) > 0 ?>
+    added in <?cs
+      if:string.find(obj.since,'.') > -1
+        ?><a href="<?cs var:toroot ?>topic/libraries/support-library/revisions.html">version<?cs
+      else
+        ?><a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level<?cs
+      /if ?><?cs
+    var:obj.since ?></a><?cs
   else ?>
     <b><a href="<?cs var:toroot ?>preview/">Android <?cs var:obj.since ?> Developer Preview</a></b><?cs
   /if?><?cs