docs: fixed generics in data binding code samples
Generic types, such as List<String>, must be escaped when they are used in XML. For example, List<String>. This commit adds escape characters to the XML samples in the data binding page. Bug: 30691285 Change-Id: If55ed55d13fb11038e2495884c79698e67219108
This commit is contained in:
@@ -601,7 +601,7 @@ any business logic inside the callback method that you invoked from the listener
|
||||
<import type="com.example.User"/>
|
||||
<import type="java.util.List"/>
|
||||
<variable name="user" type="User"/>
|
||||
<variable name="userList" type="List<User>"/>
|
||||
<variable name="userList" type="List&lt;User&gt;"/>
|
||||
</data>
|
||||
</pre>
|
||||
<p class="caution">
|
||||
@@ -945,9 +945,9 @@ android:transitionName='@{"image_" + id}'
|
||||
<import type="android.util.SparseArray"/>
|
||||
<import type="java.util.Map"/>
|
||||
<import type="java.util.List"/>
|
||||
<variable name="list" type="List<String>"/>
|
||||
<variable name="sparse" type="SparseArray<String>"/>
|
||||
<variable name="map" type="Map<String, String>"/>
|
||||
<variable name="list" type="List&lt;String&gt;"/>
|
||||
<variable name="sparse" type="SparseArray&lt;String&gt;"/>
|
||||
<variable name="map" type="Map&lt;String, String&gt;"/>
|
||||
<variable name="index" type="int"/>
|
||||
<variable name="key" type="String"/>
|
||||
</data>
|
||||
@@ -1247,7 +1247,7 @@ user.put("age", 17);
|
||||
<pre>
|
||||
<data>
|
||||
<import type="android.databinding.ObservableMap"/>
|
||||
<variable name="user" type="ObservableMap<String, Object>"/>
|
||||
<variable name="user" type="ObservableMap&lt;String, Object&gt;"/>
|
||||
</data>
|
||||
…
|
||||
<TextView
|
||||
@@ -1277,7 +1277,7 @@ user.add(17);
|
||||
<data>
|
||||
<import type="android.databinding.ObservableList"/>
|
||||
<import type="com.example.my.app.Fields"/>
|
||||
<variable name="user" type="ObservableList<Object>"/>
|
||||
<variable name="user" type="ObservableList&lt;Object&gt;"/>
|
||||
</data>
|
||||
…
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user