Revise API reference templates to make them compatible
with both DAC and DevSite. Includes a variety of cleanup and redesign.
Now prints method parameters and return values even if not documented in source.
Now prints return value data type.
Now prints method name as heading without arguments, then the full signature below.
New heading styles with more spacing and removed background color.

Change-Id: I7a991df5e8d0d7ac8ff81c20b4b4692e67eb88aa
diff --git a/tools/droiddoc/templates-sdk-dev/assets/css/default.css b/tools/droiddoc/templates-sdk-dev/assets/css/default.css
index 7693c43..dd13224 100644
--- a/tools/droiddoc/templates-sdk-dev/assets/css/default.css
+++ b/tools/droiddoc/templates-sdk-dev/assets/css/default.css
@@ -224,6 +224,14 @@
   margin: 0;
   padding: 4px 0 8px;
 }
+th>h3 {
+  font-size:inherit;
+  line-height:inherit;
+  font-weight:inherit;
+  margin:0;
+  padding:0;
+  color:inherit;
+}
 hr { /* applied to the bottom of h2 elements */
   height: 1px;
   margin: 7px 0 12px;
@@ -291,11 +299,6 @@
   -webkit-font-smoothing: subpixel-antialiased;
   -moz-osx-font-smoothing: auto;
 }
-code {
-  background-color: #f7f7f7;
-  padding: 3px 5px;
-}
-
 legend {
   display: none;
 }
@@ -1680,6 +1683,46 @@
   border: solid 1px #ddd;
   background: #f7f7f7;
 }
+
+p.package-name {
+  margin:1em 0;
+}
+
+h1.api-title {
+  padding-bottom:0;
+}
+
+h2.api-section {
+  margin: 60px 0 0;
+}
+
+h2.api-section+hr {
+  margin-bottom: 30px;
+}
+
+h3.api-name {
+  margin: 80px 0 12px;
+  padding: 0;
+}
+
+/* remove top padding when this h3 (visibly) follows an h2.
+   This accounts for the variation in structure,
+   including the collapsed mobile headings */
+h2+hr+div>div>a+div>h3.api-name,
+h2+hr+a+div>h3.api-name,
+h2+hr+a+h3.api-name {
+  margin-top: 0;
+}
+
+pre.api-signature,
+code.api-signature {
+  color:inherit;
+  padding:0;
+  margin:1em 0;
+  border:0;
+  background:transparent;
+}
+
 .str { color: #800; } /* Code string */
 .kwd { color: #008; }
 .typ { color: #606; }
@@ -2612,7 +2655,7 @@
   z-index:99;
   width:450px;
   position:fixed;
-  margin:50px 0;
+  margin:80px 0;
   padding:4em 4em 3em;
   background:#FFF;
   border:1px solid #999;
@@ -2877,19 +2920,6 @@
   padding:0 0 0 4px;
 }
 
-#jd-header {
-  padding: 0 0 12px;
-  margin: 20px 0 12px;
-  font-size:12px;
-  padding-bottom:12px;
-  border-bottom:solid 1px #ccc;
-}
-
-#jd-header h1 {
-  margin:0;
-  padding:0 0 6px 0;
-}
-
 /* not sure if this is needed in the ref docs, disabling for now
 .jd-descr h2 {
   margin:16px 0;
@@ -2910,12 +2940,11 @@
 #api-info-block {
   font-size:12px;
   margin:20px 0 0;
-  padding:0 10px 6px;
   font-weight:normal;
   float:right;
   text-align:right;
   color:#999;
-  max-width:80%;
+  max-width:300px;
   font-size: 12px;
   line-height:14px;
 }
@@ -2930,12 +2959,17 @@
 }
 
 /* inheritance table */
+table.inhtable>tbody>tr>td {
+  padding-left:0;
+}
+table.inhtable>tbody>tr>td div:first-of-type {
+  padding-left:12px;
+}
+
 .jd-inheritance-table {
   border-spacing:0;
-  margin:0;
+  margin:1em 0;
   padding:0;
-  font-size:12px;
-  line-height:14px;
   background-color:transparent;
 }
 .jd-inheritance-table tr td {
@@ -2945,23 +2979,13 @@
   background-color:transparent;
 }
 .jd-inheritance-table .jd-inheritance-space {
-  font-weight:bold;
-  width:1em;
+  width:2em;
 }
 .jd-inheritance-table .jd-inheritance-interface-cell {
   padding-left: 17px;
 }
 
 
-
-.jd-sumtable a {
-  text-decoration:none;
-}
-
-.jd-sumtable a:hover {
-  text-decoration:underline;
-}
-
 /* the link inside a sumtable for "Show All/Hide All" */
 .toggle-all {
   display:block;
@@ -2971,11 +2995,10 @@
 }
 
 /* adjustments for in/direct subclasses tables */
-.jd-sumtable.jd-sumtable-subclasses {
+.jd-sumtable-subclasses {
   margin: 1em 0 0 0;
   max-width:968px;
   background-color:transparent;
-  font-size:13px;
 }
 
 /* extra space between end of method name and open-paren */
@@ -2983,11 +3006,6 @@
   margin-right: 2px;
 }
 
-/* right alignment for the return type in sumtable */
-.jd-sumtable .jd-typecol {
-  text-align:right;
-}
-
 /* adjustments for the expando table-in-table */
 .jd-sumtable-expando {
   margin:.5em 0;
@@ -3008,7 +3026,9 @@
 
 .jd-sumtable-subclasses div#subclasses-direct,
 .jd-sumtable-subclasses div#subclasses-indirect {
-  margin:0 0 0 13px;
+  /* left margin matches width of the toggle image,
+     so this section aligns with the text above */
+  margin:0 0 0 34px;
 }
 
 
@@ -3077,10 +3097,6 @@
   padding-top:5px;
   border-top: 1px solid #ccc;
 }
-body.google table.jd-sumtable th {
-  background-color: #FFF;
-  color:#000;
-}
 
 h4.jd-tagtitle {
   padding:0;
@@ -3124,7 +3140,7 @@
   color:#999;
   float:right;
   padding:0 8px 0;
-  margin-top:-30px;
+  margin-top:-35px;
 }
 
 table.jd-tagtable td,
diff --git a/tools/droiddoc/templates-sdk-dev/assets/js/docs.js b/tools/droiddoc/templates-sdk-dev/assets/js/docs.js
index e7b62d6..44a3110 100644
--- a/tools/droiddoc/templates-sdk-dev/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk-dev/assets/js/docs.js
@@ -875,8 +875,7 @@
   writeCookie(API_LEVEL_COOKIE, selectedLevel, null);
 
   if (selectedLevel < minLevel) {
-    var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class";
-    $("#naMessage").show().html("<div><p><strong>This " + thing +
+    $("#naMessage").show().html("<div><p><strong>This API" +
               " requires API level " + minLevel + " or higher.</strong></p>" +
               "<p>This document is hidden because your selected API level for the documentation is " +
               selectedLevel + ". You can change the documentation API level with the selector " +
@@ -1104,13 +1103,13 @@
   if ((expand == null && a.hasClass("closed")) || expand) {
     list.style.display = "none";
     summary.style.display = "block";
-    trigger.src = toRoot + "assets/images/triangle-opened.png";
+    trigger.src = toRoot + "assets/images/styles/disclosure_up.png";
     a.removeClass("closed");
     a.addClass("opened");
   } else if ((expand == null && a.hasClass("opened")) || (expand == false)) {
     list.style.display = "block";
     summary.style.display = "none";
-    trigger.src = toRoot + "assets/images/triangle-closed.png";
+    trigger.src = toRoot + "assets/images/styles/disclosure_down.png";
     a.removeClass("opened");
     a.addClass("closed");
   }
@@ -4379,9 +4378,9 @@
         selected = navEl.find('> li.guides > a').addClass('selected');
       } else if (body.hasClass('reference')) {
         selected = navEl.find('> li.reference > a').addClass('selected');
-      } else if (body.hasClass('samples')) { 
+      } else if (body.hasClass('samples')) {
         selected = navEl.find('> li.samples > a').addClass('selected');
-      } else if (body.hasClass('downloads')) { 
+      } else if (body.hasClass('downloads')) {
         selected = navEl.find('> li.downloads > a').addClass('selected');
       }
     } else if (body.hasClass('design')) {
@@ -4986,7 +4985,7 @@
       var noBoundaries = (NO_BOUNDARY_LANGUAGES.indexOf(window.getLangPref()) !== -1);
       var exprBoundary = (!isAsciiOnly && noBoundaries) ? '' : '(?:^|\\s)';
       var queryRegex = new RegExp(exprBoundary + query.toLowerCase(), 'g');
-        
+
       var all = METADATA.all;
       for (var i = 0; i < all.length; i++) {
         // current search comparison, with counters for tag and title,