Merge "Adds metadata for ElizaChat sample" into lmp-docs
diff --git a/content/documentsUi/StorageProvider/template-params.xml b/content/documentsUi/StorageProvider/template-params.xml
index d6a6eed..058aace 100644
--- a/content/documentsUi/StorageProvider/template-params.xml
+++ b/content/documentsUi/StorageProvider/template-params.xml
@@ -56,19 +56,19 @@
<android>android.provider.DocumentsProvider</android>
</api_refs>
<description>
- This sample shows how to implement a simple documents provider using the storage access
- framework available in Android 4.4.
+This sample shows how to implement a simple documents provider using the storage access
+framework available in Android 4.4.
</description>
<intro>
- This sample uses the [StorageAccessFramework][1] introduced in Android 4.4 to implement a [DocumentsProvider][2].
+This sample uses the [StorageAccessFramework][1] introduced in Android 4.4 to implement a [DocumentsProvider][2].
- See [Writing A Custom Document Provider guide][3] for all the details on how to do this.
+See [Writing A Custom Document Provider guide][3] for all the details on how to do this.
- [1]: https://developer.android.com/guide/topics/providers/document-provider.html
- [2]: https://developer.android.com/reference/android/provider/DocumentsProvider.html
- [3]: https://developer.android.com/guide/topics/providers/document-provider.html#custom
+[1]: https://developer.android.com/guide/topics/providers/document-provider.html
+[2]: https://developer.android.com/reference/android/provider/DocumentsProvider.html
+[3]: https://developer.android.com/guide/topics/providers/document-provider.html#custom
</intro>
</metadata>
diff --git a/media/BasicMediaDecoder/screenshots/1-launch.png b/media/BasicMediaDecoder/screenshots/1-launch.png
new file mode 100644
index 0000000..87c246f
--- /dev/null
+++ b/media/BasicMediaDecoder/screenshots/1-launch.png
Binary files differ
diff --git a/media/BasicMediaDecoder/screenshots/2-play-video.png b/media/BasicMediaDecoder/screenshots/2-play-video.png
new file mode 100644
index 0000000..17f61fa
--- /dev/null
+++ b/media/BasicMediaDecoder/screenshots/2-play-video.png
Binary files differ
diff --git a/media/BasicMediaDecoder/screenshots/icon-web.png b/media/BasicMediaDecoder/screenshots/icon-web.png
new file mode 100644
index 0000000..c67722e
--- /dev/null
+++ b/media/BasicMediaDecoder/screenshots/icon-web.png
Binary files differ
diff --git a/media/BasicMediaDecoder/template-params.xml b/media/BasicMediaDecoder/template-params.xml
index bcb01af..ff8861c 100644
--- a/media/BasicMediaDecoder/template-params.xml
+++ b/media/BasicMediaDecoder/template-params.xml
@@ -33,4 +33,75 @@
<template src="base"/>
<common src="media"/>
+
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Media</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>screenshots/icon-web.png</icon>
+ <screenshots>
+ <img>screenshots/1-launch.png</img>
+ <img>screenshots/2-play-video.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.media.MediaCodec</android>
+ <android>android.media.MediaExtractor</android>
+ <android>android.animation.TimeAnimator</android>
+ </api_refs>
+
+ <description>
+This sample shows how to use the MediaCoder to decode a video,
+use a TimeAnimator to sync the rendering commands with the system
+display frame rendering and finally render it to a TextureView.
+ </description>
+
+ <intro>
+<![CDATA[
+[MediaCodec][1] was introduced in API 16, and can be used for low level (decoding/encoding) operations.
+In the same API was also introduced [TimeAnimator][2], which can be used to synchronise animation frames.
+Finally, [MediaExtractor][3] provides a simple way to extract demuxed media data from a data source.
+
+The main steps are described below:
+
+1. Create a layout with a [TextureView][4] for your activity.
+2. Initialise a MediaExtractor instance with `new MediaExtractor()` and a TimeAnimator instance with
+`new TimeAnimator()`.
+3. To start video playback, call `setDataSource(this, videoUri, null)` on your MediaExtractor instance,
+where `videoUri` is the URI of your video source.
+4. On your MediaExtractor instance, call `getTrackCount()` to know how many tracks you have in your streams.
+They may not all be video tracks. Deselect all tracks by calling `unselectTrack(i)` where `i` is
+the index of the track.
+5. Get the mime type of a track by calling `getTrackFormat(i).getString(MediaFormat.KEY_MIME)`
+on your MediaExtractor instance, where `i` is the index of your selected track.
+If the mime type contains "video/", then this is a video track so you can select it, using `selectTrack(i)`
+on your MediaExtractor instance.
+6. Create a MediaCodec instance by calling `MediaCodec.createDecoderByType(mimeType)`.
+7. Configure your MediaCodec instance with `configure(trackFormat, textureView, null, 0)`,
+where `trackFormat` is obtained by calling `getTrackFormat(i)` on your MediaExtractor instance.
+8. Set a TimeListener on your TimeAnimation instance, and override its `onTimeUpdate(final TimeAnimator animation,
+final long totalTime, final long deltaTime)` method.
+9. In `onTimeUpdate`, check if the media track has reached the end of stream, using `getSampleFlags()`
+on your MediaExtractor instance and looking for `MediaCodec.BUFFER_FLAG_END_OF_STREAM` flag.
+10. Still in `onTimeUpdate`, assuming this isn't the end of the sample, write the media sample to your
+MediaDecoder instance, using `queueInputBuffer(index, 0, size, presentationTimeUs, flags)` method.
+You will need to set up your buffers, refer to [MediaCodec][1] documentation for details.
+11. After writing the media sample, you need to advance the sample, calling `advance()` on your
+TimeExtractor instance (this is a blocking operation and should be done outside the main thread).
+12. Finally, you can release and render the media sample by calling
+`dequeueOutputBuffer(info, timeout)` and `releaseOutputBuffer(i, true)`, refer to [MediaCodec][1]
+documentation for details.
+13. In `onPause()` or if you have reached the end of the stream, call `end()` on your TimeAnimation instance,
+then call `stop()` and `release()` on your MediaCodec instance, and finally, call `release()` on your
+MediaExtractor instance.
+
+[1]: http://developer.android.com/reference/android/media/MediaCodec.html
+[2]: http://developer.android.com/reference/android/animation/TimeAnimator.html
+[3]: http://developer.android.com/reference/android/media/MediaExtractor.html
+[4]: http://developer.android.com/reference/android/view/TextureView.html
+]]>
+ </intro>
+ </metadata>
</sample>
diff --git a/media/Camera2Basic/Application/src/main/big_icon.png b/media/Camera2Basic/Application/src/main/big_icon.png
new file mode 100755
index 0000000..d9bd4c4
--- /dev/null
+++ b/media/Camera2Basic/Application/src/main/big_icon.png
Binary files differ
diff --git a/media/Camera2Basic/screenshots/main.png b/media/Camera2Basic/screenshots/main.png
new file mode 100644
index 0000000..47419eb
--- /dev/null
+++ b/media/Camera2Basic/screenshots/main.png
Binary files differ
diff --git a/media/Camera2Basic/template-params.xml b/media/Camera2Basic/template-params.xml
index f89b6a3..e993e21 100644
--- a/media/Camera2Basic/template-params.xml
+++ b/media/Camera2Basic/template-params.xml
@@ -34,4 +34,66 @@
<template src="base"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Media, Camera, Camera2</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>INTERMEDIATE</level>
+ <icon>Application/src/main/big_icon.png</icon>
+ <screenshots>
+ <img>screenshots/main.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.hardware.camera2.CameraManager</android>
+ <android>android.hardware.camera2.CameraDevice</android>
+ <android>android.hardware.camera2.CameraCharacteristics</android>
+ <android>android.hardware.camera2.CameraCaptureSession</android>
+ <android>android.hardware.camera2.CaptureRequest</android>
+ <android>android.hardware.camera2.CaptureResult</android>
+ <android>android.view.TextureView</android>
+ </api_refs>
+
+ <description>
+This sample demonstrates how to use basic functionalities of Camera2
+API. You can learn how to iterate through characteristics of all the
+cameras attached to the device, display a camera preview, and take
+pictures.
+ </description>
+
+ <intro>
+<![CDATA[
+The [Camera2 API][1] provides an interface to individual camera
+devices connected to an Android device. It replaces the deprecated
+Camera class.
+
+Use [getCameraIdList][2] to get a list of all the available
+cameras. You can then use [getCameraCharacteristics][3] and find the
+best camera that suits your need (front/rear facing, resolution etc).
+
+Create an instance of [CameraDevice.StateCallback][4] and open a
+camera. It is ready to start camera preview when the camera is opened.
+
+This sample uses TextureView to show the camera preview. Create a
+[CameraCaptureSession][5] and set a repeating [CaptureRequest][6] to it.
+
+Still image capture takes several steps. First, you need to lock the
+focus of the camera by updating the CaptureRequest for the camera
+preview. Then, in a similar way, you need to run a precapture
+sequence. After that, it is ready to capture a picture. Create a new
+CaptureRequest and call [capture][7]. Don't forget to unlock the focus
+when you are done.
+
+[1]: https://developer.android.com/reference/android/hardware/camera2/package-summary.html
+[2]: https://developer.android.com/reference/android/hardware/camera2/CameraManager.html#getCameraIdList()
+[3]: https://developer.android.com/reference/android/hardware/camera2/CameraManager.html#getCameraCharacteristics(java.lang.String)
+[4]: https://developer.android.com/reference/android/hardware/camera2/CameraDevice.StateCallback.html
+[5]: https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html
+[6]: https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.html
+[7]: https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)
+]]>
+ </intro>
+ </metadata>
+
</sample>
diff --git a/media/MediaBrowserService/Application/src/main/java/com/example/android/mediabrowserservice/PackageValidator.java b/media/MediaBrowserService/Application/src/main/java/com/example/android/mediabrowserservice/PackageValidator.java
index fec360f..090b6a4 100644
--- a/media/MediaBrowserService/Application/src/main/java/com/example/android/mediabrowserservice/PackageValidator.java
+++ b/media/MediaBrowserService/Application/src/main/java/com/example/android/mediabrowserservice/PackageValidator.java
@@ -159,7 +159,14 @@
*/
public static boolean isCallerAllowed(Context context, String callingPackage, int callingUid) {
// Always allow calls from the framework or development environment.
- if (Process.SYSTEM_UID == callingUid || !"user".equals(Build.TYPE)) {
+ if (Process.SYSTEM_UID == callingUid || Process.myUid() == callingUid) {
+ return true;
+ }
+ if (BuildConfig.DEBUG) {
+ // When your app is built in debug mode, any app is allowed to connect to it and browse
+ // its media library. If you want to test the behavior of your app when it gets
+ // released, either build a release version or remove this clause.
+ Log.i(TAG, "Allowing caller '"+callingPackage+" because app was built in debug mode.");
return true;
}
PackageInfo packageInfo;
diff --git a/media/MediaBrowserService/README.md b/media/MediaBrowserService/README.md
index bda9824..0072d93 100644
--- a/media/MediaBrowserService/README.md
+++ b/media/MediaBrowserService/README.md
@@ -1,12 +1,5 @@
Android MediaBrowserService Sample
-==============================
-
-This sample shows how to implement an audio media app that provides
-media library metadata and playback controls through a standard
-service. This sample is compatible with Android Auto.
-
-Introduction
-------------
+===================================
This sample shows how to implement an audio media app that provides
media library metadata and playback controls through a standard
@@ -19,64 +12,12 @@
to the Android Auto UI in the same manner as it provides them to the
local UI.
-To implement a MediaBrowserService, you need to:
-
-- extend android.service.media.MediaBrowserService, implementing the media
- browsing related methods onGetRoot and onLoadChildren;
-
-- in onCreate, start a new MediaSession and call super.setSessionToken() with
- this MediaSession's token;
-
-- set a MediaSession.Callback class on the MediaSession. The callback class
- will receive all the user's actions, like play, pause, etc;
-
-- handle all the actual music playing using any method your app prefers
- (for example, the Android MediaPlayer class)
-
-- whenever it changes, update info about the playing item and the playing
- queue using MediaSession corresponding methods (setMetadata,
- setPlaybackState, setQueue, setQueueTitle, etc)
-
-- handle AudioManager focus change events and react appropriately
- (e.g. pause when audio focus is lost)
-
-
-To make it compatible with Android Auto, you also need to:
-
-- declare a meta-data tag in AndroidManifest.xml linking to a xml resource
- with a automotiveApp root element. For a media app, this must include
- an <uses name="media"/> element as a child.
-
- For example, in AndroidManifest.xml:
-```
- <meta-data android:name="com.google.android.gms.car.application"
- android:resource="@xml/automotive_app_desc"/>
-```
-
- And in res/xml/automotive\_app\_desc.xml:
-```
- <?xml version="1.0" encoding="utf-8"?>
- <automotiveApp>
- <uses name="media"/>
- </automotiveApp>
-```
-
-- declare and export the service in AndroidManifest.xml:
-```
- <service
- android:name=".service.MusicService"
- android:exported="true">
- <intent-filter>
- <action android:name="android.media.browse.MediaBrowserService" />
- </intent-filter>
- </service>
-```
-
-
Pre-requisites
--------------
- Android SDK v21
+- Android Build Tools v21.1.1
+- Android Support Repository
Getting Started
---------------
@@ -108,7 +49,7 @@
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
+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
diff --git a/media/MediaBrowserService/template-params.xml b/media/MediaBrowserService/template-params.xml
index c129f6a..2d9f487 100644
--- a/media/MediaBrowserService/template-params.xml
+++ b/media/MediaBrowserService/template-params.xml
@@ -24,10 +24,72 @@
<strings>
<intro>
<![CDATA[
- This sample shows how to implement an audio media app that provides
- media library metadata and playback controls through a standard
- service.
+This sample shows how to implement an audio media app that provides
+media library metadata and playback controls through a standard
+service. It exposes a simple music library through the new
+MediaBrowserService and provides MediaSession callbacks. This allows
+it to be used in Android Auto, for example.
+When not connected to a car, the app has a very simple UI that browses
+the media library and provides simple playback controls. When
+connected to Android Auto, the same service provides data and callback
+to the Android Auto UI in the same manner as it provides them to the
+local UI.
]]>
+<!-- TODO(mangini): when b/18612065 is fixed, restore the block below:
+
+To implement a MediaBrowserService, you need to:
+
+- extend android.service.media.MediaBrowserService, implementing the media
+ browsing related methods onGetRoot and onLoadChildren;
+
+- in onCreate, start a new MediaSession and call super.setSessionToken() with
+ this MediaSession's token;
+
+- set a MediaSession.Callback class on the MediaSession. The callback class
+ will receive all the user's actions, like play, pause, etc;
+
+- handle all the actual music playing using any method your app prefers
+ (for example, the Android MediaPlayer class)
+
+- whenever it changes, update info about the playing item and the playing
+ queue using MediaSession corresponding methods (setMetadata,
+ setPlaybackState, setQueue, setQueueTitle, etc)
+
+- handle AudioManager focus change events and react appropriately
+ (e.g. pause when audio focus is lost)
+
+
+To make it compatible with Android Auto, you also need to:
+
+- declare a meta-data tag in AndroidManifest.xml linking to a xml resource
+ with a automotiveApp root element. For a media app, this must include
+ an <uses name="media"/> element as a child.
+
+ For example, in AndroidManifest.xml:
+```
+ <meta-data android:name="com.google.android.gms.car.application"
+ android:resource="@xml/automotive_app_desc"/>
+```
+
+ And in res/xml/automotive\_app\_desc.xml:
+```
+ <?xml version="1.0" encoding="utf-8"?>
+ <automotiveApp>
+ <uses name="media"/>
+ </automotiveApp>
+```
+
+- declare and export the service in AndroidManifest.xml:
+```
+ <service
+ android:name=".service.MusicService"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.media.browse.MediaBrowserService" />
+ </intent-filter>
+ </service>
+```
+-->
</intro>
</strings>
diff --git a/media/MediaEffects/Application/src/main/big_icon.png b/media/MediaEffects/Application/src/main/big_icon.png
new file mode 100755
index 0000000..e04452c
--- /dev/null
+++ b/media/MediaEffects/Application/src/main/big_icon.png
Binary files differ
diff --git a/media/MediaEffects/Application/src/main/res/drawable-hdpi/ic_launcher.png b/media/MediaEffects/Application/src/main/res/drawable-hdpi/ic_launcher.png
index 960dc8e..950d67b 100644
--- a/media/MediaEffects/Application/src/main/res/drawable-hdpi/ic_launcher.png
+++ b/media/MediaEffects/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaEffects/Application/src/main/res/drawable-mdpi/ic_launcher.png b/media/MediaEffects/Application/src/main/res/drawable-mdpi/ic_launcher.png
index 9356f26..cf01e9a 100644
--- a/media/MediaEffects/Application/src/main/res/drawable-mdpi/ic_launcher.png
+++ b/media/MediaEffects/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaEffects/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/media/MediaEffects/Application/src/main/res/drawable-xhdpi/ic_launcher.png
index 230d558..b66c0fd 100644
--- a/media/MediaEffects/Application/src/main/res/drawable-xhdpi/ic_launcher.png
+++ b/media/MediaEffects/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaEffects/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/media/MediaEffects/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
index c825d4e..1e0344e 100644
--- a/media/MediaEffects/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ b/media/MediaEffects/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaEffects/screenshots/duotone.png b/media/MediaEffects/screenshots/duotone.png
new file mode 100644
index 0000000..331c1a1
--- /dev/null
+++ b/media/MediaEffects/screenshots/duotone.png
Binary files differ
diff --git a/media/MediaEffects/screenshots/menu.png b/media/MediaEffects/screenshots/menu.png
new file mode 100644
index 0000000..851cda5
--- /dev/null
+++ b/media/MediaEffects/screenshots/menu.png
Binary files differ
diff --git a/media/MediaEffects/template-params.xml b/media/MediaEffects/template-params.xml
index ba17a4b..1eb44d3 100644
--- a/media/MediaEffects/template-params.xml
+++ b/media/MediaEffects/template-params.xml
@@ -42,4 +42,44 @@
<template src="FragmentView"/>
<common src="logger"/>
<common src="activities"/>
+
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Media, OpenGL</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>Application/src/main/big_icon.png</icon>
+ <screenshots>
+ <img>screenshots/menu.png</img>
+ <img>screenshots/duotone.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.media.effect.Effect</android>
+ <android>android.media.effect.EffectContext</android>
+ <android>android.media.effect.EffectFactory</android>
+ <android>android.opengl.GLSurfaceView</android>
+ </api_refs>
+
+ <description>
+This sample shows how to use the Media Effects APIs that were
+introduced in Android 4.0.
+ </description>
+
+ <intro>
+<![CDATA[
+The [Media Effects APIs][1] lets you apply effects to image frames
+represented as OpenGL ES 2.0 textures. Image frames can be images
+loaded from disk, frames from the device's camera, or other video
+streams.
+
+For a list of available effects, refer to [EffectsFactory][2].
+
+[1]: http://developer.android.com/reference/android/media/effect/package-summary.html
+[2]: http://developer.android.com/reference/android/media/effect/EffectFactory.html
+]]>
+ </intro>
+ </metadata>
+
</sample>
diff --git a/media/MediaRecorder/Application/src/main/res/drawable-hdpi/ic_launcher.png b/media/MediaRecorder/Application/src/main/res/drawable-hdpi/ic_launcher.png
index 13cd1e8..bea32bc 100644
--- a/media/MediaRecorder/Application/src/main/res/drawable-hdpi/ic_launcher.png
+++ b/media/MediaRecorder/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaRecorder/Application/src/main/res/drawable-mdpi/ic_launcher.png b/media/MediaRecorder/Application/src/main/res/drawable-mdpi/ic_launcher.png
index 00b2bd9..2a3a490 100644
--- a/media/MediaRecorder/Application/src/main/res/drawable-mdpi/ic_launcher.png
+++ b/media/MediaRecorder/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaRecorder/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/media/MediaRecorder/Application/src/main/res/drawable-xhdpi/ic_launcher.png
index 953f1cc..9674428 100644
--- a/media/MediaRecorder/Application/src/main/res/drawable-xhdpi/ic_launcher.png
+++ b/media/MediaRecorder/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaRecorder/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/media/MediaRecorder/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
index f2ccb10..61e322c 100644
--- a/media/MediaRecorder/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ b/media/MediaRecorder/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/media/MediaRecorder/packaging.yaml b/media/MediaRecorder/packaging.yaml
deleted file mode 100644
index 13cd2e9..0000000
--- a/media/MediaRecorder/packaging.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-# GOOGLE SAMPLE PACKAGING DATA
-#
-# This file is used by Google as part of our samples packaging process.
-# End users may safely ignore this file. It has no relevance to other systems.
----
-
-status: PUBLISHED
-technologies: [Android]
-categories: [Media]
-languages: [Java]
-solutions: [Mobile]
-github: googlesamples/android-MediaRecorder
-level: BEGINNER
-icon: MediaRecorderSample/src/main/res/drawable-xxhdpi/ic_launcher.png
-license: apache2-android
diff --git a/media/MediaRecorder/screenshots/big_icon.png b/media/MediaRecorder/screenshots/big_icon.png
new file mode 100644
index 0000000..99bd10c
--- /dev/null
+++ b/media/MediaRecorder/screenshots/big_icon.png
Binary files differ
diff --git a/media/MediaRecorder/screenshots/screnshot1.png b/media/MediaRecorder/screenshots/screnshot1.png
new file mode 100644
index 0000000..888c042
--- /dev/null
+++ b/media/MediaRecorder/screenshots/screnshot1.png
Binary files differ
diff --git a/media/MediaRecorder/screenshots/screnshot2.png b/media/MediaRecorder/screenshots/screnshot2.png
new file mode 100644
index 0000000..3ae570e
--- /dev/null
+++ b/media/MediaRecorder/screenshots/screnshot2.png
Binary files differ
diff --git a/media/MediaRecorder/template-params.xml b/media/MediaRecorder/template-params.xml
index 6b6ddc5..fa4a165 100644
--- a/media/MediaRecorder/template-params.xml
+++ b/media/MediaRecorder/template-params.xml
@@ -14,27 +14,62 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>MediaRecorder</name>
<group>Media</group>
<package>com.example.android.mediarecorder</package>
-
- <!-- change minSdk if needed-->
<minSdk>14</minSdk>
-
<strings>
<intro>
- <![CDATA[
- This sample uses the camera/camcorder as the A/V source for the MediaRecorder API.
- A TextureView is used as the camera preview which limits the code to API 14+. This
- can be easily replaced with a SurfaceView to run on older devices.
- ]]>
+<![CDATA[
+This sample uses the camera/camcorder as the A/V source for the MediaRecorder API.
+A TextureView is used as the camera preview which limits the code to API 14+. This
+can be easily replaced with a SurfaceView to run on older devices.
+]]>
</intro>
</strings>
-
<template src="base"/>
<common src="media"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Media</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>screenshots/big_icon.png</icon>
+ <screenshots>
+ <img>screenshots/screenshot1.png</img>
+ <img>screenshots/screenshot2.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.hardware.Camera</android>
+ <android>android.media.CamcorderProfile</android>
+ <android>android.media.MediaRecorder</android>
+ <android>android.view.TextureView</android>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample uses the camera/camcorder as the A/V source for the MediaRecorder API.
+A TextureView is used as the camera preview which limits the code to API 14+. This
+can be easily replaced with a SurfaceView to run on older devices.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This sample shows how to use the [MediaRecorder][1] API.
+It uses the [Camera][2] as input source and displays a preview on a [TextureView][3]
+The sample features a button to capture the input and stop capturing afterwards.
+
+It demonstrates how to correctly gain control and release the camera.
+The sample also shows how to save the captured audio and video to persistant storage
+and basic error handling.
+
+
+[1]: https://developer.android.com/reference/android/media/MediaRecorder.html
+[2]: https://developer.android.com/reference/android/graphics/Camera.html
+[3]: https://developer.android.com/reference/android/view/TextureView.html
+]]>
+ </intro>
+ </metadata>
</sample>
diff --git a/notification/CustomNotifications/screenshots/icon-web.png b/notification/CustomNotifications/screenshots/icon-web.png
new file mode 100644
index 0000000..183e592
--- /dev/null
+++ b/notification/CustomNotifications/screenshots/icon-web.png
Binary files differ
diff --git a/notification/CustomNotifications/screenshots/main-notification.png b/notification/CustomNotifications/screenshots/main-notification.png
new file mode 100644
index 0000000..00d4e5a
--- /dev/null
+++ b/notification/CustomNotifications/screenshots/main-notification.png
Binary files differ
diff --git a/notification/CustomNotifications/screenshots/notification.png b/notification/CustomNotifications/screenshots/notification.png
new file mode 100644
index 0000000..a6abfcb
--- /dev/null
+++ b/notification/CustomNotifications/screenshots/notification.png
Binary files differ
diff --git a/notification/CustomNotifications/template-params.xml b/notification/CustomNotifications/template-params.xml
index 1ded0d1..b18b927 100644
--- a/notification/CustomNotifications/template-params.xml
+++ b/notification/CustomNotifications/template-params.xml
@@ -30,6 +30,50 @@
</intro>
</strings>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Notification, UI</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>BEGINNER</level>
+ <icon>screenshots/icon-web.png</icon>
+ <screenshots>
+ <img>screenshots/main-notification.png</img>
+ <img>screenshots/notification.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.app.Notification</android>
+ <android>android.app.NotificationManager</android>
+ <android>android.app.PendingIntent</android>
+ <android>android.support.v4.app.NotificationCompat</android>
+ <android>android.widget.RemoteViews</android>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample demonstrates notifications with custom content views.
+The use of collapsed and expanded notification views are shown.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This sample demonstrates notifications with custom content views. It
+also demonstrates the expanded notification introduced in API level 16.
+
+This sample shows all the required steps to create and display custom
+notifications:
+
+- Create Intent to launch Activity when notification is clicked.
+- Define custom layouts for collapsed and expanded views.
+- Use NotificationManager's notify to show notification.
+
+In the sample, click on the "SHOW NOTIFICATION" button to create
+a notification. Use two-fingered gestures up and down to collapse
+and expand the notification.
+]]>
+ </intro>
+ </metadata>
+
<template src="base"/>
</sample>
diff --git a/notification/MessagingService/screenshots/1-main.png b/notification/MessagingService/screenshots/1-main.png
new file mode 100644
index 0000000..a3e527c
--- /dev/null
+++ b/notification/MessagingService/screenshots/1-main.png
Binary files differ
diff --git a/notification/MessagingService/screenshots/2-onemessage.png b/notification/MessagingService/screenshots/2-onemessage.png
new file mode 100644
index 0000000..5970c51
--- /dev/null
+++ b/notification/MessagingService/screenshots/2-onemessage.png
Binary files differ
diff --git a/notification/MessagingService/screenshots/2-threemessages.png b/notification/MessagingService/screenshots/2-threemessages.png
new file mode 100644
index 0000000..9d36923
--- /dev/null
+++ b/notification/MessagingService/screenshots/2-threemessages.png
Binary files differ
diff --git a/notification/MessagingService/screenshots/icon-web.png b/notification/MessagingService/screenshots/icon-web.png
new file mode 100644
index 0000000..2476cbd
--- /dev/null
+++ b/notification/MessagingService/screenshots/icon-web.png
Binary files differ
diff --git a/notification/MessagingService/template-params.xml b/notification/MessagingService/template-params.xml
index 7866642..10ce451 100644
--- a/notification/MessagingService/template-params.xml
+++ b/notification/MessagingService/template-params.xml
@@ -33,4 +33,47 @@
</strings>
<template src="basebuild" />
+
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>UI, Notification</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>screenshots/icon-web.png</icon>
+ <screenshots>
+ <img>screenshots/1-main.png</img>
+ <img>screenshots/2-onemessage.png</img>
+ <img>screenshots/3-threemessages.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.app.Service</android>
+ <android>android.content.Intent</android>
+ <android>android.support.v4.app.NotificationCompat</android>
+ <android>android.support.v4.app.NotificationCompat.CarExtender</android>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample shows a simple service that sends notifications using
+NotificationCompat. In addition to sending a notification, it also extends
+the notification with a CarExtender to make it compatible with Android Auto.
+Each unread conversation from a user is sent as a distinct notification.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This sample shows a simple service that sends [notifications][1] using
+NotificationCompat.
+
+In addition to sending a notification, it also extends
+the notification with a [CarExtender][2] to make it compatible with Android Auto.
+
+Each unread conversation from a user is sent as a distinct notification.
+
+[1]: https://developer.android.com/guide/topics/ui/notifiers/notifications.html
+[2]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.CarExtender.html
+]]>
+ </intro>
+ </metadata>
</sample>
diff --git a/security/keystore/BasicAndroidKeyStore/packaging.yaml b/security/keystore/BasicAndroidKeyStore/packaging.yaml
deleted file mode 100644
index a2cbd14..0000000
--- a/security/keystore/BasicAndroidKeyStore/packaging.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-# GOOGLE SAMPLE PACKAGING DATA
-#
-# This file is used by Google as part of our samples packaging process.
-# End users may safely ignore this file. It has no relevance to other systems.
----
-
-status: PUBLISHED
-technologies: [Android]
-categories: [Security]
-languages: [Java]
-solutions: [Mobile]
-github: googlesamples/android-BasicAndroidKeyStore
-level: BEGINNER
-icon: BasicAndroidKeyStoreSample/src/main/res/drawable-xxhdpi/ic_launcher.png
-license: apache2-android
diff --git a/security/keystore/BasicAndroidKeyStore/screenshots/big_icon.png b/security/keystore/BasicAndroidKeyStore/screenshots/big_icon.png
new file mode 100644
index 0000000..004d80c
--- /dev/null
+++ b/security/keystore/BasicAndroidKeyStore/screenshots/big_icon.png
Binary files differ
diff --git a/security/keystore/BasicAndroidKeyStore/screenshots/screenshot1.png b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot1.png
new file mode 100644
index 0000000..e09a209
--- /dev/null
+++ b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot1.png
Binary files differ
diff --git a/security/keystore/BasicAndroidKeyStore/screenshots/screenshot2.png b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot2.png
new file mode 100644
index 0000000..24bfa43
--- /dev/null
+++ b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot2.png
Binary files differ
diff --git a/security/keystore/BasicAndroidKeyStore/screenshots/screenshot3.png b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot3.png
new file mode 100644
index 0000000..aafbbfb
--- /dev/null
+++ b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot3.png
Binary files differ
diff --git a/security/keystore/BasicAndroidKeyStore/screenshots/screenshot4.png b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot4.png
new file mode 100644
index 0000000..3f77b54
--- /dev/null
+++ b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot4.png
Binary files differ
diff --git a/security/keystore/BasicAndroidKeyStore/screenshots/screenshot5.png b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot5.png
new file mode 100644
index 0000000..4965dc5
--- /dev/null
+++ b/security/keystore/BasicAndroidKeyStore/screenshots/screenshot5.png
Binary files differ
diff --git a/security/keystore/BasicAndroidKeyStore/template-params.xml b/security/keystore/BasicAndroidKeyStore/template-params.xml
index d603dfa..e2fddf6 100644
--- a/security/keystore/BasicAndroidKeyStore/template-params.xml
+++ b/security/keystore/BasicAndroidKeyStore/template-params.xml
@@ -24,14 +24,15 @@
<strings>
<intro>
- <![CDATA[
- Welcome to the <b>Basic Android Key Store</b> sample!\n\n
- This sample demonstrates how to use the Android Key Store to safely create and store
- encryption keys that only your application can access. You can also sign data
- using those keys.\n\n
- To create a new KeyPair, click \"Create\".\n\n
- To sign some data using a KeyPair, click \"Sign\".\n\n
- To verify the data using the signature provided, click \"Verify\".\n\n ]]>
+<![CDATA[
+Welcome to the <b>Basic Android Key Store</b> sample!\n\n
+This sample demonstrates how to use the Android Key Store to safely create and store
+encryption keys that only your application can access. You can also sign data
+using those keys.\n\n
+To create a new KeyPair, click \"Create\".\n\n
+To sign some data using a KeyPair, click \"Sign\".\n\n
+To verify the data using the signature provided, click \"Verify\".\n\n
+]]>
</intro>
</strings>
@@ -40,4 +41,44 @@
<common src="activities"/>
<common src="logger"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Security</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>screenshots/big-icon.png</icon>
+ <screenshots>
+ <img>screenshots/screenshot1.png</img>
+ <img>screenshots/screenshot2.png</img>
+ <img>screenshots/screenshot3.png</img>
+ <img>screenshots/screenshot4.png</img>
+ <img>screenshots/screenshot5.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.security.KeyPairGeneratorSpec</android>
+ </api_refs>
+ <description>
+<![CDATA[
+An advanced sample displaying the creation and usage of data integrity mechanisms
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This sample demonstrates how to use the Android [KeyStore][1] to safely create and store
+encryption keys that only your application can access.
+
+A [KeyPair][2] consisting of a [PrivateKey][3] and a [PublicKey][4] is being generated.
+The private key then is being used to sign and verify a String.
+
+Next to that appropriate exception handling for potential errors is being displayed.
+
+[1]: https://developer.android.com/reference/java/security/KeyStore.html
+[2]: https://developer.android.com/reference/java/security/KeyPair.html
+[3]: https://developer.android.com/reference/java/security/PrivateKey.html
+[4]: https://developer.android.com/reference/java/security/PublicKey.html
+]]>
+ </intro>
+</metadata>
</sample>
diff --git a/sensors/BatchStepSensor/template-params.xml b/sensors/BatchStepSensor/template-params.xml
index d43c877..0f2ffbb 100644
--- a/sensors/BatchStepSensor/template-params.xml
+++ b/sensors/BatchStepSensor/template-params.xml
@@ -49,7 +49,7 @@
<technologies>Android</technologies>
<languages>Java</languages>
<solutions>Mobile</solutions>
- <level>BEGINNER</level>
+ <level>ADVANCED</level>
<icon>screenshots/big_icon.png</icon>
<screenshots>
<img>screenshots/screenshot1.png</img>
@@ -66,30 +66,34 @@
<android>android.hardware.SensorManager</android>
</api_refs>
<description>
- Sample demonstrating how to set up SensorEventListeners for step
- detectors and step counters.
+<![CDATA[
+Sample demonstrating how to set up SensorEventListeners for step
+detectors and step counters.
+]]>
</description>
<intro>
- This sample demonstrates the use of the two step [sensors][1] (step detector and counter) and
- sensor batching.
+<![CDATA[
+This sample demonstrates the use of the two step [sensors][1] (step detector and counter) and
+sensor batching.
- It shows how to register a [SensorEventListener][2] with and without
- batching and shows how these events are received.
+It shows how to register a [SensorEventListener][2] with and without
+batching and shows how these events are received.
- The Step Detector sensor fires an
- event when a step is detected, while the step counter returns the total number of
- steps since a listener was first registered for this sensor.
+The Step Detector sensor fires an
+event when a step is detected, while the step counter returns the total number of
+steps since a listener was first registered for this sensor.
- Both sensors only count steps while a listener is registered. This sample only covers the
- basic case, where a listener is only registered while the app is running. Likewise,
- batched sensors can be used in the background (when the CPU is suspended), which
- requires manually flushing the [sensor event][3] queue before it overflows, which is not
- covered in this sample.
+Both sensors only count steps while a listener is registered. This sample only covers the
+basic case, where a listener is only registered while the app is running. Likewise,
+batched sensors can be used in the background (when the CPU is suspended), which
+requires manually flushing the [sensor event][3] queue before it overflows, which is not
+covered in this sample.
- [1]: https://developer.android.com/reference/android/hardware/Sensor.html
- [2]: https://developer.android.com/reference/android/hardware/SensorEventListener.html
- [3]: https://developer.android.com/reference/android/hardware/SensorEvent.html
+[1]: https://developer.android.com/reference/android/hardware/Sensor.html
+[2]: https://developer.android.com/reference/android/hardware/SensorEventListener.html
+[3]: https://developer.android.com/reference/android/hardware/SensorEvent.html
+]]>
</intro>
</metadata>
diff --git a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-hdpi/ic_launcher.png b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-hdpi/ic_launcher.png
index 6c0b5ee..c8342cb 100644
--- a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-hdpi/ic_launcher.png
+++ b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-mdpi/ic_launcher.png b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-mdpi/ic_launcher.png
index 4ce0b82..0e883dd 100644
--- a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-mdpi/ic_launcher.png
+++ b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xhdpi/ic_launcher.png
index 6ded707..4096b65 100644
--- a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xhdpi/ic_launcher.png
+++ b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
index 74ae891..b00fc9b 100644
--- a/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ b/ui/accessibility/BasicAccessibility/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/accessibility/BasicAccessibility/screenshots/icon-web.png b/ui/accessibility/BasicAccessibility/screenshots/icon-web.png
new file mode 100644
index 0000000..7164cad
--- /dev/null
+++ b/ui/accessibility/BasicAccessibility/screenshots/icon-web.png
Binary files differ
diff --git a/ui/accessibility/BasicAccessibility/screenshots/main.png b/ui/accessibility/BasicAccessibility/screenshots/main.png
new file mode 100644
index 0000000..0a0c1b2
--- /dev/null
+++ b/ui/accessibility/BasicAccessibility/screenshots/main.png
Binary files differ
diff --git a/ui/accessibility/BasicAccessibility/template-params.xml b/ui/accessibility/BasicAccessibility/template-params.xml
index af9d815..56b36eb 100644
--- a/ui/accessibility/BasicAccessibility/template-params.xml
+++ b/ui/accessibility/BasicAccessibility/template-params.xml
@@ -31,6 +31,41 @@
</intro>
</strings>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>UI</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>BEGINNER</level>
+ <icon>screenshots/icon-web.png</icon>
+ <screenshots>
+ <img>screenshots/main.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.view.View</android>
+ <android>android.view.accessibility.AccessibilityEvent</android>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample demonstrates how to create an accessible application, using a mix of different widgets
+demonstrating different ways of adding accessibility markup to a UI.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This sample demonstrates how to create an accessible application, showing
+how to add accessibility to both framework and custom widgets.
+
+To run this sample as intended you will need to turn on TalkBack (or another text to speach system)
+on your Android device. Go to Settings > Accessibility > TalkBack to turn TalkBack on.
+
+When you run the sample with TalkBack mode on, TalkBack will read aloud the
+description of the in-focus widget.
+]]>
+ </intro>
+ </metadata>
+
<template src="base"/>
<common src="logger"/>
diff --git a/ui/actionbarcompat/ActionBarCompat-Basic/template-params.xml b/ui/actionbarcompat/ActionBarCompat-Basic/template-params.xml
index f3d773c..bb70ab0 100644
--- a/ui/actionbarcompat/ActionBarCompat-Basic/template-params.xml
+++ b/ui/actionbarcompat/ActionBarCompat-Basic/template-params.xml
@@ -62,33 +62,37 @@
<android>android.support.v4.view.MenuItemCompat</android>
</api_refs>
<description>
- This sample shows you how to use ActionBarCompat to create a basic Activity
- which displays action items. It covers inflating items from a menu resource,
- as well as adding an item in code.
+<![CDATA[
+This sample shows you how to use ActionBarCompat to create a basic Activity
+which displays action items. It covers inflating items from a menu resource,
+as well as adding an item in code.
+]]>
</description>
<intro>
- Android 3.0 introduced the “action bar” control, a toolbar that is expected
- to be present in most types of applications. This control identifies the user
- location, and provides user actions and navigation modes.
- Using the action bar offers your users a familiar interface across applications
- that the system gracefully adapts for different screen configurations.
+<![CDATA[
+Android 3.0 introduced the “action bar” control, a toolbar that is expected
+to be present in most types of applications. This control identifies the user
+location, and provides user actions and navigation modes.
+Using the action bar offers your users a familiar interface across applications
+that the system gracefully adapts for different screen configurations.
- Instantiating an action bar can be done by using the [ActionBar][1] API provided
- in API 11 or above. Support for older devices is provided by the
- [support library’s ActionBar][2] implementation, compatible back to API 7.
- This sample demonstrates using the support library APIs.
+Instantiating an action bar can be done by using the [ActionBar][1] API provided
+in API 11 or above. Support for older devices is provided by the
+[support library’s ActionBar][2] implementation, compatible back to API 7.
+This sample demonstrates using the support library APIs.
- Using an ActionBar with the support library requires the following steps:
+Using an ActionBar with the support library requires the following steps:
- 1. Create your activity by extending ActionBarActivity.
- 2. Use (or extend) one of the Theme.AppCompat themes for your activity.
+1. Create your activity by extending ActionBarActivity.
+2. Use (or extend) one of the Theme.AppCompat themes for your activity.
- Once this is done, action items will be created for any options menu items that
- would otherwise be created during when `[onCreateOptionsMenu()][3]` is called.
+Once this is done, action items will be created for any options menu items that
+would otherwise be created during when `[onCreateOptionsMenu()][3]` is called.
- [1]: http://developer.android.com/reference/android/app/ActionBar.html
- [2]: http://developer.android.com/reference/android/support/v7/app/ActionBar.html
- [3]: http://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu(android.view.Menu)
+[1]: http://developer.android.com/reference/android/app/ActionBar.html
+[2]: http://developer.android.com/reference/android/support/v7/app/ActionBar.html
+[3]: http://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu(android.view.Menu)
+]]>
</intro>
</metadata>
</sample>
diff --git a/ui/actionbarcompat/ActionBarCompat-ShareActionProvider/Application/src/main/java/com/example/android/actionbarcompat/shareactionprovider/MainActivity.java b/ui/actionbarcompat/ActionBarCompat-ShareActionProvider/Application/src/main/java/com/example/android/actionbarcompat/shareactionprovider/MainActivity.java
index b8cc900..545764c 100644
--- a/ui/actionbarcompat/ActionBarCompat-ShareActionProvider/Application/src/main/java/com/example/android/actionbarcompat/shareactionprovider/MainActivity.java
+++ b/ui/actionbarcompat/ActionBarCompat-ShareActionProvider/Application/src/main/java/com/example/android/actionbarcompat/shareactionprovider/MainActivity.java
@@ -83,6 +83,10 @@
// Now get the ShareActionProvider from the item
mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(shareItem);
+ // Get the ViewPager's current item position and set its ShareIntent.
+ int currentViewPagerItem = ((ViewPager) findViewById(R.id.viewpager)).getCurrentItem();
+ setShareIntent(currentViewPagerItem);
+
return super.onCreateOptionsMenu(menu);
}
// END_INCLUDE(get_sap)
@@ -151,6 +155,19 @@
}
};
+ private void setShareIntent(int position) {
+ // BEGIN_INCLUDE(update_sap)
+ if (mShareActionProvider != null) {
+ // Get the currently selected item, and retrieve it's share intent
+ ContentItem item = mItems.get(position);
+ Intent shareIntent = item.getShareIntent(MainActivity.this);
+
+ // Now update the ShareActionProvider with the new share intent
+ mShareActionProvider.setShareIntent(shareIntent);
+ }
+ // END_INCLUDE(update_sap)
+ }
+
/**
* A OnPageChangeListener used to update the ShareActionProvider's share intent when a new item
* is selected in the ViewPager.
@@ -165,16 +182,7 @@
@Override
public void onPageSelected(int position) {
- // BEGIN_INCLUDE(update_sap)
- if (mShareActionProvider != null) {
- // Get the currently selected item, and retrieve it's share intent
- ContentItem item = mItems.get(position);
- Intent shareIntent = item.getShareIntent(MainActivity.this);
-
- // Now update the ShareActionProvider with the new share intent
- mShareActionProvider.setShareIntent(shareIntent);
- }
- // END_INCLUDE(update_sap)
+ setShareIntent(position);
}
@Override
diff --git a/ui/activityscenetransition/ActivitySceneTransitionBasic/template-params.xml b/ui/activityscenetransition/ActivitySceneTransitionBasic/template-params.xml
index bf7da46..85e24b3 100644
--- a/ui/activityscenetransition/ActivitySceneTransitionBasic/template-params.xml
+++ b/ui/activityscenetransition/ActivitySceneTransitionBasic/template-params.xml
@@ -22,7 +22,7 @@
<group>UI</group>
<package>com.example.android.activityscenetransitionbasic</package>
- <minSdk>7</minSdk>
+ <minSdk>21</minSdk>
<compileSdkVersion>21</compileSdkVersion>
<dependency>com.squareup.picasso:picasso:2.4.0</dependency>
@@ -31,13 +31,18 @@
<intro>
<![CDATA[
Demonstrates how to the use Activity scene transitions when transitions
- from one Activity to another. Uses a combination of moveImage and changeBounds
- to nicely transition a grid of images to an Activity with a large image and detail
- text.
+ from one Activity to another. Uses a combination of changeImageTransform and
+ changeBounds to nicely transition a grid of images to an Activity with a large image
+ and detail text.
]]>
</intro>
</strings>
+ <attribution>
+ <copyright>Copyright 2013 Square, Inc.</copyright>
+ <license>APACHE2</license>
+ </attribution>
+
<template src="base"/>
<common src="logger"/>
diff --git a/ui/graphics/DisplayingBitmaps/screenshots/1-gridview.png b/ui/graphics/DisplayingBitmaps/screenshots/1-gridview.png
new file mode 100644
index 0000000..11f9ab7
--- /dev/null
+++ b/ui/graphics/DisplayingBitmaps/screenshots/1-gridview.png
Binary files differ
diff --git a/ui/graphics/DisplayingBitmaps/screenshots/2-detail.png b/ui/graphics/DisplayingBitmaps/screenshots/2-detail.png
new file mode 100644
index 0000000..32babd9
--- /dev/null
+++ b/ui/graphics/DisplayingBitmaps/screenshots/2-detail.png
Binary files differ
diff --git a/ui/graphics/DisplayingBitmaps/screenshots/icon-web.png b/ui/graphics/DisplayingBitmaps/screenshots/icon-web.png
new file mode 100644
index 0000000..7bad768
--- /dev/null
+++ b/ui/graphics/DisplayingBitmaps/screenshots/icon-web.png
Binary files differ
diff --git a/ui/graphics/DisplayingBitmaps/template-params.xml b/ui/graphics/DisplayingBitmaps/template-params.xml
index b849f97..5a25b22 100644
--- a/ui/graphics/DisplayingBitmaps/template-params.xml
+++ b/ui/graphics/DisplayingBitmaps/template-params.xml
@@ -39,4 +39,43 @@
<template src="base"/>
<common src="logger"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>UI, Background, Views</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>screenshots/icon-web.png</icon>
+ <screenshots>
+ <img>screenshots/1-gridview.png</img>
+ <img>screenshots/2-detail.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.widget.ImageView</android>
+ <android>android.widget.GridView</android>
+ <android>android.graphics.BitmapFactory</android>
+ <android>android.os.AsyncTask</android>
+ <android>android.util.LruCache</android>
+ <android>android.support.v4.view.ViewPager</android>
+ </api_refs>
+ <description>
+<![CDATA[
+Sample demonstrating how to load large bitmaps efficiently off the main UI thread,
+caching bitmaps (both in memory and on disk), managing bitmap memory and displaying
+bitmaps in UI elements such as ViewPager and ListView/GridView.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This is a sample application for the Android Training class [Displaying Bitmaps Efficiently][1].
+
+It demonstrates how to load large bitmaps efficiently off the main UI thread, caching
+bitmaps (both in memory and on disk), managing bitmap memory and displaying bitmaps
+in UI elements such as ViewPager and ListView/GridView.
+
+[1]: http://developer.android.com/training/displaying-bitmaps/
+]]>
+ </intro>
+ </metadata>
</sample>
diff --git a/ui/transition/BasicTransition/Application/src/main/big_icon.png b/ui/transition/BasicTransition/Application/src/main/big_icon.png
new file mode 100755
index 0000000..943b3d7
--- /dev/null
+++ b/ui/transition/BasicTransition/Application/src/main/big_icon.png
Binary files differ
diff --git a/ui/transition/BasicTransition/screenshots/main.png b/ui/transition/BasicTransition/screenshots/main.png
new file mode 100644
index 0000000..f15c7af
--- /dev/null
+++ b/ui/transition/BasicTransition/screenshots/main.png
Binary files differ
diff --git a/ui/transition/BasicTransition/template-params.xml b/ui/transition/BasicTransition/template-params.xml
index 2bacb7a..034aee8 100644
--- a/ui/transition/BasicTransition/template-params.xml
+++ b/ui/transition/BasicTransition/template-params.xml
@@ -37,4 +37,55 @@
<common src="activities"/>
<common src="view"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Transition, UI</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>Application/src/main/big_icon.png</icon>
+ <screenshots>
+ <img>screenshots/main.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.transition.TransitionManager</android>
+ <android>android.transition.Transition</android>
+ <android>android.transition.Scene</android>
+ </api_refs>
+
+ <description>
+A basic app showing how to use the Transition framework introduced in
+KitKat. The app shows radioboxes to select between different Scenes,
+and uses various ways to transition between them.
+ </description>
+
+ <intro>
+<![CDATA[
+
+A Scene is an encapsulation of the state of a view hierarchy,
+including the views in that hierarchy and the various values
+(layout-related and otherwise) that those views have. A scene can be
+defined by a layout hierarchy directly or by code which sets up the
+scene dynamically as it is entered.
+
+A Transition is a mechanism to automatically animate changes that
+occur when a new scene is entered. Some transition capabilities are
+automatic. That is, entering a scene may cause animations to run which
+fade out views that go away, changeBounds and resize existing views
+that change, and fade in views that become visible. There are
+additional transitions that can animate other attributes, such as
+color changes, and which can optionally be specified to take place
+during particular scene changes. Finally, developers can define their
+own Transition subclasses which monitor particular property changes
+and which run custom animations when those properties change values.
+
+TransitionManager is used to specify custom transitions for particular
+scene changes, and to cause scene changes with specific transitions to
+take place.
+
+]]>
+ </intro>
+ </metadata>
+
</sample>
diff --git a/ui/views/FloatingActionButton/FloatingActionButtonBasic/template-params.xml b/ui/views/FloatingActionButton/FloatingActionButtonBasic/template-params.xml
index e1205ab..66533b7 100644
--- a/ui/views/FloatingActionButton/FloatingActionButtonBasic/template-params.xml
+++ b/ui/views/FloatingActionButton/FloatingActionButtonBasic/template-params.xml
@@ -54,21 +54,28 @@
<android>android.widget.Checkable</android>
</api_refs>
<description>
- This sample shows the two sizes of Floating Action Buttons and
- how to interact with them.
+<![CDATA[
+This sample shows the two sizes of Floating Action Buttons and
+how to interact with them.
+]]>
</description>
<intro>
- This sample shows how to implement a [Checkable][1] Floating Action Button.
+<![CDATA[
+This sample shows how to implement a [Checkable][1] Floating Action Button.
- Two sizes of Floating Action Buttons are being displayed on screen and can
- change their states regarding on their state.
+Floating action buttons are used for a special type of promoted action.
+They are distinguished by a circled icon floating above the UI and have
+special motion behaviors related to morphing, launching, and the transferring anchor point.
- A log can be toggled within the [ActionBar][2] to display a log which keeps
- track of the button's states.
+Floating action buttons come in two sizes:
+the default, which should be used in most cases, and the mini,
+which should only be used to create visual continuity with other elements on the screen.
- [1]: https://developer.android.com/reference/android/widget/Checkable.html
- [2]: https://developer.android.com/reference/android/app/ActionBar.html
+Both sizes of Floating Action Buttons are displayed on screen.
+
+[1]: https://developer.android.com/reference/android/widget/Checkable.html
+]]>
</intro>
</metadata>
</sample>
diff --git a/ui/views/HorizontalPaging/template-params.xml b/ui/views/HorizontalPaging/template-params.xml
index 2bad93d..ba748cc 100644
--- a/ui/views/HorizontalPaging/template-params.xml
+++ b/ui/views/HorizontalPaging/template-params.xml
@@ -50,28 +50,28 @@
<android>android.support.v4.app.FragmentPagerAdapter</android>
</api_refs>
<description>
- This sample shows how to implement tabs, using Fragments and a ViewPager.
+This sample shows how to implement tabs, using Fragments and a ViewPager.
</description>
<intro>
- This sample implements tabs using the deprecated [ActionBar.TabListener][1]. It uses [ViewPager][2] and
- [FragmentPagerAdapter][3] to handle swiping between tabs and displaying the selected tab content.
+This sample implements tabs using the deprecated [ActionBar.TabListener][1]. It uses [ViewPager][2] and
+[FragmentPagerAdapter][3] to handle swiping between tabs and displaying the selected tab content.
- 1. Create an Activity that extends [FragmentActivity][4], with a [ViewPager][2] for its layout.
- 2. Implement [ActionBar.TabListener][1] interface.
- 3. Create a class that extends [FragmentPagerAdapter][3] and override its `getItem(int position)`,
- `getCount()` and `getPageTitle(int position)` methods.
- 4. In the `onCreate(Bundle savedInstanceState)` method of your activity, set navigation mode to tabs for the
- ActionBar using `setNavigationMode(ActionBar.NAVIGATION_MODE_TABS)`. Note: This is DEPRECATED as of Android
- Lollipop.
- 5. Set your custom [FragmentPagerAdapter][3] on your [ViewPager][2].
- 6. Implement `setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener())` on your [ViewPager][2] to
- know the selected tab, so you can update your ActionBar with `setSelectedNavigationItem(position)`.
+1. Create an Activity that extends [FragmentActivity][4], with a [ViewPager][2] for its layout.
+2. Implement [ActionBar.TabListener][1] interface.
+3. Create a class that extends [FragmentPagerAdapter][3] and override its `getItem(int position)`,
+`getCount()` and `getPageTitle(int position)` methods.
+4. In the `onCreate(Bundle savedInstanceState)` method of your activity, set navigation mode to tabs for the
+ActionBar using `setNavigationMode(ActionBar.NAVIGATION_MODE_TABS)`. Note: This is DEPRECATED as of Android
+Lollipop.
+5. Set your custom [FragmentPagerAdapter][3] on your [ViewPager][2].
+6. Implement `setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener())` on your [ViewPager][2] to
+know the selected tab, so you can update your ActionBar with `setSelectedNavigationItem(position)`.
- [1]: http://developer.android.com/reference/android/support/v7/app/ActionBar.TabListener.html
- [2]: http://developer.android.com/reference/android/support/v4/view/ViewPager.html
- [3]: http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html
- [4]: http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html
+[1]: http://developer.android.com/reference/android/support/v7/app/ActionBar.TabListener.html
+[2]: http://developer.android.com/reference/android/support/v4/view/ViewPager.html
+[3]: http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html
+[4]: http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html
</intro>
</metadata>
diff --git a/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/CustomAdapter.java b/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/CustomAdapter.java
index f8e3bae..40f9375 100644
--- a/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/CustomAdapter.java
+++ b/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/CustomAdapter.java
@@ -34,21 +34,29 @@
// BEGIN_INCLUDE(recyclerViewSampleViewHolder)
/**
- * Provide a reference to the type of views that you are using (custom viewholder)
+ * Provide a reference to the type of views that you are using (custom ViewHolder)
*/
public static class ViewHolder extends RecyclerView.ViewHolder {
- private final TextView mTextView;
+ private final TextView textView;
public ViewHolder(View v) {
super(v);
- mTextView = (TextView) v.findViewById(R.id.textView);
+ // Define click listener for the ViewHolder's View.
+ v.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Log.d(TAG, "Element " + getPosition() + " clicked.");
+ }
+ });
+ textView = (TextView) v.findViewById(R.id.textView);
}
- public TextView getmTextView() {
- return mTextView;
+ public TextView getTextView() {
+ return textView;
}
}
// END_INCLUDE(recyclerViewSampleViewHolder)
+
/**
* Initialize the dataset of the Adapter.
*
@@ -61,25 +69,24 @@
// BEGIN_INCLUDE(recyclerViewOnCreateViewHolder)
// Create new views (invoked by the layout manager)
@Override
- public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) {
+ public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
// Create a new view.
View v = LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.text_row_item, viewGroup, false);
- ViewHolder vh = new ViewHolder(v);
- return vh;
+ return new ViewHolder(v);
}
// END_INCLUDE(recyclerViewOnCreateViewHolder)
// BEGIN_INCLUDE(recyclerViewOnBindViewHolder)
// Replace the contents of a view (invoked by the layout manager)
@Override
- public void onBindViewHolder(ViewHolder viewHolder, int position) {
+ public void onBindViewHolder(ViewHolder viewHolder, final int position) {
Log.d(TAG, "Element " + position + " set.");
// Get element from your dataset at this position and replace the contents of the view
// with that element
- viewHolder.getmTextView().setText(mDataSet[position]);
+ viewHolder.getTextView().setText(mDataSet[position]);
}
// END_INCLUDE(recyclerViewOnBindViewHolder)
diff --git a/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/RecyclerViewFragment.java b/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/RecyclerViewFragment.java
index 4f4a596..019657f 100644
--- a/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/RecyclerViewFragment.java
+++ b/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/RecyclerViewFragment.java
@@ -18,21 +18,37 @@
import android.os.Bundle;
import android.support.v4.app.Fragment;
+import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.RadioButton;
/**
- * Demonstrates the use of RecyclerView with a LinearLayoutManager.
+ * Demonstrates the use of {@link RecyclerView} with a {@link LinearLayoutManager} and a
+ * {@link GridLayoutManager}.
*/
public class RecyclerViewFragment extends Fragment {
private static final String TAG = "RecyclerViewFragment";
+ private static final String KEY_LAYOUT_MANAGER = "layoutManager";
+ private static final int SPAN_COUNT = 2;
+ private static final int DATASET_COUNT = 60;
+
+ private enum LayoutManagerType {
+ GRID_LAYOUT_MANAGER,
+ LINEAR_LAYOUT_MANAGER
+ }
+
+ protected LayoutManagerType mCurrentLayoutManagerType;
+
+ protected RadioButton mLinearLayoutRadioButton;
+ protected RadioButton mGridLayoutRadioButton;
protected RecyclerView mRecyclerView;
- protected RecyclerView.Adapter mAdapter;
+ protected CustomAdapter mAdapter;
protected RecyclerView.LayoutManager mLayoutManager;
protected String[] mDataset;
@@ -58,23 +74,86 @@
// to the way ListView would layout elements. The RecyclerView.LayoutManager defines how
// elements are laid out.
mLayoutManager = new LinearLayoutManager(getActivity());
- mRecyclerView.setLayoutManager(mLayoutManager);
+
+ mCurrentLayoutManagerType = LayoutManagerType.LINEAR_LAYOUT_MANAGER;
+
+ if (savedInstanceState != null) {
+ // Restore saved layout manager type.
+ mCurrentLayoutManagerType = (LayoutManagerType) savedInstanceState
+ .getSerializable(LAYOUT_MANAGER_KEY);
+ }
+ setRecyclerViewLayoutManager(mCurrentLayoutManagerType);
mAdapter = new CustomAdapter(mDataset);
// Set CustomAdapter as the adapter for RecyclerView.
mRecyclerView.setAdapter(mAdapter);
// END_INCLUDE(initializeRecyclerView)
+ mLinearLayoutRadioButton = (RadioButton) rootView.findViewById(R.id.linear_layout_rb);
+ mLinearLayoutRadioButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ setRecyclerViewLayoutManager(LayoutManagerType.LINEAR_LAYOUT_MANAGER);
+ }
+ });
+
+ mGridLayoutRadioButton = (RadioButton) rootView.findViewById(R.id.grid_layout_rb);
+ mGridLayoutRadioButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ setRecyclerViewLayoutManager(LayoutManagerType.GRID_LAYOUT_MANAGER);
+ }
+ });
+
return rootView;
}
/**
+ * Set RecyclerView's LayoutManager to the one given.
+ *
+ * @param layoutManagerType Type of layout manager to switch to.
+ */
+ public void setRecyclerViewLayoutManager(LayoutManagerType layoutManagerType) {
+ int scrollPosition = 0;
+
+ // If a layout manager has already been set, get current scroll position.
+ if (mRecyclerView.getLayoutManager() != null) {
+ scrollPosition = ((LinearLayoutManager) mRecyclerView.getLayoutManager())
+ .findFirstCompletelyVisibleItemPosition();
+ }
+
+ switch (layoutManagerType) {
+ case GRID_LAYOUT_MANAGER:
+ mLayoutManager = new GridLayoutManager(getActivity(), SPAN_COUNT);
+ mCurrentLayoutManagerType = LayoutManagerType.GRID_LAYOUT_MANAGER;
+ break;
+ case LINEAR_LAYOUT_MANAGER:
+ mLayoutManager = new LinearLayoutManager(getActivity());
+ mCurrentLayoutManagerType = LayoutManagerType.LINEAR_LAYOUT_MANAGER;
+ break;
+ default:
+ mLayoutManager = new LinearLayoutManager(getActivity());
+ mCurrentLayoutManagerType = LayoutManagerType.LINEAR_LAYOUT_MANAGER;
+ }
+
+ mRecyclerView.setLayoutManager(mLayoutManager);
+ mRecyclerView.scrollToPosition(scrollPosition);
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle savedInstanceState) {
+ // Save currently selected layout manager.
+ savedInstanceState.putSerializable(LAYOUT_MANAGER_KEY, mCurrentLayoutManagerType);
+ super.onSaveInstanceState(savedInstanceState);
+ }
+
+ /**
* Generates Strings for RecyclerView's adapter. This data would usually come
* from a local content provider or remote server.
*/
private void initDataset() {
- mDataset = new String[60];
- for (int i=0; i < 60; i++) {
+ mDataset = new String[DATASET_COUNT];
+ for (int i = 0; i < DATASET_COUNT; i++) {
mDataset[i] = "This is element #" + i;
}
}
diff --git a/ui/views/RecyclerView/Application/src/main/res/layout/recycler_view_frag.xml b/ui/views/RecyclerView/Application/src/main/res/layout/recycler_view_frag.xml
index 6682468..dda99ce 100644
--- a/ui/views/RecyclerView/Application/src/main/res/layout/recycler_view_frag.xml
+++ b/ui/views/RecyclerView/Application/src/main/res/layout/recycler_view_frag.xml
@@ -15,14 +15,28 @@
limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
+ <RadioGroup
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:orientation="horizontal"
+ android:checkedButton="@+id/linear_layout_rb">
+ <RadioButton android:id="@+id/linear_layout_rb"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/linear_layout_manager"/>
+ <RadioButton android:id="@+id/grid_layout_rb"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/grid_layout_manager"/>
+ </RadioGroup>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
- android:layout_height="match_parent" />
-
-</FrameLayout>
+ android:layout_height="match_parent"/>
+</LinearLayout>
diff --git a/ui/views/RecyclerView/Application/src/main/res/layout/text_row_item.xml b/ui/views/RecyclerView/Application/src/main/res/layout/text_row_item.xml
index d552e0e..9b94684 100644
--- a/ui/views/RecyclerView/Application/src/main/res/layout/text_row_item.xml
+++ b/ui/views/RecyclerView/Application/src/main/res/layout/text_row_item.xml
@@ -15,17 +15,16 @@
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_margin="@dimen/margin_small"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/list_item_height"
+ android:layout_marginLeft="@dimen/margin_medium"
+ android:layout_marginRight="@dimen/margin_medium"
+ android:gravity="center_vertical">
<TextView
+ android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/element_text"
- android:id="@+id/textView"
- android:layout_gravity="center_horizontal"/>
-</LinearLayout>
\ No newline at end of file
+ android:text="@string/element_text"/>
+</FrameLayout>
\ No newline at end of file
diff --git a/ui/views/RecyclerView/Application/src/main/res/values/dimens.xml b/ui/views/RecyclerView/Application/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..5af7e9e
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/values/dimens.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2014 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.
+-->
+
+<resources>
+ <dimen name="list_item_height">72dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/ui/views/RecyclerView/Application/src/main/res/values/strings.xml b/ui/views/RecyclerView/Application/src/main/res/values/strings.xml
index 179529c..642e022 100644
--- a/ui/views/RecyclerView/Application/src/main/res/values/strings.xml
+++ b/ui/views/RecyclerView/Application/src/main/res/values/strings.xml
@@ -17,4 +17,6 @@
<resources>
<string name="element_text">Element</string>
+ <string name="grid_layout_manager">Grid Layout Manager</string>
+ <string name="linear_layout_manager">Linear Layout Manager</string>
</resources>
\ No newline at end of file
diff --git a/ui/views/RecyclerView/template-params.xml b/ui/views/RecyclerView/template-params.xml
index 76fbd83..6e616d2 100644
--- a/ui/views/RecyclerView/template-params.xml
+++ b/ui/views/RecyclerView/template-params.xml
@@ -31,11 +31,24 @@
<strings>
<intro>
<![CDATA[
- Demonstration of using RecyclerView with a LayoutManager to create a vertical ListView.
+ Demonstration of using RecyclerView with a LinearLayoutManager and GridLayoutManager
+ to create a vertical list. Tap \"SHOW LOG\" to view elements as they are bound to
+ their ViewHolder. The log also displays elements that you tap.
]]>
</intro>
</strings>
+ <colors>
+ <color>
+ <name>colorPrimary</name>
+ <hexval>#00BCD4</hexval>
+ </color>
+ <color>
+ <name>colorPrimaryDark</name>
+ <hexval>#00838F</hexval>
+ </color>
+ </colors>
+
<template src="base"/>
<template src="FragmentView"/>
<common src="logger"/>
diff --git a/wearable/wear/DataLayer/template-params.xml b/wearable/wear/DataLayer/template-params.xml
index 737e8c6..6c68e1d 100644
--- a/wearable/wear/DataLayer/template-params.xml
+++ b/wearable/wear/DataLayer/template-params.xml
@@ -14,31 +14,64 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>DataLayer</name>
<group>Wearable</group>
<package>com.example.android.wearable.datalayer</package>
-
-
-
<!-- change minSdk if needed-->
<minSdk>18</minSdk>
-
-
<strings>
<intro>
<![CDATA[
- You can cause the wearable to start an activity by pressing a button in the
- companion app UI. You can also take a picture on the companion device, which will be transmitted as
- an Asset for display on the wearable.
+ Sample demonstrating the usage of the GoogleApiClient in order to send data
+ from a handheld device to a wearable. The data transmitted is a picture taken by
+ the user of the sample.
]]>
</intro>
</strings>
-
<template src="base"/>
<template src="Wear"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>UI, Wearable</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>ADVANCED</level>
+ <icon>Application/src/main/res/drawable-xxhdpi/ic_launcher.png</icon>
+ <screenshots>
+ <img>screenshots/phone_image.png</img>
+ <img>screenshots/wearable_background_image.png</img>
+ </screenshots>
+ <api_refs>
+ <ext>com.google.android.gms.wearable.DataApi</ext>
+ <ext>com.google.android.gms.wearable.DataEvent</ext>
+ <ext>com.google.android.gms.wearable.WearableListenerService</ext>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample demonstrates how to work with a WearableListenerService,
+to produce and consume DataEvents and effectively work with the DataLayer.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This sample demonstrates how to make a handheld and an Android Wear device communicate
+using the [DataApi][2].
+It does this by sending a picture between connected devices.
+An Activity is being used for both the connected devices which implement their parts of
+the required interfaces.
+
+It showcases how to use an [WearableListenerService][1] to consume DataEvents
+as well as implementations for various required listeners when using the [DataApi][2],
+[MessageApi][3] and [NodeApi][4].
+
+[1]: https://developer.android.com/reference/com/google/android/gms/wearable/WearableListenerService.html
+[2]: https://developer.android.com/reference/com/google/android/gms/wearable/DataApi.html
+[3]: https://developer.android.com/reference/com/google/android/gms/wearable/MessageApi.html
+[4]: https://developer.android.com/reference/com/google/android/gms/wearable/NodeApi.html
+]]>
+ </intro>
+ </metadata>
</sample>
diff --git a/wearable/wear/Notifications/screenshots/ic_launcher.png b/wearable/wear/Notifications/screenshots/ic_launcher.png
new file mode 100644
index 0000000..163f1f0
--- /dev/null
+++ b/wearable/wear/Notifications/screenshots/ic_launcher.png
Binary files differ
diff --git a/wearable/wear/Notifications/template-params.xml b/wearable/wear/Notifications/template-params.xml
index e3a5521..939c45e 100644
--- a/wearable/wear/Notifications/template-params.xml
+++ b/wearable/wear/Notifications/template-params.xml
@@ -48,6 +48,7 @@
<languages>Java</languages>
<solutions>Mobile</solutions>
<level>INTERMEDIATE</level>
+ <icon>screenshots/ic_launcher.png</icon>
<screenshots>
<img>screenshots/companion-content-action.png</img>
<img>screenshots/content-action</img>
@@ -61,21 +62,21 @@
<android>android.support.wearable.view.WearableListView</android>
</api_refs>
<description>
- This sample showcases the available notification styles on a device and wearable.
+This sample showcases the available notification styles on a device and wearable.
</description>
<intro>
- This sample app enables the user to choose a notification type (the selection is done on the phone),
- which it then displays on the phone and wearable. The notification is built using
- [NotificationCompat.Builder][1] and [NotificationCompat.WearableExtender][2].
+This sample app enables the user to choose a notification type (the selection is done on the phone),
+which it then displays on the phone and wearable. The notification is built using
+[NotificationCompat.Builder][1] and [NotificationCompat.WearableExtender][2].
- See [Creating a Notification][3] for all the details on how to create a notification with wearable features.
+See [Creating a Notification][3] for all the details on how to create a notification with wearable features.
- On the wearable side, the sample also shows how to create a custom layout using [WearableListView][4].
+On the wearable side, the sample also shows how to create a custom layout using [WearableListView][4].
- [1]: http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
- [2]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.WearableExtender.html
- [3]: https://developer.android.com/training/wearables/notifications/creating.html
- [4]: https://developer.android.com/training/wearables/apps/layouts.html#UiLibrary
+[1]: http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
+[2]: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.WearableExtender.html
+[3]: https://developer.android.com/training/wearables/notifications/creating.html
+[4]: https://developer.android.com/training/wearables/apps/layouts.html#UiLibrary
</intro>
</metadata>
</sample>
diff --git a/wearable/wear/SkeletonWearableApp/template-params.xml b/wearable/wear/SkeletonWearableApp/template-params.xml
index 2073e56..ea98d4a 100644
--- a/wearable/wear/SkeletonWearableApp/template-params.xml
+++ b/wearable/wear/SkeletonWearableApp/template-params.xml
@@ -14,20 +14,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>SkeletonWearableApp</name>
<group>Wearable</group>
<package>com.example.android.google.wearable.app</package>
-
-
-
<!-- change minSdk if needed-->
<minSdk>18</minSdk>
-
-
<strings>
<intro>
<![CDATA[
@@ -38,8 +30,44 @@
]]>
</intro>
</strings>
-
<template src="base"/>
<template src="Wear"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Getting Started, Wearable</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>BEGINNER</level>
+ <icon>Wearable/src/main/res/drawable-xhdpi/ic_launcher.png</icon>
+ <screenshots>
+ <img>screenshots/skeleton_wearable_app.png</img>
+ <img>screenshots/grid_view_pager.png</img>
+ <img>screenshots/dismiss_overlay.png</img>
+ <img>screenshots/delayed_confirmation.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.support.wearable.view.CardFragment</android>
+ <android>android.support.wearable.view.GridViewPager</android>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample is a basic skeleton app which can be used as a starting point for wear development.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+This sample is a mostly empty wearable app that implements a fullscreen activity
+conforming to Android Wear best practices. Included in the sample are examples of [GridViewPager][1],
+[DelayedConfirmationView][2], and [DismissOverlayView][3].
+Developers who require a fullscreen activity for
+their wearable app can use this sample as a starting point.
+
+[1]: https://developer.android.com/reference/com/google/android/support/wearable/view/GridViewPager.html
+[2]: https://developer.android.com/reference/com/google/android/support/wearable/view/DelayedConfirmationView.html
+[3]: https://developer.android.com/reference/com/google/android/support/wearable/view/DismissOverlayView.html
+]]>
+ </intro>
+ </metadata>
</sample>
diff --git a/wearable/wear/WatchViewStub/template-params.xml b/wearable/wear/WatchViewStub/template-params.xml
index a101cac..0688686 100644
--- a/wearable/wear/WatchViewStub/template-params.xml
+++ b/wearable/wear/WatchViewStub/template-params.xml
@@ -14,20 +14,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>WatchViewStub</name>
<group>Wearable</group>
<package>com.example.android.google.wearable.watchviewstub</package>
-
-
-
<!-- change minSdk if needed-->
<minSdk>18</minSdk>
-
-
<strings>
<intro>
<![CDATA[
@@ -35,8 +27,37 @@
]]>
</intro>
</strings>
-
<template src="base"/>
<template src="Wear"/>
+ <metadata>
+ <status>PUBLISHED</status>
+ <categories>Wearable</categories>
+ <technologies>Android</technologies>
+ <languages>Java</languages>
+ <solutions>Mobile</solutions>
+ <level>INTERMEDIATE</level>
+ <icon>Wearable/src/main/res/drawable-xxhdpi/ic_launcher.png</icon>
+ <screenshots>
+ <img>screenshots/watch_view_stub_rectangular.png</img>
+ <img>screenshots/watch_view_stub_round.png</img>
+ </screenshots>
+ <api_refs>
+ <android>android.support.wearable.view.WatchViewStub</android>
+ <android>android.support.wearable.view.WatchViewStub.OnLayoutInflatedListener</android>
+ </api_refs>
+ <description>
+<![CDATA[
+This sample demonstrates how to specify different layouts for round and rectangular screens.
+]]>
+ </description>
+ <intro>
+<![CDATA[
+It is a basic sample that displays a round layout on a round watch and a rectangular one on a
+rectangular watch.
+The corresponding layout is being inflated by the system. This sample shows a way to handle
+this programatically by using a `WatchViewStub.OnLayoutInflateListener`.
+]]>
+ </intro>
+ </metadata>
</sample>