This sample illustrate the use of the news Xml Adapters definition, as well as the use on the new XmlDocumentProvider class. Change-Id: Ie9738b5f0a0f00df2af643890a48573bace19311
31 lines
1.4 KiB
XML
31 lines
1.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Copyright (C) 2010 The Android Open Source Project
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
|
|
<cursor-adapter xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:selection="/rss/channel/item"
|
|
android:layout="@layout/rss_feed_item">
|
|
|
|
<bind android:from="/title" android:to="@id/title" android:as="string" />
|
|
<bind android:from="/media:content@url" android:to="@id/image"
|
|
android:as="com.example.android.xmladapters.UrlImageBinder"/>
|
|
<bind android:from="/media:description" android:to="@id/description" android:as="string" />
|
|
<bind android:from="/guid" android:to="@id/item_layout" android:as="tag" />
|
|
<bind android:from="/pubDate" android:to="@id/date" android:as="string">
|
|
<transform android:withExpression="Published on {/pubDate}." />
|
|
</bind>
|
|
|
|
</cursor-adapter>
|