From: smain@google.com Date: Sat, 6 Feb 2016 01:34:22 +0000 (-0800) Subject: Revise API reference templates to make them compatible X-Git-Tag: android-x86-7.1-r1~178^2~25^2^2~56 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a0a6d3220f83251ae632fa4ed6555bb9040af3fa;p=android-x86%2Fbuild.git 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 7693c43c0..dd132243a 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 @@ h5, h6 { 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 @@ pre, code { -webkit-font-smoothing: subpixel-antialiased; -moz-osx-font-smoothing: auto; } -code { - background-color: #f7f7f7; - padding: 3px 5px; -} - legend { display: none; } @@ -1680,6 +1683,46 @@ pre { 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 @@ div#naMessage div { 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 @@ Page-Specific Styles 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 @@ links to summary tables) */ #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 @@ links to summary tables) */ } /* 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 @@ links to summary tables) */ 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 @@ links to summary tables) */ } /* 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 @@ links to summary tables) */ 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 @@ links to summary tables) */ .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 @@ body.google h4.jd-details-title { 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 @@ div.api-level { 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 e7b62d600..44a3110cc 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 @@ function changeApiLevel() { writeCookie(API_LEVEL_COOKIE, selectedLevel, null); if (selectedLevel < minLevel) { - var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class"; - $("#naMessage").show().html("

This " + thing + + $("#naMessage").show().html("

This API" + " requires API level " + minLevel + " or higher.

" + "

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 @@ function toggleInherited(linkObj, expand) { 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 @@ $.fn.scrollIntoView = function(target) { 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 @@ window.metadata.search = (function() { 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, diff --git a/tools/droiddoc/templates-sdk-dev/body_tag.cs b/tools/droiddoc/templates-sdk-dev/body_tag.cs new file mode 100644 index 000000000..5761b71f7 --- /dev/null +++ b/tools/droiddoc/templates-sdk-dev/body_tag.cs @@ -0,0 +1,15 @@ + +

diff --git a/tools/droiddoc/templates-sdk-dev/class.cs b/tools/droiddoc/templates-sdk-dev/class.cs index d8d723618..285ffec92 100644 --- a/tools/droiddoc/templates-sdk-dev/class.cs +++ b/tools/droiddoc/templates-sdk-dev/class.cs @@ -1,258 +1,105 @@ - + - devsite> - - - - - - -
- - - - - - - - - - - - - - - - - - -
-
Deprecated since API level - -
-
- - - - -
- - - - - -

- - - - - extends
- - - implements - - - - - - - - -
- -
- -
- - - - - - - - - - - -
   ↳
- - - - -
-Known Direct Subclasses - -
- - - -
-Known Indirect Subclasses - -
- - -
- - -

Class Overview

-

- - - - -
- - - - - + + , + + + - - - - - - - - - - - () - -
- - -
+ + + + + + + + + + + - - + + + () + + +

+

+ + + + - + - - - - - - - - - - - - - - - + + + + + + + + + +

+

+ + + + - + - - - - - - + + + + +

+

- + - - Attribute Name - Related Method - Description - - - - - - - - + + +   @@ -261,30 +108,220 @@ Summary: - + - - + + - - + + - - + -   - + +

  +

+ + + + + + + + +
+

+
+ + +
+
+    
+ + + +

Constant Value: + + + + + () + + +

+ + - + + + + + +
+

+
+
+ +
+
+      ()
+ + +
+ + + + + + + +

+ + + +

Related methods:

+
    + +
  • + +
+ + + + + + devsite> + + + + + +
+ + + +

+

+ + + + + + + + +
+ + + + + extends + + + implements + + , + + + + + +

+ + + + + + + + + + +
   ↳ +
+ + +
+ Known Direct Subclasses + +
+ + +
+ Known Indirect Subclasses + +
+ +

+ + +

+ -
- + + + -

Summary

+

Summary

- +
Nested Classes
+ -

Nested classes

+
XML Attributes
+ @@ -318,15 +357,17 @@ Summary: -

XML attributes

+
- [Expand] -
Inherited XML Attributes
+ -

Inherited XML attributes

-From - + +From + + + +
- - - - - - - - - -
-

- - - - - - - -

-
- - -
-
- - - -
- Constant Value: - - - - - - () - - -
- -
-
- - - - - - - - -
-

- - - - - - - - - () -

-
-
- -
-
- - -
-
- - - - - - - -
-

-

-
- - - -
-
Related Methods
-
    - -
  • - -
-
-
-
- - - - + -

XML Attributes

+

XML attributes

@@ -609,7 +570,7 @@ From -

Enum Values

+

Enum values

@@ -617,7 +578,7 @@ From -

Constants

+

Constants

@@ -625,7 +586,7 @@ From -

Fields

+

Fields

@@ -633,7 +594,7 @@ From -

Public Constructors

+

Public constructors

@@ -641,7 +602,7 @@ From -

Protected Constructors

+

Protected constructors

@@ -649,25 +610,22 @@ From -

Public Methods

+

Public methods

-

Protected Methods

+

Protected methods

- -
+ - - diff --git a/tools/droiddoc/templates-sdk-dev/classes.cs b/tools/droiddoc/templates-sdk-dev/classes.cs index 3bdfbeab5..48be3ef0c 100644 --- a/tools/droiddoc/templates-sdk-dev/classes.cs +++ b/tools/droiddoc/templates-sdk-dev/classes.cs @@ -1,32 +1,27 @@ - + + devsite> - - + -

-
+

These are the API classes. See all +API packages.

-
-

These are the Android API classes. See all API packages.

-
-    +
+   

- +
@@ -41,11 +36,7 @@
-
- - - diff --git a/tools/droiddoc/templates-sdk-dev/footer.cs b/tools/droiddoc/templates-sdk-dev/footer.cs index 78183013e..af34a1add 100644 --- a/tools/droiddoc/templates-sdk-dev/footer.cs +++ b/tools/droiddoc/templates-sdk-dev/footer.cs @@ -1,3 +1,4 @@ +