Code drop from //branches/cupcake/...@124589
diff --git a/tools/droiddoc/templates/assets/android-developer-core.css b/tools/droiddoc/templates/assets/android-developer-core.css
index 3fb6960..eeedc7f 100644
--- a/tools/droiddoc/templates/assets/android-developer-core.css
+++ b/tools/droiddoc/templates/assets/android-developer-core.css
@@ -4,12 +4,23 @@
info: core developer styles (developer.android.com)
*/
-@import url("http://www.google.com/css/goog.css");
-@import url("http://www.google.com/css/inlay.css");
+
+/* RESET STYLES */
+
+html,body,div,h1,h2,h3,h4,h5,h6,p,img,
+dl,dt,dd,ol,ul,li,table,caption,tbody,
+tfoot,thead,tr,th,td,form,fieldset,
+embed,object,applet {
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
/* BASICS */
body {
+ font-family:arial,sans-serif;
+ color:#000;
font-size:13px;
color:#333;
overflow:hidden;
@@ -19,17 +30,47 @@
background-repeat:repeat-x;
}
+a, a code {
+ color:#00c;
+}
+
+a:active,
+a:active code {
+ color:#f00;
+}
+
+a:visited,
+a:visited code {
+ color:#551a8b;
+}
+
+input, select,
+textarea, option {
+ font-family:inherit;
+ font-size:inherit;
+}
+
+p {
+ padding:0;
+ margin:0 0 1em;
+}
+
code, pre {
color:#007000;
font-family:monospace;
line-height:1em;
}
+var {
+ color:#007000;
+ font-style:italic;
+}
+
pre {
- border:1px solid #5B7957;
+ border:1px solid #ccc;
background-color:#fafafa;
padding:10px;
- margin:0 0 1em;
+ margin:0 0 1em 1em;
overflow:auto;
}
@@ -43,55 +84,66 @@
}
ul,ol {
- margin:0;
- padding:0 0 1em 2em;
-}
-
-dl {
- margin:0;
- padding:0;
-}
-
-dt {
- font-weight:bold;
- margin:0;
- padding:0 0 .5em;
-}
-
-dd {
- font-weight:normal;
- margin:0;
- padding:0 0 .5em 1em;
-}
-
-li p, li pre, li table, li img,
-dd p, dd pre, dd table, dd img {
- margin:.5em 0 0;
+ margin:0 0 .8em;
+ padding:0 0 0 2em;
}
li {
padding:0 0 .5em;
}
+dl {
+ margin:0 0 1em 0;
+ padding:0;
+}
+
+dt {
+ margin:0;
+ padding:0;
+}
+
+dd {
+ margin:0 0 1em;
+ padding:0 0 0 2em;
+}
+
+li p, dd p {
+ margin:1em 0 0;
+}
+
+li pre, li table, li img,
+dd pre, dd table, dd img {
+ margin:1em 0 0 1em;
+}
+
li ul,
li ol {
- padding: .5em 0 0 2em;
+ margin:.5em 0 0 0;
+ padding: 0 0 0 2em;
}
-dl dl {
- padding:.5em 0 0;
+dl li {
+ padding:.5em 0 0 0;
}
-li p {
+dl dl,
+ol dl,
+ul dl {
+ margin:0 0 1em;
padding:0;
}
table {
+ font-size:1em;
margin:0 0 1em;
+ padding:0;
+ border-collapse:collapse;
+ border-width:0;
+ empty-cells:show;
}
td,th {
- border:1px solid #666;
+ border:1px solid #ccc;
padding:6px 12px;
text-align:left;
vertical-align:top;
@@ -99,17 +151,7 @@
}
th {
- background-color:#ccc;
-}
-
-a code {
- color:#00c;
-}
-a:active code {
- color:#f00;
-}
-a:visited code {
- color:#551a8b;
+ background-color:#dee8f1;
}
hr.blue {
@@ -124,6 +166,7 @@
margin:0;
position:fixed;
top:103px;
+ width:100%;
}
#header {
@@ -131,25 +174,21 @@
height: 100px;
position:relative;
z-index:100;
- min-width:730px;
-}
-
-#header img {
- padding:0;
+ min-width:620px;
}
#headerLeft{
- float:left;
+ position:absolute;
border:none;
- width:1px;
margin:20px 0 0 10px;
overflow:visible;
+ font-size: 36px;
}
#headerRight {
float:right;
border:none;
- width:715px;
+ width:615px;
height:100px;
}
@@ -162,10 +201,11 @@
height: 32px;
position:absolute;
bottom:0;
+ right:0;
}
#header li {
- float: right;
+ float: left;
margin: 0px 5px 0px 0px;
padding:0;
}
@@ -180,9 +220,8 @@
font-weight: normal;
width: 96px;
height: 32px;
- padding-top: 9px;
text-align: center;
- margin: 0px 0px 0px 0px;
+ margin: 0px;
}
#header li a:hover {
@@ -191,18 +230,34 @@
color: #fff;
}
+#header li a span {
+ position:relative;
+ top:9px;
+}
+
/* TAB HIGHLIGHTING */
-.home #home-link,
-.publish #publish-link,
-.guide #guide-link,
-.reference #reference-link,
-.sdk #sdk-link,
-.community #community-link,
-.about #about-link {
+.home #home-link a,
+.publish #publish-link a,
+.guide #guide-link a,
+.reference #reference-link a,
+.sdk #sdk-link a,
+.community #community-link a,
+.about #about-link a {
background-image: url(images/tab_selected.png);
background-repeat: no-repeat;
color: #fff;
font-weight: bold;
+ cursor:default;
+}
+
+.home #home-link a:hover,
+.publish #publish-link a:hover,
+.guide #guide-link a:hover,
+.reference #reference-link a:hover,
+.sdk #sdk-link a:hover,
+.community #community-link a:hover,
+.about #about-link a:hover {
+ background-image: url(images/tab_selected.png);
}
#headerLinks {
@@ -234,10 +289,9 @@
/* main */
#mainBodyFixed {
- float: left;
- margin: 20px;
+ margin: 20px auto;
color: #333;
- min-width:920px;
+ width:920px;
}
#mainBodyFixed h3 {
@@ -254,7 +308,14 @@
padding-bottom:.5em;
}
-#mainBodyFixed .green {
+#mainBodyFixed h1 {
+ color:#435A6E;
+ font-size:1.7em;
+ margin: 1em 0;
+}
+
+#mainBodyFixed .green,
+#jd-content .green {
color:#7BB026;
background-color:none;
}
@@ -322,7 +383,7 @@
text-align:left;
}
-#mainBodyRight td.blueBorderBox {
+#mainBodyRight .blueBorderBox {
border:5px solid #ddf0f2;
padding:18px 18px 18px 18px;
text-align:left;
@@ -389,28 +450,25 @@
}
.groupTable {
- width: 95%;
+ width: 100%;
}
.groupTable th {
- padding: 10px 20px 10px 20px;
+ padding: 10px;
color: #ffffff;
background-color: #6D8293;
border: 2px solid #fff;
}
-.groupTable .oddRow td {
- padding: 20px 28px 20px 28px;
+.groupTable td {
+ padding: 10px;
color: #333333;
background-color: #d9d9d9;
border: 2px solid #fff;
}
.groupTable .evenRow td {
- padding: 20px 28px 20px 28px;
- color: #333333;
background-color: #ededed;
- border: 2px solid #fff;
}
span.BigBlue {
@@ -496,7 +554,7 @@
color:#0000cc;
}
#search_filtered .jd-selected {
- background-color: #7BB026;
+ background-color: #A4C639;
cursor:pointer;
}
#search_filtered .jd-selected,
@@ -514,10 +572,10 @@
padding-right: 6px;
padding-top: 1px;
padding-bottom: 1px;
- font-size: 80%;
+ font-size: .8em;
border: none;
margin: 0;
- line-height: 105%;
+ line-height: 1.05em;
}
.show-row {
@@ -608,7 +666,7 @@
border:1px solid #BCCDF0;
width:99%;
padding-left:2px;
- font-size:95%;
+ font-size:.95em;
}
td.gsc-search-button {
@@ -721,17 +779,19 @@
#app-list img {
width:90px;
height:70px;
- padding:0;
+ margin:0;
}
#app-list a.selected,
-.app-list a:active.selected,
-.app-list a:hover.selected {
+#app-list a:active.selected,
+#app-list a:hover.selected {
background:#A4C639;
color:#fff;
+ cursor:default;
+ text-decoration:none;
}
#app-list a:hover,
-.app-list a:active {
+#app-list a:active {
background:#ff9900;
text-decoration:underline;
}
@@ -751,7 +811,7 @@
}
#carouselMain img {
- padding:0;
+ margin:0;
}
/*carousel bulletin layouts*/
@@ -792,3 +852,4 @@
}
+
diff --git a/tools/droiddoc/templates/assets/android-developer-docs-devguide.css b/tools/droiddoc/templates/assets/android-developer-docs-devguide.css
new file mode 100644
index 0000000..d8bd3b3
--- /dev/null
+++ b/tools/droiddoc/templates/assets/android-developer-docs-devguide.css
@@ -0,0 +1,19 @@
+
+@import url("android-developer-docs.css");
+
+/* Page title */
+
+#jd-header h1 {
+ padding: 8px 0 0 0;
+}
+
+/* Page content container */
+
+#jd-header table {
+margin: 0 0 1em 1em;
+}
+
+#jd-content table table,
+#jd-content table img {
+ margin:1em 0;
+}
\ No newline at end of file
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.css b/tools/droiddoc/templates/assets/android-developer-docs.css
old mode 100755
new mode 100644
index 5be4df0..cfbcc75
--- a/tools/droiddoc/templates/assets/android-developer-docs.css
+++ b/tools/droiddoc/templates/assets/android-developer-docs.css
@@ -15,7 +15,7 @@
color:#336666;
margin:0;
padding: 5px 10px;
- font-size: 100%;
+ font-size: 1em;
line-height: 15px;
}
@@ -26,29 +26,23 @@
padding:0 0 0 15px;
}
-#crumb {
- font-size:95%;
- padding:5px 20px;
- float:right;
- color:#336666;
-}
-
/* SIDE NAVIGATION */
#side-nav {
padding:0 6px 0 0;
background-color: #fff;
+ font-size:12px;
}
#resize-packages-nav {
/* keeps the resize handle below the h-scroll handle */
- height:200px;
+ height:270px;
overflow:hidden;
max-height:100%;
}
#packages-nav {
- height:200px;
+ height:270px;
max-height:inherit;
position:relative;
overflow:auto;
@@ -57,6 +51,7 @@
#classes-nav,
#devdoc-nav {
overflow:auto;
+ position:relative;
}
#side-nav ul {
@@ -66,25 +61,30 @@
}
#side-nav ul ul {
- margin: 0;
+ margin: .35em 0 0 0;
padding: 0;
}
#side-nav li {
- padding: 1px 0 2px 0;
- line-height:1.1em;
+ padding:0;
+ line-height:16px;
white-space:nowrap;
}
#side-nav li h2 {
- font-size: 100%;
+ font-size:12px;
font-weight: bold;
- margin: 0;
- padding: 8px 0 0 10px;
+ margin:.5em 0 0 0;
+ padding: 3px 0 1px 9px;
}
#side-nav li a {
- padding: 0 0 0 11px;
+ text-decoration:none;
+ padding: 0 0 0 18px;
+}
+
+#side-nav li a:hover {
+ text-decoration:underline;
}
#side-nav li a+a {
@@ -93,23 +93,55 @@
#side-nav li li li a {
/*sdk lists*/
- padding: 0 0 0 25px;
+ padding: 0 0 0 28px;
}
#side-nav .selected {
- background-color: #97a2ac;
+ background-color: #435a6e;
color: #fff;
font-weight:bold;
}
#side-nav .selected a {
color: #fff;
+ text-decoration:none;
}
#side-nav strong {
display:block;
}
+#side-nav .toggle-img {
+ margin:0;
+ padding:0;
+ position:absolute;
+ top:0;
+ left:0;
+ height:16px;
+ width:15px;
+ outline-style:none;
+}
+
+#side-nav .closed .toggle-img {
+ background:url('images/triangle-closed-small.png') 7px 4px no-repeat;
+}
+#side-nav .open .toggle-img {
+ background:url('images/triangle-opened-small.png') 7px 4px no-repeat;
+}
+
+#side-nav .toggle-list {
+ position:relative;
+}
+
+#side-nav .toggle-list ul {
+ margin:0;
+ display:none;
+}
+
+#side-nav .toggle-list div {
+ display:block;
+}
+
#index-links .selected {
background-color: #fff;
color: #000;
@@ -121,6 +153,53 @@
padding:7px 0 4px 10px;
}
+/* nav tree */
+
+#nav-tree ul {
+ padding:5px 0 1.5em;
+}
+
+#side-nav #nav-tree ul li a,
+#side-nav #nav-tree ul li span.no-children {
+ padding: 0 0 0 0;
+ margin: 0;
+}
+
+#nav-tree .plus {
+ margin: 0 3px 0 0;
+}
+
+#nav-tree ul ul {
+ list-style: none;
+ margin: 0;
+ padding: 0 0 0 0;
+}
+
+#nav-tree ul li {
+ margin: 0;
+ padding: 0 0 0 0;
+ white-space: nowrap;
+}
+
+#nav-tree .children_ul {
+ margin:0;
+}
+
+#nav-tree a.nolink {
+ color: black;
+ text-decoration: none;
+}
+
+#nav-tree span.label {
+ width: 100%;
+}
+
+#nav-tree {
+ overflow-x: auto;
+ overflow-y: scroll;
+}
+
+
/* DOCUMENT BODY */
#doc-content {
@@ -128,13 +207,29 @@
}
#jd-header {
- background-color: #9bb0c3;
- padding: 10px 20px;
+ background-color: #E9E9E9;
+ padding: 7px 20px;
}
#jd-header h1 {
margin: 0 0 10px;
- font-size:160%;
+ font-size:1.7em;
+}
+
+#jd-header .crumb {
+ font-size:.9em;
+ line-height:1em;
+ color:#777;
+}
+
+#jd-header .crumb a,
+#jd-header .crumb a:visited {
+ text-decoration:none;
+ color:#777;
+}
+
+#jd-header .crumb a:hover {
+ text-decoration:underline;
}
#jd-header table {
@@ -148,13 +243,22 @@
vertical-align:top;
}
+#jd-header.guide-header {
+ background-color:#fff;
+ color:#435a6e;
+ height:50px;
+}
+
+#jd-descr {
+ position:relative;
+}
/* inheritance table */
.jd-inheritance-table {
border-spacing:0;
margin:0;
padding:0;
- font-size:90%;
+ font-size:.9em;
}
.jd-inheritance-table td {
border: none;
@@ -170,7 +274,7 @@
}
#jd-content {
- padding: 12px 20px;
+ padding: 18px 20px;
}
hr {
@@ -181,51 +285,60 @@
#jd-content h1 {
/*sdk page*/
- font-size:160%;
+ font-size:1.6em;
color:#336666;
margin:0 0 .5em;
}
#jd-content h2 {
- font-size:140%;
- background-color: #97a2ac;
- border-right:20px solid #97a2ac;
- position:relative;
- left:-20px;
- width:100%;
- padding: 8px 0 8px 20px;
- z-index:-1;
+ font-size:1.45em;
+ color:#111;
+ border-top:2px solid #ccc;
+ padding: .5em 0 0;
+ margin: 1.75em 0 1em 0;
+ max-width:968px;
}
#jd-content h3 {
- font-size:130%;
- border-top: 3px solid #97a2ac;
- padding:3px 0 5px;
+ font-size:1.2em;
+ color:#222;
+ padding: .75em 0 .65em 0;
+ margin:0;
}
#jd-content h4 {
- font-size:110%;
+ font-size:1.1em;
margin-bottom:.5em;
+ color:#222;
}
-img {
- padding:0 0 1em 0;
+#jd-content .small-header {
+ font-size:1em;
+ color:#000;
+ font-weight:bold;
+ border:none;
+ padding:0;
+ margin:1em 0 .5em;
+ position:inherit;
+}
+
+#jd-content img {
+ margin: 0 0 1em 1em;
}
#jd-content li img,
#jd-content dd img {
- margin:.5em 0 0;
- padding:0;
+ margin:.5em 0 0 1em;
}
.nolist {
list-style:none;
- padding:0 0 1em;
- margin:0 0 0 1em;
+ padding:0;
+ margin:0 0 1em 1em;
}
h4 .normal {
- font-size:90%;
+ font-size:.9em;
font-weight:normal;
}
@@ -244,7 +357,7 @@
}
h4.jd-details-title {
- font-size:115%;
+ font-size:1.15em;
background-color: #d6d6d6;
margin:0 0 .6em;
padding:3px;
@@ -275,43 +388,9 @@
font-style:italic;
}
-.sidebox-wrapper {
- float: right;
- width:300px;
- background-color:#fff;
- padding-left:15px;
-}
-
-.sidebox-inner {
- border-left:2px solid #7BB026;
- padding:0 5px 0 15px;
-}
-
-.sidebox {
- float: right;
- width:300px;
- background-color:#fff;
- border-left:2px solid #7BB026;
- margin-left:15px;
- padding:0 5px 0 15px;
-}
-
-#jd-content .sidebox h2,
-#jd-content .sidebox h3,
-#jd-content .sidebox-inner h2,
-#jd-content .sidebox-inner h3 {
- background-color:#fff;
- border:none;
- font-size:110%;
- margin:0;
- padding:0 0 10px;
- left:0;
- z-index:0;
-}
-
#jd-content table h2 {
background-color: #d6d6d6;
- font-size: 110%;
+ font-size: 1.1em;
margin:0 0 10px;
padding:5px;
left:0;
@@ -319,25 +398,46 @@
}
div.special {
- padding: 10px 25px 0;
+ padding: 15px 20px 3px;
margin: 0 0 1em;
background-color: #ddf0f2;
}
+div.special p {
+ margin: .25em 0;
+}
+
+div.special ol {
+ margin: 0;
+}
+
+div.special ol li {
+ margin: 0;
+ padding: 0;
+}
+
+#jd-content div.special h2,
#jd-content div.special h3 {
color:#669999;
- font-size:120%;
+ font-size:1.2em;
border:none;
margin:0 0 .5em;
+ padding:0;
}
-p.note, p.caution, p.warning {
+/* old p.note, p.caution, p.warning {
margin:0 0 1em;
padding: 4px 10px;
background-color: #efefef;
border-top: 1px solid;
border-bottom: 1px solid;
}
+*/
+p.note, p.caution, p.warning {
+ margin: 1em;
+ padding: 0 0 0 .5em;
+ border-left: 4px solid;
+}
p.special-note {
background-color:#EBF3DB;
@@ -346,7 +446,7 @@
}
p.note {
- border-color: #3366CC;
+ border-color: #99aacc;
}
p.caution {
@@ -369,37 +469,208 @@
dl.xml dt {
font-variant:small-caps;
+ font-size:1.2em;
+}
+
+dl.xml dl {
+ padding:0;
+}
+
+dl.xml dl dt {
+ font-variant:normal;
+ font-size:1em;
+}
+
+.listhead li {
+ font-weight: bold;
+}
+
+.listhead li *, /*ie*/.listhead li li {
+ font-weight: normal;
+}
+
+ol.no-style,
+ul.no-style {
+ list-style:none;
+ padding-left:1em;
}
.new {
- font-size: 78%;
+ font-size: .78em;
font-weight: bold;
color: red;
text-decoration: none;
}
+pre.classic {
+ background-color:transparent;
+ border:none;
+ padding:0;
+}
+
+
+/* BEGIN quickview sidebar element styles */
+
+#qv-wrapper {
+ float: right;
+ position:relative;
+ width:315px;
+ background-color:#fff;
+ padding:4px 30px 15px 20px;
+ top:-55px;
+ left:20px;
+}
+
+#qv {
+ background-color:#fff;
+ border:4px solid #dee8f1;
+ margin:0 0 0 15px;
+ padding:0 6px 6px;
+ margin-top:0px;
+ width:295;
+ float:right;
+}
+
+#qv ol {
+ list-style:none;
+ padding: 0;
+}
+
+#qv ol ol{
+ list-style:none;
+ padding: 0 0 3px 12px;
+ margin:0;
+}
+
+#qv ul {
+ padding: 0 10px 0 2em;
+}
+
+#qv li {
+ padding: 0 10px;
+ margin: 2 0 0;
+ line-height: 1.2em;
+}
+
+#qv ul li {
+ padding: 0 10px 0 0;
+}
+
+#qv li.selected a {
+ color:#555;
+ text-decoration:none;
+}
+
+#qv a {
+ color:#cc6600;
+}
+
+#qv p {
+ margin:8px 0 0;
+ padding:0 10px;
+}
+
+#qv-extra #rule {
+ padding: 0 10px;
+ margin: 0;
+}
+
+#qv-sub-rule {
+ padding: 6px 20px;
+ margin: 0;
+}
+
+#qv-sub-rule p {
+ margin: 0;
+}
+
+#jd-content #qv h2 {
+ font-size:1.05em;
+ font-weight:bold;
+ margin:12px 0 .25em 0;
+ padding:0 10px;
+ background-color:transparent;
+ color:#7BB026;
+ border:none;
+ left:0;
+ z-index:1;
+}
+
+/* END quickview sidebar element styles */
+
+/* Begin sidebox sidebar element styles */
+
+.sidebox-wrapper {
+ float: right;
+ width:300px;
+ background-color:#fff;
+ margin: 0 0 0 15px;
+ padding: 5px 0 5px 15px;
+}
+
+.sidebox-inner {
+ border-left:1px solid #dee8f1;
+ background-color:#ffffee;
+ padding:0 5px 0 15px;
+}
+
+.sidebox {
+ float: right;
+ width:285px;
+ background-color:#ffffee;
+ border-left:1px solid #dee8f1;
+ margin: 0 0 0 15px;
+ padding:5px 8px 0 12px;
+}
+
+
+#jd-content .sidebox h2,
+#jd-content .sidebox h3,
+#jd-content .sidebox-inner h2,
+#jd-content .sidebox-inner h3 {
+ border:none;
+ font-size:1em;
+ margin:0;
+ padding:4px 0 4px;
+ left:0;
+ z-index:0;
+}
+
+.sidebox hr,
+.sidebox-inner hr {
+ background-color:#ccc;
+ border:none;
+}
+
+/* End sidebox sidebar element styles */
+
/* table of contents */
ol.toc {
- margin: 1em 0 0 0;
+ margin: 0 0 1em 0;
padding: 0;
list-style: none;
+ font-size:95%;
}
ol.toc li {
font-weight: bold;
- margin: .5em 0 0 1.5em;
+ margin: 0 0 .5em 1em;
padding: 0;
}
+ol.toc li p {
+ font-weight: normal;
+}
+
ol.toc li ol {
margin: 0;
padding: 0;
}
-ol.toc li ol li {
+ol.toc li li {
padding: 0;
- margin: .1em 0 0 1em;
+ margin: 0 0 0 1em;
font-weight: normal;
list-style: none;
}
@@ -458,8 +729,8 @@
}
/* expando trigger */
-.jd-expando-trigger {
- padding:0;
+#jd-content .jd-expando-trigger {
+ margin:0;
}
/* jd-expando */
@@ -487,7 +758,7 @@
color:#fff;
}
-/* INLAY 240PX EXTENSION */
+/* INLAY 180 COPY and 240PX EXTENSION */
/* modified to 43px so that all browsers eliminate the package panel h-scroll */
.g-tpl-240 .g-unit,
.g-unit .g-tpl-240 .g-unit,
@@ -523,10 +794,45 @@
float: right;
}
+/* 180px */
+.g-tpl-180 .g-unit,
+.g-unit .g-tpl-180 .g-unit,
+.g-unit .g-unit .g-tpl-180 .g-unit {
+ display: block;
+ margin: 0 0 0 180px;
+ width: auto;
+ float: none;
+}
+.g-unit .g-unit .g-tpl-180 .g-first,
+.g-unit .g-tpl-180 .g-first,
+.g-tpl-180 .g-first {
+ display: block;
+ margin: 0;
+ width: 180px;
+ float: left;
+}
+/* 180px alt */
+.g-tpl-180-alt .g-unit,
+.g-unit .g-tpl-180-alt .g-unit,
+.g-unit .g-unit .g-tpl-180-alt .g-unit {
+ display: block;
+ margin: 0 180px 0 0;
+ width: auto;
+ float: none;
+}
+.g-unit .g-unit .g-tpl-180-alt .g-first,
+.g-unit .g-tpl-180-alt .g-first,
+.g-tpl-180-alt .g-first {
+ display: block;
+ margin: 0;
+ width: 180px;
+ float: right;
+}
+
/* JQUERY RESIZABLE STYLES */
.ui-resizable { position: relative; }
-.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; }
+.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; z-index:1; }
.ui-resizable .ui-resizable-handle { display: block; }
body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
@@ -538,24 +844,50 @@
body {
overflow:visible;
}
+
+ #header {
+ height:60px;
+ }
+
+ #headerLeft {
+ margin:0;
+ }
+ #headerRight {
+ display:none;
+ }
+
+ #body-content {
+ position:inherit;
+ }
+
#side-nav {
display:none;
}
#doc-content {
- margin-left:0;
- height:auto;
- width:auto;
+ margin-left:0 !important;
+ height:auto !important;
+ width:auto !important;
+ overflow:inherit;
+ display:inline;
}
#jd-header {
- border-bottom:3px solid #9bb0c3;
+ padding:10px 0;
}
- #jd-content h2 {
- border-top:2px solid #97a2ac;
- border-bottom:2px solid #97a2ac;
+ #jd-content {
+ padding:15px 0 0;
+ }
+
+ #footer {
+ float:none;
+ margin:2em 0 0;
+ }
+
+ h4.jd-details-title {
+ border-bottom:1px solid #666;
}
pre {
@@ -577,4 +909,9 @@
page-break-inside: avoid;
}
+ #qv,
+ #qv-wrapper {
+ display:none;
+ }
+
}
\ No newline at end of file
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.js b/tools/droiddoc/templates/assets/android-developer-docs.js
index 58da116..f2276ee 100644
--- a/tools/droiddoc/templates/assets/android-developer-docs.js
+++ b/tools/droiddoc/templates/assets/android-developer-docs.js
@@ -4,7 +4,12 @@
var sidenav;
var content;
var HEADER_HEIGHT = 103;
-var cookie_style = 'android_dev_docs';
+var cookie_style = 'android_developer';
+var NAV_PREF_TREE = "tree";
+var NAV_PREF_PANELS = "panels";
+var nav_pref;
+var toRoot;
+
function addLoadEvent(newfun) {
var current = window.onload;
@@ -21,6 +26,10 @@
addLoadEvent(prepare);
window.onresize = resizeAll;
+function setToRoot(root) {
+ toRoot = root;
+}
+
function restoreWidth(navWidth) {
var windowWidth = $(window).width() + "px";
content.css({marginLeft:navWidth, width:parseInt(windowWidth) - parseInt(navWidth) + "px"});
@@ -32,12 +41,15 @@
function restoreHeight(packageHeight) {
var windowHeight = ($(window).height() - HEADER_HEIGHT);
+ var swapperHeight = windowHeight - 13;
+ $("#swapper").css({height:swapperHeight + "px"});
sidenav.css({height:windowHeight + "px"});
content.css({height:windowHeight + "px"});
- resizePackagesNav.css({maxHeight:windowHeight + "px", height:packageHeight});
- classesNav.css({height:windowHeight - parseInt(packageHeight) + "px"});
+ resizePackagesNav.css({maxHeight:swapperHeight + "px", height:packageHeight});
+ classesNav.css({height:swapperHeight - parseInt(packageHeight) + "px"});
$("#packages-nav").css({height:parseInt(packageHeight) - 6 + "px"}); //move 6px to give space for the resize handle
devdocNav.css({height:sidenav.css("height")});
+ $("#nav-tree").css({height:swapperHeight + "px"});
}
function getCookie(cookie) {
@@ -47,6 +59,9 @@
if (index != -1) {
var valStart = index + myCookie.length;
var valEnd = document.cookie.indexOf(";", valStart);
+ if (valEnd == -1) {
+ valEnd = document.cookie.length;
+ }
var val = document.cookie.substring(valStart, valEnd);
return val;
}
@@ -54,9 +69,14 @@
return 0;
}
-function writeCookie(cookie, val) {
- if (location.href.indexOf("reference") != -1) {
- document.cookie = cookie_style+'_'+cookie+'='+val+'; path=/gae/reference';
+function writeCookie(cookie, val, path, expiration) {
+ if (!val) return;
+ if (location.href.indexOf("/reference/") != -1) {
+ document.cookie = cookie_style+'_reference_'+cookie+'='+ val+'; path=' + toRoot + path +
+ ((expiration) ? '; expires=' + expiration : '');
+ } else if (location.href.indexOf("/guide/") != -1) {
+ document.cookie = cookie_style+'_guide_'+cookie+'='+val+'; path=' + toRoot + path +
+ ((expiration) ? '; expires=' + expiration : '');
}
}
@@ -68,8 +88,14 @@
sidenav = $("#side-nav");
devdocNav = $("#devdoc-nav");
- var cookieWidth = getCookie('width');
- var cookieHeight = getCookie('height');
+
+ if (location.href.indexOf("/reference/") != -1) {
+ var cookiePath = "reference_";
+ } else if (location.href.indexOf("/guide/") != -1) {
+ var cookiePath = "guide_";
+ }
+ var cookieWidth = getCookie(cookiePath+'width');
+ var cookieHeight = getCookie(cookiePath+'height');
if (cookieWidth) {
restoreWidth(cookieWidth);
} else {
@@ -89,30 +115,43 @@
function highlightNav(fullPageName) {
var lastSlashPos = fullPageName.lastIndexOf("/");
var firstSlashPos = fullPageName.indexOf("/",8); // first slash after http://
- if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (index.html)
+ if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (add 'index.html')
fullPageName = fullPageName + "index.html";
}
var htmlPos = fullPageName.lastIndexOf(".html", fullPageName.length);
- var pageName = fullPageName.slice(firstSlashPos, htmlPos + 5);
- var link = $("#devdoc-nav a[href$='"+pageName+"']");
- if (link.length == 0) { // if there's no match, maybe the nav url ends in a slash, also
- link = $("#devdoc-nav a[href$='"+pageName.slice(0,pageName.indexOf("index.html"))+"']");
+ var pathPageName = fullPageName.slice(firstSlashPos, htmlPos + 5);
+ var link = $("#devdoc-nav a[href$='"+ pathPageName+"']");
+ if (link.length == 0) { // if there's no match, then the nav url must be the parent dir (ie, this doc isn't listed, so highlight the parent
+ link = $("#devdoc-nav a[href$='"+ pathPageName.slice(0, pathPageName.lastIndexOf("/") + 1)+"']");
}
link.parent().addClass('selected');
+ if (link.parent().parent().is(':hidden')) {
+ toggle(link.parent().parent().parent(), false);
+ } else if (link.parent().parent().hasClass('toggle-list')) {
+ toggle(link.parent().parent(), false);
+ }
}
function resizeHeight() {
var windowHeight = ($(window).height() - HEADER_HEIGHT);
+ var swapperHeight = windowHeight - 13;
+ $("#swapper").css({height:swapperHeight + "px"});
sidenav.css({height:windowHeight + "px"});
content.css({height:windowHeight + "px"});
- resizePackagesNav.css({maxHeight:windowHeight + "px"});
- classesNav.css({height:windowHeight - parseInt(resizePackagesNav.css("height")) + "px"});
+ resizePackagesNav.css({maxHeight:swapperHeight + "px"});
+ classesNav.css({height:swapperHeight - parseInt(resizePackagesNav.css("height")) + "px"});
$("#packages-nav").css({height:parseInt(resizePackagesNav.css("height")) - 6 + "px"}); //move 6px for handle
devdocNav.css({height:sidenav.css("height")});
- writeCookie("height", resizePackagesNav.css("height"));
+ $("#nav-tree").css({height:swapperHeight + "px"});
+ writeCookie("height", resizePackagesNav.css("height"), "reference/", null);
}
function resizeWidth() {
+ if (location.href.indexOf("/reference/") != -1) {
+ var path = "reference/";
+ } else if (location.href.indexOf("/guide/") != -1) {
+ var path = "guide/";
+ }
var windowWidth = $(window).width() + "px";
if (sidenav.length) {
var sidenavWidth = sidenav.css("width");
@@ -123,7 +162,7 @@
resizePackagesNav.css({width:sidenavWidth});
classesNav.css({width:sidenavWidth});
$("#packages-nav").css({width:sidenavWidth});
- writeCookie("width", sidenavWidth);
+ writeCookie("width", sidenavWidth, path, null);
}
function resizeAll() {
@@ -131,14 +170,116 @@
resizeWidth();
}
-//added to onload when the bottom-left panel is empty
-function maxPackageHeight() {
- var windowHeight = resizePackagesNav.css("maxHeight");
- resizePackagesNav.css({height:windowHeight});
- $("#packages-nav").css({height:windowHeight});
+function loadLast(cookiePath) {
+ var lastPage = getCookie(cookiePath + "_lastpage");
+ if (lastPage) {
+ window.location = lastPage;
+ return false;
+ }
+ return true;
}
$(document).ready(function(){
$("#resize-packages-nav").resizable({handles: "s", resize: function(e, ui) { resizeHeight(); } });
$(".side-nav-resizable").resizable({handles: "e", resize: function(e, ui) { resizeWidth(); } });
-});
\ No newline at end of file
+});
+
+$(window).unload(function(){
+ var href = location.href;
+ if (href.indexOf("/reference/") != -1) {
+ writeCookie("lastpage", href, "", null);
+ } else if (href.indexOf("/guide/") != -1) {
+ writeCookie("lastpage", href, "", null);
+ }
+});
+
+
+
+
+function toggle(obj, slide) {
+ var ul = $("ul", obj);
+ var li = ul.parent();
+ if (li.hasClass("closed")) {
+ if (slide) {
+ ul.slideDown("fast");
+ } else {
+ ul.show();
+ }
+ li.removeClass("closed");
+ li.addClass("open");
+ $(".toggle-img", li).attr("title", "hide pages");
+ } else {
+ ul.slideUp("fast");
+ li.removeClass("open");
+ li.addClass("closed");
+ $(".toggle-img", li).attr("title", "show pages");
+ }
+}
+
+
+
+function buildToggleLists() {
+ $(".toggle-list").each(
+ function(i) {
+ $("div", this).append("<a class='toggle-img' href='#' title='show pages' onClick='toggle(this.parentNode.parentNode, true); return false;'></a>");
+ $(this).addClass("closed");
+ });
+}
+
+function getNavPref() {
+ var v = getCookie('reference_nav');
+ if (v != NAV_PREF_TREE) {
+ v = NAV_PREF_PANELS;
+ }
+ return v;
+}
+
+function chooseDefaultNav() {
+ nav_pref = getNavPref();
+ if (nav_pref == NAV_PREF_TREE) {
+ $("#nav-panels").toggle();
+ $("#panel-link").toggle();
+ $("#nav-tree").toggle();
+ $("#tree-link").toggle();
+ }
+}
+
+function swapNav() {
+ if (nav_pref == NAV_PREF_TREE) {
+ nav_pref = NAV_PREF_PANELS;
+ } else {
+ nav_pref = NAV_PREF_TREE;
+ init_navtree("nav-tree", toRoot, NAVTREE_DATA);
+ }
+ var date = new Date();
+ date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
+ writeCookie("nav", nav_pref, "reference/", date.toGMTString());
+
+ $("#nav-panels").toggle();
+ $("#panel-link").toggle();
+ $("#nav-tree").toggle();
+ $("#tree-link").toggle();
+
+ if ($("#nav-tree").is(':visible')) scrollIntoView("nav-tree");
+ else {
+ scrollIntoView("packages-nav");
+ scrollIntoView("classes-nav");
+ }
+}
+
+function scrollIntoView(nav) {
+ var navObj = $("#"+nav);
+ if (navObj.is(':visible')) {
+ var selected = $(".selected", navObj);
+ if (selected.length == 0) return;
+
+ var scrolling = document.getElementById(nav);
+ var navHeight = navObj.height();
+ var offset = selected.position();
+ if(offset.top > navHeight - 92) {
+ scrolling.scrollTop = offset.top - navHeight + 92;
+ }
+ }
+}
+
+
diff --git a/tools/droiddoc/templates/assets/carousel.js b/tools/droiddoc/templates/assets/carousel.js
old mode 100755
new mode 100644
index 9aecad7..dee3130
--- a/tools/droiddoc/templates/assets/carousel.js
+++ b/tools/droiddoc/templates/assets/carousel.js
@@ -1,291 +1,293 @@
-/* file: carousel.js
- date: oct 2008
- author: jeremydw,smain
- info: operates the carousel widget for announcements on
- the android developers home page. modified from the
- original market.js from jeremydw. */
-
-/* -- video switcher -- */
-
-var oldVid = "multi"; // set the default video
-var nowPlayingString = "Now playing:";
-var assetsRoot = "/gae/assets/";
-
-
-/* -- app thumbnail switcher -- */
-
-var currentDroid;
-var oldDroid;
-
-// shows a random application
-function randomDroid(){
-
- // count the total number of apps
- var droidListLength = 0;
- for (var k in droidList)
- droidListLength++;
-
- // pick a random app and show it
- var j = 0;
- var i = Math.floor(droidListLength*Math.random());
- for (var x in droidList) {
- if(j++ == i){
- currentDroid = x;
- showPreview(x);
- centerSlide(x);
- }
- }
-
-}
-
-// shows a bulletin, swaps the carousel highlighting
-function droid(appName){
-
- oldDroid = $("#droidlink-"+currentDroid);
- currentDroid = appName;
-
- var droid = droidList[appName];
- var layout = droid.layout;
- var imgDiv = document.getElementById("bulletinImg");
- var descDiv = document.getElementById("bulletinDesc");
-
- if (layout == "imgLeft") {
- imgDiv.className = "img-left";
- descDiv.className = "desc-right";
- } else if (layout == "imgTop") {
- imgDiv.className = "img-top";
- descDiv.className = "desc-bottom";
- } else if (layout == "imgRight") {
- imgDiv.className = "img-right";
- descDiv.className = "desc-left";
- }
-
- imgDiv.innerHTML = "<img src='" + assetsRoot + "images/home/" + droid.img + "'>";
- descDiv.innerHTML = (droid.title != "") ? "<h3>" + droid.title + "</h3>" + droid.desc : droid.desc;
-
- if(oldDroid)
- oldDroid.removeClass("selected");
-
- $("#droidlink-"+appName).addClass("selected");
-}
-
-
-// -- * build the carousel based on the droidList * -- //
-function buildCarousel() {
- var appList = document.getElementById("app-list");
- for (var x in droidList) {
- var droid = droidList[x];
- var icon = droid.icon;
- var name = droid.name;
- var a = document.createElement("a");
- var img = document.createElement("img");
- var br = document.createElement("br");
- var text = document.createTextNode(droid.name);
-
- a.setAttribute("id", "droidlink-" + x);
- a.className = x;
- a.setAttribute("href", "#");
- a.onclick = function() { showPreview(this.className); return false; }
- img.setAttribute("src", assetsRoot + "images/home/" + droid.icon);
- img.setAttribute("alt", "");
-
- a.appendChild(img);
- a.appendChild(br);
- a.appendChild(text);
- appList.appendChild(a);
- }
-}
-
-// -- * slider * -- //
-
-// -- dependencies:
-// (1) div containing slides, (2) a "clip" div to hide the scroller
-// (3) control arrows
-
-// -- * config below * -- //
-
-var slideCode = droidList; // the dictionary of slides
-var slideList = 'app-list'; // the div containing the slides
-var arrowRight = 'arrow-right'; // the right control arrow
-var arrowLeft = 'arrow-left'; // the left control arrow
-
-
-function showPreview(slideName) {
-// centerSlide(slideName);
- droid(slideName); // do this function when slide is clicked
-
-}
-
-var thumblist = document.getElementById(slideList);// the div containing the slides
-
-var slideWidth = 144; // width of a slide including all margins, etc.
-var slidesAtOnce = 3; // no. of slides to appear at once (requires odd number to have a centered slide)
-
-// -- * no editing should be needed below * -- //
-
-var originPosition = {};
-var is_animating = 0;
-var currentStripPosition = 0;
-var centeringPoint = 0;
-var rightScrollLimit = 0;
-
-// makeSlideStrip()
-// - figures out how many slides there are
-// - determines the centering point of the slide strip
-function makeSlideStrip() {
- var slideTotal = 0;
- centeringPoint = Math.ceil(slidesAtOnce/2);
- for (var x in slideCode) {
- slideTotal++;
- }
- var i = 0;
- for (var code in slideCode) {
- if (i <= centeringPoint-1) {
- originPosition[code] = 0;
- } else {
- if (i >= slideTotal-centeringPoint+1) {
- originPosition[code] = (slideTotal-slidesAtOnce)*slideWidth;
- } else {
- originPosition[code] = (i-centeringPoint+1)*slideWidth;
- }
- }
- i++;
- }
- rightScrollLimit = -1*(slideTotal-slidesAtOnce)*slideWidth;
-}
-
-// slides with acceleration
-function slide(goal, id, go_left, cp) {
- var div = document.getElementById(id);
- var animation = {};
- animation.time = 0.5; // in seconds
- animation.fps = 60;
- animation.goal = goal;
- origin = 0.0;
- animation.origin = Math.abs(origin);
- animation.frames = (animation.time * animation.fps) - 1.0;
- var current_frame = 0;
- var motions = Math.abs(animation.goal - animation.origin);
- function animate() {
- var ease_right = function (t) { return (1 - Math.cos(t * Math.PI))/2.0; };
- var ease = ease_right;
- if (go_left == 1) {
- ease = function(t) { return 1.0 - ease_right(t); };
- }
- var left = (ease(current_frame/animation.frames) * Math.abs(animation.goal - animation.origin)) - cp;
- if(left < 0) {
- left = 0;
- }
- if(!isNaN(left)) {
- div.style.left = '-' + Math.round(left) + 'px';
- }
- current_frame += 1;
- if (current_frame == animation.frames) {
- is_animating = 0;
- window.clearInterval(timeoutId)
- }
- }
- var timeoutId = window.setInterval(animate, animation.time/animation.fps * 1000);
-}
-
-//Get style property
-function getStyle(element, cssProperty){
- var elem = document.getElementById(element);
- if(elem.currentStyle){
- return elem.currentStyle[cssProperty]; //IE
- } else{
- var style = document.defaultView.getComputedStyle(elem, null); //firefox, Opera
- return style.getPropertyValue(cssProperty);
- }
-}
-
-// Left and right arrows
-function page_left() {
- var amount = slideWidth;
- animateSlide(amount, 'left');
-}
-
-function page_right() {
- var amount = slideWidth;
- animateSlide(amount, 'right');
-}
-
-
-// animates the strip
-// - sets arrows to on or off
-function animateSlide(amount,dir) {
- var currentStripPosition = parseInt(getStyle(slideList,'left'));
- var motionDistance;
- if (amount == slideWidth ) {
- motionDistance = slideWidth;
- } else {
- motionDistance = amount;
- }
-
- var rightarrow = document.getElementById(arrowRight);
- var leftarrow = document.getElementById(arrowLeft);
-
- function aToggle(state,aDir) {
- if (state == 'on') {
- if (aDir =='right') {
- rightarrow.className = 'arrow-right-on';
- rightarrow.href = "javascript:page_right()";
- } else {
- leftarrow.className = 'arrow-left-on';
- leftarrow.href = "javascript:page_left()";
- }
- } else {
- if (aDir =='right') {
- rightarrow.href = "javascript:{}";
- rightarrow.className = 'arrow-right-off';
- } else {
- leftarrow.href = "javascript:{}";
- leftarrow.className = 'arrow-left-off';
- }
- }
- }
-
- function arrowChange(rP) {
- if (rP >= rightScrollLimit) {
- aToggle('on','right');
- }
- if (rP <= rightScrollLimit) {
- aToggle('off','right');
- }
- if (rP <= slideWidth) {
- aToggle('on','left');
- }
- if (rP >= 0) {
- aToggle('off','left');
- }
- }
-
- if (dir == 'right' && is_animating == 0) {
- arrowChange(currentStripPosition-motionDistance);
- is_animating = 1;
- slide(motionDistance, slideList, 0, currentStripPosition);
- } else if (dir == 'left' && is_animating == 0) {
- arrowChange(currentStripPosition+motionDistance);
- is_animating = 1;
- rightStripPosition = currentStripPosition + motionDistance;
- slide(motionDistance, slideList, 1, rightStripPosition);
- }
-}
-
-function centerSlide(slideName) {
- var currentStripPosition = parseInt(getStyle(slideList,'left'));
- var dir = 'left';
- var originpoint = Math.abs(currentStripPosition);
- if (originpoint <= originPosition[slideName]) {
- dir = 'right';
- }
- var motionValue = Math.abs(originPosition[slideName]-originpoint);
- animateSlide(motionValue,dir);
-}
-
-
-function initCarousel(def) {
- buildCarousel();
- showPreview(def);
- makeSlideStrip();
-}
\ No newline at end of file
+/* file: carousel.js
+ date: oct 2008
+ author: jeremydw,smain
+ info: operates the carousel widget for announcements on
+ the android developers home page. modified from the
+ original market.js from jeremydw. */
+
+/* -- video switcher -- */
+
+var oldVid = "multi"; // set the default video
+var nowPlayingString = "Now playing:";
+var assetsRoot = "/assets/";
+
+
+/* -- app thumbnail switcher -- */
+
+var currentDroid;
+var oldDroid;
+
+// shows a random application
+function randomDroid(){
+
+ // count the total number of apps
+ var droidListLength = 0;
+ for (var k in droidList)
+ droidListLength++;
+
+ // pick a random app and show it
+ var j = 0;
+ var i = Math.floor(droidListLength*Math.random());
+ for (var x in droidList) {
+ if(j++ == i){
+ currentDroid = x;
+ showPreview(x);
+ centerSlide(x);
+ }
+ }
+
+}
+
+// shows a bulletin, swaps the carousel highlighting
+function droid(appName){
+
+ oldDroid = $("#droidlink-"+currentDroid);
+ currentDroid = appName;
+
+ var droid = droidList[appName];
+ var layout = droid.layout;
+ var imgDiv = document.getElementById("bulletinImg");
+ var descDiv = document.getElementById("bulletinDesc");
+
+ if (layout == "imgLeft") {
+ imgDiv.className = "img-left";
+ descDiv.className = "desc-right";
+ } else if (layout == "imgTop") {
+ imgDiv.className = "img-top";
+ descDiv.className = "desc-bottom";
+ } else if (layout == "imgRight") {
+ imgDiv.className = "img-right";
+ descDiv.className = "desc-left";
+ }
+
+ imgDiv.innerHTML = "<img src='" + assetsRoot + "images/home/" + droid.img + "'>";
+ descDiv.innerHTML = (droid.title != "") ? "<h3>" + droid.title + "</h3>" + droid.desc : droid.desc;
+
+ if(oldDroid)
+ oldDroid.removeClass("selected");
+
+ $("#droidlink-"+appName).addClass("selected");
+}
+
+
+// -- * build the carousel based on the droidList * -- //
+function buildCarousel() {
+ var appList = document.getElementById("app-list");
+ for (var x in droidList) {
+ var droid = droidList[x];
+ var icon = droid.icon;
+ var name = droid.name;
+ var a = document.createElement("a");
+ var img = document.createElement("img");
+ var br = document.createElement("br");
+ var text = document.createTextNode(droid.name);
+
+ a.setAttribute("id", "droidlink-" + x);
+ a.className = x;
+ a.setAttribute("href", "#");
+ a.onclick = function() { showPreview(this.className); return false; }
+ img.setAttribute("src", assetsRoot + "images/home/" + droid.icon);
+ img.setAttribute("alt", "");
+
+ a.appendChild(img);
+ a.appendChild(br);
+ a.appendChild(text);
+ appList.appendChild(a);
+ }
+}
+
+// -- * slider * -- //
+
+// -- dependencies:
+// (1) div containing slides, (2) a "clip" div to hide the scroller
+// (3) control arrows
+
+// -- * config below * -- //
+
+var slideCode = droidList; // the dictionary of slides
+var slideList = 'app-list'; // the div containing the slides
+var arrowRight = 'arrow-right'; // the right control arrow
+var arrowLeft = 'arrow-left'; // the left control arrow
+
+
+function showPreview(slideName) {
+// centerSlide(slideName);
+ if (slideName.indexOf('selected') != -1) {
+ return false;
+ }
+ droid(slideName); // do this function when slide is clicked
+}
+
+var thumblist = document.getElementById(slideList);// the div containing the slides
+
+var slideWidth = 144; // width of a slide including all margins, etc.
+var slidesAtOnce = 3; // no. of slides to appear at once (requires odd number to have a centered slide)
+
+// -- * no editing should be needed below * -- //
+
+var originPosition = {};
+var is_animating = 0;
+var currentStripPosition = 0;
+var centeringPoint = 0;
+var rightScrollLimit = 0;
+
+// makeSlideStrip()
+// - figures out how many slides there are
+// - determines the centering point of the slide strip
+function makeSlideStrip() {
+ var slideTotal = 0;
+ centeringPoint = Math.ceil(slidesAtOnce/2);
+ for (var x in slideCode) {
+ slideTotal++;
+ }
+ var i = 0;
+ for (var code in slideCode) {
+ if (i <= centeringPoint-1) {
+ originPosition[code] = 0;
+ } else {
+ if (i >= slideTotal-centeringPoint+1) {
+ originPosition[code] = (slideTotal-slidesAtOnce)*slideWidth;
+ } else {
+ originPosition[code] = (i-centeringPoint+1)*slideWidth;
+ }
+ }
+ i++;
+ }
+ rightScrollLimit = -1*(slideTotal-slidesAtOnce)*slideWidth;
+}
+
+// slides with acceleration
+function slide(goal, id, go_left, cp) {
+ var div = document.getElementById(id);
+ var animation = {};
+ animation.time = 0.5; // in seconds
+ animation.fps = 60;
+ animation.goal = goal;
+ origin = 0.0;
+ animation.origin = Math.abs(origin);
+ animation.frames = (animation.time * animation.fps) - 1.0;
+ var current_frame = 0;
+ var motions = Math.abs(animation.goal - animation.origin);
+ function animate() {
+ var ease_right = function (t) { return (1 - Math.cos(t * Math.PI))/2.0; };
+ var ease = ease_right;
+ if (go_left == 1) {
+ ease = function(t) { return 1.0 - ease_right(t); };
+ }
+ var left = (ease(current_frame/animation.frames) * Math.abs(animation.goal - animation.origin)) - cp;
+ if(left < 0) {
+ left = 0;
+ }
+ if(!isNaN(left)) {
+ div.style.left = '-' + Math.round(left) + 'px';
+ }
+ current_frame += 1;
+ if (current_frame == animation.frames) {
+ is_animating = 0;
+ window.clearInterval(timeoutId)
+ }
+ }
+ var timeoutId = window.setInterval(animate, animation.time/animation.fps * 1000);
+}
+
+//Get style property
+function getStyle(element, cssProperty){
+ var elem = document.getElementById(element);
+ if(elem.currentStyle){
+ return elem.currentStyle[cssProperty]; //IE
+ } else{
+ var style = document.defaultView.getComputedStyle(elem, null); //firefox, Opera
+ return style.getPropertyValue(cssProperty);
+ }
+}
+
+// Left and right arrows
+function page_left() {
+ var amount = slideWidth;
+ animateSlide(amount, 'left');
+}
+
+function page_right() {
+ var amount = slideWidth;
+ animateSlide(amount, 'right');
+}
+
+
+// animates the strip
+// - sets arrows to on or off
+function animateSlide(amount,dir) {
+ var currentStripPosition = parseInt(getStyle(slideList,'left'));
+ var motionDistance;
+ if (amount == slideWidth ) {
+ motionDistance = slideWidth;
+ } else {
+ motionDistance = amount;
+ }
+
+ var rightarrow = document.getElementById(arrowRight);
+ var leftarrow = document.getElementById(arrowLeft);
+
+ function aToggle(state,aDir) {
+ if (state == 'on') {
+ if (aDir =='right') {
+ rightarrow.className = 'arrow-right-on';
+ rightarrow.href = "javascript:page_right()";
+ } else {
+ leftarrow.className = 'arrow-left-on';
+ leftarrow.href = "javascript:page_left()";
+ }
+ } else {
+ if (aDir =='right') {
+ rightarrow.href = "javascript:{}";
+ rightarrow.className = 'arrow-right-off';
+ } else {
+ leftarrow.href = "javascript:{}";
+ leftarrow.className = 'arrow-left-off';
+ }
+ }
+ }
+
+ function arrowChange(rP) {
+ if (rP >= rightScrollLimit) {
+ aToggle('on','right');
+ }
+ if (rP <= rightScrollLimit) {
+ aToggle('off','right');
+ }
+ if (rP <= slideWidth) {
+ aToggle('on','left');
+ }
+ if (rP >= 0) {
+ aToggle('off','left');
+ }
+ }
+
+ if (dir == 'right' && is_animating == 0) {
+ arrowChange(currentStripPosition-motionDistance);
+ is_animating = 1;
+ slide(motionDistance, slideList, 0, currentStripPosition);
+ } else if (dir == 'left' && is_animating == 0) {
+ arrowChange(currentStripPosition+motionDistance);
+ is_animating = 1;
+ rightStripPosition = currentStripPosition + motionDistance;
+ slide(motionDistance, slideList, 1, rightStripPosition);
+ }
+}
+
+function centerSlide(slideName) {
+ var currentStripPosition = parseInt(getStyle(slideList,'left'));
+ var dir = 'left';
+ var originpoint = Math.abs(currentStripPosition);
+ if (originpoint <= originPosition[slideName]) {
+ dir = 'right';
+ }
+ var motionValue = Math.abs(originPosition[slideName]-originpoint);
+ animateSlide(motionValue,dir);
+}
+
+
+function initCarousel(def) {
+ buildCarousel();
+ showPreview(def);
+ makeSlideStrip();
+}
diff --git a/tools/droiddoc/templates/assets/images/android_wrench.png b/tools/droiddoc/templates/assets/images/android_wrench.png
new file mode 100644
index 0000000..6390a2d
--- /dev/null
+++ b/tools/droiddoc/templates/assets/images/android_wrench.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/grad-rule-qv.png b/tools/droiddoc/templates/assets/images/grad-rule-qv.png
new file mode 100644
index 0000000..bae2d18
--- /dev/null
+++ b/tools/droiddoc/templates/assets/images/grad-rule-qv.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/home/market-large.png b/tools/droiddoc/templates/assets/images/home/market-large.png
index fecc22b..55ab924 100644
--- a/tools/droiddoc/templates/assets/images/home/market-large.png
+++ b/tools/droiddoc/templates/assets/images/home/market-large.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/home/market-small.png b/tools/droiddoc/templates/assets/images/home/market-small.png
index 7799475..fa1201c 100644
--- a/tools/droiddoc/templates/assets/images/home/market-small.png
+++ b/tools/droiddoc/templates/assets/images/home/market-small.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/home/sdk-small.png b/tools/droiddoc/templates/assets/images/home/sdk-small.png
index 62cbb30..f90fdda 100644
--- a/tools/droiddoc/templates/assets/images/home/sdk-small.png
+++ b/tools/droiddoc/templates/assets/images/home/sdk-small.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/triangle-closed-small.png b/tools/droiddoc/templates/assets/images/triangle-closed-small.png
new file mode 100644
index 0000000..dc75915
--- /dev/null
+++ b/tools/droiddoc/templates/assets/images/triangle-closed-small.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/triangle-closed.png b/tools/droiddoc/templates/assets/images/triangle-closed.png
new file mode 100644
index 0000000..a34a055
--- /dev/null
+++ b/tools/droiddoc/templates/assets/images/triangle-closed.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/triangle-opened-small.png b/tools/droiddoc/templates/assets/images/triangle-opened-small.png
new file mode 100644
index 0000000..184031d
--- /dev/null
+++ b/tools/droiddoc/templates/assets/images/triangle-opened-small.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/triangle-opened.png b/tools/droiddoc/templates/assets/images/triangle-opened.png
new file mode 100644
index 0000000..a709604
--- /dev/null
+++ b/tools/droiddoc/templates/assets/images/triangle-opened.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/navtree.js b/tools/droiddoc/templates/assets/navtree.js
new file mode 100644
index 0000000..f48e1dc
--- /dev/null
+++ b/tools/droiddoc/templates/assets/navtree.js
@@ -0,0 +1,179 @@
+
+function new_node(me, mom, text, link, children_data)
+{
+ var node = new Object();
+ node.children = Array();
+ node.children_data = children_data;
+ node.depth = mom.depth + 1;
+
+ node.li = document.createElement("li");
+ mom.get_children_ul().appendChild(node.li);
+
+ node.label_div = document.createElement("div");
+ node.li.appendChild(node.label_div);
+ node.label_div.style.paddingLeft = 10*node.depth + "px";
+ node.label_div.className = "label";
+
+ if (children_data == null) {
+ // 12 is the width of the triangle and padding extra space
+ node.label_div.style.paddingLeft = ((10*node.depth)+12) + "px";
+ } else {
+ node.label_div.style.paddingLeft = 10*node.depth + "px";
+ node.expand_toggle = document.createElement("a");
+ node.expand_toggle.href = "javascript:void(0)";
+ node.expand_toggle.onclick = function() {
+ if (node.expanded) {
+ $(node.get_children_ul()).slideUp("fast");
+ node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png";
+ node.expanded = false;
+ } else {
+ expand_node(me, node);
+ }
+ };
+ node.label_div.appendChild(node.expand_toggle);
+
+ node.plus_img = document.createElement("img");
+ node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png";
+ node.plus_img.className = "plus";
+ node.plus_img.border = "0";
+ node.expand_toggle.appendChild(node.plus_img);
+
+ node.expanded = false;
+ }
+
+ var a = document.createElement("a");
+ node.label_div.appendChild(a);
+ node.label = document.createTextNode(text);
+ a.appendChild(node.label);
+ if (link) {
+ a.href = me.toroot + link;
+ } else {
+ if (children_data != null) {
+ a.className = "nolink";
+ a.href = "javascript:void(0)";
+ a.onclick = node.expand_toggle.onclick;
+ // This next line shouldn't be necessary. I'll buy a beer for the first
+ // person who figures out how to remove this line and have the link
+ // toggle shut on the first try. --joeo@android.com
+ node.expanded = false;
+ }
+ }
+
+
+ node.children_ul = null;
+ node.get_children_ul = function() {
+ if (!node.children_ul) {
+ node.children_ul = document.createElement("ul");
+ node.children_ul.className = "children_ul";
+ node.children_ul.style.display = "none";
+ node.li.appendChild(node.children_ul);
+ }
+ return node.children_ul;
+ };
+
+ return node;
+}
+
+function expand_node(me, node)
+{
+ if (node.children_data && !node.expanded) {
+ if (node.children_visited) {
+ $(node.get_children_ul()).slideDown("fast");
+ } else {
+ get_node(me, node);
+ $(node.get_children_ul()).slideDown("fast");
+ }
+ node.plus_img.src = me.toroot + "assets/images/triangle-opened-small.png";
+ node.expanded = true;
+ }
+}
+
+function get_node(me, mom)
+{
+ mom.children_visited = true;
+ for (var i in mom.children_data) {
+ var node_data = mom.children_data[i];
+ mom.children[i] = new_node(me, mom, node_data[0], node_data[1],
+ node_data[2]);
+ }
+}
+
+function this_page_relative(toroot)
+{
+ var full = document.location.pathname;
+ var file = "";
+ if (toroot.substr(0, 1) == "/") {
+ if (full.substr(0, toroot.length) == toroot) {
+ return full.substr(toroot.length);
+ } else {
+ // the file isn't under toroot. Fail.
+ return null;
+ }
+ } else {
+ if (toroot != "./") {
+ toroot = "./" + toroot;
+ }
+ do {
+ if (toroot.substr(toroot.length-3, 3) == "../" || toroot == "./") {
+ var pos = full.lastIndexOf("/");
+ file = full.substr(pos) + file;
+ full = full.substr(0, pos);
+ toroot = toroot.substr(0, toroot.length-3);
+ }
+ } while (toroot != "" && toroot != "/");
+ return file.substr(1);
+ }
+}
+
+function find_page(url, data)
+{
+ var nodes = data;
+ var result = null;
+ for (var i in nodes) {
+ var d = nodes[i];
+ if (d[1] == url) {
+ return new Array(i);
+ }
+ else if (d[2] != null) {
+ result = find_page(url, d[2]);
+ if (result != null) {
+ return (new Array(i).concat(result));
+ }
+ }
+ }
+ return null;
+}
+
+function init_navtree(navtree_id, toroot, root_nodes)
+{
+ var me = new Object();
+ me.toroot = toroot;
+ me.node = new Object();
+
+ me.node.li = document.getElementById(navtree_id);
+ me.node.children_data = root_nodes;
+ me.node.children = new Array();
+ me.node.children_ul = document.createElement("ul");
+ me.node.get_children_ul = function() { return me.node.children_ul; };
+ //me.node.children_ul.className = "children_ul";
+ me.node.li.appendChild(me.node.children_ul);
+ me.node.depth = 0;
+
+ get_node(me, me.node);
+
+ me.this_page = this_page_relative(toroot);
+ me.breadcrumbs = find_page(me.this_page, root_nodes);
+ if (me.breadcrumbs != null && me.breadcrumbs.length != 0) {
+ var mom = me.node;
+ for (var i in me.breadcrumbs) {
+ var j = me.breadcrumbs[i];
+ mom = mom.children[j];
+ expand_node(me, mom);
+ }
+ mom.label_div.className = mom.label_div.className + " selected";
+ addLoadEvent(function() {
+ scrollIntoView("nav-tree");
+ });
+ }
+}
+
diff --git a/tools/droiddoc/templates/assets/search_autocomplete.js b/tools/droiddoc/templates/assets/search_autocomplete.js
index b5d26ea..392aa46 100644
--- a/tools/droiddoc/templates/assets/search_autocomplete.js
+++ b/tools/droiddoc/templates/assets/search_autocomplete.js
@@ -136,7 +136,7 @@
gSelectedIndex = -1;
for (i=0; i<DATA.length; i++) {
var s = DATA[i];
- if (text.length != 0 && s.label.toLowerCase().indexOf(text.toLowerCase()) != -1) {
+ if (text.length != 0 && s.label.indexOf(text) != -1) {
gMatches[matchedCount] = s;
if (gSelectedID == s.id) {
gSelectedIndex = matchedCount;
@@ -156,8 +156,10 @@
obj.style.color="#000000";
}
} else {
- obj.value = DEFAULT_TEXT;
- obj.style.color="#aaaaaa";
+ if(obj.value == ""){
+ obj.value = DEFAULT_TEXT;
+ obj.style.color="#aaaaaa";
+ }
document.getElementById("search_filtered").className = "no-display";
}
}
diff --git a/tools/droiddoc/templates/assets/style.css b/tools/droiddoc/templates/assets/style.css
index 37f66d4..5ad1118 100644
--- a/tools/droiddoc/templates/assets/style.css
+++ b/tools/droiddoc/templates/assets/style.css
@@ -313,3 +313,4 @@
margin-top: 0px;
}
}
+
diff --git a/tools/droiddoc/templates/assets/triangle-close.png b/tools/droiddoc/templates/assets/triangle-close.png
deleted file mode 100644
index 5595adf..0000000
--- a/tools/droiddoc/templates/assets/triangle-close.png
+++ /dev/null
Binary files differ
diff --git a/tools/droiddoc/templates/assets/triangle-none.gif b/tools/droiddoc/templates/assets/triangle-none.gif
new file mode 100644
index 0000000..0c7b469
--- /dev/null
+++ b/tools/droiddoc/templates/assets/triangle-none.gif
Binary files differ
diff --git a/tools/droiddoc/templates/assets/triangle-open.png b/tools/droiddoc/templates/assets/triangle-open.png
deleted file mode 100644
index 116ce91..0000000
--- a/tools/droiddoc/templates/assets/triangle-open.png
+++ /dev/null
Binary files differ