Update modal download dialogs for sdk/ndk download.

Revise the redirect behavior once download completes.
Add more appropriate title and download message when installing SDK tools only.
Force refresh when the Studio download dialog is dismissed, to avoid leaving the dialog in stale state.
Add styles for the Studio download page.

Change-Id: Ibc4ddb4a6130ab8bd8d6044472022465829f2000
This commit is contained in:
Dirk Dougherty 2016-01-28 08:32:47 -08:00 committed by smain@google.com
parent 0d268bea3c
commit c607a4d4d5
6 changed files with 431 additions and 333 deletions

View file

@ -7793,6 +7793,20 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools]
text-align: center;
}
/* Android Studio download page */
section#features {
padding-top:0;
}
.wrap.feature {
margin:80px auto;
}
.dac-section-links.feature-more {
margin-top:-20px;
}
.dac-toggle-content .wrap.feature {
margin-top:0;
}
@media (max-width: 719px) {
.dac-hero-figure {
height: 150px;
@ -7802,6 +7816,17 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools]
.dac-hero-figure img {
max-height: 150px;
}
/* Android Studio download page */
.feature .dac-hero-figure,
.feature .dac-hero-figure img {
height:auto;
max-height:none;
}
.feature .dac-hero-figure img {
width:90%;
margin:0 auto;
}
}
.dac-hero-carousel {

View file

@ -3891,6 +3891,11 @@ switch (window.getLangPref()) {
this.el.removeClass('dac-active');
$('body').removeClass('dac-modal-open');
this.isOpen = false;
// When closing the modal for Android Studio downloads, reload the page
// because otherwise we might get stuck with post-download dialog state
if ($("[data-modal='studio_tos']").length) {
location.reload();
}
};
Modal.prototype.open_ = function() {

View file

@ -12,16 +12,19 @@
<?cs else ?>
<?cs include:"head_tag.cs" ?>
<?cs /if ?>
<body class="gc-documentation <?cs
if:(guide||develop||training||reference||tools||sdk) ?> develop<?cs
elif:design ?> design<?cs
elif:distribute ?> distribute<?cs
elif:ndk ?> ndk<?cs
if:downloads ?> downloads<?cs /if ?><?cs
<body class="gc-documentation
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
elif:design ?>design<?cs
elif:distribute ?>distribute<?cs
/if ?>" itemscope itemtype="http://schema.org/CreativeWork">
<a name="top"></a>
<?cs include:"header.cs" ?>
<div <?cs if:fullpage
?><?cs else
?>class="col-13" id="doc-col"<?cs /if ?> >
<?cs if:sdk.redirect ?>
<div class="g-unit">
@ -41,15 +44,7 @@
# The following is for SDK/NDK pages
#
#
?><?cs
if:ndk ?>
<ul class="dac-header-crumbs">
<?cs # More <li> elements added here with javascript ?>
</ul>
<!-- Breadcrumb Setup -->
<p><script>$('.dac-nav-list').dacCurrentPage().dacCrumbs();</script></p><?cs
/if ?>
?>
<?cs if:header.hide ?><?cs else ?>
<h1 itemprop="name"><?cs var:page.title ?></h1>
@ -86,20 +81,20 @@ if:ndk ?>
<th>Platform</th>
<th>Package</th>
<th style="white-space:nowrap">Size (Bytes)</th>
<th>MD5 Checksum</th>
<th>SHA1 Checksum</th>
</tr>
<tr>
<td>Windows 32-bit</td>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.win32_download ?>"><?cs var:ndk.win32_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.win32_download ?>"><?cs var:ndk.win32_download ?></a>
</td>
<td><?cs var:ndk.win32_bytes ?></td>
<td><?cs var:ndk.win32_checksum ?></td>
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/ndk/<?cs var:ndk.win32.legacy_download ?>"><?cs var:ndk.win32.legacy_download ?></a>
</td>
<td><?cs var:ndk.win32.legacy_bytes ?></td>
@ -108,16 +103,16 @@ if:ndk ?>
<tr>
<td>Windows 64-bit</td>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.win64_download ?>"><?cs var:ndk.win64_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.win64_download ?>"><?cs var:ndk.win64_download ?></a>
</td>
<td><?cs var:ndk.win64_bytes ?></td>
<td><?cs var:ndk.win64_checksum ?></td>
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.win64.legacy_download ?>"><?cs var:ndk.win64.legacy_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.win64.legacy_download ?>"><?cs var:ndk.win64.legacy_download ?></a>
</td>
<td><?cs var:ndk.win64.legacy_bytes ?></td>
<td><?cs var:ndk.win64.legacy_checksum ?></td>
@ -126,8 +121,8 @@ if:ndk ?>
<tr>
<td>Mac OS X 32-bit</td>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.mac32_download ?>"><?cs var:ndk.mac32_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac32_download ?>"><?cs var:ndk.mac32_download ?></a>
</td>
<td><?cs var:ndk.mac32_bytes ?></td>
<td><?cs var:ndk.mac32_checksum ?></td>
@ -135,41 +130,32 @@ if:ndk ?>
<!-- (this item is deprecated)
<tr>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.mac32.legacy_download ?>"><?cs var:ndk.mac32.legacy_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac32.legacy_download ?>"><?cs var:ndk.mac32.legacy_download ?></a>
</td>
<td><?cs var:ndk.mac32.legacy_bytes ?></td>
<td><?cs var:ndk.mac32.legacy_checksum ?></td>
</tr> -->
<td>Mac OS X 64-bit</td>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.mac64_download ?>"><?cs var:ndk.mac64_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac64_download ?>"><?cs var:ndk.mac64_download ?></a>
</td>
<td><?cs var:ndk.mac64_bytes ?></td>
<td><?cs var:ndk.mac64_checksum ?></td>
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.mac64.legacy_download ?>"><?cs var:ndk.mac64.legacy_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac64.legacy_download ?>"><?cs var:ndk.mac64.legacy_download ?></a>
</td>
<td><?cs var:ndk.mac64.legacy_bytes ?></td>
<td><?cs var:ndk.mac64.legacy_checksum ?></td>
</tr> -->
<tr>
<td>Linux 32-bit (x86)</td>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.linux32_download ?>"><?cs var:ndk.linux32_download ?></a>
</td>
<td><?cs var:ndk.linux32_bytes ?></td>
<td><?cs var:ndk.linux32_checksum ?></td>
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.linux32.legacy_download ?>"><?cs var:ndk.linux32.legacy_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.linux32.legacy_download ?>"><?cs var:ndk.linux32.legacy_download ?></a>
</td>
<td><?cs var:ndk.linux32.legacy_bytes ?></td>
<td><?cs var:ndk.linux32.legacy_checksum ?></td>
@ -177,16 +163,16 @@ if:ndk ?>
<tr>
<td>Linux 64-bit (x86)</td>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.linux64_download ?>"><?cs var:ndk.linux64_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.linux64_download ?>"><?cs var:ndk.linux64_download ?></a>
</td>
<td><?cs var:ndk.linux64_bytes ?></td>
<td><?cs var:ndk.linux64_checksum ?></td>
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
href="http://dl.google.com/android/ndk/<?cs var:ndk.linux64.legacy_download ?>"><?cs var:ndk.linux64.legacy_download ?></a>
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.linux64.legacy_download ?>"><?cs var:ndk.linux64.legacy_download ?></a>
</td>
<td><?cs var:ndk.linux64.legacy_bytes ?></td>
<td><?cs var:ndk.linux64.legacy_checksum ?></td>
@ -198,16 +184,13 @@ if:ndk ?>
<?cs call:tag_list(root.descr) ?>
<?cs ######## The NDK version of the download script ######### ?>
<script>
function onDownload(link) {
$("#downloadForRealz").html("Download " + $(link).text());
$("#downloadForRealz").attr('href',$(link).attr('href'));
$("#tos").fadeIn('slow');
location.hash = "download";
return false;
}
@ -220,25 +203,28 @@ if:ndk ?>
}
}
function onDownloadNdkForRealz(link) {
function onDownloadForRealz(link) {
if ($("input#agree").is(':checked')) {
$("#tos").fadeOut('slow');
$('html, body').animate({
scrollTop: $("#Installing").offset().top
}, 800, function() {
$("#Installing").click();
$("div.sdk-terms").slideUp();
$("h2#tos-header").text('Now downloading...');
$(".sdk-terms-intro").text('Your download is in progress.');
$("#sdk-terms-form").fadeOut('slow', function() {
setTimeout(function() {
// close the dialog
$('#ndk_tos').trigger('modal-close');
// reload to refresh the tos or optionally forward the user
location.reload();
}, 3000);
});
ga('send', 'event', 'NDK', 'IDE and Tools', $("#downloadForRealz").html());
return true;
} else {
$("label#agreeLabel").parent().stop().animate({color: "#258AAF"}, 200,
function() {$("label#agreeLabel").parent().stop().animate({color: "#222"}, 200)}
);
return false;
}
}
$(window).hashchange( function(){
if (location.hash == "") {
location.reload();
@ -270,153 +256,173 @@ if:ndk ?>
<?cs call:tag_list(root.descr) ?>
<section id="downloads" class="dac-section dac-small">
<div class="wrap">
<h2 class="norule">Start using Android Studio today</h2>
<p>Android Studio includes all the tools you need to build apps for Android.</p>
<div style="float:left;margin-right:40px;width:auto;">
<p>
<a class="landing-button green download-bundle-button"
data-modal-toggle="studio_tos">Download Android Studio 2.0<br>
<span class="small"></span></a>
</p>
</div>
<div style="float:left;width:auto;margin-bottom:40px">
<ul class="nolist" style="text-transform: uppercase;margin:8px 0">
<li>Version: <?cs var:studio.version ?></li>
<li>Release date: <?cs var:studio.release.date ?></li>
</ul>
</div>
<div class="pax col-13 online" style="margin:0;">
<h3>SDK Tools Only</h3>
<p>If you prefer to use a different IDE or run the tools from the
command line or with build scripts, you can instead download the stand-alone Android SDK Tools.
These packages provide the basic SDK tools for app development, without an IDE.
Also see the <a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">SDK tools release notes</a>.</p>
<h4 style="clear:left;margin-top:40px">Select a different platform</h4>
<table class="download">
<tr>
<th>Platform</th>
<th>Package</th>
<th>Android Studio package</th>
<th>Size</th>
<th>SHA-1 Checksum</th>
<th>SHA-1 checksum</th>
</tr>
<tr>
<td rowspan="2">Windows</td>
<td>
<a onclick="return onDownload(this)" id="win-tools" href="http://dl.google.com/android/<?cs
var:sdk.win_installer
?>"><?cs var:sdk.win_installer ?></a> (Recommended)
</td>
<td><?cs var:sdk.win_installer_bytes ?> bytes</td>
<td><?cs var:sdk.win_installer_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_download
?>"><?cs var:sdk.win_download ?></a>
</td>
<td><?cs var:sdk.win_bytes ?> bytes</td>
<td><?cs var:sdk.win_checksum ?></td>
</tr>
<tr>
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this)" id="mac-tools" href="http://dl.google.com/android/<?cs
var:sdk.mac_download
?>"><?cs var:sdk.mac_download ?></a>
</td>
<td><?cs var:sdk.mac_bytes ?> bytes</td>
<td><?cs var:sdk.mac_checksum ?></td>
</tr>
<tr>
<td>Linux</td>
<td>
<a onclick="return onDownload(this)" id="linux-tools" href="http://dl.google.com/android/<?cs
var:sdk.linux_download
?>"><?cs var:sdk.linux_download ?></a>
</td>
<td><?cs var:sdk.linux_bytes ?> bytes</td>
<td><?cs var:sdk.linux_checksum ?></td>
</tr>
</table>
<h3>All Android Studio Packages</h3>
<p>Select a specific Android Studio package for your platform. Also see the
<a href="<?cs var:toroot ?>tools/revisions/studio.html">Android Studio release notes</a>.</p>
<table class="download">
<tr>
<th>Platform</th>
<th>Package</th>
<th>Size</th>
<th>SHA-1 Checksum</th>
</tr>
<tr>
<td rowspan="3">Windows</td>
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle"
<a onclick="return onDownload(this,false,true)" id="win-bundle" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_bundle_exe_download ?>"
><?cs var:studio.win_bundle_exe_download ?></a><br>(Recommended)
><?cs var:studio.win_bundle_exe_download ?></a><br>
Includes Windows installer (recommended)
</td>
<td><?cs var:studio.win_bundle_exe_bytes ?> bytes</td>
<td id="win-bundle-size"><?cs call:size_in_mb(studio.win_bundle_exe_bytes) ?> MB
<br>(<?cs var:studio.win_bundle_exe_bytes ?> bytes)</td>
<td><?cs var:studio.win_bundle_exe_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle-notools"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_notools_exe_download ?>"
><?cs var:studio.win_notools_exe_download ?></a><br>(No SDK tools included)
</td>
<td><?cs var:studio.win_notools_exe_bytes ?> bytes</td>
<td><?cs var:studio.win_notools_exe_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle-zip"
<a onclick="return onDownload(this,false,true)" id="win-bundle-zip" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/ide-zips/<?cs var:studio.version ?>/<?cs var:studio.win_bundle_download ?>"
><?cs var:studio.win_bundle_download ?></a>
><?cs var:studio.win_bundle_download ?></a><br>
No Windows installer
</td>
<td><?cs var:studio.win_bundle_bytes ?> bytes</td>
<td><?cs call:size_in_mb(studio.win_bundle_bytes) ?> MB
<br>(<?cs var:studio.win_bundle_bytes ?> bytes)</td>
<td><?cs var:studio.win_bundle_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle-notools" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_notools_exe_download ?>"
><?cs var:studio.win_notools_exe_download ?></a><br>
Includes Windows installer but no SDK tools
</td>
<td><?cs call:size_in_mb(studio.win_notools_exe_bytes) ?> MB
<br>(<?cs var:studio.win_notools_exe_bytes ?> bytes)</td>
<td><?cs var:studio.win_notools_exe_checksum ?></td>
</tr>
<tr>
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this,false,true)" id="mac-bundle"
<a onclick="return onDownload(this,false,true)" id="mac-bundle" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.mac_bundle_download ?>"
><?cs var:studio.mac_bundle_download ?></a>
</td>
<td><?cs var:studio.mac_bundle_bytes ?> bytes</td>
<td id="mac-bundle-size"><?cs call:size_in_mb(studio.mac_bundle_bytes) ?> MB
<br>(<?cs var:studio.mac_bundle_bytes ?> bytes)</td>
<td><?cs var:studio.mac_bundle_checksum ?></td>
</tr>
<tr>
<td>Linux</td>
<td>
<a onclick="return onDownload(this,false,true)" id="linux-bundle"
<a onclick="return onDownload(this,false,true)" id="linux-bundle" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/ide-zips/<?cs var:studio.version ?>/<?cs var:studio.linux_bundle_download ?>"
><?cs var:studio.linux_bundle_download ?></a>
</td>
<td><?cs var:studio.linux_bundle_bytes ?> bytes</td>
<td id="linux-bundle-size"><?cs call:size_in_mb(studio.linux_bundle_bytes) ?> MB
<br>(<?cs var:studio.linux_bundle_bytes ?> bytes)</td>
<td><?cs var:studio.linux_bundle_checksum ?></td>
</tr>
</table>
</div><!-- end pax -->
<h4 class="norule" style="margin-top:40px">Get just the SDK tools</h4>
<p>If you do not need Android Studio, you can download the basic
Android SDK tools below.</p>
<table class="download">
<tr>
<th>Platform</th>
<th>SDK tools package</th>
<th>Size</th>
<th>SHA-1 checksum</th>
</tr>
<tr>
<td rowspan="2">Windows</td>
<td>
<a onclick="return onDownload(this)" id="win-tools" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs
var:sdk.win_installer
?>"><?cs var:sdk.win_installer ?></a><br>
Includes Windows installer
</td>
<td><?cs call:size_in_mb(sdk.win_installer_bytes) ?> MB
<br>(<?cs var:sdk.win_installer_bytes ?> bytes)</td>
<td><?cs var:sdk.win_installer_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this)" id="win-tools2" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs var:sdk.win_download
?>"><?cs var:sdk.win_download ?></a><br>
No Windows installer
</td>
<td><?cs call:size_in_mb(sdk.win_bytes) ?> MB
<br>(<?cs var:sdk.win_bytes ?> bytes)</td>
<td><?cs var:sdk.win_checksum ?></td>
</tr>
<tr>
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this)" id="mac-tools" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs
var:sdk.mac_download
?>"><?cs var:sdk.mac_download ?></a>
</td>
<td><?cs call:size_in_mb(sdk.mac_bytes) ?> MB
<br>(<?cs var:sdk.mac_bytes ?> bytes)</td>
<td><?cs var:sdk.mac_checksum ?></td>
</tr>
<tr>
<td>Linux</td>
<td>
<a onclick="return onDownload(this)" id="linux-tools" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs
var:sdk.linux_download
?>"><?cs var:sdk.linux_download ?></a>
</td>
<td><?cs call:size_in_mb(sdk.linux_bytes) ?> MB
<br>(<?cs var:sdk.linux_bytes ?> bytes)</td>
<td><?cs var:sdk.linux_checksum ?></td>
</tr>
</table>
<p>
Also see the <a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">SDK
tools release notes</a>.</p>
</div><!-- end wrap -->
</section>
<?cs ######## The Android Studio version of the download script ######### ?>
<script>
if (location.hash == "#Requirements") {
$('.reqs').show();
} else if (location.hash == "#ExistingIDE") {
$('.ide').show();
}
var os;
var bundlename;
var $toolslink;
@ -441,7 +447,9 @@ var:sdk.linux_download
$('#not-supported').hide();
/* set up primary Android Studio download button */
$('.download-bundle-button > .small').html(" for " + os);
idname = bundlename + "-size";
sizeMB = $(idname).text().split(' MB')[0];
$('.download-bundle-button > .small').html(" for " + os + " <em>(" + sizeMB + " MB)</em>");
$('.download-bundle-button').click(function() {return onDownload(this,true,true);}).attr('href', bundlename);
}
@ -459,13 +467,10 @@ var:sdk.linux_download
if (bundle && !button) {
$("a#downloadForRealz").attr("name", "#" + $(link).attr('id'));
} else {
$("h2#tos-header").text('Download the Android SDK Tools');
$("a#downloadForRealz").attr("name", $(link).attr('href'));
}
$("#tos").show();
$("#landing").hide();
location.hash = "top";
return false;
}
@ -493,22 +498,24 @@ var:sdk.linux_download
function onDownloadForRealz(link) {
if ($("input#agree").is(':checked')) {
location.hash = "";
location.hash = "top";
$("div.sdk-terms").slideUp();
$("h1#tos-header").text('Now downloading...');
$(".sdk-terms-intro").text('You\'ll be redirected to the install instructions in a moment.');
$("#sdk-terms-form").fadeOut('slow', function() {
setTimeout(function() {
if ($("#downloadForRealz").attr('bundle') == 'true') {
// User downloaded the studio Bundle
window.location = "/sdk/installing/index.html?pkg=studio";
} else {
// User downloaded the SDK Tools
window.location = "/sdk/installing/index.html?pkg=tools";
}
}, 3000);
});
if ($("#downloadForRealz").attr('bundle') == 'true') {
$("h2#tos-header").text('Now downloading Android Studio!');
$(".sdk-terms-intro").text('Redirecting to the install instructions...');
$("#sdk-terms-form").slideUp(function() {
setTimeout(function() {
window.location = "/sdk/installing/index.html";
}, 2000);
});
} else {
$("h2#tos-header").text('Now downloading the Android SDK Tools!');
$(".sdk-terms-intro").html("<p>Because you've chosen to download " +
"only the Android SDK tools (and not Android Studio), there are no " +
"setup procedures to follow.</p><p>For information about how to " +
"keep your SDK tools up to date, refer to the " +
"<a href='/tools/help/sdk-manager.html'>SDK Manager</a> guide.</p>");
$("#sdk-terms-form").slideUp();
}
ga('send', 'event', 'SDK', 'IDE and Tools', $("#downloadForRealz").html());
return true;
} else {
@ -526,7 +533,7 @@ var:sdk.linux_download
</div><!-- end the wrapper used for relative/absolute positions -->
<?cs # THIS DIV WAS OPENED IN INDEX.JD ?>
@ -573,9 +580,14 @@ var:sdk.linux_download
<?cs /if ?>
</div><!-- end g-unit -->
<?cs if:!devsite ?>
<?cs include:"trailer.cs" ?>
<?cs /if ?>
<script src="https://developer.android.com/ytblogger_lists_unified.js?v=17" type="text/javascript"></script>
<script src="/jd_lists_unified.js?v=17" type="text/javascript"></script>
<script src="/jd_extras.js?v=17" type="text/javascript"></script>
<script src="/jd_collections.js?v=17" type="text/javascript"></script>
<script src="/jd_tag_helpers.js?v=17" type="text/javascript"></script>
<!-- Start of Tag -->
<script type="text/javascript">
var axel = Math.random() + "";

View file

@ -7787,6 +7787,20 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
text-align: center;
}
/* Android Studio download page */
section#features {
padding-top:0;
}
.wrap.feature {
margin:80px auto;
}
.dac-section-links.feature-more {
margin-top:-20px;
}
.dac-toggle-content .wrap.feature {
margin-top:0;
}
@media (max-width: 719px) {
.dac-hero-figure {
height: 150px;
@ -7796,6 +7810,17 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
.dac-hero-figure img {
max-height: 150px;
}
/* Android Studio download page */
.feature .dac-hero-figure,
.feature .dac-hero-figure img {
height:auto;
max-height:none;
}
.feature .dac-hero-figure img {
width:90%;
margin:0 auto;
}
}
.dac-hero-carousel {

View file

@ -4944,6 +4944,11 @@ function showSamples() {
this.el.removeClass('dac-active');
$('body').removeClass('dac-modal-open');
this.isOpen = false;
// When closing the modal for Android Studio downloads, reload the page
// because otherwise we might get stuck with post-download dialog state
if ($("[data-modal='studio_tos']").length) {
location.reload();
}
};
Modal.prototype.open_ = function() {

View file

@ -86,7 +86,7 @@
<tr>
<td>Windows 32-bit</td>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.win32_download ?>"><?cs var:ndk.win32_download ?></a>
</td>
<td><?cs var:ndk.win32_bytes ?></td>
@ -94,7 +94,7 @@
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/ndk/<?cs var:ndk.win32.legacy_download ?>"><?cs var:ndk.win32.legacy_download ?></a>
</td>
<td><?cs var:ndk.win32.legacy_bytes ?></td>
@ -103,7 +103,7 @@
<tr>
<td>Windows 64-bit</td>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.win64_download ?>"><?cs var:ndk.win64_download ?></a>
</td>
<td><?cs var:ndk.win64_bytes ?></td>
@ -111,7 +111,7 @@
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.win64.legacy_download ?>"><?cs var:ndk.win64.legacy_download ?></a>
</td>
<td><?cs var:ndk.win64.legacy_bytes ?></td>
@ -121,7 +121,7 @@
<tr>
<td>Mac OS X 32-bit</td>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac32_download ?>"><?cs var:ndk.mac32_download ?></a>
</td>
<td><?cs var:ndk.mac32_bytes ?></td>
@ -130,7 +130,7 @@
<!-- (this item is deprecated)
<tr>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac32.legacy_download ?>"><?cs var:ndk.mac32.legacy_download ?></a>
</td>
<td><?cs var:ndk.mac32.legacy_bytes ?></td>
@ -138,7 +138,7 @@
</tr> -->
<td>Mac OS X 64-bit</td>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac64_download ?>"><?cs var:ndk.mac64_download ?></a>
</td>
<td><?cs var:ndk.mac64_bytes ?></td>
@ -146,7 +146,7 @@
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.mac64.legacy_download ?>"><?cs var:ndk.mac64.legacy_download ?></a>
</td>
<td><?cs var:ndk.mac64.legacy_bytes ?></td>
@ -154,7 +154,7 @@
</tr> -->
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.linux32.legacy_download ?>"><?cs var:ndk.linux32.legacy_download ?></a>
</td>
<td><?cs var:ndk.linux32.legacy_bytes ?></td>
@ -163,7 +163,7 @@
<tr>
<td>Linux 64-bit (x86)</td>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.linux64_download ?>"><?cs var:ndk.linux64_download ?></a>
</td>
<td><?cs var:ndk.linux64_bytes ?></td>
@ -171,7 +171,7 @@
</tr>
<!-- <tr>
<td>
<a onClick="return onDownload(this)"
<a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
href="http://dl.google.com/android/repository/<?cs var:ndk.linux64.legacy_download ?>"><?cs var:ndk.linux64.legacy_download ?></a>
</td>
<td><?cs var:ndk.linux64.legacy_bytes ?></td>
@ -184,16 +184,13 @@
<?cs call:tag_list(root.descr) ?>
<?cs ######## The NDK version of the download script ######### ?>
<script>
function onDownload(link) {
$("#downloadForRealz").html("Download " + $(link).text());
$("#downloadForRealz").attr('href',$(link).attr('href'));
$("#tos").fadeIn('slow');
location.hash = "download";
return false;
}
@ -206,25 +203,28 @@
}
}
function onDownloadNdkForRealz(link) {
function onDownloadForRealz(link) {
if ($("input#agree").is(':checked')) {
$("#tos").fadeOut('slow');
$('html, body').animate({
scrollTop: $("#Installing").offset().top
}, 800, function() {
$("#Installing").click();
$("div.sdk-terms").slideUp();
$("h2#tos-header").text('Now downloading...');
$(".sdk-terms-intro").text('Your download is in progress.');
$("#sdk-terms-form").fadeOut('slow', function() {
setTimeout(function() {
// close the dialog
$('#ndk_tos').trigger('modal-close');
// reload to refresh the tos or optionally forward the user
location.reload();
}, 3000);
});
ga('send', 'event', 'NDK', 'IDE and Tools', $("#downloadForRealz").html());
return true;
} else {
$("label#agreeLabel").parent().stop().animate({color: "#258AAF"}, 200,
function() {$("label#agreeLabel").parent().stop().animate({color: "#222"}, 200)}
);
return false;
}
}
$(window).hashchange( function(){
if (location.hash == "") {
location.reload();
@ -256,153 +256,173 @@
<?cs call:tag_list(root.descr) ?>
<section id="downloads" class="dac-section dac-small">
<div class="wrap">
<h2 class="norule">Start using Android Studio today</h2>
<p>Android Studio includes all the tools you need to build apps for Android.</p>
<div style="float:left;margin-right:40px;width:auto;">
<p>
<a class="landing-button green download-bundle-button"
data-modal-toggle="studio_tos">Download Android Studio 2.0<br>
<span class="small"></span></a>
</p>
</div>
<div style="float:left;width:auto;margin-bottom:40px">
<ul class="nolist" style="text-transform: uppercase;margin:8px 0">
<li>Version: <?cs var:studio.version ?></li>
<li>Release date: <?cs var:studio.release.date ?></li>
</ul>
</div>
<div class="pax col-13 online" style="margin:0;">
<h3>SDK Tools Only</h3>
<p>If you prefer to use a different IDE or run the tools from the
command line or with build scripts, you can instead download the stand-alone Android SDK Tools.
These packages provide the basic SDK tools for app development, without an IDE.
Also see the <a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">SDK tools release notes</a>.</p>
<h4 style="clear:left;margin-top:40px">Select a different platform</h4>
<table class="download">
<tr>
<th>Platform</th>
<th>Package</th>
<th>Android Studio package</th>
<th>Size</th>
<th>SHA-1 Checksum</th>
<th>SHA-1 checksum</th>
</tr>
<tr>
<td rowspan="2">Windows</td>
<td>
<a onclick="return onDownload(this)" id="win-tools" href="http://dl.google.com/android/<?cs
var:sdk.win_installer
?>"><?cs var:sdk.win_installer ?></a> (Recommended)
</td>
<td><?cs var:sdk.win_installer_bytes ?> bytes</td>
<td><?cs var:sdk.win_installer_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_download
?>"><?cs var:sdk.win_download ?></a>
</td>
<td><?cs var:sdk.win_bytes ?> bytes</td>
<td><?cs var:sdk.win_checksum ?></td>
</tr>
<tr>
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this)" id="mac-tools" href="http://dl.google.com/android/<?cs
var:sdk.mac_download
?>"><?cs var:sdk.mac_download ?></a>
</td>
<td><?cs var:sdk.mac_bytes ?> bytes</td>
<td><?cs var:sdk.mac_checksum ?></td>
</tr>
<tr>
<td>Linux</td>
<td>
<a onclick="return onDownload(this)" id="linux-tools" href="http://dl.google.com/android/<?cs
var:sdk.linux_download
?>"><?cs var:sdk.linux_download ?></a>
</td>
<td><?cs var:sdk.linux_bytes ?> bytes</td>
<td><?cs var:sdk.linux_checksum ?></td>
</tr>
</table>
<h3>All Android Studio Packages</h3>
<p>Select a specific Android Studio package for your platform. Also see the
<a href="<?cs var:toroot ?>tools/revisions/studio.html">Android Studio release notes</a>.</p>
<table class="download">
<tr>
<th>Platform</th>
<th>Package</th>
<th>Size</th>
<th>SHA-1 Checksum</th>
</tr>
<tr>
<td rowspan="3">Windows</td>
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle"
<a onclick="return onDownload(this,false,true)" id="win-bundle" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_bundle_exe_download ?>"
><?cs var:studio.win_bundle_exe_download ?></a><br>(Recommended)
><?cs var:studio.win_bundle_exe_download ?></a><br>
Includes Windows installer (recommended)
</td>
<td><?cs var:studio.win_bundle_exe_bytes ?> bytes</td>
<td id="win-bundle-size"><?cs call:size_in_mb(studio.win_bundle_exe_bytes) ?> MB
<br>(<?cs var:studio.win_bundle_exe_bytes ?> bytes)</td>
<td><?cs var:studio.win_bundle_exe_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle-notools"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_notools_exe_download ?>"
><?cs var:studio.win_notools_exe_download ?></a><br>(No SDK tools included)
</td>
<td><?cs var:studio.win_notools_exe_bytes ?> bytes</td>
<td><?cs var:studio.win_notools_exe_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle-zip"
<a onclick="return onDownload(this,false,true)" id="win-bundle-zip" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/ide-zips/<?cs var:studio.version ?>/<?cs var:studio.win_bundle_download ?>"
><?cs var:studio.win_bundle_download ?></a>
><?cs var:studio.win_bundle_download ?></a><br>
No Windows installer
</td>
<td><?cs var:studio.win_bundle_bytes ?> bytes</td>
<td><?cs call:size_in_mb(studio.win_bundle_bytes) ?> MB
<br>(<?cs var:studio.win_bundle_bytes ?> bytes)</td>
<td><?cs var:studio.win_bundle_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this,false,true)" id="win-bundle-notools" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_notools_exe_download ?>"
><?cs var:studio.win_notools_exe_download ?></a><br>
Includes Windows installer but no SDK tools
</td>
<td><?cs call:size_in_mb(studio.win_notools_exe_bytes) ?> MB
<br>(<?cs var:studio.win_notools_exe_bytes ?> bytes)</td>
<td><?cs var:studio.win_notools_exe_checksum ?></td>
</tr>
<tr>
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this,false,true)" id="mac-bundle"
<a onclick="return onDownload(this,false,true)" id="mac-bundle" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.mac_bundle_download ?>"
><?cs var:studio.mac_bundle_download ?></a>
</td>
<td><?cs var:studio.mac_bundle_bytes ?> bytes</td>
<td id="mac-bundle-size"><?cs call:size_in_mb(studio.mac_bundle_bytes) ?> MB
<br>(<?cs var:studio.mac_bundle_bytes ?> bytes)</td>
<td><?cs var:studio.mac_bundle_checksum ?></td>
</tr>
<tr>
<td>Linux</td>
<td>
<a onclick="return onDownload(this,false,true)" id="linux-bundle"
<a onclick="return onDownload(this,false,true)" id="linux-bundle" data-modal-toggle="studio_tos"
href="https://dl.google.com/dl/android/studio/ide-zips/<?cs var:studio.version ?>/<?cs var:studio.linux_bundle_download ?>"
><?cs var:studio.linux_bundle_download ?></a>
</td>
<td><?cs var:studio.linux_bundle_bytes ?> bytes</td>
<td id="linux-bundle-size"><?cs call:size_in_mb(studio.linux_bundle_bytes) ?> MB
<br>(<?cs var:studio.linux_bundle_bytes ?> bytes)</td>
<td><?cs var:studio.linux_bundle_checksum ?></td>
</tr>
</table>
</div><!-- end pax -->
<h4 class="norule" style="margin-top:40px">Get just the SDK tools</h4>
<p>If you do not need Android Studio, you can download the basic
Android SDK tools below.</p>
<table class="download">
<tr>
<th>Platform</th>
<th>SDK tools package</th>
<th>Size</th>
<th>SHA-1 checksum</th>
</tr>
<tr>
<td rowspan="2">Windows</td>
<td>
<a onclick="return onDownload(this)" id="win-tools" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs
var:sdk.win_installer
?>"><?cs var:sdk.win_installer ?></a><br>
Includes Windows installer
</td>
<td><?cs call:size_in_mb(sdk.win_installer_bytes) ?> MB
<br>(<?cs var:sdk.win_installer_bytes ?> bytes)</td>
<td><?cs var:sdk.win_installer_checksum ?></td>
</tr>
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="return onDownload(this)" id="win-tools2" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs var:sdk.win_download
?>"><?cs var:sdk.win_download ?></a><br>
No Windows installer
</td>
<td><?cs call:size_in_mb(sdk.win_bytes) ?> MB
<br>(<?cs var:sdk.win_bytes ?> bytes)</td>
<td><?cs var:sdk.win_checksum ?></td>
</tr>
<tr>
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this)" id="mac-tools" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs
var:sdk.mac_download
?>"><?cs var:sdk.mac_download ?></a>
</td>
<td><?cs call:size_in_mb(sdk.mac_bytes) ?> MB
<br>(<?cs var:sdk.mac_bytes ?> bytes)</td>
<td><?cs var:sdk.mac_checksum ?></td>
</tr>
<tr>
<td>Linux</td>
<td>
<a onclick="return onDownload(this)" id="linux-tools" data-modal-toggle="studio_tos"
href="//dl.google.com/android/<?cs
var:sdk.linux_download
?>"><?cs var:sdk.linux_download ?></a>
</td>
<td><?cs call:size_in_mb(sdk.linux_bytes) ?> MB
<br>(<?cs var:sdk.linux_bytes ?> bytes)</td>
<td><?cs var:sdk.linux_checksum ?></td>
</tr>
</table>
<p>
Also see the <a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">SDK
tools release notes</a>.</p>
</div><!-- end wrap -->
</section>
<?cs ######## The Android Studio version of the download script ######### ?>
<script>
if (location.hash == "#Requirements") {
$('.reqs').show();
} else if (location.hash == "#ExistingIDE") {
$('.ide').show();
}
var os;
var bundlename;
var $toolslink;
@ -427,7 +447,9 @@ var:sdk.linux_download
$('#not-supported').hide();
/* set up primary Android Studio download button */
$('.download-bundle-button > .small').html(" for " + os);
idname = bundlename + "-size";
sizeMB = $(idname).text().split(' MB')[0];
$('.download-bundle-button > .small').html(" for " + os + " <em>(" + sizeMB + " MB)</em>");
$('.download-bundle-button').click(function() {return onDownload(this,true,true);}).attr('href', bundlename);
}
@ -445,13 +467,10 @@ var:sdk.linux_download
if (bundle && !button) {
$("a#downloadForRealz").attr("name", "#" + $(link).attr('id'));
} else {
$("h2#tos-header").text('Download the Android SDK Tools');
$("a#downloadForRealz").attr("name", $(link).attr('href'));
}
$("#tos").show();
$("#landing").hide();
location.hash = "top";
return false;
}
@ -479,22 +498,24 @@ var:sdk.linux_download
function onDownloadForRealz(link) {
if ($("input#agree").is(':checked')) {
location.hash = "";
location.hash = "top";
$("div.sdk-terms").slideUp();
$("h1#tos-header").text('Now downloading...');
$(".sdk-terms-intro").text('You\'ll be redirected to the install instructions in a moment.');
$("#sdk-terms-form").fadeOut('slow', function() {
setTimeout(function() {
if ($("#downloadForRealz").attr('bundle') == 'true') {
// User downloaded the studio Bundle
window.location = "/sdk/installing/index.html?pkg=studio";
} else {
// User downloaded the SDK Tools
window.location = "/sdk/installing/index.html?pkg=tools";
}
}, 3000);
});
if ($("#downloadForRealz").attr('bundle') == 'true') {
$("h2#tos-header").text('Now downloading Android Studio!');
$(".sdk-terms-intro").text('Redirecting to the install instructions...');
$("#sdk-terms-form").slideUp(function() {
setTimeout(function() {
window.location = "/sdk/installing/index.html";
}, 2000);
});
} else {
$("h2#tos-header").text('Now downloading the Android SDK Tools!');
$(".sdk-terms-intro").html("<p>Because you've chosen to download " +
"only the Android SDK tools (and not Android Studio), there are no " +
"setup procedures to follow.</p><p>For information about how to " +
"keep your SDK tools up to date, refer to the " +
"<a href='/tools/help/sdk-manager.html'>SDK Manager</a> guide.</p>");
$("#sdk-terms-form").slideUp();
}
ga('send', 'event', 'SDK', 'IDE and Tools', $("#downloadForRealz").html());
return true;
} else {
@ -512,7 +533,7 @@ var:sdk.linux_download
</div><!-- end the wrapper used for relative/absolute positions -->
<?cs # THIS DIV WAS OPENED IN INDEX.JD ?>
@ -561,6 +582,11 @@ var:sdk.linux_download
</div><!-- end g-unit -->
<?cs include:"trailer.cs" ?>
<script src="https://developer.android.com/ytblogger_lists_unified.js?v=17" type="text/javascript"></script>
<script src="/jd_lists_unified.js?v=17" type="text/javascript"></script>
<script src="/jd_extras.js?v=17" type="text/javascript"></script>
<script src="/jd_collections.js?v=17" type="text/javascript"></script>
<script src="/jd_tag_helpers.js?v=17" type="text/javascript"></script>
<!-- Start of Tag -->
<script type="text/javascript">