+
+
+
+
+
+
+
+
+
Select a package to view its members
+
+
+
+
-
+
referenceguidesdkhomecommunitypublishabout">
+
+
offline.htmlindex.html">
+ Home
+ Startseite
+ ホーム
+ 主页
+ 首頁
+
+
+ SDK
+
+
+ Dev Guide
+ Handbuch
+ Guía
+ Guide
+ Guida
+ 開発ガイド
+ 开发人员指南
+ 開發指南
+
+
+ Reference
+ Referenz
+ Referencia
+ Référence
+ Riferimento
+ リファレンス
+ 参考
+ 參考資料
+
+
+ Blog
+ ブログ
+ 博客
+ 網誌
+
+
+
+
\ No newline at end of file
diff --git a/tools/droiddoc/templates/assets/android-developer-core.css b/tools/droiddoc/templates/assets/android-developer-core.css
index 79e40b2d9..dee006fea 100644
--- a/tools/droiddoc/templates/assets/android-developer-core.css
+++ b/tools/droiddoc/templates/assets/android-developer-core.css
@@ -238,6 +238,10 @@ hr.blue {
top:7px;
}
+#header li a span+span {
+ display:none;
+}
+
/* TAB HIGHLIGHTING */
.home #home-link a,
.publish #publish-link a,
@@ -268,20 +272,20 @@ hr.blue {
#headerLinks {
margin:10px 10px 0 0;
height:13px;
-}
-
-#headerLinks .text {
- text-decoration: none;
- color: #7FA9B5;
font-size: 11px;
vertical-align: top;
}
#headerLinks a {
- text-decoration: underline;
color: #7FA9B5;
- font-size: 11px;
- vertical-align: top;
+}
+
+#headerLinks img {
+ vertical-align:middle;
+}
+
+#language {
+ margin:0 10px 0 4px;
}
#search {
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.css b/tools/droiddoc/templates/assets/android-developer-docs.css
index f4aa5ef75..cf44b261f 100644
--- a/tools/droiddoc/templates/assets/android-developer-docs.css
+++ b/tools/droiddoc/templates/assets/android-developer-docs.css
@@ -89,6 +89,10 @@
zoom:1;
}
+#side-nav li a span+span {
+ display:none;
+}
+
#side-nav li a:hover {
text-decoration:underline;
}
@@ -1130,9 +1134,9 @@ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body
page-break-inside: avoid;
}
- #qv,
+/* #qv,
#qv-wrapper {
display:none;
}
-
+*/
}
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.js b/tools/droiddoc/templates/assets/android-developer-docs.js
index 2a8c3bf51..964191bf7 100644
--- a/tools/droiddoc/templates/assets/android-developer-docs.js
+++ b/tools/droiddoc/templates/assets/android-developer-docs.js
@@ -4,7 +4,7 @@ var devdocNav;
var sidenav;
var content;
var HEADER_HEIGHT = 117;
-var cookie_style = 'android_developer';
+var cookie_namespace = 'android_developer';
var NAV_PREF_TREE = "tree";
var NAV_PREF_PANELS = "panels";
var nav_pref;
@@ -70,8 +70,8 @@ function restoreHeight(packageHeight) {
$("#nav-tree").css({height:swapperHeight + "px"});
}
-function getCookie(cookie) {
- var myCookie = cookie_style+"_"+cookie+"=";
+function readCookie(cookie) {
+ var myCookie = cookie_namespace+"_"+cookie+"=";
if (document.cookie) {
var index = document.cookie.indexOf(myCookie);
if (index != -1) {
@@ -87,16 +87,15 @@ function getCookie(cookie) {
return 0;
}
-function writeCookie(cookie, val, path, expiration) {
+function writeCookie(cookie, val, section, expiration) {
if (!val) return;
- var date = new Date();
- date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
- expiration = expiration ? expiration : date.toGMTString();
- if (location.href.indexOf("/reference/") != -1) {
- document.cookie = cookie_style+'_reference_'+cookie+'='+val+'; expires='+expiration+'; path='+'/'+path;
- } else if (location.href.indexOf("/guide/") != -1) {
- document.cookie = cookie_style+'_guide_'+cookie+'='+val+'; expires='+expiration+'; path='+'/'+path;
+ section = section == null ? "_" : "_"+section+"_";
+ if (expiration == null) {
+ var date = new Date();
+ date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
+ expiration = date.toGMTString();
}
+ document.cookie = cookie_namespace+section+cookie+"="+val+"; expires="+expiration+"; path=/";
}
function init() {
@@ -116,8 +115,8 @@ function init() {
if (!isMobile) {
$("#resize-packages-nav").resizable({handles: "s", resize: function(e, ui) { resizeHeight(); } });
$(".side-nav-resizable").resizable({handles: "e", resize: function(e, ui) { resizeWidth(); } });
- var cookieWidth = getCookie(cookiePath+'width');
- var cookieHeight = getCookie(cookiePath+'height');
+ var cookieWidth = readCookie(cookiePath+'width');
+ var cookieHeight = readCookie(cookiePath+'height');
if (cookieWidth) {
restoreWidth(cookieWidth);
} else if ($(".side-nav-resizable").length) {
@@ -175,7 +174,9 @@ function resizeHeight() {
$("#packages-nav").css({height:parseInt(resizePackagesNav.css("height")) - 6 + "px"}); //move 6px for handle
devdocNav.css({height:sidenav.css("height")});
$("#nav-tree").css({height:swapperHeight + "px"});
- writeCookie("height", resizePackagesNav.css("height"), "", null);
+
+ var section = location.pathname.substring(1,location.pathname.indexOf("/",1));
+ writeCookie("height", resizePackagesNav.css("height"), section, null);
}
function resizeWidth() {
@@ -190,7 +191,9 @@ function resizeWidth() {
resizePackagesNav.css({width:sidenavWidth});
classesNav.css({width:sidenavWidth});
$("#packages-nav").css({width:sidenavWidth});
- writeCookie("width", sidenavWidth, "", null);
+
+ var section = location.pathname.substring(1,location.pathname.indexOf("/",1));
+ writeCookie("width", sidenavWidth, section, null);
}
function resizeAll() {
@@ -202,12 +205,25 @@ function resizeAll() {
}
}
+function getBaseUri(uri) {
+ intlUrl = uri.substring(0,6) == "/intl/";
+ if (intlUrl) {
+ base = uri.substring(uri.indexOf('intl/')+5,uri.length);
+ base = base.substring(base.indexOf('/')+1, base.length);
+ //alert("intl, returning base url: /" + base);
+ return ("/" + base);
+ } else {
+ //alert("not intl, returning uri as found.");
+ return uri;
+ }
+}
+
function loadLast(cookiePath) {
var location = window.location.href;
if (location.indexOf("/"+cookiePath+"/") != -1) {
return true;
}
- var lastPage = getCookie(cookiePath + "_lastpage");
+ var lastPage = readCookie(cookiePath + "_lastpage");
if (lastPage) {
window.location = lastPage;
return false;
@@ -216,16 +232,14 @@ function loadLast(cookiePath) {
}
$(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);
+ var path = getBaseUri(location.pathname);
+ if (path.indexOf("/reference/") != -1) {
+ writeCookie("lastpage", path, "reference", null);
+ } else if (path.indexOf("/guide/") != -1) {
+ writeCookie("lastpage", path, "guide", null);
}
});
-
-
function toggle(obj, slide) {
var ul = $("ul", obj);
var li = ul.parent();
@@ -246,8 +260,6 @@ function toggle(obj, slide) {
}
}
-
-
function buildToggleLists() {
$(".toggle-list").each(
function(i) {
@@ -257,7 +269,7 @@ function buildToggleLists() {
}
function getNavPref() {
- var v = getCookie('reference_nav');
+ var v = readCookie('reference_nav');
if (v != NAV_PREF_TREE) {
v = NAV_PREF_PANELS;
}
@@ -283,7 +295,7 @@ function swapNav() {
}
var date = new Date();
date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
- writeCookie("nav", nav_pref, "", date.toGMTString());
+ writeCookie("nav", nav_pref, "reference", date.toGMTString());
$("#nav-panels").toggle();
$("#panel-link").toggle();
@@ -349,3 +361,60 @@ function toggleAllSummaryInherited(linkObj) {
}
return false;
}
+
+
+function changeTabLang(lang) {
+ var nodes = $("#header-tabs").find("."+lang);
+ for (i=0; i < nodes.length; i++) { // for each node in this language
+ var node = $(nodes[i]);
+ node.siblings().css("display","none"); // hide all siblings
+ if (node.not(":empty").length != 0) { //if this languages node has a translation, show it
+ node.css("display","inline");
+ } else { //otherwise, show English instead
+ node.css("display","none");
+ node.siblings().filter(".en").css("display","inline");
+ }
+ }
+}
+
+function changeNavLang(lang) {
+ var nodes = $("#side-nav").find("."+lang);
+ for (i=0; i < nodes.length; i++) { // for each node in this language
+ var node = $(nodes[i]);
+ node.siblings().css("display","none"); // hide all siblings
+ if (node.not(":empty").length != 0) { // if this languages node has a translation, show it
+ node.css("display","inline");
+ } else { // otherwise, show English instead
+ node.css("display","none");
+ node.siblings().filter(".en").css("display","inline");
+ }
+ }
+}
+
+function changeDocLang(lang) {
+ changeTabLang(lang);
+ changeNavLang(lang);
+}
+
+function changeLangPref(lang, refresh) {
+ var date = new Date();
+ expires = date.toGMTString(date.setTime(date.getTime()+(10*365*24*60*60*1000))); // keep this for 50 years
+ //alert("expires: " + expires)
+ writeCookie("pref_lang", lang, null, expires);
+ //changeDocLang(lang);
+ if (refresh) {
+ l = getBaseUri(location.pathname);
+ window.location = l;
+ }
+}
+
+function loadLangPref() {
+ var lang = readCookie("pref_lang");
+ if (lang != 0) {
+ $("#language").find("option[value='"+lang+"']").attr("selected",true);
+ }
+}
+
+function getLangPref() {
+ return $("#language").find(":selected").attr("value");
+}
diff --git a/tools/droiddoc/templates/macros.cs b/tools/droiddoc/templates/macros.cs
index 3ba743bbf..a2306a089 100644
--- a/tools/droiddoc/templates/macros.cs
+++ b/tools/droiddoc/templates/macros.cs
@@ -233,108 +233,5 @@ def:expandable_class_list(id, classes, default) ?>
-
-
-
-
-
-
-
-
-
Select a package to view its members
-
-
-
-
-
-
-
-
-
From c13d04594ce638584a70c3996960705c93af7695 Mon Sep 17 00:00:00 2001
From: Dirk Dougherty
Date: Wed, 8 Jul 2009 14:39:31 -0700
Subject: [PATCH 05/36] AI 150389: Fix handling of cookie writes for intl
pages. BUG=1790234
Automated import of CL 150389
---
tools/droiddoc/templates/assets/android-developer-docs.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.js b/tools/droiddoc/templates/assets/android-developer-docs.js
index 964191bf7..654e9a862 100644
--- a/tools/droiddoc/templates/assets/android-developer-docs.js
+++ b/tools/droiddoc/templates/assets/android-developer-docs.js
@@ -175,7 +175,8 @@ function resizeHeight() {
devdocNav.css({height:sidenav.css("height")});
$("#nav-tree").css({height:swapperHeight + "px"});
- var section = location.pathname.substring(1,location.pathname.indexOf("/",1));
+ var basePath = getBaseUri(location.pathname);
+ var section = basePath.substring(1,basePath.indexOf("/",1));
writeCookie("height", resizePackagesNav.css("height"), section, null);
}
@@ -192,7 +193,8 @@ function resizeWidth() {
classesNav.css({width:sidenavWidth});
$("#packages-nav").css({width:sidenavWidth});
- var section = location.pathname.substring(1,location.pathname.indexOf("/",1));
+ var basePath = getBaseUri(location.pathname);
+ var section = basePath.substring(1,basePath.indexOf("/",1));
writeCookie("width", sidenavWidth, section, null);
}
From 8ebeb52cb0e851be649989560f4a4a81e18cb533 Mon Sep 17 00:00:00 2001
From: Scott Main
Date: Wed, 8 Jul 2009 14:45:58 -0700
Subject: [PATCH 06/36] AI 150393: edit the reference's navtree highlighting
logic to handle intl/ directories BUG=1790234
Automated import of CL 150393
---
tools/droiddoc/templates/assets/navtree.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/droiddoc/templates/assets/navtree.js b/tools/droiddoc/templates/assets/navtree.js
index f48e1dcad..a209d12ad 100644
--- a/tools/droiddoc/templates/assets/navtree.js
+++ b/tools/droiddoc/templates/assets/navtree.js
@@ -104,7 +104,8 @@ function this_page_relative(toroot)
var file = "";
if (toroot.substr(0, 1) == "/") {
if (full.substr(0, toroot.length) == toroot) {
- return full.substr(toroot.length);
+ var basePath = getBaseUri(full);
+ return basePath.substring(toroot.length);
} else {
// the file isn't under toroot. Fail.
return null;
From 4cb0b458b04ba5f4b86861197cc6034d50036b37 Mon Sep 17 00:00:00 2001
From: Scott Main
Date: Wed, 8 Jul 2009 15:14:05 -0700
Subject: [PATCH 07/36] AI 150398: fix the sdk build break BUG=1790234
Automated import of CL 150398
---
tools/droiddoc/templates/customization.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/droiddoc/templates/customization.cs b/tools/droiddoc/templates/customization.cs
index d437c2cd3..db008f59b 100644
--- a/tools/droiddoc/templates/customization.cs
+++ b/tools/droiddoc/templates/customization.cs
@@ -2,6 +2,10 @@
+
+
+
+