diff options
Diffstat (limited to 'docs/html/preview')
| -rw-r--r-- | docs/html/preview/api-overview.jd | 120 | ||||
| -rw-r--r-- | docs/html/preview/data-binding/guide.jd | 908 | ||||
| -rw-r--r-- | docs/html/preview/images/bugs.png | bin | 0 -> 2359 bytes | |||
| -rw-r--r-- | docs/html/preview/images/dev-prev.png | bin | 0 -> 706073 bytes | |||
| -rw-r--r-- | docs/html/preview/images/m-preview-timeline.png | bin | 0 -> 40543 bytes | |||
| -rw-r--r-- | docs/html/preview/images/updates.png | bin | 0 -> 2398 bytes | |||
| -rw-r--r-- | docs/html/preview/index.jd | 52 | ||||
| -rw-r--r-- | docs/html/preview/license.jd (renamed from docs/html/preview/license.html) | 145 | ||||
| -rw-r--r-- | docs/html/preview/overview.jd | 56 | ||||
| -rw-r--r-- | docs/html/preview/preview_toc.cs | 37 | ||||
| -rw-r--r-- | docs/html/preview/reference.jd | 15 | ||||
| -rw-r--r-- | docs/html/preview/samples.jd | 37 | ||||
| -rw-r--r-- | docs/html/preview/setup-sdk.jd (renamed from docs/html/preview/index.html) | 546 | ||||
| -rw-r--r-- | docs/html/preview/support.jd | 67 |
14 files changed, 1437 insertions, 546 deletions
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd new file mode 100644 index 0000000..dde3c7b --- /dev/null +++ b/docs/html/preview/api-overview.jd @@ -0,0 +1,120 @@ +page.title=API Overview +page.keywords=preview,sdk,compatibility +sdk.platform.apiLevel=22 +@jd:body + + +<div id="qv-wrapper"> +<div id="qv"> + +<h2>In this document + <a href="#" onclick="hideNestedItems('#toc44',this);return false;" class="header-toggle"> + <span class="more">show more</span> + <span class="less" style="display:none">show less</span></a></h2> + +<ol id="toc44" class="hide-nested"> + <li><a href="#">Important Behavior Changes</a> + <ol> + <li><a href="#">change 1</a></li> + <li><a href="#">change 2</a></li> + </ol> + </li> + <li><a href="#">Feature Group 1</a> + <ol> + <li><a href="#">change 1</a></li> + <li><a href="#">change 2</a></li> + </ol> + </li> + <li><a href="#">Feature Group 2</a> + <ol> + <li><a href="#">change 1</a></li> + <li><a href="#">change 2</a></li> + </ol> + </li> +</ol> + +</div> +</div> + +<p>The M Developer Preview gives you an advance look at the upcoming release +for the Android platform, which offers new features for users and app +developers. This document provides an introduction to the most notable APIs.</p> + +<p>The M Developer Preview is intended for <strong>developer early +adopters</strong> and <strong>testers</strong>. If you are interested in +influencing the direction of the Android framework, +<a href="{@docRoot}preview/setup-sdk.html">give the M Developer Preview a +try</a> and send us your feedback!</p> + +<p class="caution"><strong>Caution:</strong> Do not not publish apps +that use the M Developer Preview to the Google Play store.</p> + +<p class="note"><strong>Note:</strong> This document often refers to classes and +methods that do not yet have reference material available on <a +href="{@docRoot}">developer.android.com</a>. These API elements are +formatted in {@code code style} in this document (without hyperlinks). For the +preliminary API documentation for these elements, download the <a +href="http://storage.googleapis.com/androiddevelopers/preview/l-developer-preview-reference.zip">preview +reference</a>.</p> + +<h2 id="Behaviors">Important Behavior Changes</h2> + +<p>If you have previously published an app for Android, be aware that your app + might be affected by changes in the upcoming release.</p> + +<h3 id="id">Behavior Change 1</h3> + +<p> + Bacon ipsum dolor amet biltong picanha t-bone, jowl salami tri-tip jerky kielbasa sirloin boudin + porchetta fatback cow meatloaf capicola. Short ribs kielbasa pig drumstick rump boudin jowl chuck + beef ribs doner tenderloin biltong swine. +</p> + + + +<h2 id="id">Feature Group 1</h2> + +<h3 id="id">Feature item 1</h3> + +<p> + Bacon ipsum dolor amet landjaeger capicola tail sausage shank swine biltong pork andouille t-bone + alcatra chicken. Strip steak bacon tongue beef bresaola landjaeger. Shankle boudin pork belly + jowl pig. Rump swine ham hock frankfurter pork shankle. Shank corned beef alcatra doner flank + turducken. Tongue brisket ham shoulder: +</p> + +<h3 id="id">Feature item 2</h3> + +<p> + Bacon ipsum dolor amet landjaeger capicola tail sausage shank swine biltong pork andouille t-bone + alcatra chicken. Strip steak bacon tongue beef bresaola landjaeger. Shankle boudin pork belly + jowl pig. Rump swine ham hock frankfurter pork shankle. Shank corned beef alcatra doner flank + turducken. Tongue brisket ham shoulder: +</p> + +<h2 id="id">Feature Group 2</h2> + +<h3 id="id">Feature item 1</h3> + +<p> + Bacon ipsum dolor amet landjaeger capicola tail sausage shank swine biltong pork andouille t-bone + alcatra chicken. Strip steak bacon tongue beef bresaola landjaeger. Shankle boudin pork belly + jowl pig. Rump swine ham hock frankfurter pork shankle. Shank corned beef alcatra doner flank + turducken. Tongue brisket ham shoulder: +</p> + +<h3 id="id">Feature item 2</h3> + +<p> + Bacon ipsum dolor amet landjaeger capicola tail sausage shank swine biltong pork andouille t-bone + alcatra chicken. Strip steak bacon tongue beef bresaola landjaeger. Shankle boudin pork belly + jowl pig. Rump swine ham hock frankfurter pork shankle. Shank corned beef alcatra doner flank + turducken. Tongue brisket ham shoulder: +</p> + + + +<p class="note"> + For a detailed view of all API changes in the M Developer Preview, see the <a href= + "{@docRoot}preview/reference.html">API Differences Report</a>. +</p>
\ No newline at end of file diff --git a/docs/html/preview/data-binding/guide.jd b/docs/html/preview/data-binding/guide.jd new file mode 100644 index 0000000..49b690f --- /dev/null +++ b/docs/html/preview/data-binding/guide.jd @@ -0,0 +1,908 @@ +page.title=Data Binding Guide + +@jd:body +<p>Data Binding allows you write declarative layouts and minimize the glue code +that is necessary to bind your application logic and layouts.</p> + + +<h2 id=build_environment>Build Environment</h2> + + +<p><strong>Setting Up Work Environment:</strong></p> + +<p>Data Binding EAP only supports gradle.</p> + +<p>To set up your application, unzip the provided bundle to a location. It has 3 +sections</p> + +<ul> + <li> <em>maven-repo:</em> which keeps the data-binding libraries + <li> <em>samples:</em> Sample applications + <li> <em>databinding.properties:</em> Properties file that can be used to integrate with your app +</ul> + +<p>Add the following section to the project’s build.gradle file (not the module's +build.gradle) and replace <code><BUNDLE_FOLDER> </code>with the absolute path of the bundle that you’ve unzipped in the previous step.</p> + +<pre class=prettyprint> +buildscript { + <strong>def </strong>eapFolder = '<BUNDLE_FOLDER>' +<strong> def </strong>Properties props = <strong>new </strong>Properties() + props.load(<strong>new </strong>FileInputStream(<strong>"</strong>${eapFolder}<strong>/databinding.properties"</strong>)) + props.mavenRepoDir = <strong>"</strong>${eapFolder}<strong>/</strong>${props.mavenRepoName}<strong>" + </strong>ext.config = props + repositories { + jcenter() + maven { + url config.mavenRepoDir + } + } + dependencies { + classpath <strong>"com.android.tools.build:gradle:1.1.3" + </strong>classpath <strong>"com.android.databinding:dataBinder:</strong>${config.snapshotVersion}<strong>" +<em></strong> </em>} +} +allprojects { + repositories { + jcenter() + maven { + url config.mavenRepoDir + } + } +} +</pre> + +<p>Next, add the following lines to the <em>build.gradle</em> +file of each module that will use data-binding. The application module must +have this, even if only its libraries use data binding.</p> + +<pre class=prettyprint> +apply plugin: <strong>'com.android.databinding' +</strong>dependencies { + compile <strong>"com.android.databinding:library:</strong>${config.snapshotVersion}<strong>" +</strong> compile <strong>"com.android.databinding:baseLibrary:</strong>${config.snapshotVersion}<strong>" +</strong> compile <strong>"com.android.databinding:adapters:</strong>${config.snapshotVersion}<strong>" +</strong> provided <strong>"com.android.databinding:annotationprocessor:</strong>${config.snapshotVersion}<strong>" +</strong>} +</pre> + + +<h2 id="data_binding_layout_files">Data Binding Layout Files</h2> + + +<h3 id="writing_expressions">Writing your first data binding expressions:</h3> + +<p>Data-binding layout files are slightly different and start with a root tag of +<strong>layout</strong> followed by a <strong>data</strong> element and a +<strong>view</strong> root element. This view element is what your root would +be in a non-binding layout file.A sample file looks like this:</p> + +<pre class=prettyprint> +<em><?<strong></em>xml version="1.0" encoding="utf-8"<em></strong>?> +</em><<strong>layout xmlns:android="http://schemas.android.com/apk/res/android"</strong>> + <<strong>data</strong>> + <<strong>variable name="user" type="com.example.User"</strong>/> + </<strong>data</strong>> + <<strong>LinearLayout + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"</strong>> + <<strong>TextView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@{user.firstName}"</strong>/> + <<strong>TextView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@{user.lastName}"</strong>/> + </<strong>LinearLayout</strong>> +</<strong>layout</strong>> +</pre> + +<p>The user <strong>variable</strong> within <strong>data</strong> describes a property that may be used within this layout.</p> + +<pre class=prettyprint> +<<strong>variable name="user" type="com.example.User"</strong>/> +</pre> + +<p>Expressions within the layout are written in the attribute properties using the +“<code>@{}</code>” syntax. Here, the TextView’s text is set to the firstName property of user:</p> +<pre class=prettyprint> +<<strong>TextView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@{user.firstName}"</strong>/> +</pre> + + +<h3 id="data_object">Data Object</h3> + +<p>Let’s assume for now that you have a plain-old Java object (POJO) for User:</p> +<pre class=prettyprint> +<strong>public class </strong>User { + <strong>public final </strong>String <strong>firstName</strong>; + <strong>public final </strong>String <strong>lastName</strong>; + <strong>public </strong>User(String firstName, String lastName) { + <strong>this</strong>.<strong>firstName </strong>= firstName; + <strong>this</strong>.<strong>lastName </strong>= lastName; + } +} +</pre> + +<p>This type of object has data that never changes. It is common in applications +to have data that is read once and never changes thereafter. It is also +possible to use a JavaBeans objects:</p> +<pre class=prettyprint> +<strong>public class </strong>User { + <strong>private final </strong>String <strong>firstName</strong>; + <strong>private final </strong>String <strong>lastName</strong>; + <strong>public </strong>User(String firstName, String lastName) { + <strong>this</strong>.<strong>firstName </strong>= firstName; + <strong>this</strong>.<strong>lastName </strong>= lastName; + } + <strong>public </strong>String getFirstName() { + <strong>return this</strong>.<strong>firstName</strong>; + } + <strong>public </strong>String getLastName() { + <strong>return this</strong>.<strong>lastName</strong>; + } +} +</pre> + +<p>From the perspective of data binding, these two classes are equivalent. The +expression <strong><code>@{user.lastName}</code></strong> used for the TextView’s <strong><code>android:text</code></strong> attribute will access the <strong><code>firstName</code></strong> field in the former class and the <code>getFirstName()</code> method in the latter class. +</p><h3 id=binding_data>Binding Data</h3> + +<p>By default, a Binding class will be generated based on the name of the layout +file, converting it to Pascal case and suffixing “Binding” to it. The above +layout file was <code>activity_main.xml</code> so the generate class was <code>ActivityMainBinding</code>. This class holds all the bindings from the layout properties (e.g. the <code>user</code> variable) to the layout’s Views and knows how to assign values for the binding +expressions.The easiest means for creating the bindings is to do it while inflating: +</p> + +<pre class=prettyprint> +@Override +<strong>protected void </strong>onCreate(Bundle savedInstanceState) { + <strong>super</strong>.onCreate(savedInstanceState); + ActivityMainBinding binding = DataBindingUtil.<em>setContentView</em>(<strong>this</strong>, R.layout.<em><strong>main_activity</strong></em>); + User user = <strong>new </strong>User(<strong>"Test"</strong>, <strong>"User"</strong>); + binding.setUser(user); +} +</pre> + +<p>You’re done! Run the application and you’ll see Test User in the UI.Alternatively, you can get the view via: +</p><pre class=prettyprint> +MainActivityBinding binding = MainActivityBinding.<em>inflate</em>(getLayoutInflater()); +</pre> + +<p>If you are using data binding items inside a ListView or RecyclerView adapter, +you may prefer to use: +</p><pre class=prettyprint> +ListItemBinding binding = ListItemBinding.inflate(layoutInflater, viewGroup, +false); +//or +ListItemBinding binding = DataBindingUtil.<em>inflate</em>(layoutInflater, R.layout.<em><strong>list_item</strong></em>, viewGroup, <strong>false</strong>); +</pre> + + +<h2 id=layout_details>Layout Details</h2> + + +<h3 id=imports>Imports</h3> + +<p>Zero or more <strong><code>import</code></strong> elements may be used inside the <strong><code>data</code></strong> element. These allow easy reference to classes inside your layout file, just +like in Java. +</p><pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="android.view.View"</strong>/> +</<strong>data</strong>> +</pre> + +<p>Now, View may be used within your binding expression: +</p><pre class=prettyprint> +<<strong>TextView + android:text="@{user.lastName}" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="@{user.isAdult ? View.VISIBLE : View.GONE}"</strong>/> +</pre> + +<p>When there are class name conflicts, one of the classes may be renamed to an +“alias:”</p> +<pre class=prettyprint> +<<strong>import type="android.view.View"</strong>/> +<<strong>import type="com.example.real.estate.View" + alias="Vista"</strong>/> +</pre> + +<p>Now, <strong><code>Vista</code></strong> may be used to reference the <code>com.example.real.estate.View</code> and <strong><code>View</code></strong> may be used to reference <code>android.view.View </code>within the layout file.Imported types may be used as type references in variables and expressions:</p> +<pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="com.example.User"</strong>/> + <<strong>import type="java.util.List"</strong>/> + <<strong>variable name="user" type="User"</strong>/> + <<strong>variable name="userList" type="List<User>"</strong>/> +</<strong>data</strong>> +… +<<strong>TextView + android:text="@{((User)(user.connection)).lastName}" + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +</pre> + +<p>Imported types may also be used when referencing static fields and methods in +expressions:</p> +<pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="com.example.MyStringUtils"</strong>/> + <<strong>variable name="user" type="com.example.User"</strong>/> +</<strong>data</strong>> +… +<<strong>TextView + android:text="@{MyStringUtils.capitalize(user.lastName)}" + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +</pre> + +<p>Just as in Java, <code>java.lang.*</code> is imported automatically.</p> +<h3 id=variables>Variables</h3> + +<p>Any number of <strong><code>variable</code></strong> elements may be used inside the <strong><code>data</code></strong> element. Each <strong><code>variable</code></strong> element describes a property that may be set on the layout to be used in +binding expressions within the layout file.</p> +<pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="android.graphics.drawable.Drawable"</strong>/> + <<strong>variable name="user" type="com.example.User"</strong>/> + <<strong>variable name="image" type="Drawable"</strong>/> + <<strong>variable name="note" type="String"</strong>/> +</<strong>data</strong>> +</pre> + +<p>The variable types are inspected at compile time, so if a variable implements <a href="#observable_objects">Observable</a>, <a href="#observable_collections">observable collection</a>, that should be reflected in the type. If the variable is a base class or + interface that does not implement the Observable* interface, the variables will <strong>not be</strong> observed!</p> + +<p>When there are different layout files for various configurations (e.g. +landscape or portrait), the variables will be combined. There must not be +conflicting variable definitions between these layout files.</p> + +<p>The generated binding class will have a setter and getter for each of the +described variables. The variables will take the default Java values until the +setter is called — <code>null</code> for reference types, <code>0</code> for <code>int</code>, <code>false</code> for <code>boolean</code>, etc.</p> + +<h3 id=custom_binding_class_names>Custom Binding Class Names</h3> + +<p>By default, a Binding class is generated based on the name of the layout file, +starting it with upper-case, removing underscores ( _ ) and capitalizing the +following letter and then suffixing “Binding”. This class will be placed in a +databinding package under the module package. For example, the layout file <code>contact_item.xml</code> will generate <code>ContactItemBinding</code>. If the module package is <code>com.example.my.app</code>, then it will be placed in <code>com.example.my.app.databinding</code>.</p> + +<p>Binding classes may be renamed or placed in different packages by adjusting the <strong><code>class</code></strong> attribute of the <strong><code>data</code></strong> element. For example:</p> +<pre class=prettyprint> +<<strong>data class="ContactItem"</strong>> + ... +</<strong>data</strong>> +</pre> + +<p>This generates the binding class as <code>ContactItem</code> in the databinding package in the module package. If the class should be +generated in a different package within the module package, it may be prefixed +with “.”:</p> +<pre class=prettyprint> +<<strong>data class=".ContactItem"</strong>> + ... +</<strong>data</strong>> +</pre> + +In this case, <code>ContactItem</code> is generated in the module package directly.Any package may be used if the full package is provided: +<pre class=prettyprint> +<<strong>data class="com.example.ContactItem"</strong>> + ... +</<strong>data</strong>> +</pre> + + +<h3 id=includes>Includes</h3> + +<p>Variables may be passed into an included layout's binding from the containing +layout by using the application namespace and the variable name in an +attribute:</p> +<pre class=prettyprint> +<em><?<strong></em>xml version="1.0" encoding="utf-8"<em></strong>?> +</em><<strong>layout xmlns:android="http://schemas.android.com/apk/res/android" +</strong> <strong> xmlns:bind="http://schemas.android.com/apk/res-auto"</strong>> + <<strong>data</strong>> + <<strong>variable name="user" type="com.example.User"</strong>/> + </<strong>data</strong>> + <<strong>LinearLayout + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"</strong>> + <<strong>include layout="@layout/name" + bind:user="@{user}"</strong>/> + <<strong>include layout="@layout/contact" + bind:user="@{user}"</strong>/> + </<strong>LinearLayout</strong>> +</<strong>layout</strong>> +</pre> + +<p>Here, there must be a <code>user</code> variable in both the <code>name.xml </code>and <code>contact.xml </code>layout files.</p> +<h3 id=expression_language>Expression Language</h3> + + +<h4 id=common_features>Common Features</h4> + +<p>The expression language looks a lot like a Java expression. These are the same:</p> +<ul> + <li> Mathematical <strong><code>+ - / * %</code></strong> + <li> String concatenation <strong><code>+</code></strong> + <li> <code>L</code>ogical <strong><code>&& ||</code></strong> + <li> Binary <strong><code>&</code> <code>|</code> <code>^</code></strong> + <li> Unary <strong><code>+ - ! ~</code></strong> + <li> Shift <strong><code>>> >>> <<</code></strong> + <li> Comparison <strong><code>== > < >= <=</code></strong> + <li> <strong><code>instanceof</code></strong> + <li> Grouping <strong><code>()</code></strong> + <li> Literals - character, String, numeric, <strong><code>null</code></strong> + <li> Cast + <li> Method calls + <li> Field access + <li> Array access <strong><code>[]</code></strong> + <li> Ternary operator <strong><code>?:</code></strong> +</ul> +<p>Examples:</p> +<pre class=prettyprint> +<strong>android:text="@{String.valueOf(index + 1)}" +android:visibility="@{age < 13 ? View.GONE : View.VISIBLE}" +android:transitionName='@{"image_" + id}'</strong> +</pre> + + +<h4 id=missing_operations>Missing Operations</h4> + +<p>A few operations are missing from the expression syntax that you can use in +Java.</p> +<ul> + <li> <strong><code>this</code></strong> + <li> <strong><code>super</code></strong> + <li> <strong><code>new</code></strong> + <li> Explicit generic invocation +</ul> + +<h4 id=null_coalescing_operator>Null Coalescing Operator</h4> + +<p>The null coalescing operator (<strong><code>??</code></strong>) chooses the left operand if it is not null or the right if it is null.</p> +<pre class=prettyprint> +<strong>android:text="@{user.displayName ?? user.lastName}"</strong> +</pre> + +<p>This is functionally equivalent to:</p> +<pre class=prettyprint> +<strong>android:text="@{user.displayName != null ? user.displayName : user.lastName}"</strong> +</pre> + + +<h4 id=property_reference>Property Reference</h4> + +<p>The first was already discussed in the <a href="#writing_your_first_data_binding_expressions">Writing your first data binding expressions</a> above: short form JavaBean references. When an expression references a +property on a class, it uses the same format for fields, getters, and +ObservableFields.</p> +<pre class=prettyprint> +<strong>android:text="@{user.lastName}"</strong> +</pre> + + +<h4 id=collections>Collections</h4> + +<p>Common collections: arrays, lists, sparse lists, and maps, may be accessed +using the <code>[]</code> operator for convenience.</p> +<pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="android.util.SparseArray"</strong>/> + <<strong>import type="java.util.Map"</strong>/> + <<strong>import type="java.util.List"</strong>/> + <<strong>variable name="list" type="List<String>"</strong>/> + <<strong>variable name="sparse" type="SparseArray<String>"</strong>/> + <<strong>variable name="map" type="Map<String, String>"</strong>/> + <<strong>variable name="index" type="int"</strong>/> + <<strong>variable name="key" type="String"</strong>/> +</<strong>data</strong>> +… +<strong>android:text="@{list[index]}" +</strong>… +<strong>android:text="@{sparse[index]}" +</strong>… +<strong>android:text="@{map[key]}" +</strong> +</pre> + + +<h4 id=string_literals>String Literals</h4> + +<p>When using single quotes around the attribute value, it is easy to use double +quotes in the expression:</p> +<pre class=prettyprint> +<strong>android:text='@{map["firstName"]}'</strong> +</pre> + +<p>It is also possible to use double quotes to surround the attribute value. When +doing so, String literals should either use the " or back quote (`).</p> +<pre class=prettyprint> +<strong>android:text="@{map[`firstName`}" +android:text="@{map["firstName"]}"</strong> +</pre> + + +<h4 id=resources>Resources</h4> + +<p>It is possible to access resources as part of expressions using the normal +syntax:</p> +<pre class=prettyprint> +<strong>android:padding="@{large? @dimen/largePadding : @dimen/smallPadding}"</strong> +</pre> + +<p>Format strings and plurals may be evaluated by providing parameters:</p> +<pre class=prettyprint> +<strong>android:text="@{@string/nameFormat(firstName, lastName)}" +android:text="@{@plurals/banana(bananaCount)}"</strong> +</pre> + +<p>Some resources require explicit type evaluation.</p> + +<table> + <tr> + <th>Type</th> + <th>Normal Reference</th> + <th>Expression Reference</th> + </tr> + <tr> + <td> +<pre class=prettyprint> +String[]</td> + <td> +@array</td> + <td> +@stringArray</td> + </tr> + <tr> + <td> +int[]</td> + <td> +@array</td> + <td> +@intArray</td> + </tr> + <tr> + <td> +TypedArray</td> + <td> +@array</td> + <td> +@typedArray</td> + </tr> + <tr> + <td> +Animator</td> + <td> +@animator</td> + <td> +@animator</td> + </tr> + <tr> + <td> +StateListAnimator</td> + <td> +@animator</td> + <td> +@stateListAnimator</td> + </tr> + <tr> + <td> +</pre> + +color <code>int</code></td> + <td> +<pre class=prettyprint> +@color</td> + <td> +@color</td> + </tr> + <tr> + <td> +ColorStateList</td> + <td> +@color</td> + <td> +@colorStateList</td> + </tr> +</table> + +</pre> + + +<h2 id="data_objects">Data Objects</h2> + + +<p>Any plain old Java object (POJO) may be used for data binding, but modifying a +POJO will not cause the UI to update. The real power of data binding can be +used by giving your data objects the ability to notify when data changes. There +are three different data change notification mechanisms, <code>Observable </code>objects, <code>ObservableField</code>s, and <code>observable collections</code>.</p> + +<p>When one of these observable data object is bound to the UI and a property of +the data object changes, the UI will be updated automatically.</p> + +<h3 id=observable_objects>Observable Objects</h3> + + +<p>A class implementing <code>android.databinding.Observable</code> interface will allow the binding to attach a single listener to a bound object +to listen for changes of all properties on that object.</p> + +<p>The <code>Observable</code> interface has a mechanism to add and remove listeners, but notifying is up to +the developer. To make development easier, a base class, <code>BaseObservable,</code> was created to implement the listener registration mechanism. The data class +implementer is still responsible for notifying when the properties change. This +is done by assigning an <code>Bindable </code>annotation to the getter and notifying in the setter.</p> + +<pre class=prettyprint> +<strong>private static class </strong>User <strong>extends </strong>BaseObservable { + <strong>private </strong>String <strong>firstName</strong>; + <strong>private </strong>String <strong>lastName</strong>; + @Bindable + <strong>public </strong>String getFirstName() { + <strong>return this</strong>.<strong>firstName</strong>; + } + @Bindable + <strong>public </strong>String getFirstName() { + <strong>return this</strong>.<strong>lastName</strong>; + } + <strong>public void </strong>setFirstName(String firstName) { + <strong>this</strong>.<strong>firstName </strong>= firstName; + notifyPropertyChanged(BR.firstName); + } + <strong>public void </strong>setLastName(String lastName) { + <strong>this</strong>.<strong>lastName </strong>= lastName; + notifyPropertyChanged(BR.lastName); + } +} +</pre> + +<p>The <code>Bindable </code>annotation generates an entry in the BR class file during compilation. The BR +class file will be generated in the module package.If the base class for data classes cannot be changed, the <code>Observable</code> interface may be implemented using the convenient <code>PropertyChangeRegistry</code> to store and notify listeners efficiently.</p> + +<h3 id=observablefields>ObservableFields</h3> + +<p>A little work is involved in creating Observable classes, so developers who +want to save time or have few properties may use ObservableFields. +ObservableFields are self-contained observable objects that have a single +field. There are versions for all primitive types and one for reference types. +To use, create a public final field in the data class:</p> +<pre class=prettyprint> +<strong>private static class </strong>User <strong>extends </strong>BaseObservable { + <strong>public final </strong>ObservableField<String> <strong>firstName </strong>= + <strong>new </strong>ObservableField<>(); + <strong>public final </strong>ObservableField<String> <strong>lastName </strong>= + <strong>new </strong>ObservableField<>(); + <strong>public final </strong>ObservableInt <strong>age </strong>= <strong>new </strong>ObservableInt(); +} +</pre> + +<p>That's it! To access the value, use the set and get accessor methods:</p> +<pre class=prettyprint> +user.<strong>firstName</strong>.set(<strong>"Google"</strong>); +<strong>int </strong>age = user.<strong>age</strong>.get(); +</pre> + + +<h3 id=observable_collections>Observable Collections</h3> + +<p>Some applications use more dynamic structures to hold data. Observable + collections allow keyed access to these data objects.ObservableArrayMap is useful when the key is a reference type, such as String.</p> + +<pre class=prettyprint> +ObservableArrayMap<String, Object> user = <strong>new </strong>ObservableArrayMap<>(); +user.put(<strong>"firstName"</strong>, <strong>"Google"</strong>); +user.put(<strong>"lastName"</strong>, <strong>"Inc."</strong>); +user.put(<strong>"age"</strong>, 17); +</pre> + +In the layout, the map may be accessed through the String keys: +<pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="android.databinding.ObservableMap"</strong>/> + <<strong>variable name="user" type="ObservableMap<String, Object>"</strong>/> +</<strong>data</strong>> +… +<<strong>TextView + android:text='@{user["lastName"]}' + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +<<strong>TextView + android:text='@{String.valueOf(1 + (Integer)user["age"])}' + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +</pre> + +<p>ObservableArrayList is useful when the key is an integer:</p> +<pre class=prettyprint> +ObservableArrayList<Object> user = <strong>new </strong>ObservableArrayList<>(); +user.add(<strong>"Google"</strong>); +user.add(<strong>"Inc."</strong>); +user.add(17); +</pre> + +<p>In the layout, the list may be accessed through the indices:</p> +<pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="android.databinding.ObservableList"</strong>/> + <<strong>import type="com.example.my.app.Fields"</strong>/> + <<strong>variable name="user" type="ObservableList<Object>"</strong>/> +</<strong>data</strong>> +… +<<strong>TextView + android:text='@{user[Fields.LAST_NAME]}' + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +<<strong>TextView + android:text='@{String.valueOf(1 + (Integer)user[Fields.AGE])}' + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +</pre> + + +<h2 id=generated_binding>Generated Binding</h2> + +<p>The generated binding class links the layout variables with the Views within +the layout. As discussed earlier, the name and package of the Binding may be <a href="#custom_binding_class_names">customized</a>. The Generated binding classes all extend <code>android.databinding.ViewDataBinding</code>.</p> +<h3 id=creating>Creating</h3> + +<p>The binding should be created soon after inflation to ensure that the View +hierarchy is not disturbed prior to binding to the Views with expressions +within the layout. There are a few ways to bind to a layout. The most common is +to use the static methods on the Binding class.The inflate method inflates the View hierarchy and binds to it all it one step. +There are versions that attach the View to its parent and that inflate without +attaching.</p> +<pre class=prettyprint> +MyLayoutBinding binding = MyLayoutBinding.<em>inflate</em>(<strong>this</strong>); +MyLayoutBinding binding = MyLayoutBinding.<em>inflate</em>(viewGroup); +</pre> + +<p>If the layout was inflated using a different mechanism, it may be bound +separately:</p> +<pre class=prettyprint> +MyLayoutBinding binding = MyLayoutBinding.<em>bind</em>(viewRoot); +</pre> + +<p>Sometimes the binding cannot be known in advance. In such cases, the binding +can be created using the DataBindingUtil class:</p> +<pre class=prettyprint> +ViewDataBinding binding = DataBindingUtil.<em>inflate</em>(context, layoutId, + parent, attachToParent); +ViewDataBinding binding = DataBindingUtil.<em>bindTo</em>(viewRoot, layoutId); +</pre> + + +<h3 id=views_with_ids>Views With IDs</h3> + +<p>A public final field will be generated for each View with an ID in the layout. +The binding does a single pass on the View hierarchy, extracting the Views with +IDs. This mechanism can be faster than calling findViewById for several Views. For example:</p> +<pre class=prettyprint> +<<strong>layout xmlns:android="http://schemas.android.com/apk/res/android"</strong>> + <<strong>data</strong>> + <<strong>variable name="user" type="com.example.User"</strong>/> + </<strong>data</strong>> + <<strong>LinearLayout + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"</strong>> + <<strong>TextView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@{user.firstName}" +</strong> <strong>android:id="@+id/firstName"</strong>/> + <<strong>TextView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@{user.lastName}"</strong> <strong>android:id="@+id/lastName"</strong>/> + </<strong>LinearLayout</strong>> +</<strong>layout</strong>> +</pre> + +Will generate a binding class with: +<pre class=prettyprint> +<strong>public final </strong>TextView <strong>firstName</strong>; +<strong>public final </strong>TextView <strong>lastName</strong>; +</pre> + +<p>IDs are not nearly as necessary as without data binding, but there are still +some instances where access to Views are still necessary from code.</p> +<h3 id=variables>Variables</h3> + +<p>Each variable will be given a accessor methods.</p> +<pre class=prettyprint> +<<strong>data</strong>> + <<strong>import type="android.graphics.drawable.Drawable"</strong>/> + <<strong>variable name="user" type="com.example.User"</strong>/> + <<strong>variable name="image" type="Drawable"</strong>/> + <<strong>variable name="note" type="String"</strong>/> +</<strong>data</strong>> +</pre> + +<p>will generate setters and getters in the binding:</p> +<pre class=prettyprint> +<strong>public abstract </strong>com.example.User getUser(); +<strong>public abstract void </strong>setUser(com.example.User user); +<strong>public abstract </strong>Drawable getImage(); +<strong>public abstract void </strong>setImage(Drawable image); +<strong>public abstract </strong>String getNote(); +<strong>public abstract void </strong>setNote(String note); +</pre> + + +<h3 id=viewstubs>ViewStubs</h3> + +<p>ViewStubs are a little different from normal Views. They start off invisible +and when they either are made visible or are explicitly told to inflate, they +replace themselves in the layout by inflating another layout.</p> + +<p>Because the ViewStub essentially disappears from the View hierarchy, the View +in the binding object must also disappear to allow collection. Because the +Views are final, a ViewStubProxy object takes the place of the ViewStub, giving +the developer access to the ViewStub when it exists and also access to the +inflated View hierarchy when the ViewStub has been inflated.</p> + +<p>When inflating another layout, a binding must be established for the new +layout. Therefore, the ViewStubProxy must listen to the ViewStub's +OnInflateListener and establish the binding at that time. Since only one can +exist, the ViewStubProxy allows the developer to set an OnInflateListener on it +that it will call after establishing the binding.</p> + +<h3 id=advanced_binding>Advanced Binding</h3> + + +<h4 id=dynamic_variables>Dynamic Variables</h4> + +<p>At times, the specific binding class won't be known. For example, a +RecyclerView Adapter operating against arbitrary layouts won't know the +specific binding class. It still must assign the binding value during the +onBindViewHolder.</p> + +<p>In this example, all layouts that the RecyclerView binds to have an "item" +variable. The BindingHolder has a getBinding method returning the <code>ViewDataBinding</code> base.</p> +<pre class=prettyprint> +<strong>public void </strong>onBindViewHolder(BindingHolder holder, <strong>int </strong>position) { + <strong>final </strong>T item = <strong>mItems</strong>.get(position); + holder.getBinding().setVariable(BR.item, item); + holder.getBinding().executePendingBindings(); +} +</pre> + + +<h4 id=immediate_binding>Immediate Binding</h4> + +<p>When a variable or observable changes, the binding will be scheduled to change +before the next frame. There are times, however, when binding must be executed +immediately. To force execution, use the executePendingBindings() method.</p> +<h2 id=attribute_setters>Attribute Setters</h2> + +<p>Whenever a bound value changes, the generated binding class must call a setter +method on the View with the binding expression. The data binding framework has +ways to customize which method to call to set the value.</p> +<h3 id=automatic_setters>Automatic Setters</h3> + +For an attribute, data binding tries to find the method setAttribute. The +namespace for the attribute does not matter, only the attribute name itself. + +<p>For example, an expression associated with TextView's attribute <strong><code>android:text</code></strong> will look for a setText(String). If the expression returns an int, data +binding will search for a setText(int) method. Be careful to have the +expression return the correct type, casting if necessary.Note that data binding will work even if no attribute exists with the given +name. You can then easily "create" attributes for any setter by using data +binding. For example, support DrawerLayout doesn't have any attributes, but +plenty of setters. You can use the automatic setters to use one of these.</p> +<pre class=prettyprint> +<android.support.v4.widget.<strong>DrawerLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:scrimColor="@{@color/scrim}" + app:drawerListener="@{fragment.drawerListener}"/></strong> +</pre> + + +<h3 id=renamed_setters>Renamed Setters</h3> + +<p>Some attributes have setters that don't match by name. For these methods, an +attribute may be associated with the setter through BindingMethods annotation. +This must be associated with a class and contains BindingMethod annotations, +one for each renamed method. For example, the <strong><code>android:tint</code></strong> attribute is really associated with setImageTintList, not setTint.</p> +<pre class=prettyprint> +@BindingMethods({ + @BindingMethod(type = <strong>"android.widget.ImageView"</strong>, + attribute = <strong>"android:tint"</strong>, + method = <strong>"setImageTintList"</strong>), +}) +</pre> + +<p>It is unlikely that developers will need to rename setters; the android +framework attributes have already been implemented.</p> +<h3 id=custom_setters>Custom Setters</h3> + +<p>Some attributes need custom binding logic. For example, there is no associated +setter for the <strong><code>android:paddingLeft</code></strong> attribute. Instead, setPadding(left, top, right, bottom) exists. A static +binding adapter method with the BindingAdapter annotation allows the developer +to customize how a setter for an attribute is called.</p> + +<p>The android attributes have already had BindingAdapters created. For example, +here is the one for paddingLeft:</p> +<pre class=prettyprint></p> +@BindingAdapter(<strong>"android:paddingLeft"</strong>) +<strong>public static void </strong>setPaddingLeft(View view, <strong>int </strong>padding) { + view.setPadding(padding, + view.getPaddingTop(), + view.getPaddingRight(), + view.getPaddingBottom()); +} +</pre> + +<p>Binding adapters are useful for other types of customization. For example, a + custom loader can be called off-thread to load an image.</p> + +<p>Developer-created binding adapters will override the data binding default +adapters when there is a conflict.</p> + +<p>You can also have adapters that receive multiple parameters. </p> +<pre class=prettyprint> +@BindingAdapter(attributes = {<strong>"bind:imageUrl"</strong>, <strong>"bind:error"</strong>}) +<strong>public static void </strong>loadImage(ImageView view, String url, Drawable error) { + Picasso.<em>with</em>(view.getContext()).load(url).error(error).into(view); +} +</pre> + +<p>This adapter will be called if both <strong>imageUrl </strong>and <strong>error </strong>are used for an ImageView and <em>imageUrl </em>is a string and <em>error</em> is a drawable.</p> +<ul> + <li> Custom namespaces are ignore during matching. + <li> You can also write adapters for android namespace. +</ul> + +<pre class=prettyprint> +<ImageView app:imageUrl=“@{venue.imageUrl}” +app:error=“@{@drawable/venueError}”/> +</pre> + + +<h2 id=converters>Converters</h2> + + +<h3 id=object_conversions>Object Conversions</h3> + +<p>When an Object is returned from a binding expression, a setter will be chosen +from the automatic, renamed, and custom setters. The Object will be cast to a +parameter type of the chosen setter.</p><p>This is a convenience for those using ObservableMaps to hold data. for example:</p> +<pre class=prettyprint> +<<strong>TextView + android:text='@{userMap["lastName"]}' + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +</pre> + +<p>The userMap returns an Object and that Object will be automatically cast to +parameter type found in the setter <code>setText(CharSequence)</code>. When there may be confusion about the parameter type, the developer will need +to cast in the expression.</p> +<h3 id=custom_conversions>Custom Conversions</h3> + +<p>Sometimes conversions should be automatic between specific types. For example, +when setting the background:</p> +<pre class=prettyprint> +<<strong>View + android:background="@{isError ? @color/red : @color/white}" + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +</pre> + +<p>Here, the background takes a <code>Drawable</code>, but the color is an integer. Whenever a <code>Drawable</code> is expected and an integer is returned, the <code>int</code> should be converted to a <code>ColorDrawable</code>. This conversion is done using a static method with a BindingConversion +annotation:</p> +<pre class=prettyprint> +@BindingConversion +<strong>public static </strong>ColorDrawable convertColorToDrawable(<strong>int </strong>color) { + <strong>return new </strong>ColorDrawable(color); +} +</pre> + +<p>Note that conversions only happen at the setter level, so it is <strong>not allowed </strong>to mix types like this:</p> +<pre class=prettyprint> +<<strong>View + android:background="@{isError ? @drawable/error : @color/white}" + android:layout_width="wrap_content" + android:layout_height="wrap_content"</strong>/> +</pre> + diff --git a/docs/html/preview/images/bugs.png b/docs/html/preview/images/bugs.png Binary files differnew file mode 100644 index 0000000..46adf05 --- /dev/null +++ b/docs/html/preview/images/bugs.png diff --git a/docs/html/preview/images/dev-prev.png b/docs/html/preview/images/dev-prev.png Binary files differnew file mode 100644 index 0000000..eae6ede --- /dev/null +++ b/docs/html/preview/images/dev-prev.png diff --git a/docs/html/preview/images/m-preview-timeline.png b/docs/html/preview/images/m-preview-timeline.png Binary files differnew file mode 100644 index 0000000..a065c21 --- /dev/null +++ b/docs/html/preview/images/m-preview-timeline.png diff --git a/docs/html/preview/images/updates.png b/docs/html/preview/images/updates.png Binary files differnew file mode 100644 index 0000000..f165c5a --- /dev/null +++ b/docs/html/preview/images/updates.png diff --git a/docs/html/preview/index.jd b/docs/html/preview/index.jd new file mode 100644 index 0000000..c6c2068 --- /dev/null +++ b/docs/html/preview/index.jd @@ -0,0 +1,52 @@ +page.title=M Developer Preview +page.tags=preview +meta.tags="preview" +fullpage=true +page.viewport_width=970 +section.landing=true +header.hide=1 +footer.hide=1 +@jd:body + +<section class="dac-expand dac-hero dac-light"> + <div class="wrap"> + <div class="cols dac-hero-content"> + <div class="col-1of2 col-push-1of2 dac-hero-figure"> + <img class="dac-hero-image" src="/design/media/hero-material-design.png"> + </div> + <div class="col-1of2 col-pull-1of2"> + <h1 class="dac-hero-title">M Developer Preview</h1> + <p class="dac-hero-description"> + Get ready for the next official release of the platform. The preview program gives + you an advance look at new APIs, features, and behaviors coming to Android. + Test your apps and give us feedback! + </p> + + <a class="dac-hero-cta" href="{@docRoot}preview/overview.html"> + <span class="dac-sprite dac-auto-chevron"></span> + Preview Program Overview + </a><br> + <a class="dac-hero-cta" href="{@docRoot}preview/api-overview.html"> + <span class="dac-sprite dac-auto-chevron"></span> + Review the API changes + </a><br> + <a class="dac-hero-cta" href="{@docRoot}preview/setup-sdk.html"> + <span class="dac-sprite dac-auto-chevron"></span> + Set up the Preview SDK + </a><br> + <a class="dac-hero-cta" href="https://code.google.com/p/android-developer-preview/"> + <span class="dac-sprite dac-auto-chevron"></span> + Report issues + </a><br> + + </div> + </div> + + <div class="dac-section dac-small"> + <div class="resource-widget resource-flow-layout col-16" + data-query="collection:preview/landing/resources" + data-cardSizes="6x2" + data-maxResults="6"></div> + </div> + </div> +</section>
\ No newline at end of file diff --git a/docs/html/preview/license.html b/docs/html/preview/license.jd index deb16aa..5ff52ba 100644 --- a/docs/html/preview/license.html +++ b/docs/html/preview/license.jd @@ -1,105 +1,16 @@ -<!DOCTYPE html> +page.title=License Agreement -<html> -<head> +@jd:body - -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="viewport" content="width=970" /> - -<meta name="Description" content="To get started with the Android SDK Preview, you must agree to the following terms and conditions. As described below, please note that this is a preview version of the Android SDK, subject to change, that you use at your own risk."> -<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> -<title>License Agreement | Android Developers</title> - -<!-- STYLESHEETS --> -<link rel="stylesheet" -href="//fonts.googleapis.com/css?family=Roboto+Condensed"> -<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold" - title="roboto"> -<link href="/assets/css/default.css" rel="stylesheet" type="text/css"> - - - -<!-- JAVASCRIPT --> -<script src="//www.google.com/jsapi" type="text/javascript"></script> -<script src="/assets/js/android_3p-bundle.js" type="text/javascript"></script> -<script type="text/javascript"> - var toRoot = "/"; - var metaTags = []; - var devsite = false; -</script> -<script src="/assets/js/docs.js" type="text/javascript"></script> - -<script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-5831155-1', 'android.com'); - ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'}); // New tracker); - ga('send', 'pageview'); - ga('universal.send', 'pageview'); // Send page view for new tracker. -</script> - -</head> - - -<body class="gc-documentation" itemscope="" itemtype="http://schema.org/Article"> - - -<a name="top"></a> -<div id="body-content"> -<div class="fullpage"> -<div id="jd-content"> - <div class="jd-descr" itemprop="articleBody"> -<style> -body,html, #qv {background-color:#e9e9e9} - -#qv * { font-weight:bold;} - -.fullpage>#footer, -#jd-content>.content-footer.wrap { - display:none; -} - -.content-footer { - display: none; -} -</style> - - <div style="border-bottom: 1px solid #a5c43a; position: absolute; left: 0; right: 0; top: 0;"> - <div class="wrap" style="position: relative; height: 45px; padding: 0 20px;"> - <a href="/index.html" style="position:absolute;top:8px"> - <img src="/assets/images/dac_logo.png" srcset="/assets/images/dac_logo@2x.png 2x" width="123" height="25" alt="Android Developers home page"> - </a> - </div> - </div> - - <div class="landing-rest-of-page"> - <div class="landing-section" style="padding:55px 10px 0"> - -<div class="wrap"> - -<div class="col-16" id="doc-col" > - - <h1 itemprop="name" >L Developer Preview License Agreement</h1> - -<div class="jd-descr" itemprop="articleBody"> - <p> -If you are using the Android SDK -Preview, you must agree to the following terms -and conditions. As described below, please note that the preview version of the -Android SDK is subject to change, and that you use it at your own risk. The -Android SDK Preview is not a stable release, and may contain errors and defects -that can result in serious damage to your computer systems, devices and data. +<p> +To get started with the Android SDK Preview, you must agree to the following terms and conditions. +As described below, please note that this is a preview version of the Android SDK, subject to change, that you use at your own risk. The Android SDK Preview is not a stable release, and may contain errors and defects that can result in serious damage to your computer systems, devices and data. </p> <p> This is the Android SDK Preview License Agreement (the “License Agreement”). </p> - -<div class="sdk-terms" style="height:auto;border:0;padding:0;width:940px"> +<div class="sdk-terms" style="height:auto;border:0;padding:0;width:700px"> 1. Introduction 1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview. @@ -229,46 +140,4 @@ This is the Android SDK Preview License Agreement (the “License Agreement”). 14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. -</div> - </div> - </div> - -</div> - </div> <!-- end landing-body-content --> - - </div> - - <div class="content-footer wrap" itemscope="" - itemtype="http://schema.org/SiteNavigationElement"> - - <div class="paging-links layout-content-col col-10"> - - </div> - - </div> - - - - - </div> <!-- end jd-content --> - -<div id="footer" class="wrap" style="width:940px"> - - - <div id="copyright"> - - Except as noted, this content is - licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> - Creative Commons Attribution 2.5</a>. For details and - restrictions, see the <a href="https://developer.android.com/license.html">Content - License</a>. - </div> - - -</div> <!-- end footer --> -</div><!-- end doc-content --> - -</div> <!-- end body-content --> - -</body> -</html> +</div>
\ No newline at end of file diff --git a/docs/html/preview/overview.jd b/docs/html/preview/overview.jd new file mode 100644 index 0000000..0c8931d --- /dev/null +++ b/docs/html/preview/overview.jd @@ -0,0 +1,56 @@ +page.title=Preview Program Overview + +@jd:body + +<p> + The M Developer Preview program is an opportunity for you to test the compatibility of your apps + with the next platform release, try out early versions of new API features, and provide feedback + to the Android team. The program includes update releases during course of the program to allow + you to follow the progress of feature development and fixes, leading up to the official release + of the platform, as shown in Figure 1. +</p> + +<img src="{@docRoot}preview/images/m-preview-timeline.png" + alt="Preview program timeline" id="figure1" style="margin-top: 15px;"> +<p class="img-caption"> + <b>Figure 1.</b> Timeline for the M Developer Preview program. +</p> + +<p> + We strongly encourage you to provide feedback for the M Preview releases through our <a href= + "https://code.google.com/p/android-developer-preview/">issue tracker</a>. Issues reported early + in the program have a better chance of being addressed before the official release, so reports + provided by June 30, 2015 receive priority processing by the Android team. +</p> + +<p> + To get started testing your app: +</p> + +<ul> + <li>Review the <a href="{@docRoot}preview/api-overview.html"> + API Overview</a> and <a href= + "{@docRoot}preview/api-changes.html">Behavior Changes</a> to + get an idea of what's new and how it affects your app. + </li> + + <li>Setup for testing and development by following the instructions for <a href= + "{@docRoot}preview/setup-sdk.html">Setting up the Preview + SDK</a> and configuring test devices. + </li> + + <li>Review the <a href="{@docRoot}preview/reference.html">M + Preview API Reference</a> and <a href= + "{@docRoot}preview/samples.html">M Preview samples</a> to + gain more insight into new API features and how to use them in your app. + </li> + + <li>Join the <a href="https://plus.google.com/communities/101985907812750684586">M Preview + Google+ developer community</a> to get the latest developer updates and connect with other + developers working with the preview. + </li> +</ul> + +<p> + Thanks in advance for your participation in the developer preview program! +</p> diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs new file mode 100644 index 0000000..fbf73f6 --- /dev/null +++ b/docs/html/preview/preview_toc.cs @@ -0,0 +1,37 @@ +<ul id="nav"> + + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/overview.html"> + Program Overview</a></div> + </li> + + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/setup-sdk.html"> + Set up the SDK</a></div> + </li> + + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/api-overview.html"> + API Overview</a></div> + </li> + + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/samples.html"> + Samples</a></div> + </li> + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/reference.html"> + Reference</a></div> + </li> + + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/support.html"> + Support</a></div> + </li> + + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/license.html"> + License Agreement</a></div> + </li> + +</ul> diff --git a/docs/html/preview/reference.jd b/docs/html/preview/reference.jd new file mode 100644 index 0000000..2d30c62 --- /dev/null +++ b/docs/html/preview/reference.jd @@ -0,0 +1,15 @@ +page.title=Reference + +@jd:body + +<p> + The reference documentation and API difference report for the Developer Preview are available in + this downloadable package. +</p> + +<ul> + <li> + <a href="http://storage.googleapis.com/androiddevelopers/preview/m-developer-preview-reference.zip"> + M Developer Preview reference</a> + </li> +</ul>
\ No newline at end of file diff --git a/docs/html/preview/samples.jd b/docs/html/preview/samples.jd new file mode 100644 index 0000000..fb80e30 --- /dev/null +++ b/docs/html/preview/samples.jd @@ -0,0 +1,37 @@ +page.title=Samples + +@jd:body + +<p> + The following code samples are provided for the M Developer Preview. You can download them in the + Android SDK Manager under the <b>SDK Samples</b> component for the M Developer Preview. +</p> + +<p class="note"> + <strong>Note:</strong> These downloadable projects are designed + for use with Gradle and Android Studio. +</p> + + +<h3 id="id">Sample 1</h3> + +<p> + This sample demonstrates how to turducken frankfurter boudin, ham brisket alcatra kielbasa pork + loin pork. Jowl kielbasa kevin, sausage landjaeger corned beef cow spare ribs pastrami leberkas + drumstick. +</p> + +<p><a href="#">Get it on GitHub</a></p> + + +<h3 id="id">Sample 2</h3> + +<p> + This sample demonstrates how to turducken frankfurter boudin, ham brisket alcatra kielbasa pork + loin pork. Jowl kielbasa kevin, sausage landjaeger corned beef cow spare ribs pastrami leberkas + drumstick. +</p> + +<p><a href="#">Get it on GitHub</a></p> + + diff --git a/docs/html/preview/index.html b/docs/html/preview/setup-sdk.jd index 7cd029f..11b009e 100644 --- a/docs/html/preview/index.html +++ b/docs/html/preview/setup-sdk.jd @@ -1,84 +1,5 @@ -<!DOCTYPE html> - -<html> -<head> - - -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="viewport" content="width=970" /> - -<meta name="Description" content="Test and build your apps against the next version of Android to ensure they're ready when the platform officially launches."> -<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> -<title>Android L Developer Preview | Android Developers</title> - -<!-- STYLESHEETS --> -<link rel="stylesheet" -href="//fonts.googleapis.com/css?family=Roboto+Condensed"> -<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold" - title="roboto"> -<link href="/assets/css/default.css" rel="stylesheet" type="text/css"> - - - -<!-- JAVASCRIPT --> -<script src="//www.google.com/jsapi" type="text/javascript"></script> -<script src="/assets/js/android_3p-bundle.js" type="text/javascript"></script> -<script type="text/javascript"> - var toRoot = "/"; - var metaTags = []; - var devsite = false; -</script> -<script src="/assets/js/docs.js" type="text/javascript"></script> - -<script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-5831155-1', 'android.com'); - ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'}); // New tracker); - ga('send', 'pageview'); - ga('universal.send', 'pageview'); // Send page view for new tracker. -</script> - -</head> - - -<body class="gc-documentation" itemscope="" itemtype="http://schema.org/Article"> - - -<a name="top"></a> -<a name="download"></a> -<div id="body-content"> -<div class="fullpage"> -<div id="jd-content"> - <div class="jd-descr" itemprop="articleBody"> -<style> -body,html, #qv {background-color:#e9e9e9} - -#qv * { font-weight:bold;} - -.fullpage>#footer, -#jd-content>.content-footer.wrap { - display:none; -} - -.content-footer { - display: none; -} -</style> - - <div style="border-bottom: 1px solid #a5c43a; position: absolute; left: 0; right: 0; top: 0; z-index:99"> - <div class="wrap" style="position: relative; height: 45px; padding: 0 20px;"> - <a href="/index.html" style="position:absolute;top:8px"> - <img src="/assets/images/dac_logo.png" srcset="/assets/images/dac_logo@2x.png 2x" width="123" height="25" alt="Android Developers home page"> - </a> - </div> - </div> - - - +page.title=Setting Up the Preview SDK +@jd:body @@ -86,25 +7,14 @@ body,html, #qv {background-color:#e9e9e9} +<div style="position:relative; min-height:600px"> + <div class="wrap" id="tos" style="position:absolute;display:none;width:inherit;"> - - <div class="landing-rest-of-page" style="position:relative;"> - - - - - - - - - <div class="wrap" id="tos" style="display:none;padding-top:90px"> - - <p class="sdk-terms-intro">Before downloading the Android Preview system image, - you must agree to the following terms and conditions.</p> + <p class="sdk-terms-intro">Before installing the Android SDK, you must agree to the following terms and conditions.</p> <h2 class="norule">Terms and Conditions</h2> - <div class="sdk-terms" onfocus="this.blur()" style="width:100%"> + <div class="sdk-terms" onfocus="this.blur()" style="width:678px"> This is the Android SDK Preview License Agreement (the “License Agreement”). 1. Introduction @@ -255,342 +165,163 @@ This is the Android SDK Preview License Agreement (the “License Agreement”). - <div class="landing-section" id="landing-wrapper" style="padding:55px 10px 0"> - <div class="landing-section-header" style="margin:0"> - <div class="landing-h1">Android L Developer Preview</div> - <div class="landing-subhead" style="padding-bottom:40px"> - Final APIs now available! - </div> - </div> - <div class="wrap" style="padding:20px; position:relative"> - - <img src="/images/home/l-hero_2x.png" - srcset="/images/home/l-hero.png 1x, /images/home/l-hero_2x.png 2x" - style=" margin:-5px -30px 0 0;float:right" alt="" width="510"> - - <a href="/about/versions/android-5.0.html" class="landing-button landing-primary" - style="position:absolute;z-index:100;right:215px;top:375px">Android 5.0 API Overview</a> - <div style="width:440px"> -<p>Android 5.0 (Lollipop) is now out of preview and available to users.</p> -<p>If you previously developed apps with the L Developer Preview, be aware that various APIs and -behaviors have changed, so you should update your SDK now to test your apps and take advantage of -new features in Android 5.0.</p> + <div id="landing"> +<p>The Preview SDK is available from the Android SDK Manager. +This document assumes that you are familiar with Android app development, such +as using the Android SDK Manager and creating projects. If you're new to +Android, see <a href="{@docRoot}training/basics/firstapp/index.html">Building Your First +App</a> training lesson first.</a></p> - <p>To get the latest Android 5.0 SDK:</p> - <ol> - <li>Start the <a href="/tools/help/sdk-manager.html">Android SDK Manager</a>.</li> - <li>In the <b>Tools</b> section, select the latest <b>SDK Tools</b>, - <b>SDK Platform-tools</b>, and <b>SDK Build-tools</b>.</li> - <!-- Android L not yet showing up in Android SDK Manager... --> - <li>Select everything under the <b>Android 5.0</b> section, then - click <b>Install packages...</b></li> - <li>Accept the licensing agreement for the packages, then click - <b>Install</b>.</li> - <li>If you previously installed the Android L Preview SDK, select all those - packages in the SDK Manager and click <strong>Delete packages</strong>. - </ol> - <p>Now you're ready to develop and test on Android 5.0 with your normal workflow - and begin publishing app updates to Google Play. - </div> +<h2 id="downloadSdk">Download the SDK</h2> - <h2 id="Start" class="norule" style="margin:60px 0 0 0">Get Started on Android 5.0</h2> - </div> <!-- end .wrap --> +<ol> + <li>Start the <a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.</li> + <li>In the <b>Tools</b> section, select the latest Android <b>SDK Tools</b>, + <b>Platform-tools</b>, and <b>Build-tools</b>.</li> + <li>Select everything under the <b>Android M Developer Preview</b> section and + click <b>Install packages...</b></li> + <li>Accept the Licensing Agreement for all of the packages and click + <b>Install</b>.</li> +</ol> +<p class="note"><strong>Note:</strong> The Eclipse ADT plug-in requires Java 7 + if your compilation target is the M Developer Preview.</p> +<h2 id="setupHardware">Set Up Hardware and AVDs</h2> - <div class="wrap" style="background-color:#fff;padding:20px;position:relative"> +<p>The Android M Developer Preview provides you with 32-bit system images +to flash the following devices: +</p> - <div id="qv-wrapper"> - <div id="qv"> - <h2>More about Android 5.0</h2> - <ul> - <li><a href="http://android-developers.blogspot.com/">Android 5.0 announcement</a></li> - <li><a href="/about/versions/android-5.0.html">Android 5.0 API Overview</a></li> - <li><a href="/sdk/api_diff/21/changes.html">Android 5.0 API Diff Report</a></li> - <li><a href="/samples/new/index.html">Android 5.0 API Samples</a></li> - </ul> - </div> - </div> +<ul> + <li>Nexus 5</li> + <li>Nexus 7 Wi-Fi (version 2, released in 2013)</li> +</ul> - <p>Now that Android 5.0 APIs are final:</p> - <ul> - <li>The API level for Android 5.0 is 21, so be sure to update your - app's manifest file to set <a href="/guide/topics/manifest/uses-sdk-element.html#target" - ><code>targetSdkVersion</code></a> to - <code>"21"</code> when you begin testing: - <pre><uses-sdk android:targetSdkVersion="21" ... /></pre> - </li> - <li>Google Play now accepts APKs with <a - href="/guide/topics/manifest/uses-sdk-element.html#min"><code>minSdkVersion</code></a> or - <a href="/guide/topics/manifest/uses-sdk-element.html#target" - ><code>targetSdkVersion</code></a> set - to <code>"21"</code>, so you can upload your updated apps today.</li> - </ul> +<p>In addition, you also get the emulator system images, which includes +experimental 64-bit system images along with standard 32-bit system images. +</p> - <p>If you previously flashed your Nexus 5 or Nexus 7 with a preview system image, you should - now update your device to the final factory system image. - Download the appropriate image from - <a href="http://developers.google.com/android/nexus/images">Factory Images for Nexus - Devices</a> and follow the flashing instructions on that page.</p> +<p class="note"><strong>Note:</strong> The 64-bit system images require the +Intel x86 Emulator Accelerator (HAXM) Rev.5 which can be downloaded from the +<a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> <em>Extras</em> +folder.</p> - </div> <!-- end .wrap --> +<h3 id="installImage">Install the M Preview System Image</h3> +<p class="warning"><b>Warning:</b> This is a preview version of the Android +system image, and is subject to change. Your use of this system image is +governed by the Android SDK Preview License Agreement. The Android preview +system image is not a stable release, and may contain errors and defects that +can result in damage to your computer systems, devices, and data. The preview +Android system image is not subject to the same testing as the factory OS and +can cause your phone and installed services and applications to stop working. +</p> +<ol> + <li>Download and uncompress the Android Developer Preview package. + <table style="width:860px"> + <tr> + <th scope="col">Device</th> + <th scope="col">Download</th> + <th scope="col">Checksum</th> + </tr> + <tr id="hammerhead"> + <td>Nexus 5 (GSM/LTE) <br>"hammerhead"</td> + <td><a href="#top" onclick="onDownload(this)" + >hammerhead-lpv79-preview-ac1d8a8e.tgz</a></td> + <td>MD5: <code>5a6ae77217978cb7b958a240c2e80b57</code> + <br>SHA-1: <code>ac1d8a8e4f4a1dca5864dc733caa940bffc28616</code></td> + </tr> + <tr id="razor"> + <td>Nexus 7 (Wifi) <br>"razor"</td> + <td><a href="#top" onclick="onDownload(this)" + >razor-lpv79-preview-d0ddf8ce.tgz</a></td> + <td>MD5: <code>b293a5d3a4e07beabebcc0be85ad68a2</code> + <br><nobr>SHA-1: <code>d0ddf8ce733ba2a34279cdff8827fd604762c2342d</nobr></td> + </tr> + </table> + </li> + <li>Follow the instructions at + <a href="https://developers.google.com/android/nexus/images#instructions">developers.google.com/android</a> + to flash the image onto your device.</li> +</ol> +<h3 id="revertDevice">Revert a Device to Factory Specifications</h3> - <div class="wrap" style="padding:20px; position:relative"> - <h2 id="Material" class="norule" style="margin:40px 0 0 0">Design with Material</h2> - </div> - - <div class="wrap" style="background-color:#fff;padding:20px;position:relative"> - <img src="images/material-layers.png" width="240" - style="position:absolute;right:20px;top:-50px"> - - <div id="qv-wrapper" style="margin-top:120px"> - <div id="qv"> - - <h2>More about Material Design</h2> - <ul> - <li><a href="http://www.google.com/design/spec/material-design/introduction.html">Material - Design Spec</a></li> - <li><a href="/design/material/index.html">Android Material Design</a></li> - <li><a href="/training/material/index.html">Creating Apps with Material Design</a> - </ul> - </div> - </div> - - -<p>Material design is a complete design philosophy for visual, motion, and interaction design -across platforms and devices. The <a href= -"http://www.google.com/design/spec/material-design/introduction.html">material design specification -(preview)</a> provides all the details for designers.</p> - - - <p>To get started with Material design in your Android app, update - your <a href="/guide/topics/manifest/uses-sdk-element.html#target" - ><code>targetSdkVersion</code></a> to <code>"21"</code> and apply the new - <a href="/reference/android/R.style.html#Theme_Material" - ><code>Material</code></a> theme. For example, when creating - a <a href="/guide/topics/ui/themes.html">custom theme</a> - for your app, open your project's <code>res/values/styles.xml</code> file - and extend the <a href="/reference/android/R.style.html#Theme_Material" - ><code>Material</code></a> theme:</p> -<pre> -<resources> - <style name="AppTheme" parent="android:Theme.Material"> - <!-- Customize the Material elements here --> - </style> -</resources> -</pre> -<p>Then apply your custom theme to your application in the manifest file:</p> -<pre> -<application android:theme="@style/AppTheme"> -</pre> -<p>Material design is more than just the UI theme, though. It's also about the way the app - behaves—how elements move and transform when the user interacts with them. So Android 5.0 - and the <a href="/tools/support-library/features.html#v7">v7 support library</a> provide new - widgets and animation APIs that allow you to - build interaction patterns described in the - <a href="http://www.google.com/design/spec/material-design/introduction.html">Material design - specification</a>.</p> - -<p>All the Material design elements and interaction patterns provided by the UI styles and widgets -are flexible, so you can adopt only what's appropriate for your app and retain a unique identity -and experience for your product.</p> - -<p>And Material design on Android isn't just for Android 5.0. The - <a href="/tools/support-library/features.html#v7">v7 support library</a> has been significantly - updated in revision 21 to make many of the Material design elements available when - running on older versions of the platform.</p> - -<p>For many more details about how to implement the Material look and feel, - see <a href="/training/material/index.html">Creating Apps with Material - Design</a>.</p> - - - </div> - + <p>If you want to uninstall the Preview and revert the device to factory +specifications, go to <a href="http://developers.google.com/android +/nexus/images">developers.google.com/android</a> and download the image you want +to flash to for your device. Follow the instructions on that page to flash the +image to your device.</p> +<h3 id="setupAVD">Set up an AVD</h3> + +<p>You can set up <a href="{@docRoot}tools/devices/">Android Virtual Devices +(AVD)</a> and use the emulator to build and test apps with the M Preview.</p> + +<p>To create an AVD with the AVD Manager:</p> + +<ol> + <li>Install the M Preview SDK in your development environment, as described + in <a href="{@docRoot}preview/setup-sdk.html">Setting Up the Preview + SDK.</a></li> + <li>Follow the steps in + <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD + Manager</a>. Use the following settings: + <ul> + <li><b>Device:</b> Either Nexus 5 or Nexus 7</li> + <li><b>Target:</b> <!-- Confirm exact text when we have final distro --> + Android M (Preview) - API Level M</li> + </ul> + <!-- Confirm this works when you can download image through SDK manager! --> + </li> +</ol> +<h2 id="createProject">Create a Project</h2> + +<p>Android Studio makes it easy to create a project for the M Developer Preview. Follow +the steps described in <a href="{@docRoot}sdk/installing/create-project.html">Creating a +Project</a>. In the <strong>Form Factors</strong> screen:</p> + +<ul> + <li>Check <strong>Phone and Tablet</strong>.</li> + <li>Select <strong>API 22+: Android M (Preview)</strong> in <strong>Minimum SDK</strong>.</li> +</ul> + +<p>On the development environment, open the <code>build.gradle</code> file for your module +and make sure that:</p> + +<ul> + <li><code>compileSdkVersion</code> is set to <code>'android-M'</code></li> + <li><code>minSdkVersion</code> is set to <code>'M'</code></li> + <li><code>targetSdkVersion</code> is set to <code>'M'</code></li> +</ul> + + </div><!-- landing --> + +</div><!-- relative wrapper --> - - - - <div class="wrap" style="padding:20px; position:relative"> - <h2 id="TV" class="norule" style="margin:40px 0 0 0">Build for Android TV</h2> - </div> - - <div class="wrap" style="background-color:#fff;padding:20px;position:relative"> - <img src="/tv/images/components.png" width="240" - style="position:absolute;right:20px;top:-50px"> - - <div id="qv-wrapper" style="margin-top:120px"> - <div id="qv"> - - <h2>More about Android TV</h2> - <ul> - <li><a href="/design/tv/index.html">Android TV Design</a></li> - <li><a href="/training/tv/start/index.html">Building Apps for Android TV</a></li> - <li><a href="/training/tv/games/index.html">Building TV Games</a></li> - <li><a href="/training/tv/playback/index.html">Building TV Playback Apps</a></li> - <li><a href="/distribute/essentials/quality/tv.html">TV App Quality</a></li> - </ul> - </div> - </div> - -<p>Android 5.0 provides a new platform for users to experience your app on a big screen. The -Android TV experience is centered around a simplified home screen that allows users to discover -your app's content with personalized recommendations and voice search, or select your app to launch -into your fullscreen experience.</p> - - -<p>Making your app available on Android TV does not require that you build an entirely new app. -Android TV is simply another form factor for the Android platform, so you can deliver the same APK -that you provide for phones and tablets to TVs through Google Play. However, to make your app -available on Android TV, you'll need to make some optimizations such as adding layouts -for the big screen and adding support for remote control input. For more information about design -guidelines, see <a href="/distribute/essentials/quality/tv.html">TV App Quality</a>.</p> - -<p class="note"><strong>Note:</strong> Google Play for Android TV will officially -open for apps on November 3.</p> - -<p>Android TV is also great new opportunity for Android games. If you'd like to make your games -available on Android TV, be sure to optimize the user experience for the big screen by following -the recommendations in <a href="/training/tv/games/index.html">Building TV Games</a>.</p> - - - <p>To get started on Android TV, you need:</p> - <ul> - <li>The Android 5.0 SDK packages from the - <a href="/tools/help/sdk-manager.html">Android SDK Manager</a>, - including the <strong>Android TV System Image</strong> so you can create an - Android TV emulator.</li> - <li>An activity that's launchable from the Android TV home screen. This requires that you - add the <a href="/reference/android/content/Intent.html#CATEGORY_LEANBACK_LAUNCHER" - ><code>LEANBACK_LAUNCHER</code></a> category to one of your activities. For example: -<pre> -<activity ... > - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> - </intent-filter> -</activity> -</pre> - </li> - - <li>For a set of default styles that optimize your UI for the TV's - <em>leanback user experience</em>, - you should also apply the <a - href="/reference/android/support/v17/leanback/R.style.html#Theme_Leanback" - ><code>Leanback</code></a> theme to your activity: -<pre> -<activity android:theme="@style/Theme.Leanback" ... > -</pre> - </li> - - </ul> - <p>You should also take advantage of the <a - href="/tools/support-library/features.html#v17-leanback">v17 leanback library</a>, which - provides the <a href="/reference/android/support/v17/leanback/R.style.html#Theme_Leanback" - ><code>Leanback</code></a> theme shown above, plus several widgets designed to - make your UI beautiful and easy to navigate on the big screen, such as a widget that creates - a set of large horizontal card views.</p> - - <p>For more information about setting up a project for your TV app, building - TV layouts, and handling controller input, - see <a href="/training/tv/start/index.html">Building - TV Apps</a>.</p> - </div> - - - - - - - - - </div> <!-- end .landing-section --> - - - - - - - - - <!-- spacer --> - <div class="wrap" style="padding:20px; position:relative"> - <p> </p> - </div> - - - - <div id="footer" class="wrap" style="width:940px;position:relative;"> - <div id="copyright"> - Except as noted, this content is - licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> - Creative Commons Attribution 2.5</a>. For details and - restrictions, see the <a href="https://developer.android.com/license.html">Content - License</a>. - </div> - </div> - </div> <!-- end landing-body-content --> - - </div> - - <div class="content-footer wrap" itemscope="" - itemtype="http://schema.org/SiteNavigationElement"> - - <div class="paging-links layout-content-col col-10"> - - </div> - - </div> - - - - - </div> <!-- end jd-content --> - -<div id="footer" class="wrap" style="width:940px"> - - - <div id="copyright"> - - Except as noted, this content is - licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> - Creative Commons Attribution 2.5</a>. For details and - restrictions, see the <a href="https://developer.android.com/license.html">Content - License</a>. - </div> - - -</div> <!-- end footer --> -</div><!-- end doc-content --> - -</div> <!-- end body-content --> - - <script> - var urlRoot = "http://storage.googleapis.com/androiddevelopers/finalpreview/"; + var urlRoot = "http://storage.googleapis.com/androiddevelopers/preview/"; function onDownload(link) { $("#downloadForRealz").html("Download " + $(link).text()); $("#downloadForRealz").attr('href', urlRoot + $(link).text()); - $("#tos").show(); - $("#landing-wrapper").hide(); + $("#tos").fadeIn('fast'); + $("#landing").fadeOut('fast'); return true; } @@ -609,12 +340,9 @@ the recommendations in <a href="/training/tv/games/index.html">Building TV Games function onDownloadForRealz(link) { if ($("input#agree").is(':checked')) { $("#tos").fadeOut('fast'); - $("#landing-wrapper").fadeIn('fast'); - ga('send', 'event', 'L Preview', 'System Image', $("#downloadForRealz").html()); + $("#landing").fadeIn('fast'); + ga('send', 'event', 'M Preview', 'System Image', $("#downloadForRealz").html()); location.hash = ""; - // reset the checkbox for future downloads - $("#agree").trigger('click'); - $("a#downloadForRealz").addClass('disabled'); return true; } else { $("label#agreeLabel").parent().stop().animate({color: "#258AAF"}, 200, @@ -624,8 +352,10 @@ the recommendations in <a href="/training/tv/games/index.html">Building TV Games } } -</script> - + $(window).hashchange( function(){ + if (location.hash == "") { + location.reload(); + } + }); -</body> -</html>
\ No newline at end of file +</script> diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd new file mode 100644 index 0000000..4be6dd7 --- /dev/null +++ b/docs/html/preview/support.jd @@ -0,0 +1,67 @@ +page.title=Support + +@jd:body + +<p> + If you've encountered bugs or have feedback about the M Developer Preview, + <a href="https://code.google.com/p/android-developer-preview/">create an issue</a> + on our issue tracker. +</p> + +<p> + For more support, join the + <a href="https://plus.google.com/communities/101985907812750684586">M Developer + Preview Google+ community</a> to discuss your development experiences. +</p> + +<h2 id="release-notes">Release Notes</h2> + +<!-- +<div class="toggle-content opened"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>M Developer Preview, Revision 2</a> <em>(Month 2015)</em> + </p> + + <div class="toggle-content-toggleme"> + + <dl> + + <dt>Fix Category 1</dt> + <dd> + <ul> + <li>Fixed issue X.</li> + <li>Fixed issue Y.</li> + <li>Fixed issue Z.</li> + </ul> + </dd> + + <dt>Fix Category 2</dt> + <dd> + <ul> + <li>Fixed issue X.</li> + <li>Fixed issue Y.</li> + <li>Fixed issue Z.</li> + </ul> + </dd> + + </dl> + </div> +</div> +--> + +<div class="toggle-content opened"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>M Developer Preview, Revision 1</a> <em>(May 2015)</em> + </p> + + <div class="toggle-content-toggleme"> + + <dl> + <dt>Initial release.</dt> + </dl> + </div> +</div> + + |
