merge in lmp-release history after reset to c9fa8401b6fafd30ff2cf712cd08405431f119da
diff --git a/admin/BasicManagedProfile/Application/src/main/res/values/styles.xml b/admin/BasicManagedProfile/Application/src/main/res/values/styles.xml
new file mode 100644
index 0000000..fbf538d
--- /dev/null
+++ b/admin/BasicManagedProfile/Application/src/main/res/values/styles.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>
+ <style name="MaterialTheme" parent="android:Theme.Material.Light.DarkActionBar">
+ </style>
+</resources>
diff --git a/admin/BasicManagedProfile/README.md b/admin/BasicManagedProfile/README.md
new file mode 100644
index 0000000..c1e4fde
--- /dev/null
+++ b/admin/BasicManagedProfile/README.md
@@ -0,0 +1,52 @@
+Android BasicManagedProfile Sample
+==============================
+
+This sample demonstrates how to create a managed profile. You can also learn how to enable or
+disable other apps and how to set restrictions to them. Intents can be configured to be forwarded
+between primary account and managed profile. Finally, you can wipe all the data associated with the
+profile. Note that there can only be one managed profile on a device.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-BasicManagedProfile
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/admin/BasicManagedProfile/packaging.yaml b/admin/BasicManagedProfile/packaging.yaml
new file mode 100644
index 0000000..81ec492
--- /dev/null
+++ b/admin/BasicManagedProfile/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [Admin]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-BasicManagedProfile
+level: BEGINNER
+icon: BasicManagedProfileSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/admin/BasicManagedProfile/settings.gradle b/admin/BasicManagedProfile/settings.gradle
index 68c02fb..9464a35 100644
--- a/admin/BasicManagedProfile/settings.gradle
+++ b/admin/BasicManagedProfile/settings.gradle
@@ -1,4 +1 @@
-
-
-
include 'Application'
diff --git a/background/JobScheduler/CONTRIB.md b/background/JobScheduler/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/background/JobScheduler/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/background/JobScheduler/LICENSE b/background/JobScheduler/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/background/JobScheduler/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/background/JobScheduler/README.md b/background/JobScheduler/README.md
new file mode 100644
index 0000000..6b285a9
--- /dev/null
+++ b/background/JobScheduler/README.md
@@ -0,0 +1,50 @@
+Android JobScheduler Sample
+==============================
+
+Demonstration of the JobScheduler API, which provides an interface for scheduling
+background tasks when certain tasks apply.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-JobScheduler
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/background/JobScheduler/packaging.yaml b/background/JobScheduler/packaging.yaml
new file mode 100644
index 0000000..f2ea281
--- /dev/null
+++ b/background/JobScheduler/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [Background]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-JobScheduler
+level: BEGINNER
+icon: JobSchedulerSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/background/JobScheduler/settings.gradle b/background/JobScheduler/settings.gradle
index 77a2714..9464a35 100644
--- a/background/JobScheduler/settings.gradle
+++ b/background/JobScheduler/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'JobSchedulerSample'
+include 'Application'
diff --git a/build.gradle b/build.gradle
index dfc8cc7..34fd249 100644
--- a/build.gradle
+++ b/build.gradle
@@ -59,7 +59,12 @@
"ui/views/FloatingActionButton/FloatingActionButtonBasic",
"ui/views/RevealEffect/RevealEffectBasic",
"background/JobScheduler",
-"wearable/wear/SynchronizedNotifications"
+"wearable/wear/SynchronizedNotifications",
+"ui/views/RecyclerView",
+"ui/views/CardView",
+"ui/notifications/LNotifications",
+"ui/DrawableTinting",
+"ui/Interpolator",
]
List<String> taskNames = [
diff --git a/media/Camera2Basic/README.md b/media/Camera2Basic/README.md
new file mode 100644
index 0000000..73b9eac
--- /dev/null
+++ b/media/Camera2Basic/README.md
@@ -0,0 +1,50 @@
+Android Camera2Basic Sample
+==============================
+
+This sample demonstrates the basic use of Camera2 API. Check the source code to see how you can
+display camera preview and take pictures.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-Camera2Basic
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/media/Camera2Basic/packaging.yaml b/media/Camera2Basic/packaging.yaml
new file mode 100644
index 0000000..d0327da
--- /dev/null
+++ b/media/Camera2Basic/packaging.yaml
@@ -0,0 +1,15 @@
+# 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-Camera2Basic
+level: BEGINNER
+icon: Camera2BasicSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/media/Camera2Basic/settings.gradle b/media/Camera2Basic/settings.gradle
index 68c02fb..9464a35 100644
--- a/media/Camera2Basic/settings.gradle
+++ b/media/Camera2Basic/settings.gradle
@@ -1,4 +1 @@
-
-
-
include 'Application'
diff --git a/media/Camera2Video/CONTRIB.md b/media/Camera2Video/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/media/Camera2Video/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/media/Camera2Video/LICENSE b/media/Camera2Video/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/media/Camera2Video/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/media/Camera2Video/README.md b/media/Camera2Video/README.md
new file mode 100644
index 0000000..543d7cd
--- /dev/null
+++ b/media/Camera2Video/README.md
@@ -0,0 +1,49 @@
+Android Camera2Video Sample
+==============================
+
+This sample demonstrates how to record video using Camera2 API.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-Camera2Video
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/media/Camera2Video/packaging.yaml b/media/Camera2Video/packaging.yaml
new file mode 100644
index 0000000..26270dc
--- /dev/null
+++ b/media/Camera2Video/packaging.yaml
@@ -0,0 +1,15 @@
+# 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-Camera2Video
+level: BEGINNER
+icon: Camera2VideoSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/media/Camera2Video/settings.gradle b/media/Camera2Video/settings.gradle
index 68c02fb..9464a35 100644
--- a/media/Camera2Video/settings.gradle
+++ b/media/Camera2Video/settings.gradle
@@ -1,4 +1 @@
-
-
-
include 'Application'
diff --git a/ui/DrawableTinting/Application/.gitignore b/ui/DrawableTinting/Application/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/DrawableTinting/Application/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/views/Elevation/ElevationDrag/Application/README-fragmentview.txt b/ui/DrawableTinting/Application/README-fragmentview.txt
similarity index 100%
rename from ui/views/Elevation/ElevationDrag/Application/README-fragmentview.txt
rename to ui/DrawableTinting/Application/README-fragmentview.txt
diff --git a/background/alarms/RepeatingAlarm/Application/build.gradle b/ui/DrawableTinting/Application/build.gradle
similarity index 93%
rename from background/alarms/RepeatingAlarm/Application/build.gradle
rename to ui/DrawableTinting/Application/build.gradle
index 4c19e8b..5fa47b7 100644
--- a/background/alarms/RepeatingAlarm/Application/build.gradle
+++ b/ui/DrawableTinting/Application/build.gradle
@@ -1,6 +1,3 @@
-
-
-
buildscript {
repositories {
mavenCentral()
@@ -41,8 +38,6 @@
res.srcDirs "src/${dir}/res"
}
}
- androidTest.setRoot('tests')
- androidTest.java.srcDirs = ['tests/src']
}
diff --git a/ui/DrawableTinting/Application/src/main/AndroidManifest.xml b/ui/DrawableTinting/Application/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..eb737b6
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/AndroidManifest.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.drawabletinting"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="android-L" android:targetSdkVersion="android-L" />
+
+ <application android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/AppTheme">
+
+ <activity android:name=".MainActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+
+</manifest>
diff --git a/ui/DrawableTinting/Application/src/main/java/com/example/android/drawabletinting/DrawableTintingFragment.java b/ui/DrawableTinting/Application/src/main/java/com/example/android/drawabletinting/DrawableTintingFragment.java
new file mode 100644
index 0000000..cd46fb9
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/java/com/example/android/drawabletinting/DrawableTintingFragment.java
@@ -0,0 +1,316 @@
+/*
+* 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.
+*/
+
+package com.example.android.drawabletinting;
+
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.SeekBar;
+import android.widget.Spinner;
+import android.widget.SpinnerAdapter;
+import android.widget.TextView;
+
+import com.example.android.common.logger.Log;
+
+/**
+ * Sample that shows tinting of Drawables programmatically and of Drawable resources in XML.
+ * Tinting is set on a nine-patch drawable through the "tint" and "tintMode" parameters.
+ * A color state list is referenced as the tint color, which defines colors for different
+ * states of a View (for example disabled/enabled, focused, pressed or selected).
+ * Programmatically, tinting is applied to a Drawable through its "setColorFilter" method, with
+ * a reference to a color and a PorterDuff blend mode. The color and blend mode can be
+ * changed from the UI.
+ *
+ * @see android.graphics.drawable.Drawable#setColorFilter(int, android.graphics.PorterDuff.Mode)
+ * @see android.graphics.drawable.Drawable#setTint(android.content.res.ColorStateList, android.graphics.PorterDuff.Mode)
+ */
+public class DrawableTintingFragment extends Fragment {
+
+ /**
+ * String that identifies logging output from this Fragment.
+ */
+ private static final String TAG = "DrawableTintingFragment";
+
+ /**
+ * Image that tinting is applied to programmatically.
+ */
+ private ImageView mImage;
+
+ /**
+ * Seekbar for alpha component of tinting color.
+ */
+ private SeekBar mAlphaBar;
+ /**
+ * Seekbar for red component of tinting color.
+ */
+ private SeekBar mRedBar;
+ /**
+ * Seekbar for green bar of tinting color.
+ */
+ private SeekBar mGreenBar;
+ /**
+ * Seekbar for blue bar of tinting color.
+ */
+ private SeekBar mBlueBar;
+
+ /**
+ * Text label for alpha component seekbar.
+ */
+ private TextView mAlphaText;
+ /**
+ * Text label for red component seekbar.
+ */
+ private TextView mRedText;
+ /**
+ * Text label for green component seekbar.
+ */
+ private TextView mGreenText;
+ /**
+ * Text label for blue component seekbar.
+ */
+ private TextView mBlueText;
+
+ /**
+ * Selector for blend type for color tinting.
+ */
+ private Spinner mBlendSpinner;
+
+ /**
+ * Computed color for tinting of drawable.
+ */
+ private int mHintColor;
+
+ /**
+ * Selected color tinting mode.
+ */
+ private PorterDuff.Mode mMode;
+
+ /**
+ * Identifier for state of blend mod spinner in state bundle.
+ */
+ private static final String STATE_BLEND = "DRAWABLETINTING_BLEND";
+ /**
+ * Identifier for state of alpha seek bar in state bundle.
+ */
+ private static final String STATE_ALPHA = "DRAWABLETINTING_ALPHA";
+ /**
+ * Identifier for state of red seek bar in state bundle.
+ */
+ private static final String STATE_RED = "DRAWABLETINTING_RED";
+ /**
+ * Identifier for state of green seek bar in state bundle.
+ */
+ private static final String STATE_GREEN = "DRAWABLETINTING_GREEN";
+ /**
+ * Identifier for state of blue seek bar in state bundle.
+ */
+ private static final String STATE_BLUE = "DRAWABLETINTING_BLUE";
+
+ /**
+ * Available tinting modes. Note that this array must be kept in sync with the
+ * <code>blend_modes</code> string array that provides labels for these modes.
+ */
+ private static final PorterDuff.Mode[] MODES = new PorterDuff.Mode[]{
+ PorterDuff.Mode.ADD,
+ PorterDuff.Mode.CLEAR,
+ PorterDuff.Mode.DARKEN,
+ PorterDuff.Mode.DST,
+ PorterDuff.Mode.DST_ATOP,
+ PorterDuff.Mode.DST_IN,
+ PorterDuff.Mode.DST_OUT,
+ PorterDuff.Mode.DST_OVER,
+ PorterDuff.Mode.LIGHTEN,
+ PorterDuff.Mode.MULTIPLY,
+ PorterDuff.Mode.OVERLAY,
+ PorterDuff.Mode.SCREEN,
+ PorterDuff.Mode.SRC,
+ PorterDuff.Mode.SRC_ATOP,
+ PorterDuff.Mode.SRC_IN,
+ PorterDuff.Mode.SRC_OUT,
+ PorterDuff.Mode.SRC_OVER,
+ PorterDuff.Mode.XOR
+ };
+
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View v = inflater.inflate(R.layout.tinting_fragment, null);
+
+ // Set a drawable as the image to display
+ mImage = (ImageView) v.findViewById(R.id.image);
+ mImage.setImageResource(R.drawable.btn_default_normal_holo);
+
+ // Get text labels and seekbars for the four color components: ARGB
+ mAlphaBar = (SeekBar) v.findViewById(R.id.alphaSeek);
+ mAlphaText = (TextView) v.findViewById(R.id.alphaText);
+ mGreenBar = (SeekBar) v.findViewById(R.id.greenSeek);
+ mGreenText = (TextView) v.findViewById(R.id.greenText);
+ mRedBar = (SeekBar) v.findViewById(R.id.redSeek);
+ mRedText = (TextView) v.findViewById(R.id.redText);
+ mBlueText = (TextView) v.findViewById(R.id.blueText);
+ mBlueBar = (SeekBar) v.findViewById(R.id.blueSeek);
+
+ // Set a listener to update tinted image when selections have changed
+ mAlphaBar.setOnSeekBarChangeListener(mSeekBarListener);
+ mRedBar.setOnSeekBarChangeListener(mSeekBarListener);
+ mGreenBar.setOnSeekBarChangeListener(mSeekBarListener);
+ mBlueBar.setOnSeekBarChangeListener(mSeekBarListener);
+
+
+ // Set up the spinner for blend mode selection from a string array resource
+ mBlendSpinner = (Spinner) v.findViewById(R.id.blendSpinner);
+ SpinnerAdapter sa = ArrayAdapter.createFromResource(getActivity(),
+ R.array.blend_modes, android.R.layout.simple_spinner_dropdown_item);
+ mBlendSpinner.setAdapter(sa);
+ // Set a listener to update the tinted image when a blend mode is selected
+ mBlendSpinner.setOnItemSelectedListener(mBlendListener);
+ // Select the first item
+ mBlendSpinner.setSelection(0);
+ mMode = MODES[0];
+
+ if (savedInstanceState != null) {
+ // Restore the previous state if this fragment has been restored
+ mBlendSpinner.setSelection(savedInstanceState.getInt(STATE_BLEND));
+ mAlphaBar.setProgress(savedInstanceState.getInt(STATE_ALPHA));
+ mRedBar.setProgress(savedInstanceState.getInt(STATE_RED));
+ mGreenBar.setProgress(savedInstanceState.getInt(STATE_GREEN));
+ mBlueBar.setProgress(savedInstanceState.getInt(STATE_BLUE));
+ }
+
+ // Apply the default blend mode and color
+ updateTint(getColor(), getTintMode());
+
+ return v;
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ Log.d(TAG, "state saved.");
+ outState.putInt(STATE_BLEND, mBlendSpinner.getSelectedItemPosition());
+ outState.putInt(STATE_ALPHA, mAlphaBar.getProgress());
+ outState.putInt(STATE_RED, mRedBar.getProgress());
+ outState.putInt(STATE_GREEN, mGreenBar.getProgress());
+ outState.putInt(STATE_BLUE, mBlueBar.getProgress());
+ }
+
+ /**
+ * Computes the {@link Color} value from selection on ARGB sliders.
+ *
+ * @return color computed from selected ARGB values
+ */
+ public int getColor() {
+ final int alpha = mAlphaBar.getProgress();
+ final int red = mRedBar.getProgress();
+ final int green = mGreenBar.getProgress();
+ final int blue = mBlueBar.getProgress();
+
+ return Color.argb(alpha, red, green, blue);
+ }
+
+ /**
+ * Returns the {@link android.graphics.PorterDuff.Mode} for the selected tint mode option.
+ *
+ * @return selected tint mode
+ */
+ public PorterDuff.Mode getTintMode() {
+ return MODES[mBlendSpinner.getSelectedItemPosition()];
+ }
+
+ /**
+ * Update the tint of the image with the color set in the seekbars and selected blend mode.
+ * The seekbars are set to a maximum of 255, with one for each of the four components of the
+ * ARGB color. (Alpha, Red, Green, Blue.) Once a color has been computed using
+ * {@link Color#argb(int, int, int, int)}, it is set togethe with the blend mode on the background
+ * image using
+ * {@link android.widget.ImageView#setColorFilter(int, android.graphics.PorterDuff.Mode)}.
+ */
+ public void updateTint(int color, PorterDuff.Mode mode) {
+ // Set the color hint of the image: ARGB
+ mHintColor = color;
+
+ // Set the color tint mode based on the selection of the Spinner
+ mMode = mode;
+
+ // Log selection
+ Log.d(TAG, String.format("Updating tint with color [ARGB: %d,%d,%d,%d] and mode [%s]",
+ Color.alpha(color), Color.red(color), Color.green(color), Color.blue(color),
+ mode.toString()));
+
+ // Apply the color tint for the selected tint mode
+ mImage.setColorFilter(mHintColor, mMode);
+
+ // Update the text for each label with the value of each channel
+ mAlphaText.setText(getString(R.string.value_alpha, Color.alpha(color)));
+ mRedText.setText(getString(R.string.value_red, Color.red(color)));
+ mGreenText.setText(getString(R.string.value_green, Color.green(color)));
+ mBlueText.setText(getString(R.string.value_blue, Color.blue(color)));
+ }
+
+ /**
+ * Listener that updates the tint when a blend mode is selected.
+ */
+ private AdapterView.OnItemSelectedListener mBlendListener =
+ new AdapterView.OnItemSelectedListener() {
+
+ @Override
+ public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
+ // Selected a blend mode and update the tint of image
+ updateTint(getColor(), getTintMode());
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> adapterView) {
+
+ }
+
+ };
+
+ /**
+ * Seekbar listener that updates the tinted color when the progress bar has changed.
+ */
+ private SeekBar.OnSeekBarChangeListener mSeekBarListener =
+ new SeekBar.OnSeekBarChangeListener() {
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
+ // Update the tinted color from all selections in the UI
+ updateTint(getColor(), getTintMode());
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ }
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ }
+ };
+}
diff --git a/ui/DrawableTinting/Application/src/main/res/color/custom_tint.xml b/ui/DrawableTinting/Application/src/main/res/color/custom_tint.xml
new file mode 100644
index 0000000..983880a
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/color/custom_tint.xml
@@ -0,0 +1,37 @@
+<?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.
+-->
+
+<!-- This color state list defines the color applied to the "buttonbackground" drawable.
+ A color is selected based on the state of its view.-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- Pressed state -->
+ <item android:color="@color/red" android:state_pressed="true" />
+
+ <!-- Focused state -->
+ <item android:color="@color/light_purple" android:state_focused="true" />
+
+ <item android:color="@color/deep_purple" android:state_enabled="true" />
+
+ <!-- Disabled state -->
+ <item android:color="@color/light_blue" android:state_enabled="false" />
+
+ <!-- Default -->
+ <item android:color="@color/light_blue" />
+
+
+</selector>
\ No newline at end of file
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-hdpi/btn_default_normal_holo.9.png b/ui/DrawableTinting/Application/src/main/res/drawable-hdpi/btn_default_normal_holo.9.png
new file mode 100644
index 0000000..dbcede7
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-hdpi/btn_default_normal_holo.9.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-hdpi/ic_launcher.png b/ui/DrawableTinting/Application/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a8cb237
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-mdpi/btn_default_normal_holo.9.png b/ui/DrawableTinting/Application/src/main/res/drawable-mdpi/btn_default_normal_holo.9.png
new file mode 100644
index 0000000..0e0da34
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-mdpi/btn_default_normal_holo.9.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-mdpi/ic_launcher.png b/ui/DrawableTinting/Application/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..9249aa2
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-xhdpi/btn_default_normal_holo.9.png b/ui/DrawableTinting/Application/src/main/res/drawable-xhdpi/btn_default_normal_holo.9.png
new file mode 100644
index 0000000..92a49db
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-xhdpi/btn_default_normal_holo.9.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/DrawableTinting/Application/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..5d57004
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-xxhdpi/btn_default_normal_holo.9.png b/ui/DrawableTinting/Application/src/main/res/drawable-xxhdpi/btn_default_normal_holo.9.png
new file mode 100644
index 0000000..c1632c8
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-xxhdpi/btn_default_normal_holo.9.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/DrawableTinting/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..9ceea0e
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/DrawableTinting/Application/src/main/res/drawable/buttonbackground.xml b/ui/DrawableTinting/Application/src/main/res/drawable/buttonbackground.xml
new file mode 100644
index 0000000..060c5c7
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/drawable/buttonbackground.xml
@@ -0,0 +1,24 @@
+<?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.
+-->
+
+<!-- This nine patch definition refers to a drawable bitmap (btn_default_holo.png) to which
+a tint is applied. The tint is a color state list that changes color based on the state of the
+view it is applied to. Refer to its definition in "color/custom_tint.xml". -->
+<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/btn_default_normal_holo"
+ android:tint="@color/custom_tint"
+ android:tintMode="multiply" />
\ No newline at end of file
diff --git a/ui/DrawableTinting/Application/src/main/res/layout/tinting_fragment.xml b/ui/DrawableTinting/Application/src/main/res/layout/tinting_fragment.xml
new file mode 100644
index 0000000..0a3bfa7
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/layout/tinting_fragment.xml
@@ -0,0 +1,124 @@
+<!--
+ 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.
+-->
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginBottom="@dimen/vertical_page_margin"
+ android:layout_marginEnd="@dimen/horizontal_page_margin"
+ android:layout_marginStart="@dimen/horizontal_page_margin"
+ android:layout_marginTop="@dimen/vertical_page_margin"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/horizontal_page_margin">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/resource_tint_label" />
+
+ <!-- Button on which the background is set to a Drawable resource that references a
+ color state list to define its tint. The color varies based on the state of the View. -->
+ <Button
+ android:id="@+id/button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:background="@drawable/buttonbackground"
+ android:paddingEnd="7dp"
+ android:paddingStart="7dp"
+ android:text="@string/resource_tint_button" />
+
+ <!-- Image -->
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/prog_tint_label" />
+
+ <ImageView
+ android:id="@+id/image"
+ android:layout_width="200dp"
+ android:layout_height="50dp"
+ android:layout_gravity="center_horizontal"
+ android:scaleType="fitXY"
+ android:tint="#330000FF" />
+
+ <!-- Blend mode -->
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="0dp"
+ android:text="@string/blend_mode_label" />
+
+ <Spinner
+ android:id="@+id/blendSpinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <!-- Alpha -->
+ <TextView
+ android:id="@+id/alphaText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <SeekBar
+ android:id="@+id/alphaSeek"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:max="255"
+ android:progress="255" />
+
+ <!-- Red -->
+ <TextView
+ android:id="@+id/redText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <SeekBar
+ android:id="@+id/redSeek"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:max="255" />
+
+ <!-- Green -->
+ <TextView
+ android:id="@+id/greenText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <SeekBar
+ android:id="@+id/greenSeek"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:max="255" />
+
+ <!-- Blue -->
+ <TextView
+ android:id="@+id/blueText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <SeekBar
+ android:id="@+id/blueSeek"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:max="255" />
+
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/ui/DrawableTinting/Application/src/main/res/values/color.xml b/ui/DrawableTinting/Application/src/main/res/values/color.xml
new file mode 100644
index 0000000..86a2db7
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/values/color.xml
@@ -0,0 +1,26 @@
+<?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>
+
+ <color name="red">#e51c23</color>
+ <color name="light_purple">#e1bee7</color>
+ <color name="deep_purple">#673ab7</color>
+ <color name="light_blue">#e7e9fd</color>
+ <color name="green">#259b24</color>
+
+</resources>
\ No newline at end of file
diff --git a/ui/DrawableTinting/Application/src/main/res/values/strings.xml b/ui/DrawableTinting/Application/src/main/res/values/strings.xml
new file mode 100644
index 0000000..4a517d1
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/main/res/values/strings.xml
@@ -0,0 +1,49 @@
+<?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>
+ <string name="resource_tint_label">Button with tinting set by state color list as resource:</string>
+ <string name="resource_tint_button">Tinting set by StateDrawable</string>
+ <string name="prog_tint_label">View with tinting set programmatically:</string>
+ <string name="value_alpha">Alpha: %d\%</string>
+ <string name="value_red">Red: %d\%</string>
+ <string name="value_green">Green: %d\%</string>
+ <string name="value_blue">Blue: %d\%</string>
+ <string name="blend_mode_label">Blend Mode:</string>
+
+ <string-array name="blend_modes">
+ <item>Add</item>
+ <item>Clear</item>
+ <item>Darken</item>
+ <item>Destination (DST)</item>
+ <item>Destination atop (DST_ATOP)</item>
+ <item>Destination in (DST_IN)</item>
+ <item>Destination out (DST_OUT)</item>
+ <item>Destination over (DST_OVER)</item>
+ <item>Lighten</item>
+ <item>Multiply</item>
+ <item>Overlay</item>
+ <item>Screen</item>
+ <item>Source (SRC)</item>
+ <item>Source atop (SRC_ATOP)</item>
+ <item>Source in (SRC_IN)</item>
+ <item>Source out (SRC_OUT)</item>
+ <item>Source over (SRC_OVER)</item>
+ <item>XOR</item>
+ </string-array>
+
+</resources>
\ No newline at end of file
diff --git a/ui/DrawableTinting/Application/src/proguard-project.txt b/ui/DrawableTinting/Application/src/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/ui/DrawableTinting/Application/src/test/SampleTests.java b/ui/DrawableTinting/Application/src/test/SampleTests.java
new file mode 100644
index 0000000..534ad12
--- /dev/null
+++ b/ui/DrawableTinting/Application/src/test/SampleTests.java
@@ -0,0 +1,158 @@
+/*
+* Copyright (C) 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.
+*/
+package android.ui.DrawableTinting.Application.src.test;
+
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.UiThreadTest;
+import android.ui.DrawableTinting.Application.src.main.java.com.example.android.drawabletinting.DrawableTintingFragment;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.SeekBar;
+import android.widget.Spinner;
+
+import com.example.android.drawabletinting.MainActivity;
+import com.example.android.drawabletinting.R;
+
+/**
+ * Tests for drawabletinting sample.
+ */
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private DrawableTintingFragment mTestFragment;
+
+ View mFragmentView;
+ SeekBar mAlpha;
+ SeekBar mRed;
+ SeekBar mGreen;
+ SeekBar mBlue;
+ Spinner mBlendMode;
+ ImageView mImage;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (DrawableTintingFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+
+ final View fragmentView = mTestFragment.getView();
+ mAlpha = (SeekBar) fragmentView.findViewById(R.id.alphaSeek);
+ mRed = (SeekBar) fragmentView.findViewById(R.id.redSeek);
+ mGreen = (SeekBar) fragmentView.findViewById(R.id.greenSeek);
+ mBlue = (SeekBar) fragmentView.findViewById(R.id.blueSeek);
+ mBlendMode = (Spinner) fragmentView.findViewById(R.id.blendSpinner);
+ mImage = (ImageView) fragmentView.findViewById(R.id.image);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Test the initial state of all UI elements, color and blend mode.
+ */
+ public void testInitialState() {
+ assertEquals(255, mAlpha.getProgress());
+ assertEquals(0, mRed.getProgress());
+ assertEquals(0, mGreen.getProgress());
+ assertEquals(0, mBlue.getProgress());
+ assertEquals("Add", (String) mBlendMode.getSelectedItem());
+
+ PorterDuffColorFilter colorFilter = (PorterDuffColorFilter) mImage.getColorFilter();
+ assertNotNull(colorFilter);
+ int initialColor = Color.BLACK;
+ assertEquals(initialColor, colorFilter.getColor());
+ assertEquals(PorterDuff.Mode.ADD, colorFilter.getMode());
+ }
+
+ /**
+ * Test application of blend modes.
+ */
+ @UiThreadTest
+ public void testModes() {
+ final int testColor = Color.GREEN;
+ // Test that each tint mode can be successfully applied and matches a valid PorterDuff mode
+ final PorterDuff.Mode[] modes = PorterDuff.Mode.values();
+
+ // Test that each blend mode can be applied
+ for (PorterDuff.Mode m : modes) {
+ mTestFragment.updateTint(testColor, m);
+ final PorterDuffColorFilter filter = (PorterDuffColorFilter) mImage.getColorFilter();
+ assertEquals(m, filter.getMode());
+ assertEquals(testColor, filter.getColor());
+ }
+ }
+
+ /**
+ * Test the color computation from ARGB Seekbars.
+ */
+ public void testColor() {
+ // Red
+ mAlpha.setProgress(255);
+ mRed.setProgress(255);
+ mBlue.setProgress(0);
+ mGreen.setProgress(0);
+ assertEquals(Color.RED, mTestFragment.getColor());
+
+ // Blue
+ mAlpha.setProgress(255);
+ mRed.setProgress(0);
+ mBlue.setProgress(255);
+ mGreen.setProgress(0);
+ assertEquals(Color.BLUE, mTestFragment.getColor());
+
+ // Green
+ mAlpha.setProgress(255);
+ mRed.setProgress(0);
+ mBlue.setProgress(0);
+ mGreen.setProgress(255);
+ assertEquals(Color.GREEN, mTestFragment.getColor());
+
+ // Black
+ mAlpha.setProgress(255);
+ mRed.setProgress(0);
+ mBlue.setProgress(0);
+ mGreen.setProgress(0);
+ assertEquals(Color.BLACK, mTestFragment.getColor());
+
+ // Transparent
+ mAlpha.setProgress(0);
+ mRed.setProgress(0);
+ mBlue.setProgress(0);
+ mGreen.setProgress(0);
+ assertEquals(Color.TRANSPARENT, mTestFragment.getColor());
+ }
+
+}
diff --git a/ui/DrawableTinting/CONTRIB.md b/ui/DrawableTinting/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/ui/DrawableTinting/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/DrawableTinting/LICENSE b/ui/DrawableTinting/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/ui/DrawableTinting/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/ui/DrawableTinting/README.md b/ui/DrawableTinting/README.md
new file mode 100644
index 0000000..db2efaa
--- /dev/null
+++ b/ui/DrawableTinting/README.md
@@ -0,0 +1,61 @@
+Android DrawableTinting Sample
+==============================
+
+Sample that shows applying tinting and color filters to Drawables both programmatically
+and as Drawable resources in XML.
+
+Introduction
+------------
+
+Tinting is set on a nine-patch drawable through the "tint" and "tintMode" parameters.
+A color state list is referenced as the tint color, which defines colors for different
+states of a View (for example disabled/enabled, focused, pressed or selected).
+
+Programmatically, tinting is applied to a Drawable through its "setColorFilter" method,
+with a reference to a color and a PorterDuff blend mode. The color and blend mode can be
+changed from the UI to see the effect of different options.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-DrawableTinting
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/DrawableTinting/build.gradle b/ui/DrawableTinting/build.gradle
new file mode 100644
index 0000000..c7a137e
--- /dev/null
+++ b/ui/DrawableTinting/build.gradle
@@ -0,0 +1,10 @@
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../build"
+ pathToSamplesCommon "../../common"
+}
+apply from: "../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/DrawableTinting/buildSrc/build.gradle b/ui/DrawableTinting/buildSrc/build.gradle
new file mode 100644
index 0000000..29282af
--- /dev/null
+++ b/ui/DrawableTinting/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/DrawableTinting/gradle/wrapper/gradle-wrapper.jar b/ui/DrawableTinting/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/DrawableTinting/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/DrawableTinting/gradle/wrapper/gradle-wrapper.properties b/ui/DrawableTinting/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..56f685a
--- /dev/null
+++ b/ui/DrawableTinting/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
diff --git a/ui/DrawableTinting/gradlew b/ui/DrawableTinting/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/DrawableTinting/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/DrawableTinting/gradlew.bat b/ui/DrawableTinting/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/ui/DrawableTinting/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/DrawableTinting/packaging.yaml b/ui/DrawableTinting/packaging.yaml
new file mode 100644
index 0000000..67e603d
--- /dev/null
+++ b/ui/DrawableTinting/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-DrawableTinting
+level: BEGINNER
+icon: DrawableTintingSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/ui/DrawableTinting/settings.gradle b/ui/DrawableTinting/settings.gradle
new file mode 100644
index 0000000..9464a35
--- /dev/null
+++ b/ui/DrawableTinting/settings.gradle
@@ -0,0 +1 @@
+include 'Application'
diff --git a/ui/DrawableTinting/template-params.xml b/ui/DrawableTinting/template-params.xml
new file mode 100644
index 0000000..5c3bd62
--- /dev/null
+++ b/ui/DrawableTinting/template-params.xml
@@ -0,0 +1,40 @@
+<?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.
+-->
+<sample>
+ <name>DrawableTinting</name>
+ <group>UI</group>
+ <package>com.example.android.drawabletinting</package>
+ <!-- change minSdk if needed-->
+ <minSdk>L</minSdk>
+ <strings>
+ <intro>
+ <![CDATA[
+ Sample that shows applying tinting and color filters to Drawables both programmatically
+ and as Drawable resources in XML.
+ \n\nTinting is set on a nine-patch drawable through the "tint" and "tintMode" parameters.
+ A color state list is referenced as the tint color, which defines colors for different
+ states of a View (for example disabled/enabled, focused, pressed or selected).
+ \n\nProgrammatically, tinting is applied to a Drawable through its "setColorFilter" method,
+ with a reference to a color and a PorterDuff blend mode. The color and blend mode can be
+ changed from the UI to see the effect of different options.
+ ]]>
+ </intro>
+ </strings>
+ <template src="base"/>
+ <template src="FragmentView"/>
+ <common src="logger"/>
+ <common src="activities"/>
+</sample>
\ No newline at end of file
diff --git a/ui/Interpolator/Application/.gitignore b/ui/Interpolator/Application/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/Interpolator/Application/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/Interpolator/Application/proguard-project.txt b/ui/Interpolator/Application/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/ui/Interpolator/Application/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/ui/Interpolator/Application/src/main/AndroidManifest.xml b/ui/Interpolator/Application/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..180f78a
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?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.
+-->
+
+
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.interpolator"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="android-L" android:targetSdkVersion="android-L" />
+
+ <application android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/AppTheme">
+
+ <activity android:name=".MainActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+
+</manifest>
diff --git a/ui/Interpolator/Application/src/main/java/com/example/android/interpolator/InterpolatorFragment.java b/ui/Interpolator/Application/src/main/java/com/example/android/interpolator/InterpolatorFragment.java
new file mode 100644
index 0000000..07ecc95
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/java/com/example/android/interpolator/InterpolatorFragment.java
@@ -0,0 +1,244 @@
+/*
+* 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.
+*/
+
+package com.example.android.interpolator;
+
+import android.animation.ObjectAnimator;
+import android.graphics.Path;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.AnimationUtils;
+import android.view.animation.Interpolator;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.SeekBar;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+import com.example.android.common.logger.Log;
+
+/**
+ * This sample demonstrates the use of animation interpolators and path animations for
+ * Material Design.
+ * It shows how an {@link android.animation.ObjectAnimator} is used to animate two properties of a
+ * view (scale X and Y) along a path.
+ */
+public class InterpolatorFragment extends Fragment {
+
+ /**
+ * View that is animated.
+ */
+ private View mView;
+ /**
+ * Spinner for selection of interpolator.
+ */
+ private Spinner mInterpolatorSpinner;
+ /**
+ * SeekBar for selection of duration of animation.
+ */
+ private SeekBar mDurationSeekbar;
+ /**
+ * TextView that shows animation selected in SeekBar.
+ */
+ private TextView mDurationLabel;
+
+ /**
+ * Interpolators used for animation.
+ */
+ private Interpolator mInterpolators[];
+ /**
+ * Path for in (shrinking) animation, from 100% scale to 20%.
+ */
+ private Path mPathIn;
+ /**
+ * Path for out (growing) animation, from 20% to 100%.
+ */
+ private Path mPathOut;
+
+ /**
+ * Set to true if View is animated out (is shrunk).
+ */
+ private boolean mIsOut = false;
+
+ /**
+ * Default duration of animation in ms.
+ */
+ private static final int INITIAL_DURATION_MS = 750;
+
+ /**
+ * String used for logging.
+ */
+ public static final String TAG = "InterpolatorplaygroundFragment";
+
+ public InterpolatorFragment() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+
+ // Inflate the fragment_animation layout
+ View v = inflater.inflate(R.layout.interpolator_fragment, container, false);
+
+ // Set up the 'animate' button, when it is clicked the view is animated with the options
+ // selected: the Interpolator, duration and animation path
+ Button button = (Button) v.findViewById(R.id.animateButton);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ // Interpolator selected in the spinner
+ Interpolator interpolator = mInterpolators[mInterpolatorSpinner.getSelectedItemPosition()];
+ // Duration selected in SeekBar
+ long duration = mDurationSeekbar.getProgress();
+ // Animation path is based on whether animating in or out
+ Path path = mIsOut ? mPathIn : mPathOut;
+
+ // Log animation details
+ Log.i(TAG, String.format("Starting animation: [%d ms, %s, %s]",
+ duration, (String) mInterpolatorSpinner.getSelectedItem(),
+ ((mIsOut) ? "Out (growing)" : "In (shrinking)")));
+
+ // Start the animation with the selected options
+ startAnimation(interpolator, duration, path);
+
+ // Toggle direction of animation (path)
+ mIsOut = !mIsOut;
+ }
+ });
+
+ // Get the label to display the selected duration
+ mDurationLabel = (TextView) v.findViewById(R.id.durationLabel);
+
+ // Initialize Interpolators programmatically by loading them from their XML definitions
+ // provided by the framework.
+ mInterpolators = new Interpolator[]{
+ new AnimationUtils().loadInterpolator(getActivity(),
+ android.R.interpolator.linear),
+ new AnimationUtils().loadInterpolator(getActivity(),
+ android.R.interpolator.fast_out_linear_in),
+ new AnimationUtils().loadInterpolator(getActivity(),
+ android.R.interpolator.fast_out_slow_in),
+ new AnimationUtils().loadInterpolator(getActivity(),
+ android.R.interpolator.linear_out_slow_in)
+ };
+
+ // Load names of interpolators from a resource
+ String[] interpolatorNames = getResources().getStringArray(R.array.interpolator_names);
+
+ // Set up the Spinner with the names of interpolators
+ mInterpolatorSpinner = (Spinner) v.findViewById(R.id.interpolatorSpinner);
+ ArrayAdapter<String> spinnerAdapter =
+ new ArrayAdapter<String>(getActivity(),
+ android.R.layout.simple_spinner_dropdown_item, interpolatorNames);
+ mInterpolatorSpinner.setAdapter(spinnerAdapter);
+
+ // Set up SeekBar that defines the duration of the animation
+ mDurationSeekbar = (SeekBar) v.findViewById(R.id.durationSeek);
+
+ // Register listener to update the text label when the SeekBar value is updated
+ mDurationSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
+ mDurationLabel.setText(getResources().getString(R.string.animation_duration, i));
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ }
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ }
+ });
+
+ // Set initial progress to trigger SeekBarChangeListener and update UI
+ mDurationSeekbar.setProgress(INITIAL_DURATION_MS);
+
+ // Get the view that will be animated
+ mView = v.findViewById(R.id.square);
+
+ // The following Path definitions are used by the ObjectAnimator to scale the view.
+
+ // Path for 'in' animation: growing from 20% to 100%
+ mPathIn = new Path();
+ mPathIn.moveTo(0.2f, 0.2f);
+ mPathIn.lineTo(1f, 1f);
+
+ // Path for 'out' animation: shrinking from 100% to 20%
+ mPathOut = new Path();
+ mPathOut.moveTo(1f, 1f);
+ mPathOut.lineTo(0.2f, 0.2f);
+ return v;
+ }
+
+ /**
+ * Start an animation on the sample view.
+ * The view is animated using an {@link android.animation.ObjectAnimator} on the
+ * {@link View#SCALE_X} and {@link View#SCALE_Y} properties, with its animation based on a path.
+ * The only two paths defined here ({@link #mPathIn} and {@link #mPathOut}) scale the view
+ * uniformly.
+ *
+ * @param interpolator The interpolator to use for the animation.
+ * @param duration Duration of the animation in ms.
+ * @param path Path of the animation
+ * @return The ObjectAnimator used for this animation
+ * @see android.animation.ObjectAnimator#ofFloat(Object, String, String, android.graphics.Path)
+ */
+ public ObjectAnimator startAnimation(Interpolator interpolator, long duration, Path path) {
+ // This ObjectAnimator uses the path to change the x and y scale of the mView object.
+ ObjectAnimator animator = ObjectAnimator.ofFloat(mView, View.SCALE_X, View.SCALE_Y, path);
+
+ // Set the duration and interpolator for this animation
+ animator.setDuration(duration);
+ animator.setInterpolator(interpolator);
+
+ animator.start();
+
+ return animator;
+ }
+
+ /**
+ * Return the array of loaded Interpolators available in this Fragment.
+ *
+ * @return Interpolators
+ */
+ public Interpolator[] getInterpolators() {
+ return mInterpolators;
+ }
+
+ /**
+ * Return the animation path for the 'in' (shrinking) animation.
+ *
+ * @return
+ */
+ public Path getPathIn() {
+ return mPathIn;
+ }
+
+ /**
+ * Return the animation path for the 'out' (growing) animation.
+ *
+ * @return
+ */
+ public Path getPathOut() {
+ return mPathOut;
+ }
+}
\ No newline at end of file
diff --git a/ui/Interpolator/Application/src/main/res/drawable-hdpi/ic_launcher.png b/ui/Interpolator/Application/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..14a1e3a
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/Interpolator/Application/src/main/res/drawable-mdpi/ic_launcher.png b/ui/Interpolator/Application/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..e328c42
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/Interpolator/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/Interpolator/Application/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..c78e0c4
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/Interpolator/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/Interpolator/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..0be3d8b
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/Interpolator/Application/src/main/res/layout/interpolator_fragment.xml b/ui/Interpolator/Application/src/main/res/layout/interpolator_fragment.xml
new file mode 100644
index 0000000..6e1cb04
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/res/layout/interpolator_fragment.xml
@@ -0,0 +1,86 @@
+<!--
+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.
+-->
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/vertical_page_margin"
+ android:paddingLeft="@dimen/horizontal_page_margin"
+ android:paddingRight="@dimen/horizontal_page_margin"
+ android:paddingTop="@dimen/vertical_page_margin">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:id="@+id/interpolatorLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBottom="@+id/interpolatorSpinner"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentTop="true"
+ android:gravity="center_vertical"
+ android:text="@string/interpolator" />
+
+ <Spinner
+ android:id="@+id/interpolatorSpinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_toEndOf="@+id/interpolatorLabel" />
+
+
+ <SeekBar
+ android:id="@+id/durationSeek"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_below="@+id/durationLabel"
+ android:max="5000" />
+
+ <TextView
+ android:id="@+id/durationLabel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/interpolatorSpinner"
+ android:gravity="center_vertical" />
+
+ <Button
+ android:id="@+id/animateButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/durationSeek"
+ android:layout_centerHorizontal="true"
+ android:text="@string/animate" />
+
+ <View
+ android:id="@+id/square"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentBottom="true"
+ android:layout_below="@+id/animateButton"
+ android:layout_centerHorizontal="true"
+ android:layout_margin="10dp"
+ android:background="@color/purple"
+ android:minHeight="100dp"
+ android:minWidth="100dp" />
+
+ </RelativeLayout>
+
+</ScrollView>
\ No newline at end of file
diff --git a/ui/Interpolator/Application/src/main/res/values/color.xml b/ui/Interpolator/Application/src/main/res/values/color.xml
new file mode 100644
index 0000000..aa18437
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/res/values/color.xml
@@ -0,0 +1,19 @@
+<?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>
+ <color name="purple">#9c27b0</color>
+</resources>
\ No newline at end of file
diff --git a/ui/Interpolator/Application/src/main/res/values/strings.xml b/ui/Interpolator/Application/src/main/res/values/strings.xml
new file mode 100644
index 0000000..e2cfb2a
--- /dev/null
+++ b/ui/Interpolator/Application/src/main/res/values/strings.xml
@@ -0,0 +1,27 @@
+<?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>
+ <string name="animation_duration">Duration: %1$d ms</string>
+ <string name="interpolator">Interpolator:</string>
+ <string name="animate">Animate!</string>
+ <string-array name="interpolator_names">
+ <item>Linear</item>
+ <item>Fast Out Linear In</item>
+ <item>Fast Out Slow In</item>
+ <item>Linear Out Slow In</item>
+ </string-array>
+</resources>
\ No newline at end of file
diff --git a/ui/Interpolator/Application/tests/AndroidManifest.xml b/ui/Interpolator/Application/tests/AndroidManifest.xml
new file mode 100644
index 0000000..702e29a
--- /dev/null
+++ b/ui/Interpolator/Application/tests/AndroidManifest.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.interpolatorplayground.tests"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="android-L"
+ android:targetSdkVersion="android-L" />
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.example.android.interpolatorplayground"
+ android:label="Tests for com.example.android.interpolatorplayground" />
+
+</manifest>
\ No newline at end of file
diff --git a/ui/Interpolator/Application/tests/src/com/example/android/interpolatorplayground/tests/SampleTests.java b/ui/Interpolator/Application/tests/src/com/example/android/interpolatorplayground/tests/SampleTests.java
new file mode 100644
index 0000000..7a0264b
--- /dev/null
+++ b/ui/Interpolator/Application/tests/src/com/example/android/interpolatorplayground/tests/SampleTests.java
@@ -0,0 +1,115 @@
+/*
+* 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.
+*/
+
+package com.example.android.interpolatorplayground.tests;
+
+import com.example.android.interpolator.InterpolatorFragment;
+import com.example.android.interpolatorplayground.*;
+
+import android.animation.ObjectAnimator;
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.UiThreadTest;
+import android.view.animation.Interpolator;
+import android.widget.SeekBar;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+/**
+ * Tests for interpolatorplayground sample.
+ */
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private InterpolatorFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ setActivityInitialTouchMode(true);
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (InterpolatorFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Test if all UI elements have been set up correctly.
+ */
+ public void testInitialisation() {
+ final int initialDuration = 750;
+ final String initialInterpolator = "Linear";
+
+ SeekBar durationBar = (SeekBar) getActivity().findViewById(R.id.durationSeek);
+ TextView durationLabel = (TextView) getActivity().findViewById(R.id.durationLabel);
+ Spinner interpolateSpinner = (Spinner) getActivity().findViewById(R.id.interpolatorSpinner);
+ Interpolator[] interpolators = mTestFragment.getInterpolators();
+
+ // Duration in progress bar
+ assertEquals(durationBar.getProgress(), initialDuration);
+ // Duration label
+ assertEquals(durationLabel.getText().toString(), getActivity().getResources().getString(R.string.animation_duration, initialDuration));
+ // Initial Interpolator
+ assertEquals((String) interpolateSpinner.getSelectedItem(), initialInterpolator);
+
+ // The number of loaded interpolators has to match the number of entries in the spinner
+ assertEquals(interpolators.length, interpolateSpinner.getCount());
+ // Test that all interpolators have been loaded
+ for (Interpolator i : interpolators) {
+ assertNotNull(i);
+ }
+
+ }
+
+ /**
+ * Test if all Interpolators can be used to start an animation.
+ */
+ @UiThreadTest
+ public void testStartInterpolators() {
+
+ // Start an animation for each interpolator
+ final Interpolator[] interpolators = mTestFragment.getInterpolators();
+
+ for (final Interpolator i : interpolators) {
+ // Start the animation
+ ObjectAnimator animator = mTestFragment.startAnimation(i, 1000L, mTestFragment.getPathIn());
+ // Check that the correct interpolator is used for the animation
+ assertEquals(i, animator.getInterpolator());
+ // Verify the animation has started
+ assertTrue(animator.isStarted());
+ // Cancel before starting the next animation
+ animator.cancel();
+ }
+ }
+}
\ No newline at end of file
diff --git a/ui/Interpolator/CONTRIB.md b/ui/Interpolator/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/ui/Interpolator/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/Interpolator/LICENSE b/ui/Interpolator/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/ui/Interpolator/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/ui/Interpolator/README.md b/ui/Interpolator/README.md
new file mode 100644
index 0000000..faf9086
--- /dev/null
+++ b/ui/Interpolator/README.md
@@ -0,0 +1,51 @@
+Android Interpolator Sample
+==============================
+
+This sample demonstrates the use of animation interpolators and path animations for
+Material Design. It shows how an ObjectAnimator is used to animate two properties of a
+view (scale X and Y) along a path.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-Interpolator
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/Interpolator/build.gradle b/ui/Interpolator/build.gradle
new file mode 100644
index 0000000..f9f6f65
--- /dev/null
+++ b/ui/Interpolator/build.gradle
@@ -0,0 +1,14 @@
+
+
+
+
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../build"
+ pathToSamplesCommon "../../common"
+}
+apply from: "../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/Interpolator/buildSrc/build.gradle b/ui/Interpolator/buildSrc/build.gradle
new file mode 100644
index 0000000..29282af
--- /dev/null
+++ b/ui/Interpolator/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/Interpolator/gradle/wrapper/gradle-wrapper.jar b/ui/Interpolator/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/Interpolator/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/Interpolator/gradle/wrapper/gradle-wrapper.properties b/ui/Interpolator/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..56f685a
--- /dev/null
+++ b/ui/Interpolator/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
diff --git a/ui/Interpolator/gradlew b/ui/Interpolator/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/Interpolator/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/Interpolator/gradlew.bat b/ui/Interpolator/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/ui/Interpolator/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/Interpolator/packaging.yaml b/ui/Interpolator/packaging.yaml
new file mode 100644
index 0000000..962ed1b
--- /dev/null
+++ b/ui/Interpolator/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-Interpolator
+level: BEGINNER
+icon: InterpolatorSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/ui/Interpolator/settings.gradle b/ui/Interpolator/settings.gradle
new file mode 100644
index 0000000..9464a35
--- /dev/null
+++ b/ui/Interpolator/settings.gradle
@@ -0,0 +1 @@
+include 'Application'
diff --git a/ui/Interpolator/template-params.xml b/ui/Interpolator/template-params.xml
new file mode 100644
index 0000000..6549b44
--- /dev/null
+++ b/ui/Interpolator/template-params.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<sample>
+ <name>Interpolator</name>
+ <group>UI</group>
+ <package>com.example.android.interpolator</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>L</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates the use of animation interpolators and path animations for
+ Material Design. It shows how an ObjectAnimator is used to animate two properties of a
+ view (scale X and Y) along a path.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <template src="FragmentView"/>
+
+ <common src="logger"/>
+ <common src="activities"/>
+
+</sample>
diff --git a/ui/activityscenetransition/ActivitySceneTransitionBasic/CONTRIB.md b/ui/activityscenetransition/ActivitySceneTransitionBasic/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/ui/activityscenetransition/ActivitySceneTransitionBasic/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/activityscenetransition/ActivitySceneTransitionBasic/LICENSE b/ui/activityscenetransition/ActivitySceneTransitionBasic/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/ui/activityscenetransition/ActivitySceneTransitionBasic/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/ui/activityscenetransition/ActivitySceneTransitionBasic/README.md b/ui/activityscenetransition/ActivitySceneTransitionBasic/README.md
new file mode 100644
index 0000000..afb91ce
--- /dev/null
+++ b/ui/activityscenetransition/ActivitySceneTransitionBasic/README.md
@@ -0,0 +1,51 @@
+Android ActivitySceneTransitionBasic Sample
+==============================
+
+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.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-ActivitySceneTransitionBasic
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/activityscenetransition/ActivitySceneTransitionBasic/packaging.yaml b/ui/activityscenetransition/ActivitySceneTransitionBasic/packaging.yaml
new file mode 100644
index 0000000..0d1188d
--- /dev/null
+++ b/ui/activityscenetransition/ActivitySceneTransitionBasic/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-ActivitySceneTransitionBasic
+level: BEGINNER
+icon: ActivitySceneTransitionBasicSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/ui/activityscenetransition/ActivitySceneTransitionBasic/settings.gradle b/ui/activityscenetransition/ActivitySceneTransitionBasic/settings.gradle
index 363009d..9464a35 100644
--- a/ui/activityscenetransition/ActivitySceneTransitionBasic/settings.gradle
+++ b/ui/activityscenetransition/ActivitySceneTransitionBasic/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'ActivitySceneTransitionBasicSample'
+include 'Application'
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/.gitignore b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/proguard-project.txt b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/AndroidManifest.xml b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..71ac7d0
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/AndroidManifest.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.documentcentricrecents"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="android-L" android:targetSdkVersion="android-L" />
+
+ <application android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/AppTheme">
+
+ <activity android:name=".DocumentCentricActivity"
+ android:label="@string/app_name"
+ android:persistableMode="persistAcrossReboots">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name=".NewDocumentActivity"
+ android:label="@string/activity_new_document_title" >
+ </activity>
+ </application>
+
+</manifest>
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/java/com/example/android/documentcentricrecents/DocumentCentricActivity.java b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/java/com/example/android/documentcentricrecents/DocumentCentricActivity.java
new file mode 100644
index 0000000..1d2dcee
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/java/com/example/android/documentcentricrecents/DocumentCentricActivity.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 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.
+ */
+
+package com.example.android.documentcentricrecents;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.PersistableBundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.CheckBox;
+
+/**
+ * DocumentCentricActivity shows the basic usage of the new Document-Centric Recents API. The new
+ * API modifies the meaning of the {@link Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET} flag, which is
+ * now deprecated. In versions before L it serves to define a boundary between the main task and a
+ * subtask. The subtask holds a different thumbnail and all activities in it are finished when the
+ * task is reset. In L this flag causes a full break with the task that launched it. As such it has
+ * been renamed to {@link Intent#FLAG_ACTIVITY_NEW_DOCUMENT}.
+ *
+ * This sample mainly uses Intent flags in code. But Activities can also specify in their manifests
+ * that they shall always be launched into a new task in the above manner using the new activity
+ * attribute documentLaunchMode which may take on one of three values, “intoExisting” equivalent to
+ * NEW_DOCUMENT, “always” equivalent to NEW_DOCUMENT | MULTIPLE_TASK, “none” the default, and
+ * “never” which will negate the effect of any attempt to launch the activity with NEW_DOCUMENT.
+ */
+public class DocumentCentricActivity extends Activity {
+
+ private final static String TAG = "DocumentCentricActivity";
+
+ public final static String KEY_EXTRA_NEW_DOCUMENT_COUNTER = "KEY_EXTRA_NEW_DOCUMENT_COUNTER";
+
+ private static int mDocumentCounter = 0;
+
+ private CheckBox mCheckbox;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_document_centric_main);
+ mCheckbox = (CheckBox) findViewById(R.id.multiple_task_checkbox);
+ }
+
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
+ super.onPostCreate(savedInstanceState, persistentState);
+ // Restore state from PersistableBundle
+ if (persistentState != null) {
+ mDocumentCounter = persistentState.getInt(KEY_EXTRA_NEW_DOCUMENT_COUNTER);
+ }
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
+ /*
+ To maintain activity state across reboots the system saves and restore critical information for
+ all tasks and their activities. Information known by the system includes the activity stack order,
+ each task’s thumbnails and each activity’s and task's Intents. For Information that cannot be retained
+ because they contain Bundles which can’t be persisted a new constrained version of Bundle,
+ PersistableBundle is added. PersistableBundle can store only basic data types. To use it
+ in your Activities you must declare the new activity:persistableMode attribute in the manifest.
+ */
+ outPersistentState.putInt(KEY_EXTRA_NEW_DOCUMENT_COUNTER, mDocumentCounter);
+ super.onSaveInstanceState(outState, outPersistentState);
+ }
+
+ public void createNewDocument(View view) {
+ boolean useMultipleTasks = mCheckbox.isChecked();
+ final Intent newDocumentIntent = newDocumentIntent();
+ if (useMultipleTasks) {
+ /*
+ When {@linkIntent#FLAG_ACTIVITY_NEW_DOCUMENT} is used with {@link Intent#FLAG_ACTIVITY_MULTIPLE_TASK}
+ the system will always create a new task with the target activity as the root. This allows the same
+ document to be opened in more than one task.
+ */
+ newDocumentIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
+ }
+ startActivity(newDocumentIntent);
+ }
+
+
+ /**
+ * Returns an new {@link Intent} to start {@link NewDocumentActivity} as a new document in recents.
+ *
+ * To start a new document task {@link Intent#FLAG_ACTIVITY_NEW_DOCUMENT} must be used. The
+ * system will search through existing tasks for one whose Intent matches the Intent component
+ * name and the Intent data. If it finds one then that task will be brought to the front and the
+ * new Intent will be passed to onNewIntent().
+ *
+ * Activities launched with the NEW_DOCUMENT flag must be created with launchMode="standard".
+ */
+ private Intent newDocumentIntent() {
+ final Intent newDocumentIntent = new Intent(this, NewDocumentActivity.class);
+ newDocumentIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
+ newDocumentIntent.putExtra(KEY_EXTRA_NEW_DOCUMENT_COUNTER, incrementAndGet());
+ return newDocumentIntent;
+ }
+
+ private static int incrementAndGet() {
+ Log.d(TAG, "incrementAndGet(): " + mDocumentCounter);
+ return mDocumentCounter++;
+ }
+
+}
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/java/com/example/android/documentcentricrecents/NewDocumentActivity.java b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/java/com/example/android/documentcentricrecents/NewDocumentActivity.java
new file mode 100644
index 0000000..c94ad34
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/java/com/example/android/documentcentricrecents/NewDocumentActivity.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 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.
+ */
+
+package com.example.android.documentcentricrecents;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * Represents a "document" in the new recents notion. This is just a placeholder.
+ * Real world examples of this could be:
+ *
+ * <ul>
+ * <li>Document Editing</li>
+ * <li>Browser tabs</li>
+ * <li>Message composition</li>
+ * <li>Sharing</li>
+ * <li>Shopping item details</li>
+ * </ul>
+ */
+public class NewDocumentActivity extends Activity {
+
+ private TextView mDocumentCounterTextView;
+ private int mDocumentCount;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_new_document);
+ mDocumentCount = getIntent()
+ .getIntExtra(DocumentCentricActivity.KEY_EXTRA_NEW_DOCUMENT_COUNTER, 0);
+ mDocumentCounterTextView = (TextView) findViewById(
+ R.id.hello_new_document_text_view);
+ setDocumentCounterText(R.string.hello_new_document_counter);
+ }
+
+ @Override
+ protected void onNewIntent(Intent intent) {
+ super.onNewIntent(intent);
+ /* If {@link Intent#FLAG_ACTIVITY_MULTIPLE_TASK} has not been used this Activity
+ will be reused.
+ */
+ setDocumentCounterText(R.string.reusing_document_counter);
+ }
+
+ public void onRemoveFromRecents(View view) {
+ // It is good pratice to remove a document from the recents stack if not needed anymore.
+ finishAndRemoveTask();
+ }
+
+ public void setDocumentCounterText(int resId) {
+ mDocumentCounterTextView
+ .setText(String.format(getString(resId), String.valueOf(mDocumentCount)));
+ }
+
+}
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-hdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..b1efaf4
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-mdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..f5f9244
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..5d07b3f
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..6ef21e1
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/layout/activity_document_centric_main.xml b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/layout/activity_document_centric_main.xml
new file mode 100755
index 0000000..5f62415
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/layout/activity_document_centric_main.xml
@@ -0,0 +1,63 @@
+<?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.
+-->
+
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ style="@style/Widget.SampleMessageTile"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ style="@style/Widget.SampleMessage"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/horizontal_page_margin"
+ android:layout_marginRight="@dimen/horizontal_page_margin"
+ android:layout_marginTop="@dimen/vertical_page_margin"
+ android:text="@string/intro_message" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
+ android:orientation="vertical">
+
+ <Button
+ android:id="@+id/new_document_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:padding="@dimen/margin_medium"
+ android:text="@string/new_document_button_text"
+ android:onClick="createNewDocument" />
+
+ <CheckBox
+ android:id="@+id/multiple_task_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_small"
+ android:text="@string/multiple_task_checkbox_label" />
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/layout/activity_new_document.xml b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/layout/activity_new_document.xml
new file mode 100644
index 0000000..3dc7a4a
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/layout/activity_new_document.xml
@@ -0,0 +1,41 @@
+<?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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:context="com.example.android.basicdocumentcentric.DocumentActivity">
+
+ <TextView
+ android:id="@+id/hello_new_document_text_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small" />
+
+ <Button
+ android:id="@+id/remove_task_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
+ android:text="@string/remove_task_button_text"
+ android:onClick="onRemoveFromRecents" />
+
+</LinearLayout>
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/values/dimens.xml b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..061387a
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/values/dimens.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/values/strings.xml b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/values/strings.xml
new file mode 100644
index 0000000..56f801f
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/src/main/res/values/strings.xml
@@ -0,0 +1,28 @@
+<?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>
+
+ <string name="title_activity_main">MainActivity</string>
+ <string name="hello_new_document_counter">Hello Document %s!</string>
+ <string name="reusing_document_counter">Reusing Document %s!</string>
+ <string name="activity_new_document_title">DocumentActivity</string>
+ <string name="new_document_button_text">Create new document</string>
+ <string name="multiple_task_checkbox_label">Task per document</string>
+ <string name="remove_task_button_text">Remove from Recents</string>
+
+</resources>
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/tests/src/com/example/android/documentcentricrecents/tests/DocumentCentricRecentsInstrumentationTest.java b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/tests/src/com/example/android/documentcentricrecents/tests/DocumentCentricRecentsInstrumentationTest.java
new file mode 100644
index 0000000..3c17059
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/tests/src/com/example/android/documentcentricrecents/tests/DocumentCentricRecentsInstrumentationTest.java
@@ -0,0 +1,72 @@
+/*
+* Copyright (C) 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.
+*/
+
+package com.example.android.documentcentricrecents.tests;
+
+import com.example.android.documentcentricrecents.DocumentCentricActivity;
+import com.example.android.documentcentricrecents.R;
+
+import android.app.ActivityManager;
+import android.content.Context;
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.TouchUtils;
+import android.test.suitebuilder.annotation.LargeTest;
+import android.widget.Button;
+
+import java.util.List;
+
+/**
+ * Instrumentation tests for DocumentCentricRecents sample.
+ */
+@LargeTest
+public class DocumentCentricRecentsInstrumentationTest extends
+ ActivityInstrumentationTestCase2<DocumentCentricActivity> {
+
+ private DocumentCentricActivity mDocumentCentricActivity;
+
+ public DocumentCentricRecentsInstrumentationTest() {
+ super(DocumentCentricActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mDocumentCentricActivity = getActivity();
+ }
+
+ public void testNewDocument_CreatesRecentsEntry() {
+ // Given a initialized Activity
+ assertNotNull("mDocumentCentricActivity is null", mDocumentCentricActivity);
+ final Button createNewDocumentButton = (Button) mDocumentCentricActivity
+ .findViewById(R.id.new_document_button);
+ assertNotNull(createNewDocumentButton);
+
+ // When "Create new Document" Button is clicked
+ TouchUtils.clickView(this, createNewDocumentButton);
+
+ // Then a entry in recent app tasks is created.
+ List<ActivityManager.AppTask> recentAppTasks = getRecentAppTasks();
+ assertEquals("# of recentAppTasks does not match", 2, recentAppTasks.size());
+ }
+
+ private List<ActivityManager.AppTask> getRecentAppTasks() {
+ ActivityManager activityManager = (ActivityManager) getInstrumentation().getTargetContext()
+ .getSystemService(Context.ACTIVITY_SERVICE);
+ List<ActivityManager.AppTask> appTasks = activityManager.getAppTasks();
+ return appTasks;
+ }
+
+}
\ No newline at end of file
diff --git a/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/tests/src/com/example/android/documentcentricrecents/tests/DocumentCentricRecentsUnitTest.java b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/tests/src/com/example/android/documentcentricrecents/tests/DocumentCentricRecentsUnitTest.java
new file mode 100644
index 0000000..4c13002
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/DocumentCentricRecentsSample/tests/src/com/example/android/documentcentricrecents/tests/DocumentCentricRecentsUnitTest.java
@@ -0,0 +1,90 @@
+/*
+* Copyright (C) 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.
+*/
+
+package com.example.android.documentcentricrecents.tests;
+
+import com.example.android.documentcentricrecents.DocumentCentricActivity;
+import com.example.android.documentcentricrecents.R;
+
+import android.content.Intent;
+import android.test.ActivityUnitTestCase;
+import android.test.suitebuilder.annotation.LargeTest;
+import android.test.suitebuilder.annotation.MediumTest;
+import android.util.Log;
+import android.widget.Button;
+import android.widget.CheckBox;
+
+/**
+ * Unit tests for DocumentCentricRecents sample.
+ */
+@MediumTest
+public class DocumentCentricRecentsUnitTest extends ActivityUnitTestCase<DocumentCentricActivity> {
+
+ private DocumentCentricActivity mDocumentCentricActivity;
+
+ public DocumentCentricRecentsUnitTest() {
+ super(DocumentCentricActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ final Intent launchIntent = new Intent(getInstrumentation()
+ .getTargetContext(), DocumentCentricActivity.class);
+ mDocumentCentricActivity = startActivity(launchIntent, null, null);
+ }
+
+ public void testNewDocumentButton_IntentIsSentOnClick() {
+ // Given a initialized Activity
+ assertNotNull("mDocumentCentricActivity is null", mDocumentCentricActivity);
+ final Button createNewDocumentButton = (Button) mDocumentCentricActivity
+ .findViewById(R.id.new_document_button);
+ assertNotNull(createNewDocumentButton);
+
+ // When "Create new Document" Button is clicked
+ createNewDocumentButton.performClick();
+
+ // Then NewDocumentActivity is started with the correct flags
+ final Intent newDocumentIntent = getStartedActivityIntent();
+ assertNotNull("newDocumentIntent is null", newDocumentIntent);
+ assertEquals("intent is missing flag FLAG_ACTIVITY_NEW_DOCUMENT", Intent.FLAG_ACTIVITY_NEW_DOCUMENT,
+ newDocumentIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
+ }
+
+ public void testNewDocumentButton_FlagMultipleSetWhenCheckboxIsChecked() {
+ // Given a initialized Activity and ticked "Create new task" checkbox
+ assertNotNull("mDocumentCentricActivity is null", mDocumentCentricActivity);
+ final Button createNewDocumentButton = (Button) mDocumentCentricActivity
+ .findViewById(R.id.new_document_button);
+ assertNotNull(createNewDocumentButton);
+ final CheckBox newTaskCheckbox = (CheckBox) mDocumentCentricActivity
+ .findViewById(R.id.multiple_task_checkbox);
+ assertNotNull(newTaskCheckbox);
+ newTaskCheckbox.setChecked(true);
+
+ // When "Create new Document" Button is clicked
+ createNewDocumentButton.performClick();
+
+ // Then NewDocumentActivity is started with the new document and multiple task flags
+ final Intent newDocumentIntent = getStartedActivityIntent();
+ assertNotNull("newDocumentIntent is null", newDocumentIntent);
+ assertEquals("intent is missing flag FLAG_ACTIVITY_NEW_DOCUMENT", Intent.FLAG_ACTIVITY_NEW_DOCUMENT,
+ newDocumentIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
+ assertEquals("intent is missing flag FLAG_ACTIVITY_MULTIPLE_TASK", Intent.FLAG_ACTIVITY_MULTIPLE_TASK,
+ newDocumentIntent.getFlags() & Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
+ }
+
+}
\ No newline at end of file
diff --git a/ui/activitytasks/DocumentCentricRecents/build.gradle b/ui/activitytasks/DocumentCentricRecents/build.gradle
new file mode 100644
index 0000000..be1fa82
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/build.gradle
@@ -0,0 +1,14 @@
+
+
+
+
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+apply from: "../../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/activitytasks/DocumentCentricRecents/buildSrc/build.gradle b/ui/activitytasks/DocumentCentricRecents/buildSrc/build.gradle
new file mode 100644
index 0000000..e344a8c
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/activitytasks/DocumentCentricRecents/gradle/wrapper/gradle-wrapper.jar b/ui/activitytasks/DocumentCentricRecents/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRecents/gradle/wrapper/gradle-wrapper.properties b/ui/activitytasks/DocumentCentricRecents/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..56f685a
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
diff --git a/ui/activitytasks/DocumentCentricRecents/gradlew b/ui/activitytasks/DocumentCentricRecents/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/activitytasks/DocumentCentricRecents/gradlew.bat b/ui/activitytasks/DocumentCentricRecents/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/activitytasks/DocumentCentricRecents/settings.gradle b/ui/activitytasks/DocumentCentricRecents/settings.gradle
new file mode 100644
index 0000000..68519b4
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/settings.gradle
@@ -0,0 +1,4 @@
+
+
+
+include 'DocumentCentricRecentsSample'
diff --git a/ui/activitytasks/DocumentCentricRecents/template-params.xml b/ui/activitytasks/DocumentCentricRecents/template-params.xml
new file mode 100644
index 0000000..1e602d2
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRecents/template-params.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+
+
+
+<sample>
+ <name>DocumentCentricRecents</name>
+ <group>UI</group>
+ <package>com.example.android.documentcentricrecents</package>
+
+
+
+ <!-- change minSdk if needed-->
+ <minSdk>"android-L"</minSdk>
+ <compileSdkVersion>"android-L"</compileSdkVersion>
+
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample shows the basic usage of the new \"Document Centric Recents\" API.
+ It let\'s you create new documents in the recents history and persists its
+ state through reboots. If \"Task per document\" is checked a new task will be
+ created for every new document in recents.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+
+</sample>
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/.gitignore b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/proguard-project.txt b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/AndroidManifest.xml b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..9276d5c
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/AndroidManifest.xml
@@ -0,0 +1,50 @@
+<?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.
+-->
+
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.documentcentricrelinquishidentity"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="android-L"
+ android:targetSdkVersion="android-L" />
+
+ <application
+ android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/AppTheme">
+
+ <activity
+ android:name=".RelinquishIdentityActivity"
+ android:label="@string/activity_relinquish_title"
+ android:relinquishTaskIdentity="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name=".NewDocumentActivity"
+ android:label="@string/activity_new_document" />
+ </application>
+
+
+</manifest>
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/java/com/example/android/documentcentricrelinquishidentity/NewDocumentActivity.java b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/java/com/example/android/documentcentricrelinquishidentity/NewDocumentActivity.java
new file mode 100644
index 0000000..c3037d6
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/java/com/example/android/documentcentricrelinquishidentity/NewDocumentActivity.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 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.
+ */
+
+package com.example.android.documentcentricrelinquishidentity;
+
+import android.app.Activity;
+import android.app.ActivityManager;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.Bundle;
+
+/**
+ * Activity that changes its task identifiers by setting a new {@link android.app.ActivityManager.TaskDescription}
+ */
+public class NewDocumentActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_document);
+ // Set a new task description to change label and icon
+ setTaskDescription(newTaskDescription());
+ }
+
+ /**
+ * Creates a new {@link android.app.ActivityManager.TaskDescription} with a new label and icon to change the
+ * appearance of this activity in the recents stack.
+ */
+ private ActivityManager.TaskDescription newTaskDescription() {
+ Bitmap newIcon = BitmapFactory.decodeResource(getResources(), R.drawable.new_icon);
+ String newDocumentRecentsLabel = getString(R.string.new_document_recents_label);
+ ActivityManager.TaskDescription newTaskDescription = new ActivityManager.TaskDescription(
+ newDocumentRecentsLabel, newIcon);
+ return newTaskDescription;
+ }
+
+}
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/java/com/example/android/documentcentricrelinquishidentity/RelinquishIdentityActivity.java b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/java/com/example/android/documentcentricrelinquishidentity/RelinquishIdentityActivity.java
new file mode 100644
index 0000000..d2ce228
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/java/com/example/android/documentcentricrelinquishidentity/RelinquishIdentityActivity.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 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.
+ */
+
+package com.example.android.documentcentricrelinquishidentity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+/**
+ * Activities that serve as the root of a task may give up certain task identifiers to activities
+ * above it in the task stack. These identifiers include the task base Intent, and the task name,
+ * color and icon used in the recent task list. The base @link{Intent} is used to match the task when
+ * relaunching based on an incoming Intent.
+ *
+ * <p>
+ * To relinquish its identity the base activity must have the activity attribute
+ * android:relinquishTaskIdentity=”true” in the manifest.
+ * </p>
+ */
+public class RelinquishIdentityActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_relinquish_identity);
+ }
+
+ public void createNewDocument(View view) {
+ final Intent intent = newDocumentIntent();
+ startActivity(intent);
+ }
+
+ /**
+ * Returns an new intent to start {@link NewDocumentActivity}
+ * as a new document in recents..
+ */
+ private Intent newDocumentIntent() {
+ final Intent newDocumentIntent = new Intent(this, NewDocumentActivity.class);
+ newDocumentIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
+ // Always launch in a new task.
+ newDocumentIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
+ return newDocumentIntent;
+ }
+
+}
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-hdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..b1efaf4
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-hdpi/new_icon.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-hdpi/new_icon.png
new file mode 100755
index 0000000..34767f3
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-hdpi/new_icon.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-mdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..f5f9244
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-mdpi/new_icon.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-mdpi/new_icon.png
new file mode 100755
index 0000000..f1b91b9
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-mdpi/new_icon.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..5d07b3f
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xhdpi/new_icon.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xhdpi/new_icon.png
new file mode 100755
index 0000000..412a06d
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xhdpi/new_icon.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..6ef21e1
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xxhdpi/new_icon.png b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xxhdpi/new_icon.png
new file mode 100755
index 0000000..a159b16
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/drawable-xxhdpi/new_icon.png
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/layout/activity_document.xml b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/layout/activity_document.xml
new file mode 100644
index 0000000..b9f6755
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/layout/activity_document.xml
@@ -0,0 +1,35 @@
+<?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.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/Widget.SampleMessageTile"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ style="@style/Widget.SampleMessage"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/horizontal_page_margin"
+ android:layout_marginRight="@dimen/horizontal_page_margin"
+ android:layout_marginTop="@dimen/vertical_page_margin"
+ android:text="@string/go_to_recents_text" />
+
+</LinearLayout>
+
+
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/layout/activity_relinquish_identity.xml b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/layout/activity_relinquish_identity.xml
new file mode 100755
index 0000000..7552eae
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/layout/activity_relinquish_identity.xml
@@ -0,0 +1,50 @@
+<?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.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+
+ <LinearLayout
+ style="@style/Widget.SampleMessageTile"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ style="@style/Widget.SampleMessage"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/horizontal_page_margin"
+ android:layout_marginRight="@dimen/horizontal_page_margin"
+ android:layout_marginTop="@dimen/vertical_page_margin"
+ android:text="@string/intro_message" />
+ </LinearLayout>
+
+ <Button
+ android:id="@+id/new_document_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
+ android:padding="@dimen/margin_medium"
+ android:text="@string/new_document_button_text"
+ android:onClick="createNewDocument" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/values/dimens.xml b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..061387a
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/values/dimens.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/values/strings.xml b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/values/strings.xml
new file mode 100644
index 0000000..4ddf4c7
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/DocumentCentricRelinquishIdentitySample/src/main/res/values/strings.xml
@@ -0,0 +1,26 @@
+<?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>
+
+ <string name="activity_relinquish_title">RelinquishIdentityActivity</string>
+ <string name="activity_new_document">NewDocumentActivity</string>
+ <string name="new_document_button_text">Create new document</string>
+ <string name="new_document_recents_label">New Label</string>
+ <string name="go_to_recents_text">Click on the Recents button in the navigation bar to see the label and icon change in the recents stack.</string>
+
+</resources>
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/build.gradle b/ui/activitytasks/DocumentCentricRelinquishIdentity/build.gradle
new file mode 100644
index 0000000..be1fa82
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/build.gradle
@@ -0,0 +1,14 @@
+
+
+
+
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+apply from: "../../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/buildSrc/build.gradle b/ui/activitytasks/DocumentCentricRelinquishIdentity/buildSrc/build.gradle
new file mode 100644
index 0000000..e344a8c
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/gradle/wrapper/gradle-wrapper.jar b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/gradle/wrapper/gradle-wrapper.properties b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..56f685a
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/gradlew b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/gradlew.bat b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/settings.gradle b/ui/activitytasks/DocumentCentricRelinquishIdentity/settings.gradle
new file mode 100644
index 0000000..7b883bf
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/settings.gradle
@@ -0,0 +1,4 @@
+
+
+
+include 'DocumentCentricRelinquishIdentitySample'
diff --git a/ui/activitytasks/DocumentCentricRelinquishIdentity/template-params.xml b/ui/activitytasks/DocumentCentricRelinquishIdentity/template-params.xml
new file mode 100644
index 0000000..13e0309
--- /dev/null
+++ b/ui/activitytasks/DocumentCentricRelinquishIdentity/template-params.xml
@@ -0,0 +1,42 @@
+<?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.
+-->
+
+
+
+<sample>
+ <name>DocumentCentricRelinquishIdentity</name>
+ <group>UI</group>
+ <package>com.example.android.documentcentricrelinquishidentity</package>
+
+
+
+ <!-- change minSdk if needed-->
+ <minSdk>"android-L"</minSdk>
+ <compileSdkVersion>"android-L"</compileSdkVersion>
+
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample shows how to relinquish identity to activities above it in the task stack.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+
+</sample>
diff --git a/ui/graphics/PdfRendererBasic/Application/src/main/AndroidManifest.xml b/ui/graphics/PdfRendererBasic/Application/src/main/AndroidManifest.xml
index 6796ab9..2287067 100644
--- a/ui/graphics/PdfRendererBasic/Application/src/main/AndroidManifest.xml
+++ b/ui/graphics/PdfRendererBasic/Application/src/main/AndroidManifest.xml
@@ -20,8 +20,6 @@
android:versionCode="1"
android:versionName="1.0">
- <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />
-
<application android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
diff --git a/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/MainActivity.java b/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/MainActivity.java
index 54cb54d..6b7e8b4 100644
--- a/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/MainActivity.java
+++ b/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/MainActivity.java
@@ -24,13 +24,16 @@
public class MainActivity extends Activity {
+ public static final String FRAGMENT_PDF_RENDERER_BASIC = "pdf_renderer_basic";
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_real);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
- .add(R.id.container, new PdfRendererBasicFragment())
+ .add(R.id.container, new PdfRendererBasicFragment(),
+ FRAGMENT_PDF_RENDERER_BASIC)
.commit();
}
}
diff --git a/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/PdfRendererBasicFragment.java b/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/PdfRendererBasicFragment.java
index 2d8cf60..e413c65 100644
--- a/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/PdfRendererBasicFragment.java
+++ b/ui/graphics/PdfRendererBasic/Application/src/main/java/com/example/android/pdfrendererbasic/PdfRendererBasicFragment.java
@@ -193,6 +193,15 @@
getActivity().setTitle(getString(R.string.app_name_with_index, index + 1, pageCount));
}
+ /**
+ * Gets the number of pages in the PDF. This method is marked as public for testing.
+ *
+ * @return The number of pages.
+ */
+ public int getPageCount() {
+ return mPdfRenderer.getPageCount();
+ }
+
@Override
public void onClick(View view) {
switch (view.getId()) {
diff --git a/ui/graphics/PdfRendererBasic/Application/tests/AndroidManifest.xml b/ui/graphics/PdfRendererBasic/Application/tests/AndroidManifest.xml
new file mode 100644
index 0000000..35ff2a6
--- /dev/null
+++ b/ui/graphics/PdfRendererBasic/Application/tests/AndroidManifest.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest
+ package="com.example.android.pdfrendererbasic.tests"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="L"
+ android:targetSdkVersion="L"/>
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner"/>
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:label="Tests for com.example.android.pdfrendererbasic"
+ android:targetPackage="com.example.android.pdfrendererbasic"/>
+
+</manifest>
diff --git a/ui/graphics/PdfRendererBasic/Application/tests/src/com/example/android/pdfrendererbasic/tests/PdfRendererBasicFragmentTests.java b/ui/graphics/PdfRendererBasic/Application/tests/src/com/example/android/pdfrendererbasic/tests/PdfRendererBasicFragmentTests.java
new file mode 100644
index 0000000..0f94cbf
--- /dev/null
+++ b/ui/graphics/PdfRendererBasic/Application/tests/src/com/example/android/pdfrendererbasic/tests/PdfRendererBasicFragmentTests.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 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.
+ */
+
+package com.example.android.pdfrendererbasic.tests;
+
+import android.content.pm.ActivityInfo;
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.TouchUtils;
+import android.test.suitebuilder.annotation.LargeTest;
+import android.view.View;
+import android.widget.Button;
+
+import com.example.android.pdfrendererbasic.MainActivity;
+import com.example.android.pdfrendererbasic.PdfRendererBasicFragment;
+import com.example.android.pdfrendererbasic.R;
+
+/**
+ * Tests for PdfRendererBasic sample.
+ */
+public class PdfRendererBasicFragmentTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mActivity;
+ private PdfRendererBasicFragment mFragment;
+
+ private Button mButtonPrevious;
+ private Button mButtonNext;
+
+ public PdfRendererBasicFragmentTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ mFragment = (PdfRendererBasicFragment) mActivity.getFragmentManager()
+ .findFragmentByTag(MainActivity.FRAGMENT_PDF_RENDERER_BASIC);
+ }
+
+ @LargeTest
+ public void testActivityTitle() {
+ // The title of the activity should be "PdfRendererBasic (1/10)" at first
+ String expectedActivityTitle = mActivity.getString(R.string.app_name_with_index, 1,
+ mFragment.getPageCount());
+ assertEquals(expectedActivityTitle, mActivity.getTitle());
+ }
+
+ @LargeTest
+ public void testButtons_previousDisabledAtFirst() {
+ setUpButtons();
+ // Check that the previous button is disabled at first
+ assertFalse(mButtonPrevious.isEnabled());
+ // The next button should be enabled
+ assertTrue(mButtonNext.isEnabled());
+ }
+
+ @LargeTest
+ public void testButtons_bothEnabledInMiddle() {
+ setUpButtons();
+ turnPages(1);
+ // Two buttons should be both enabled
+ assertTrue(mButtonPrevious.isEnabled());
+ assertTrue(mButtonNext.isEnabled());
+ }
+
+ @LargeTest
+ public void testButtons_nextDisabledLastPage() {
+ setUpButtons();
+ int pageCount = mFragment.getPageCount();
+ // Click till it reaches the last page
+ turnPages(pageCount - 1);
+ // Check the page count
+ String expectedActivityTitle = mActivity.getString(R.string.app_name_with_index,
+ pageCount, pageCount);
+ assertEquals(expectedActivityTitle, mActivity.getTitle());
+ // The previous button should be enabled
+ assertTrue(mButtonPrevious.isEnabled());
+ // Check that the next button is disabled
+ assertFalse(mButtonNext.isEnabled());
+ }
+
+ @LargeTest
+ public void testOrientationChangePreserveState() {
+ mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ setUpButtons();
+ turnPages(1);
+ int pageCount = mFragment.getPageCount();
+ String expectedActivityTitle = mActivity.getString(R.string.app_name_with_index,
+ 2, pageCount);
+ assertEquals(expectedActivityTitle, mActivity.getTitle());
+ mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+ // Check that the title is the same after orientation change
+ assertEquals(expectedActivityTitle, mActivity.getTitle());
+ }
+
+ /**
+ * Prepares references to the buttons "Previous" and "Next".
+ */
+ private void setUpButtons() {
+ View view = mFragment.getView();
+ assertNotNull(view);
+ mButtonPrevious = (Button) view.findViewById(R.id.previous);
+ assertNotNull(mButtonPrevious);
+ mButtonNext = (Button) view.findViewById(R.id.next);
+ assertNotNull(mButtonNext);
+ }
+
+ /**
+ * Click the "Next" button to turn the pages.
+ *
+ * @param count The number of times to turn pages.
+ */
+ private void turnPages(int count) {
+ for (int i = 0; i < count; ++i) {
+ TouchUtils.clickView(this, mButtonNext);
+ }
+ }
+
+}
diff --git a/ui/graphics/PdfRendererBasic/settings.gradle b/ui/graphics/PdfRendererBasic/settings.gradle
index f34faad..9464a35 100644
--- a/ui/graphics/PdfRendererBasic/settings.gradle
+++ b/ui/graphics/PdfRendererBasic/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'PdfRendererBasicSample'
+include 'Application'
diff --git a/ui/notifications/LNotifications/Application/.gitignore b/ui/notifications/LNotifications/Application/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/notifications/LNotifications/Application/proguard-project.txt b/ui/notifications/LNotifications/Application/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/ui/notifications/LNotifications/Application/src/main/AndroidManifest.xml b/ui/notifications/LNotifications/Application/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..816d78f
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/AndroidManifest.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.lnotifications"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-permission android:name="android.permission.READ_CONTACTS" />
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name=".LNotificationActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/HeadsUpNotificationFragment.java b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/HeadsUpNotificationFragment.java
new file mode 100644
index 0000000..d304cf4
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/HeadsUpNotificationFragment.java
@@ -0,0 +1,134 @@
+/*
+* 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.
+*/
+
+package com.example.android.lnotifications;
+
+import android.app.Fragment;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.Toast;
+
+/**
+ * Fragment that demonstrates options for displaying Heads-Up Notifications.
+ */
+public class HeadsUpNotificationFragment extends Fragment {
+
+ /**
+ * NotificationId used for the notifications from this Fragment.
+ */
+ private static final int NOTIFICATION_ID = 1;
+
+ private NotificationManager mNotificationManager;
+
+ /**
+ * Button to show a notification.
+ */
+ private Button mShowNotificationButton;
+
+ /**
+ * If checked, notifications that this Fragment creates will be displayed as Heads-Up
+ * Notifications.
+ */
+ private CheckBox mUseHeadsUpCheckbox;
+
+ /**
+ * Use this factory method to create a new instance of
+ * this fragment using the provided parameters.
+ *
+ * @return A new instance of fragment NotificationFragment.
+ */
+ public static HeadsUpNotificationFragment newInstance() {
+ HeadsUpNotificationFragment fragment = new HeadsUpNotificationFragment();
+ fragment.setRetainInstance(true);
+ return fragment;
+ }
+
+ public HeadsUpNotificationFragment() {
+ // Required empty public constructor
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mNotificationManager = (NotificationManager) getActivity().getSystemService(Context
+ .NOTIFICATION_SERVICE);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_heads_up_notification, container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ mShowNotificationButton = (Button) view.findViewById(R.id.show_notification_button);
+ mShowNotificationButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mNotificationManager.notify(NOTIFICATION_ID, createNotification(
+ mUseHeadsUpCheckbox.isChecked()));
+ Toast.makeText(getActivity(), "Show Notification clicked", Toast.LENGTH_SHORT).show();
+ }
+ });
+ mUseHeadsUpCheckbox = (CheckBox) view.findViewById(R.id.use_heads_up_checkbox);
+ }
+
+ /**
+ * Creates a new notification depending on the argument.
+ *
+ * @param makeHeadsUpNotification A boolean value to indicating whether a notification will be
+ * created as a heads-up notification or not.
+ * <ul>
+ * <li>true : Creates a heads-up notification.</li>
+ * <li>false : Creates a non-heads-up notification.</li>
+ * </ul>
+ *
+ * @return A Notification instance.
+ */
+ //@VisibleForTesting
+ Notification createNotification(boolean makeHeadsUpNotification) {
+ Notification.Builder notificationBuilder = new Notification.Builder(getActivity())
+ .setSmallIcon(R.drawable.ic_launcher_notification)
+ .setPriority(Notification.PRIORITY_DEFAULT)
+ .setCategory(Notification.CATEGORY_MESSAGE)
+ .setContentTitle("Sample Notification")
+ .setContentText("This is a normal notification.");
+ if (makeHeadsUpNotification) {
+ Intent push = new Intent();
+ push.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ push.setClass(getActivity(), LNotificationActivity.class);
+
+ PendingIntent fullScreenPendingIntent = PendingIntent.getActivity(getActivity(), 0,
+ push, PendingIntent.FLAG_CANCEL_CURRENT);
+ notificationBuilder
+ .setContentText("Heads-Up Notification on Android L or above.")
+ .setFullScreenIntent(fullScreenPendingIntent, true);
+ }
+ return notificationBuilder.build();
+ }
+}
diff --git a/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/LNotificationActivity.java b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/LNotificationActivity.java
new file mode 100644
index 0000000..fbc3e62
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/LNotificationActivity.java
@@ -0,0 +1,80 @@
+/*
+* 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.
+*/
+
+package com.example.android.lnotifications;
+
+import android.app.ActionBar;
+import android.app.Activity;
+import android.app.Fragment;
+import android.app.FragmentTransaction;
+import android.os.Bundle;
+
+/**
+ * Launcher Activity for the L Notification samples application.
+ */
+public class LNotificationActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_notification);
+ setTitle(R.string.title_lnotification_activity);
+ ActionBar actionBar = getActionBar();
+
+ // Use ViewPager in the support library where possible.
+ // At this time, the support library for L is not ready so using the deprecated method
+ // to create tabs.
+ actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
+ ActionBar.Tab tabHeadsUpNotification = actionBar.newTab().setText("Heads Up");
+ ActionBar.Tab tabVisibilityMetadata = actionBar.newTab().setText("Visibility");
+ ActionBar.Tab tabOtherMetadata = actionBar.newTab().setText("Others");
+ tabHeadsUpNotification.setTabListener(new FragmentTabListener(HeadsUpNotificationFragment
+ .newInstance()));
+ tabVisibilityMetadata.setTabListener(new FragmentTabListener(VisibilityMetadataFragment
+ .newInstance()));
+ tabOtherMetadata.setTabListener(new FragmentTabListener(OtherMetadataFragment.newInstance
+ ()));
+ actionBar.addTab(tabHeadsUpNotification, 0);
+ actionBar.addTab(tabVisibilityMetadata, 1);
+ actionBar.addTab(tabOtherMetadata, 2);
+ }
+
+ /**
+ * TabListener that replaces a Fragment when a tab is clicked.
+ */
+ private static class FragmentTabListener implements ActionBar.TabListener {
+ public Fragment fragment;
+
+ public FragmentTabListener(Fragment fragment) {
+ this.fragment = fragment;
+ }
+
+ @Override
+ public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
+ //do nothing.
+ }
+
+ @Override
+ public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
+ ft.replace(R.id.container, fragment);
+ }
+
+ @Override
+ public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
+ ft.remove(fragment);
+ }
+ }
+}
diff --git a/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/OtherMetadataFragment.java b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/OtherMetadataFragment.java
new file mode 100644
index 0000000..51616e7
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/OtherMetadataFragment.java
@@ -0,0 +1,345 @@
+/*
+* 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.
+*/
+
+package com.example.android.lnotifications;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Bundle;
+import android.provider.ContactsContract;
+import android.provider.MediaStore;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.io.IOException;
+import java.util.Random;
+
+/**
+ * Fragment that demonstrates how to attach metadata introduced in Android L, such as
+ * priority data, notification category and person data.
+ */
+public class OtherMetadataFragment extends Fragment {
+
+ private static final String TAG = OtherMetadataFragment.class.getSimpleName();
+
+ /**
+ * Request code used for picking a contact.
+ */
+ public static final int REQUEST_CODE_PICK_CONTACT = 1;
+
+ /**
+ * Incremental Integer used for ID for notifications so that each notification will be
+ * treated differently.
+ */
+ private Integer mIncrementalNotificationId = Integer.valueOf(0);
+
+ private NotificationManager mNotificationManager;
+
+ /**
+ * Button to show a notification.
+ */
+ private Button mShowNotificationButton;
+
+ /**
+ * Spinner that holds possible categories used for a notification as
+ * {@link Notification.Builder#setCategory(String)}.
+ */
+ private Spinner mCategorySpinner;
+
+ /**
+ * Spinner that holds possible priorities used for a notification as
+ * {@link Notification.Builder#setPriority(int)}.
+ */
+ private Spinner mPrioritySpinner;
+
+ /**
+ * Holds a URI for the person to be attached to the notification.
+ */
+ //@VisibleForTesting
+ Uri mContactUri;
+
+ /**
+ * Use this factory method to create a new instance of
+ * this fragment using the provided parameters.
+ *
+ * @return A new instance of fragment NotificationFragment.
+ */
+ public static OtherMetadataFragment newInstance() {
+ OtherMetadataFragment fragment = new OtherMetadataFragment();
+ fragment.setRetainInstance(true);
+ return fragment;
+ }
+
+ public OtherMetadataFragment() {
+ // Required empty public constructor
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mNotificationManager = (NotificationManager) getActivity().getSystemService(Context
+ .NOTIFICATION_SERVICE);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_other_metadata, container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ mShowNotificationButton = (Button) view.findViewById(R.id.show_notification_button);
+ mShowNotificationButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Priority selectedPriority = (Priority) mPrioritySpinner.getSelectedItem();
+ Category selectedCategory = (Category) mCategorySpinner.getSelectedItem();
+ showNotificationClicked(selectedPriority, selectedCategory, mContactUri);
+ }
+ });
+
+ mCategorySpinner = (Spinner) view.findViewById(R.id.category_spinner);
+ ArrayAdapter<Category> categoryArrayAdapter = new ArrayAdapter<Category>(getActivity(),
+ android.R.layout.simple_spinner_item, Category.values());
+ categoryArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ mCategorySpinner.setAdapter(categoryArrayAdapter);
+
+ mPrioritySpinner = (Spinner) view.findViewById(R.id.priority_spinner);
+ ArrayAdapter<Priority> priorityArrayAdapter = new ArrayAdapter<Priority>(getActivity(),
+ android.R.layout.simple_spinner_item, Priority.values());
+ priorityArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ mPrioritySpinner.setAdapter(priorityArrayAdapter);
+
+ view.findViewById(R.id.attach_person).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ findContact();
+ }
+ });
+
+ view.findViewById(R.id.contact_entry).setVisibility(View.GONE);
+ }
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ switch (requestCode) {
+ case REQUEST_CODE_PICK_CONTACT:
+ if (resultCode == Activity.RESULT_OK) {
+ Uri contactUri = data.getData();
+ mContactUri = contactUri;
+ updateContactEntryFromUri(contactUri);
+ }
+ break;
+ }
+ }
+
+ /**
+ * Invoked when {@link #mShowNotificationButton} is clicked.
+ * Creates a new notification and sets metadata passed as arguments.
+ *
+ * @param priority The priority metadata.
+ * @param category The category metadata.
+ * @param contactUri The URI to be added to the new notification as metadata.
+ *
+ * @return A Notification instance.
+ */
+ //@VisibleForTesting
+ Notification createNotification(Priority priority, Category category, Uri contactUri) {
+ Notification.Builder notificationBuilder = new Notification.Builder(getActivity())
+ .setContentTitle("Notification with other metadata")
+ .setSmallIcon(R.drawable.ic_launcher_notification)
+ .setPriority(priority.value)
+ .setCategory(category.value)
+ .setContentText(String.format("Category %s, Priority %s", category.value,
+ priority.name()));
+ if (contactUri != null) {
+ notificationBuilder.addPerson(contactUri.toString());
+ Bitmap photoBitmap = loadBitmapFromContactUri(contactUri);
+ if (photoBitmap != null) {
+ notificationBuilder.setLargeIcon(photoBitmap);
+ }
+ }
+ return notificationBuilder.build();
+ }
+
+ /**
+ * Invoked when {@link #mShowNotificationButton} is clicked.
+ * Creates a new notification and sets metadata passed as arguments.
+ *
+ * @param priority The priority metadata.
+ * @param category The category metadata.
+ * @param contactUri The URI to be added to the new notification as metadata.
+ */
+ private void showNotificationClicked(Priority priority, Category category, Uri contactUri) {
+ // Assigns a unique (incremented) notification ID in order to treat each notification as a
+ // different one. This helps demonstrate how a priority flag affects ordering.
+ mIncrementalNotificationId = new Integer(mIncrementalNotificationId + 1);
+ mNotificationManager.notify(mIncrementalNotificationId, createNotification(priority,
+ category, contactUri));
+ Toast.makeText(getActivity(), "Show Notification clicked", Toast.LENGTH_SHORT).show();
+ }
+
+ private void findContact() {
+ Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
+ startActivityForResult(intent, REQUEST_CODE_PICK_CONTACT);
+ }
+
+ /**
+ * Returns a {@link Bitmap} from the Uri specified as the argument.
+ *
+ * @param contactUri The Uri from which the result Bitmap is created.
+ * @return The {@link Bitmap} instance retrieved from the contactUri.
+ */
+ private Bitmap loadBitmapFromContactUri(Uri contactUri) {
+ if (contactUri == null) {
+ return null;
+ }
+ Bitmap result = null;
+ Cursor cursor = getActivity().getContentResolver().query(contactUri, null, null, null,
+ null);
+ if (cursor != null && cursor.moveToFirst()) {
+ int idx = cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_ID);
+ String hasPhoto = cursor.getString(idx);
+ Uri photoUri = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo
+ .CONTENT_DIRECTORY);
+ if (hasPhoto != null) {
+ try {
+ result = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver()
+ , photoUri);
+ } catch (IOException e) {
+ Log.e(TAG, String.format("Failed to load resource. Uri %s", photoUri), e);
+ }
+ } else {
+ Drawable defaultContactDrawable = getActivity().getResources().getDrawable(R
+ .drawable.ic_contact_picture);
+ result = ((BitmapDrawable) defaultContactDrawable).getBitmap();
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Updates the Contact information on the screen when a contact is picked.
+ *
+ * @param contactUri The Uri from which the contact is retrieved.
+ */
+ private void updateContactEntryFromUri(Uri contactUri) {
+ Cursor cursor = getActivity().getContentResolver().query(contactUri, null, null, null,
+ null);
+ if (cursor != null && cursor.moveToFirst()) {
+ int idx = cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
+ String name = cursor.getString(idx);
+ idx = cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_ID);
+ String hasPhoto = cursor.getString(idx);
+
+ Uri photoUri = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo
+ .CONTENT_DIRECTORY);
+ ImageView contactPhoto = (ImageView) getActivity().findViewById(R.id.contact_photo);
+ if (hasPhoto != null) {
+ contactPhoto.setImageURI(photoUri);
+ } else {
+ Drawable defaultContactDrawable = getActivity().getResources().getDrawable(R
+ .drawable.ic_contact_picture);
+ contactPhoto.setImageDrawable(defaultContactDrawable);
+ }
+ TextView contactName = (TextView) getActivity().findViewById(R.id.contact_name);
+ contactName.setText(name);
+
+ getActivity().findViewById(R.id.contact_entry).setVisibility(View.VISIBLE);
+ getActivity().findViewById(R.id.attach_person).setVisibility(View.GONE);
+ getActivity().findViewById(R.id.click_to_change).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ findContact();
+ }
+ });
+ Log.i(TAG, String.format("Contact updated. Name %s, PhotoUri %s", name, photoUri));
+ }
+ }
+
+ /**
+ * Enum indicating possible categories in {@link Notification} used from
+ * {@link #mCategorySpinner}.
+ */
+ //@VisibleForTesting
+ static enum Category {
+ ALARM("alarm"),
+ CALL("call"),
+ EMAIL("email"),
+ ERROR("err"),
+ EVENT("event"),
+ MESSAGE("msg"),
+ PROGRESS("progress"),
+ PROMO("promo"),
+ RECOMMENDATION("recommendation"),
+ SERVICE("service"),
+ SOCIAL("social"),
+ STATUS("status"),
+ SYSTEM("sys"),
+ TRANSPORT("transport");
+
+ private final String value;
+
+ Category(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return value;
+ }
+ }
+
+ /**
+ * Enum indicating possible priorities in {@link Notification} used from
+ * {@link #mPrioritySpinner}.
+ */
+ //@VisibleForTesting
+ static enum Priority {
+ DEFAULT(Notification.PRIORITY_DEFAULT),
+ MAX(Notification.PRIORITY_MAX),
+ HIGH(Notification.PRIORITY_HIGH),
+ LOW(Notification.PRIORITY_LOW),
+ MIN(Notification.PRIORITY_MIN);
+
+ private final int value;
+
+ Priority(int value) {
+ this.value = value;
+ }
+ }
+}
diff --git a/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/VisibilityMetadataFragment.java b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/VisibilityMetadataFragment.java
new file mode 100644
index 0000000..616632b
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/java/com/example/android/lnotifications/VisibilityMetadataFragment.java
@@ -0,0 +1,202 @@
+/*
+* 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.
+*/
+
+package com.example.android.lnotifications;
+
+import android.app.Fragment;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.content.Context;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.RadioGroup;
+import android.widget.Toast;
+
+import java.util.Random;
+
+
+/**
+ * Fragment that demonstrates how notifications with different visibility metadata differ on
+ * a lockscreen.
+ */
+public class VisibilityMetadataFragment extends Fragment {
+
+ private NotificationManager mNotificationManager;
+
+ /**
+ * {@link RadioGroup} that has Visibility RadioButton in its children.
+ */
+ private RadioGroup mRadioGroup;
+
+ /**
+ * Incremental Integer used for ID for notifications so that each notification will be
+ * treated differently.
+ */
+ private Integer mIncrementalNotificationId = Integer.valueOf(0);
+
+ /**
+ * Button to show a notification.
+ */
+ private Button mShowNotificationButton;
+
+ /**
+ * Use this factory method to create a new instance of
+ * this fragment using the provided parameters.
+ *
+ * @return A new instance of fragment NotificationFragment.
+ */
+ public static VisibilityMetadataFragment newInstance() {
+ VisibilityMetadataFragment fragment = new VisibilityMetadataFragment();
+ fragment.setRetainInstance(true);
+ return fragment;
+ }
+
+ public VisibilityMetadataFragment() {
+ // Required empty public constructor
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mNotificationManager = (NotificationManager) getActivity().getSystemService(Context
+ .NOTIFICATION_SERVICE);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_visibility_metadata_notification, container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ mShowNotificationButton = (Button) view.findViewById(R.id.show_notification_button);
+ mShowNotificationButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ NotificationVisibility visibility = getVisibilityFromSelectedRadio(mRadioGroup);
+ showNotificationClicked(visibility);
+ }
+ });
+ mRadioGroup = (RadioGroup) view.findViewById(R.id.visibility_radio_group);
+ }
+
+ /**
+ * Creates a new notification with a different visibility level.
+ *
+ * @param visibility The visibility of the notification to be created.
+ *
+ * @return A Notification instance.
+ */
+ //@VisibleForTesting
+ Notification createNotification(NotificationVisibility visibility) {
+ Notification.Builder notificationBuilder = new Notification.Builder(getActivity())
+ .setContentTitle("Notification for Visibility metadata");
+
+ notificationBuilder.setVisibility(visibility.getVisibility());
+ notificationBuilder.setContentText(String.format("Visibility : %s",
+ visibility.getDescription()));
+ notificationBuilder.setSmallIcon(visibility.getNotificationIconId());
+
+ return notificationBuilder.build();
+ }
+
+ /**
+ * Returns a {@link NotificationVisibility} depending on which RadioButton in the radiogroup
+ * is selected.
+ *
+ * @param radiogroup The RadioGroup.
+ * @return The instance of {@link NotificationVisibility} corresponding to RadioButton.
+ */
+ private NotificationVisibility getVisibilityFromSelectedRadio(RadioGroup radiogroup) {
+ switch (radiogroup.getCheckedRadioButtonId()) {
+ case R.id.visibility_public_radio_button:
+ return NotificationVisibility.PUBLIC;
+ case R.id.visibility_private_radio_button:
+ return NotificationVisibility.PRIVATE;
+ case R.id.visibility_secret_radio_button:
+ return NotificationVisibility.SECRET;
+ default:
+ //If not selected, returns PUBLIC as default.
+ return NotificationVisibility.PUBLIC;
+ }
+ }
+
+ /**
+ * Invoked when {@link #mShowNotificationButton} is clicked.
+ * Creates a new notification with a different visibility level.
+ *
+ * @param visibility The visibility of the notification to be created.
+ */
+ private void showNotificationClicked(NotificationVisibility visibility) {
+ // Assigns a unique (incremented) notification ID in order to treat each notification as a
+ // different one. This helps demonstrate how a notification with a different visibility
+ // level differs on the lockscreen.
+ mIncrementalNotificationId = new Integer(mIncrementalNotificationId + 1);
+ mNotificationManager.notify(mIncrementalNotificationId, createNotification(visibility));
+ Toast.makeText(getActivity(), "Show Notification clicked", Toast.LENGTH_SHORT).show();
+ }
+
+ /**
+ * Enum indicating possible visibility levels for notifications and related data(String
+ * representation of visibility levels, an icon ID to create a notification) to
+ * create a notification.
+ */
+ //@VisibleForTesting
+ static enum NotificationVisibility {
+ PUBLIC(Notification.VISIBILITY_PUBLIC, "Public", R.drawable.ic_public_notification),
+ PRIVATE(Notification.VISIBILITY_PRIVATE, "Private", R.drawable.ic_private_notification),
+ SECRET(Notification.VISIBILITY_SECRET, "Secret", R.drawable.ic_secret_notification);
+
+ /**
+ * Visibility level of the notification.
+ */
+ private final int mVisibility;
+
+ /**
+ * String representation of the visibility.
+ */
+ private final String mDescription;
+
+ /**
+ * Id of an icon used for notifications created from the visibility.
+ */
+ private final int mNotificationIconId;
+
+ NotificationVisibility(int visibility, String description, int notificationIconId) {
+ mVisibility = visibility;
+ mDescription = description;
+ mNotificationIconId = notificationIconId;
+ }
+
+ public int getVisibility() {
+ return mVisibility;
+ }
+
+ public String getDescription() {
+ return mDescription;
+ }
+
+ public int getNotificationIconId() {
+ return mNotificationIconId;
+ }
+ }
+}
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_contact_picture.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_contact_picture.png
new file mode 100644
index 0000000..00d0ec4
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_contact_picture.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_launcher.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..015d248
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_launcher_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_launcher_notification.png
new file mode 100644
index 0000000..4b058c1
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_launcher_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_private.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_private.png
new file mode 100644
index 0000000..663f93e
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_private.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_private_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_private_notification.png
new file mode 100644
index 0000000..dbf5139
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_private_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_public.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_public.png
new file mode 100644
index 0000000..033281d
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_public.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_public_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_public_notification.png
new file mode 100644
index 0000000..fe1ee81
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_public_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_secret.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_secret.png
new file mode 100644
index 0000000..a22dbdf
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_secret.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_secret_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_secret_notification.png
new file mode 100644
index 0000000..5776624
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-hdpi/ic_secret_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_contact_picture.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_contact_picture.png
new file mode 100644
index 0000000..771cb6b
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_contact_picture.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_launcher.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..605a256
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_launcher_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_launcher_notification.png
new file mode 100644
index 0000000..72cd1b3
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_launcher_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_private.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_private.png
new file mode 100644
index 0000000..2556153
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_private.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_private_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_private_notification.png
new file mode 100644
index 0000000..df93964
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_private_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_public.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_public.png
new file mode 100644
index 0000000..ff0c653
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_public.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_public_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_public_notification.png
new file mode 100644
index 0000000..7c69019
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_public_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_secret.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_secret.png
new file mode 100644
index 0000000..2843164
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_secret.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_secret_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_secret_notification.png
new file mode 100644
index 0000000..652e8b0
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-mdpi/ic_secret_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_contact_picture.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_contact_picture.png
new file mode 100644
index 0000000..bdba57b
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_contact_picture.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..c08bafa
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_launcher_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_launcher_notification.png
new file mode 100644
index 0000000..9a42c7a
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_launcher_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_private.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_private.png
new file mode 100644
index 0000000..823d942
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_private.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_private_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_private_notification.png
new file mode 100644
index 0000000..497a1ac
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_private_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_public.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_public.png
new file mode 100644
index 0000000..93b89ff
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_public.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_public_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_public_notification.png
new file mode 100644
index 0000000..1d6f1f1
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_public_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_secret.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_secret.png
new file mode 100644
index 0000000..5124eee
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_secret.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_secret_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_secret_notification.png
new file mode 100644
index 0000000..8388dd5
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xhdpi/ic_secret_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_contact_picture.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_contact_picture.png
new file mode 100644
index 0000000..b36ec17
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_contact_picture.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..1224b39
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_launcher_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_launcher_notification.png
new file mode 100644
index 0000000..e25fff1
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_launcher_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_private.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_private.png
new file mode 100644
index 0000000..4e4d3d6
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_private.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_private_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_private_notification.png
new file mode 100644
index 0000000..dd5de27
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_private_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_public.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_public.png
new file mode 100644
index 0000000..6aede4e
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_public.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_public_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_public_notification.png
new file mode 100644
index 0000000..9b8c59f
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_public_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_secret.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_secret.png
new file mode 100644
index 0000000..d1e126c
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_secret.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_secret_notification.png b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_secret_notification.png
new file mode 100644
index 0000000..be59c8f
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/drawable-xxhdpi/ic_secret_notification.png
Binary files differ
diff --git a/ui/notifications/LNotifications/Application/src/main/res/layout/activity_notification.xml b/ui/notifications/LNotifications/Application/src/main/res/layout/activity_notification.xml
new file mode 100644
index 0000000..cd0cd68
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/layout/activity_notification.xml
@@ -0,0 +1,27 @@
+<!--
+ 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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ tools:context="com.example.android.lnotifications.LNotificationActivity">
+</FrameLayout>
diff --git a/ui/notifications/LNotifications/Application/src/main/res/layout/contact_entry.xml b/ui/notifications/LNotifications/Application/src/main/res/layout/contact_entry.xml
new file mode 100644
index 0000000..90ab4b8
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/layout/contact_entry.xml
@@ -0,0 +1,50 @@
+<?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.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <ImageView
+ android:id="@+id/contact_photo"
+ android:layout_width="96dp"
+ android:layout_height="96dp"
+ android:src="@drawable/ic_contact_picture"
+ />
+
+ <TextView
+ android:id="@+id/contact_name"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_toRightOf="@id/contact_photo"
+ />
+
+ <TextView
+ android:id="@+id/click_to_change"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="10dp"
+ android:layout_marginLeft="10dp"
+ android:clickable="true"
+ android:layout_below="@id/contact_name"
+ android:layout_toRightOf="@id/contact_photo"
+ android:text="@string/click_to_change"
+ android:textColor="@color/link_text"
+ />
+</RelativeLayout>
\ No newline at end of file
diff --git a/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_heads_up_notification.xml b/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_heads_up_notification.xml
new file mode 100644
index 0000000..bbcb84b
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_heads_up_notification.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/heads_up_notification_description"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/heads_up_notification_description"
+ />
+
+ <CheckBox
+ android:id="@+id/use_heads_up_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/heads_up_notification_description"
+ android:text="@string/use_heads_up_notification_where_possible"/>
+
+ <Button
+ android:id="@+id/show_notification_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_marginTop="20dp"
+ android:text="@string/show_notification"
+ />
+</LinearLayout>
\ No newline at end of file
diff --git a/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_other_metadata.xml b/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_other_metadata.xml
new file mode 100644
index 0000000..5222302
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_other_metadata.xml
@@ -0,0 +1,107 @@
+<?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.
+-->
+
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
+
+ <LinearLayout android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/notification_metadata_description"
+ />
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_medium"
+ android:orientation="horizontal"
+ android:paddingLeft="@dimen/margin_tiny"
+ android:paddingRight="@dimen/margin_tiny"
+ >
+
+ <TextView
+ android:layout_width="70dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:text="@string/label_category"
+ />
+ <Spinner
+ android:id="@+id/category_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_medium"
+ android:orientation="horizontal"
+ android:paddingLeft="@dimen/margin_tiny"
+ android:paddingRight="@dimen/margin_tiny"
+ >
+ <TextView
+ android:layout_width="70dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:text="@string/label_priority"
+ />
+ <Spinner
+ android:id="@+id/priority_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/attach_person"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_medium"
+ android:clickable="true"
+ android:text="@string/attach_person"
+ android:textColor="@color/link_text"
+ android:paddingLeft="@dimen/margin_tiny"
+ android:paddingRight="@dimen/margin_tiny"
+ />
+
+ <include
+ layout="@layout/contact_entry"
+ android:id="@+id/contact_entry"
+ android:layout_marginTop="@dimen/margin_medium"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:paddingLeft="@dimen/margin_tiny"
+ android:paddingRight="@dimen/margin_tiny"
+ />
+
+ <Button
+ android:id="@+id/show_notification_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_medium"
+ android:text="@string/show_notification"
+ />
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_visibility_metadata_notification.xml b/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_visibility_metadata_notification.xml
new file mode 100644
index 0000000..2a7bbca
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/layout/fragment_visibility_metadata_notification.xml
@@ -0,0 +1,71 @@
+<?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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/visibility_metadata_notification_description"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/visibility_metadata_description"
+ />
+
+ <RadioGroup
+ android:id="@+id/visibility_radio_group"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:checkedButton="@+id/visibility_public_radio_button"
+ android:layout_marginTop="20dp">
+
+ <RadioButton
+ android:id="@+id/visibility_public_radio_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableLeft="@drawable/ic_public"
+ android:text="@string/visibility_public"
+ />
+
+ <RadioButton
+ android:id="@+id/visibility_private_radio_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableLeft="@drawable/ic_private"
+ android:text="@string/visibility_private"
+ />
+
+ <RadioButton
+ android:id="@+id/visibility_secret_radio_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableLeft="@drawable/ic_secret"
+ android:text="@string/visibility_secret"
+ />
+
+ </RadioGroup>
+
+ <Button
+ android:id="@+id/show_notification_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_marginTop="20dp"
+ android:text="@string/show_notification"
+ />
+</LinearLayout>
\ No newline at end of file
diff --git a/ui/notifications/LNotifications/Application/src/main/res/values/colors.xml b/ui/notifications/LNotifications/Application/src/main/res/values/colors.xml
new file mode 100644
index 0000000..31d81ee
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/values/colors.xml
@@ -0,0 +1,20 @@
+<!--
+ 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>
+ <color name="black_overlay">#66000000</color>
+ <color name="link_text">#6DB7C4</color>
+</resources>
diff --git a/ui/notifications/LNotifications/Application/src/main/res/values/dimens.xml b/ui/notifications/LNotifications/Application/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..a776bac
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/values/dimens.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+ <dimen name="navigation_drawer_width">240dp</dimen>
+
+</resources>
diff --git a/ui/notifications/LNotifications/Application/src/main/res/values/strings.xml b/ui/notifications/LNotifications/Application/src/main/res/values/strings.xml
new file mode 100644
index 0000000..e6cb124
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/src/main/res/values/strings.xml
@@ -0,0 +1,43 @@
+<?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>
+ <string name="action_settings">Settings</string>
+ <string name="heads_up_notification_description">This sample demonstrates options for displaying Heads-Up Notifications on Android.
+ \n\n
+ On Android L or above, you have options to display important information in front of the user (Heads-Up Notifications) which
+ does not obscure the entire viewport.\n</string>
+ <string name="notification_metadata_description">This sample demonstrates how to attach
+ metadata introduced in Android L, such as
+ priority data, notification category and person data.\n
+ </string>
+ <string name="visibility_metadata_description">
+ This sample demonstrates how to attach visibility metadata.\n
+ You need to have your lockscreen secured(PIN, Pattern, or Password) if you don\'t want to
+ show sensitive information on it.
+ </string>
+ <string name="visibility_public">Public</string>
+ <string name="visibility_private">Private</string>
+ <string name="visibility_secret">Secret</string>
+ <string name="title_lnotification_activity">Notification samples for L</string>
+ <string name="attach_person">Attach Person</string>
+ <string name="click_to_change">Click to Change</string>
+ <string name="show_notification">Show notification</string>
+ <string name="use_heads_up_notification_where_possible">Use Heads Up Notification when possible</string>
+ <string name="label_category">Category</string>
+ <string name="label_priority">Priority</string>
+</resources>
diff --git a/ui/notifications/LNotifications/Application/tests/AndroidManifest.xml b/ui/notifications/LNotifications/Application/tests/AndroidManifest.xml
new file mode 100644
index 0000000..84f916f
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<!--
+ Copyright (C) 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest
+ package="com.example.android.lnotifications.tests"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="8"
+ android:targetSdkVersion="19"/>
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner"/>
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:label="Tests for L notifications sample"
+ android:targetPackage="com.example.android.lnotifications"/>
+
+</manifest>
\ No newline at end of file
diff --git a/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/HeadsUpNotificationFragmentTest.java b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/HeadsUpNotificationFragmentTest.java
new file mode 100644
index 0000000..1264c16
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/HeadsUpNotificationFragmentTest.java
@@ -0,0 +1,51 @@
+package com.example.android.lnotifications;
+
+import android.app.Notification;
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+ * Unit tests for {@link HeadsUpNotificationFragment}.
+ */
+public class HeadsUpNotificationFragmentTest extends
+ ActivityInstrumentationTestCase2<LNotificationActivity> {
+
+ private LNotificationActivity mActivity;
+ private HeadsUpNotificationFragment mFragment;
+
+ public HeadsUpNotificationFragmentTest() {
+ super(LNotificationActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ // The first tab should be {@link HeadsUpNotificationFragment}, that is tested in the
+ // {@link LNotificationActivityTest}.
+ mActivity.getActionBar().setSelectedNavigationItem(0);
+ getInstrumentation().waitForIdleSync();
+ mFragment = (HeadsUpNotificationFragment) mActivity.getFragmentManager()
+ .findFragmentById(R.id.container);
+ }
+
+ public void testPreconditions() {
+ assertNotNull(mActivity);
+ assertNotNull(mFragment);
+ assertNotNull(mActivity.findViewById(R.id.heads_up_notification_description));
+ assertNotNull(mActivity.findViewById(R.id.show_notification_button));
+ assertNotNull(mActivity.findViewById(R.id.use_heads_up_checkbox));
+ }
+
+ public void testCreateNotification_verifyFullScreenIntentIsNotNull() {
+ Notification notification = mFragment.createNotification(true);
+ assertNotNull(notification.fullScreenIntent);
+ }
+
+ public void testCreateNotification_verifyFullScreenIntentIsNull() {
+ Notification notification = mFragment.createNotification(false);
+ assertNull(notification.fullScreenIntent);
+ }
+
+ // If Mockito can be used, mock the NotificationManager and tests Notifications are actually
+ // created.
+}
diff --git a/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/LNotificationActivityTest.java b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/LNotificationActivityTest.java
new file mode 100644
index 0000000..061f9e8
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/LNotificationActivityTest.java
@@ -0,0 +1,49 @@
+package com.example.android.lnotifications;
+
+import android.app.Fragment;
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+ * Unit tests for {@link LNotificationActivity}.
+ */
+public class LNotificationActivityTest extends
+ ActivityInstrumentationTestCase2<LNotificationActivity> {
+
+ private LNotificationActivity mActivity;
+
+ public LNotificationActivityTest() {
+ super(LNotificationActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ }
+
+ public void testPreconditions() {
+ assertNotNull(String.format("%s is null", LNotificationActivity.class.getSimpleName()),
+ mActivity);
+ }
+
+ public void testFirstTabInActionBarIsHeadsUpNotificationFragment() {
+ mActivity.getActionBar().setSelectedNavigationItem(0);
+ getInstrumentation().waitForIdleSync();
+ Fragment fragment = mActivity.getFragmentManager().findFragmentById(R.id.container);
+ assertTrue(fragment instanceof HeadsUpNotificationFragment);
+ }
+
+ public void testSecondtabInActionBarIsVisibilityMetadataFragment() {
+ mActivity.getActionBar().setSelectedNavigationItem(1);
+ getInstrumentation().waitForIdleSync();
+ Fragment fragment = mActivity.getFragmentManager().findFragmentById(R.id.container);
+ assertTrue(fragment instanceof VisibilityMetadataFragment);
+ }
+
+ public void testThirdtabInActionBarIsOtherMetadataFragment() {
+ mActivity.getActionBar().setSelectedNavigationItem(2);
+ getInstrumentation().waitForIdleSync();
+ Fragment fragment = mActivity.getFragmentManager().findFragmentById(R.id.container);
+ assertTrue(fragment instanceof OtherMetadataFragment);
+ }
+}
diff --git a/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/OtherMetadataFragmentTest.java b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/OtherMetadataFragmentTest.java
new file mode 100644
index 0000000..11a6c81
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/OtherMetadataFragmentTest.java
@@ -0,0 +1,84 @@
+package com.example.android.lnotifications;
+
+import android.app.Activity;
+import android.app.Notification;
+import android.content.Intent;
+import android.net.Uri;
+import android.test.ActivityInstrumentationTestCase2;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+
+/**
+ * Unit tests for {@link OtherMetadataFragment}.
+ */
+public class OtherMetadataFragmentTest extends
+ ActivityInstrumentationTestCase2<LNotificationActivity> {
+
+ private LNotificationActivity mActivity;
+ private OtherMetadataFragment mFragment;
+
+ public OtherMetadataFragmentTest() {
+ super(LNotificationActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ // The third tab should be {@link OtherMetadataFragment}, that is tested in the
+ // {@link LNotificationActivityTest}.
+ mActivity.getActionBar().setSelectedNavigationItem(2);
+ getInstrumentation().waitForIdleSync();
+ mFragment = (OtherMetadataFragment) mActivity.getFragmentManager()
+ .findFragmentById(R.id.container);
+ }
+
+ public void testPreconditions() {
+ assertNotNull(mActivity);
+ assertNotNull(mFragment);
+ assertNull(mFragment.mContactUri);
+ assertNotNull(mActivity.findViewById(R.id.attach_person));
+ assertNotNull(mActivity.findViewById(R.id.category_spinner));
+ assertNotNull(mActivity.findViewById(R.id.priority_spinner));
+ assertNotNull(mActivity.findViewById(R.id.show_notification_button));
+ }
+
+ public void testCreateNotification_verifyPriorityAndCategoryWithoutPerson() {
+ Notification notification = mFragment.createNotification(OtherMetadataFragment.Priority
+ .HIGH, OtherMetadataFragment.Category.CALL, null);
+ assertEquals(Notification.PRIORITY_HIGH, notification.priority);
+ assertEquals(Notification.CATEGORY_CALL, notification.category);
+ }
+
+ public void testCreateNotification_verifyPriorityAndCategoryWithPerson() {
+ String tel = "81 (90) 555-1212";
+ Uri dummyContactUri = Uri.fromParts("tel", tel, null);
+ Notification notification = mFragment.createNotification(OtherMetadataFragment.Priority
+ .DEFAULT, OtherMetadataFragment.Category.MESSAGE, dummyContactUri);
+ assertEquals(Notification.PRIORITY_DEFAULT, notification.priority);
+ assertEquals(Notification.CATEGORY_MESSAGE, notification.category);
+
+ String[] peopleArray = notification.extras.getStringArray(Notification.EXTRA_PEOPLE);
+ assertNotNull(peopleArray);
+ assertEquals(1, peopleArray.length);
+ }
+
+ public void testActionPickResultUpdatesContactInstanceField() {
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ String tel = "81 (90) 555-1212";
+ Uri dummyContactUri = Uri.fromParts("tel", tel, null);
+ Intent intent = new Intent(Intent.ACTION_PICK);
+ intent.setData(dummyContactUri);
+ mFragment.onActivityResult(mFragment.REQUEST_CODE_PICK_CONTACT,
+ Activity.RESULT_OK, intent);
+ }
+ });
+ getInstrumentation().waitForIdleSync();
+ assertNotNull(mFragment.mContactUri);
+ }
+}
diff --git a/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/VisibilityMetadataFragmentTest.java b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/VisibilityMetadataFragmentTest.java
new file mode 100644
index 0000000..eec62f0
--- /dev/null
+++ b/ui/notifications/LNotifications/Application/tests/src/com/example/android/lnotifications/VisibilityMetadataFragmentTest.java
@@ -0,0 +1,66 @@
+package com.example.android.lnotifications;
+
+import android.app.Notification;
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+ * Unit tests for {@link VisibilityMetadataFragment}.
+ */
+public class VisibilityMetadataFragmentTest extends
+ ActivityInstrumentationTestCase2<LNotificationActivity> {
+
+ private LNotificationActivity mActivity;
+ private VisibilityMetadataFragment mFragment;
+
+ public VisibilityMetadataFragmentTest() {
+ super(LNotificationActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ // The second tab should be {@link VisibilityMetadataFragment}, that is tested in the
+ // {@link LNotificationActivityTest}.
+ mActivity.getActionBar().setSelectedNavigationItem(1);
+ getInstrumentation().waitForIdleSync();
+ mFragment = (VisibilityMetadataFragment) mActivity.getFragmentManager()
+ .findFragmentById(R.id.container);
+ }
+
+ public void testPreconditions() {
+ assertNotNull(mActivity);
+ assertNotNull(mFragment);
+ assertNotNull(mActivity.findViewById(R.id.visibility_metadata_notification_description));
+ assertNotNull(mActivity.findViewById(R.id.visibility_radio_group));
+ assertNotNull(mActivity.findViewById(R.id.visibility_private_radio_button));
+ assertNotNull(mActivity.findViewById(R.id.visibility_secret_radio_button));
+ assertNotNull(mActivity.findViewById(R.id.visibility_public_radio_button));
+ assertNotNull(mActivity.findViewById(R.id.show_notification_button));
+ }
+
+ public void testCreateNotification_publicVisibility() {
+ Notification notification = mFragment.createNotification(VisibilityMetadataFragment
+ .NotificationVisibility.PUBLIC);
+
+ assertEquals(Notification.VISIBILITY_PUBLIC, notification.visibility);
+ assertEquals(R.drawable.ic_public_notification, notification.icon);
+ }
+
+ public void testCreateNotification_privateVisibility() {
+ Notification notification = mFragment.createNotification(VisibilityMetadataFragment
+ .NotificationVisibility.PRIVATE);
+
+ assertEquals(Notification.VISIBILITY_PRIVATE, notification.visibility);
+ assertEquals(R.drawable.ic_private_notification, notification.icon);
+ }
+
+ public void testCreateNotification_secretVisibility() {
+ Notification notification = mFragment.createNotification(VisibilityMetadataFragment
+ .NotificationVisibility.SECRET);
+
+ assertEquals(Notification.VISIBILITY_SECRET, notification.visibility);
+ assertEquals(R.drawable.ic_secret_notification, notification.icon);
+ }
+}
+
diff --git a/ui/notifications/LNotifications/CONTRIB.md b/ui/notifications/LNotifications/CONTRIB.md
new file mode 100644
index 0000000..8ddb52d
--- /dev/null
+++ b/ui/notifications/LNotifications/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Google Cloud Platform Samples Style Guide]
+ (https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/notifications/LNotifications/LICENSE b/ui/notifications/LNotifications/LICENSE
new file mode 100644
index 0000000..c02ca2f
--- /dev/null
+++ b/ui/notifications/LNotifications/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2014 Google Inc.
+
+ 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.
diff --git a/ui/notifications/LNotifications/README.md b/ui/notifications/LNotifications/README.md
new file mode 100644
index 0000000..56f330b
--- /dev/null
+++ b/ui/notifications/LNotifications/README.md
@@ -0,0 +1,51 @@
+Android RecyclerView Sample
+===========================
+
+This sample demonstrates how new features for notifications introduced in Android L
+are used such as Heads-Up notifications, visibility, people, category and priority
+metadata. (Priority metadata has been present since Jelly Bean, but actually unused).
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-BasicAndroidKeyStore
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/notifications/LNotifications/build.gradle b/ui/notifications/LNotifications/build.gradle
new file mode 100644
index 0000000..be1fa82
--- /dev/null
+++ b/ui/notifications/LNotifications/build.gradle
@@ -0,0 +1,14 @@
+
+
+
+
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+apply from: "../../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/notifications/LNotifications/buildSrc/build.gradle b/ui/notifications/LNotifications/buildSrc/build.gradle
new file mode 100644
index 0000000..e344a8c
--- /dev/null
+++ b/ui/notifications/LNotifications/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/notifications/LNotifications/gradle/wrapper/gradle-wrapper.jar b/ui/notifications/LNotifications/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/notifications/LNotifications/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/notifications/LNotifications/gradle/wrapper/gradle-wrapper.properties b/ui/notifications/LNotifications/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..fbe0ffd
--- /dev/null
+++ b/ui/notifications/LNotifications/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Aug 06 17:33:35 JST 2014
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
diff --git a/ui/notifications/LNotifications/gradlew b/ui/notifications/LNotifications/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/notifications/LNotifications/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/notifications/LNotifications/gradlew.bat b/ui/notifications/LNotifications/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/ui/notifications/LNotifications/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/notifications/LNotifications/packaging.yaml b/ui/notifications/LNotifications/packaging.yaml
new file mode 100644
index 0000000..23d65ba
--- /dev/null
+++ b/ui/notifications/LNotifications/packaging.yaml
@@ -0,0 +1,16 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-LNotifications
+level: INTERMEDIATE
+icon: LNotificationsSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+doc_refs:
+ - android:preview/notifications.html
+license: apache2
diff --git a/ui/notifications/LNotifications/settings.gradle b/ui/notifications/LNotifications/settings.gradle
new file mode 100644
index 0000000..9464a35
--- /dev/null
+++ b/ui/notifications/LNotifications/settings.gradle
@@ -0,0 +1 @@
+include 'Application'
diff --git a/ui/notifications/LNotifications/template-params.xml b/ui/notifications/LNotifications/template-params.xml
new file mode 100644
index 0000000..7f4607a
--- /dev/null
+++ b/ui/notifications/LNotifications/template-params.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<sample>
+ <name>LNotifications Sample</name>
+ <group>UI</group>
+ <package>com.example.android.lnotifications</package>
+
+
+
+ <!-- change minSdk if needed-->
+ <minSdk>21</minSdk>
+ <compileSdkVersion>"android-L"</compileSdkVersion>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates how new features for notifications introduced in Android L
+ are used such as Heads-Up notifications, visibility, people, category and priority
+ metadata. (Priority metadata has been present since Jelly Bean, but actually unused).
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+
+</sample>
diff --git a/ui/views/CardView/Application/.gitignore b/ui/views/CardView/Application/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/views/CardView/Application/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/views/CardView/Application/proguard-project.txt b/ui/views/CardView/Application/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/ui/views/CardView/Application/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/ui/views/CardView/Application/src/main/AndroidManifest.xml b/ui/views/CardView/Application/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b90c56b
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/AndroidManifest.xml
@@ -0,0 +1,37 @@
+<?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.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.cardview"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name=".CardViewActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/ui/views/CardView/Application/src/main/java/com/example/android/cardview/CardViewActivity.java b/ui/views/CardView/Application/src/main/java/com/example/android/cardview/CardViewActivity.java
new file mode 100644
index 0000000..0153f56
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/java/com/example/android/cardview/CardViewActivity.java
@@ -0,0 +1,37 @@
+/*
+* 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.
+*/
+
+package com.example.android.cardview;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+/**
+ * Launcher Activity for the CardView sample app.
+ */
+public class CardViewActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_card_view);
+ if (savedInstanceState == null) {
+ getFragmentManager().beginTransaction()
+ .add(R.id.container, CardViewFragment.newInstance())
+ .commit();
+ }
+ }
+}
diff --git a/ui/views/CardView/Application/src/main/java/com/example/android/cardview/CardViewFragment.java b/ui/views/CardView/Application/src/main/java/com/example/android/cardview/CardViewFragment.java
new file mode 100644
index 0000000..46ba6b0
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/java/com/example/android/cardview/CardViewFragment.java
@@ -0,0 +1,120 @@
+/*
+* 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.
+*/
+
+package com.example.android.cardview;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.support.v7.widget.CardView;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.SeekBar;
+
+/**
+ * Fragment that demonstrates how to use CardView.
+ */
+public class CardViewFragment extends Fragment {
+
+ private static final String TAG = CardViewFragment.class.getSimpleName();
+
+ /** The CardView widget. */
+ //@VisibleForTesting
+ CardView mCardView;
+
+ /**
+ * SeekBar that changes the cornerRadius attribute for the {@link #mCardView} widget.
+ */
+ //@VisibleForTesting
+ SeekBar mRadiusSeekBar;
+
+ /**
+ * SeekBar that changes the Elevation attribute for the {@link #mCardView} widget.
+ */
+ //@VisibleForTesting
+ SeekBar mElevationSeekBar;
+
+ /**
+ * Use this factory method to create a new instance of
+ * this fragment using the provided parameters.
+ *
+ * @return A new instance of fragment NotificationFragment.
+ */
+ public static CardViewFragment newInstance() {
+ CardViewFragment fragment = new CardViewFragment();
+ fragment.setRetainInstance(true);
+ return fragment;
+ }
+
+ public CardViewFragment() {
+ // Required empty public constructor
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_card_view, container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ mCardView = (CardView) view.findViewById(R.id.cardview);
+ mRadiusSeekBar = (SeekBar) view.findViewById(R.id.cardview_radius_seekbar);
+ mRadiusSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+ Log.d(TAG, String.format("SeekBar Radius progress : %d", progress));
+ mCardView.setRadius(progress);
+ }
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ //Do nothing
+ }
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ //Do nothing
+ }
+ });
+
+ mElevationSeekBar = (SeekBar) view.findViewById(R.id.cardview_elevation_seekbar);
+ mElevationSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+ Log.d(TAG, String.format("SeekBar Elevation progress : %d", progress));
+ mCardView.setElevation(progress);
+ }
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ //Do nothing
+ }
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ //Do nothing
+ }
+ });
+ }
+}
+
diff --git a/ui/views/CardView/Application/src/main/res/drawable-hdpi/ic_launcher.png b/ui/views/CardView/Application/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..36f4db5
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/CardView/Application/src/main/res/drawable-mdpi/ic_launcher.png b/ui/views/CardView/Application/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..f4ca065
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/CardView/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/views/CardView/Application/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6464a93
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/CardView/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/views/CardView/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..5a017ba
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/CardView/Application/src/main/res/layout/activity_card_view.xml b/ui/views/CardView/Application/src/main/res/layout/activity_card_view.xml
new file mode 100644
index 0000000..e32b7a6
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/layout/activity_card_view.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ tools:context="com.example.android.cardview.CardViewActivity"
+ tools:ignore="MergeRootFrame" />
diff --git a/ui/views/CardView/Application/src/main/res/layout/fragment_card_view.xml b/ui/views/CardView/Application/src/main/res/layout/fragment_card_view.xml
new file mode 100644
index 0000000..432c524
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/layout/fragment_card_view.xml
@@ -0,0 +1,91 @@
+<?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.
+-->
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ >
+
+ <LinearLayout android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ >
+ <android.support.v7.widget.CardView
+ android:id="@+id/cardview"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:elevation="100dp"
+ card_view:cardBackgroundColor="@color/cardview_initial_background"
+ card_view:cardCornerRadius="8dp"
+ android:layout_marginLeft="@dimen/margin_large"
+ android:layout_marginRight="@dimen/margin_large"
+ >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/margin_medium"
+ android:text="@string/cardview_contents"
+ />
+ </android.support.v7.widget.CardView>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_large"
+ android:orientation="horizontal"
+ >
+ <TextView
+ android:layout_width="@dimen/seekbar_label_length"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:text="@string/cardview_radius_seekbar_text"
+ />
+ <SeekBar
+ android:id="@+id/cardview_radius_seekbar"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/margin_medium"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ >
+ <TextView
+ android:layout_width="@dimen/seekbar_label_length"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:text="@string/cardview_elevation_seekbar_text"
+ />
+ <SeekBar
+ android:id="@+id/cardview_elevation_seekbar"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/margin_medium"
+ />
+ </LinearLayout>
+ </LinearLayout>
+</ScrollView>
+
diff --git a/ui/views/CardView/Application/src/main/res/values/colors.xml b/ui/views/CardView/Application/src/main/res/values/colors.xml
new file mode 100644
index 0000000..71d15f7
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/values/colors.xml
@@ -0,0 +1,19 @@
+<?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>
+ <color name="cardview_initial_background">#71C3DE</color>
+</resources>
\ No newline at end of file
diff --git a/ui/views/CardView/Application/src/main/res/values/dimens.xml b/ui/views/CardView/Application/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..9133662
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/values/dimens.xml
@@ -0,0 +1,22 @@
+<?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>
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+ <dimen name="seekbar_label_length">70dp</dimen>
+</resources>
diff --git a/ui/views/CardView/Application/src/main/res/values/strings.xml b/ui/views/CardView/Application/src/main/res/values/strings.xml
new file mode 100644
index 0000000..c995595
--- /dev/null
+++ b/ui/views/CardView/Application/src/main/res/values/strings.xml
@@ -0,0 +1,28 @@
+<?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>
+ <string name="title_activity_card_view">CardViewActivity</string>
+ <string name="cardview_contents">This is a CardView widget. CardView widgets can have
+ shadows and rounded corners.
+ \n\nTo create a card with a shadow, use the <font fgcolor="#FFFFFFFF">android:elevation</font>
+ attribute.
+ \n\nTo set the corner radius in your layouts, use the <font
+ fgcolor="#FFFFFFFF">card_view:cardCornerRadius</font> attribute.
+ </string>
+ <string name="cardview_radius_seekbar_text">Radius</string>
+ <string name="cardview_elevation_seekbar_text">Elevation</string>
+</resources>
diff --git a/ui/views/CardView/Application/tests/AndroidManifest.xml b/ui/views/CardView/Application/tests/AndroidManifest.xml
new file mode 100644
index 0000000..01338c3
--- /dev/null
+++ b/ui/views/CardView/Application/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<!--
+ Copyright (C) 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest
+ package="com.example.android.cardview.tests"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="8"
+ android:targetSdkVersion="19"/>
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner"/>
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:label="Tests for CardView sample"
+ android:targetPackage="com.example.android.cardview"/>
+
+</manifest>
\ No newline at end of file
diff --git a/ui/views/CardView/Application/tests/src/com/example/android/cardview/SampleTests.java b/ui/views/CardView/Application/tests/src/com/example/android/cardview/SampleTests.java
new file mode 100644
index 0000000..87b2588
--- /dev/null
+++ b/ui/views/CardView/Application/tests/src/com/example/android/cardview/SampleTests.java
@@ -0,0 +1,70 @@
+/*
+* 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.
+*/
+package com.example.android.cardview;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+ * Unit tests for CardView samples.
+ */
+public class SampleTests extends ActivityInstrumentationTestCase2<CardViewActivity> {
+
+ private CardViewActivity mActivity;
+ private CardViewFragment mFragment;
+
+ public SampleTests() {
+ super(CardViewActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ mFragment = (CardViewFragment) mActivity.getFragmentManager().findFragmentById(R.id
+ .container);
+ }
+
+ public void testPreconditions() {
+ assertNotNull(String.format("%s is null", CardViewActivity.class.getSimpleName()),
+ mActivity);
+ assertNotNull(String.format("%s is null", CardViewFragment.class.getSimpleName()),
+ mFragment);
+ assertNotNull("SeekBar for Radius is null", mFragment.mRadiusSeekBar);
+ assertNotNull("SeekBar for Elevation is null", mFragment.mElevationSeekBar);
+ }
+
+ public void testRadiusSeekbarChangesRadiusOfCardView() {
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ float radius = 50.0f;
+ mFragment.mRadiusSeekBar.setProgress((int) radius);
+ assertEquals(radius, mFragment.mCardView.getRadius());
+ }
+ });
+ }
+
+ public void testElevationSeekbarChangesElevationOfCardView() {
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ float elevation = 40.0f;
+ mFragment.mElevationSeekBar.setProgress((int) elevation);
+ assertEquals(elevation, mFragment.mCardView.getElevation());
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/ui/views/CardView/CONTRIB.md b/ui/views/CardView/CONTRIB.md
new file mode 100644
index 0000000..8ddb52d
--- /dev/null
+++ b/ui/views/CardView/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Google Cloud Platform Samples Style Guide]
+ (https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/views/CardView/LICENSE b/ui/views/CardView/LICENSE
new file mode 100644
index 0000000..c02ca2f
--- /dev/null
+++ b/ui/views/CardView/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2014 Google Inc.
+
+ 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.
diff --git a/ui/views/CardView/README.md b/ui/views/CardView/README.md
new file mode 100644
index 0000000..afa2483
--- /dev/null
+++ b/ui/views/CardView/README.md
@@ -0,0 +1,49 @@
+Android CardView Sample
+=======================
+
+Demonstration of the CardView API introduced in Android L.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-BasicAndroidKeyStore
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/views/CardView/build.gradle b/ui/views/CardView/build.gradle
new file mode 100644
index 0000000..be1fa82
--- /dev/null
+++ b/ui/views/CardView/build.gradle
@@ -0,0 +1,14 @@
+
+
+
+
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+apply from: "../../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/views/CardView/buildSrc/build.gradle b/ui/views/CardView/buildSrc/build.gradle
new file mode 100644
index 0000000..e344a8c
--- /dev/null
+++ b/ui/views/CardView/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/views/CardView/gradle/wrapper/gradle-wrapper.jar b/ui/views/CardView/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/views/CardView/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/views/CardView/gradle/wrapper/gradle-wrapper.properties b/ui/views/CardView/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..588fabb
--- /dev/null
+++ b/ui/views/CardView/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Aug 22 14:55:27 JST 2014
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
diff --git a/ui/views/CardView/gradlew b/ui/views/CardView/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/views/CardView/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/views/CardView/gradlew.bat b/ui/views/CardView/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/ui/views/CardView/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/views/CardView/packaging.yaml b/ui/views/CardView/packaging.yaml
new file mode 100644
index 0000000..1dbd957
--- /dev/null
+++ b/ui/views/CardView/packaging.yaml
@@ -0,0 +1,16 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-CardView
+level: INTERMEDIATE
+icon: CardViewSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+doc_refs:
+ - android:preview/material/ui-widgets.html
+license: apache2
diff --git a/ui/views/CardView/settings.gradle b/ui/views/CardView/settings.gradle
new file mode 100644
index 0000000..9464a35
--- /dev/null
+++ b/ui/views/CardView/settings.gradle
@@ -0,0 +1 @@
+include 'Application'
diff --git a/ui/views/CardView/template-params.xml b/ui/views/CardView/template-params.xml
new file mode 100644
index 0000000..7dc7719
--- /dev/null
+++ b/ui/views/CardView/template-params.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<sample>
+ <name>CardView Sample</name>
+ <group>UI</group>
+ <package>com.example.android.cardview</package>
+
+ <auto_add_support_lib>false</auto_add_support_lib>
+
+ <!-- change minSdk if needed-->
+ <minSdk>21</minSdk>
+ <compileSdkVersion>"android-L"</compileSdkVersion>
+
+ <dependency>com.android.support:cardview-v7:21.+</dependency>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates how to use CardView introduced in the support library for the
+ Android L preview.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+
+</sample>
diff --git a/ui/views/Clipping/ClippingBasic/Application/README-fragmentview.txt b/ui/views/Clipping/ClippingBasic/Application/README-fragmentview.txt
deleted file mode 100644
index 38d903f..0000000
--- a/ui/views/Clipping/ClippingBasic/Application/README-fragmentview.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Copyright 2013 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.
--->
-
-Steps to implement FragmentView template:
--in template-params.xml.ftl:
- -add the following line to common imports
- <common src="activities"/>
-
--Add a Fragment to show behavior. In your MainActivity.java class, it will reference a Fragment
- called (yourProjectName)Fragment.java. Create that file in your project, using the "main" source
- folder instead of "common" or "templates".
- For instance, if your package name is com.example.foo, create the file
- src/main/java/com/example/foo/FooFragment.java
-
-
--Within this fragment, make sure that the onCreate method has the line
- "setHasOptionsMenu(true);", to enable the fragment to handle menu events.
-
--In order to override menu events, override onOptionsItemSelected.
-
--refer to sampleSamples/fragmentViewSample for a reference implementation of a
-project built on this template.
-
-
diff --git a/ui/views/Clipping/ClippingBasic/CONTRIB.md b/ui/views/Clipping/ClippingBasic/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/ui/views/Clipping/ClippingBasic/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/views/Clipping/ClippingBasic/LICENSE b/ui/views/Clipping/ClippingBasic/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/ui/views/Clipping/ClippingBasic/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/ui/views/Clipping/ClippingBasic/README.md b/ui/views/Clipping/ClippingBasic/README.md
new file mode 100644
index 0000000..f6347ea
--- /dev/null
+++ b/ui/views/Clipping/ClippingBasic/README.md
@@ -0,0 +1,49 @@
+Android ClippingBasic Sample
+==============================
+
+Basic sample to demonstrate clipping on a View.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-ClippingBasic
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/views/Clipping/ClippingBasic/packaging.yaml b/ui/views/Clipping/ClippingBasic/packaging.yaml
new file mode 100644
index 0000000..2e26f7d
--- /dev/null
+++ b/ui/views/Clipping/ClippingBasic/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-ClippingBasic
+level: BEGINNER
+icon: ClippingBasicSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/ui/views/Clipping/ClippingBasic/settings.gradle b/ui/views/Clipping/ClippingBasic/settings.gradle
index 670e715..9464a35 100644
--- a/ui/views/Clipping/ClippingBasic/settings.gradle
+++ b/ui/views/Clipping/ClippingBasic/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'ClippingBasicSample'
+include 'Application'
diff --git a/ui/views/Elevation/ElevationBasic/Application/README-fragmentview.txt b/ui/views/Elevation/ElevationBasic/Application/README-fragmentview.txt
deleted file mode 100644
index 38d903f..0000000
--- a/ui/views/Elevation/ElevationBasic/Application/README-fragmentview.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Copyright 2013 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.
--->
-
-Steps to implement FragmentView template:
--in template-params.xml.ftl:
- -add the following line to common imports
- <common src="activities"/>
-
--Add a Fragment to show behavior. In your MainActivity.java class, it will reference a Fragment
- called (yourProjectName)Fragment.java. Create that file in your project, using the "main" source
- folder instead of "common" or "templates".
- For instance, if your package name is com.example.foo, create the file
- src/main/java/com/example/foo/FooFragment.java
-
-
--Within this fragment, make sure that the onCreate method has the line
- "setHasOptionsMenu(true);", to enable the fragment to handle menu events.
-
--In order to override menu events, override onOptionsItemSelected.
-
--refer to sampleSamples/fragmentViewSample for a reference implementation of a
-project built on this template.
-
-
diff --git a/ui/views/Elevation/ElevationBasic/CONTRIB.md b/ui/views/Elevation/ElevationBasic/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/ui/views/Elevation/ElevationBasic/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/views/Elevation/ElevationBasic/LICENSE b/ui/views/Elevation/ElevationBasic/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/ui/views/Elevation/ElevationBasic/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/ui/views/Elevation/ElevationBasic/README.md b/ui/views/Elevation/ElevationBasic/README.md
new file mode 100644
index 0000000..b40a734
--- /dev/null
+++ b/ui/views/Elevation/ElevationBasic/README.md
@@ -0,0 +1,51 @@
+Android ElevationBasic Sample
+==============================
+
+This sample demonstrates two alternative ways to move a view in the z-axis. The
+first view has a fixed elevation using XML and the second one is raised when the user
+taps on it, using setTranslationZ().
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-ElevationBasic
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/views/Elevation/ElevationBasic/packaging.yaml b/ui/views/Elevation/ElevationBasic/packaging.yaml
new file mode 100644
index 0000000..cb6d6c2
--- /dev/null
+++ b/ui/views/Elevation/ElevationBasic/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [NoGroup]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-ElevationBasic
+level: BEGINNER
+icon: ElevationBasicSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/ui/views/Elevation/ElevationBasic/settings.gradle b/ui/views/Elevation/ElevationBasic/settings.gradle
index 99cb553..9464a35 100644
--- a/ui/views/Elevation/ElevationBasic/settings.gradle
+++ b/ui/views/Elevation/ElevationBasic/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'ElevationBasicSample'
+include 'Application'
diff --git a/ui/views/Elevation/ElevationDrag/CONTRIB.md b/ui/views/Elevation/ElevationDrag/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/ui/views/Elevation/ElevationDrag/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/views/Elevation/ElevationDrag/LICENSE b/ui/views/Elevation/ElevationDrag/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/ui/views/Elevation/ElevationDrag/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/ui/views/Elevation/ElevationDrag/README.md b/ui/views/Elevation/ElevationDrag/README.md
new file mode 100644
index 0000000..f3c2129
--- /dev/null
+++ b/ui/views/Elevation/ElevationDrag/README.md
@@ -0,0 +1,51 @@
+Android ElevationDrag Sample
+==============================
+
+This sample demonstrates a drag and drop action on different shapes. Elevation and
+z-translation are used to render the shadows and the views are clipped using different
+Outlines.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-ElevationDrag
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/views/Elevation/ElevationDrag/packaging.yaml b/ui/views/Elevation/ElevationDrag/packaging.yaml
new file mode 100644
index 0000000..044a7d3
--- /dev/null
+++ b/ui/views/Elevation/ElevationDrag/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-ElevationDrag
+level: BEGINNER
+icon: ElevationDragSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/ui/views/Elevation/ElevationDrag/settings.gradle b/ui/views/Elevation/ElevationDrag/settings.gradle
index bb7fd61..9464a35 100644
--- a/ui/views/Elevation/ElevationDrag/settings.gradle
+++ b/ui/views/Elevation/ElevationDrag/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'ElevationDragSample'
+include 'Application'
diff --git a/ui/views/FloatingActionButton/FloatingActionButtonBasic/Application/README-fragmentview.txt b/ui/views/FloatingActionButton/FloatingActionButtonBasic/Application/README-fragmentview.txt
deleted file mode 100644
index 38d903f..0000000
--- a/ui/views/FloatingActionButton/FloatingActionButtonBasic/Application/README-fragmentview.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Copyright 2013 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.
--->
-
-Steps to implement FragmentView template:
--in template-params.xml.ftl:
- -add the following line to common imports
- <common src="activities"/>
-
--Add a Fragment to show behavior. In your MainActivity.java class, it will reference a Fragment
- called (yourProjectName)Fragment.java. Create that file in your project, using the "main" source
- folder instead of "common" or "templates".
- For instance, if your package name is com.example.foo, create the file
- src/main/java/com/example/foo/FooFragment.java
-
-
--Within this fragment, make sure that the onCreate method has the line
- "setHasOptionsMenu(true);", to enable the fragment to handle menu events.
-
--In order to override menu events, override onOptionsItemSelected.
-
--refer to sampleSamples/fragmentViewSample for a reference implementation of a
-project built on this template.
-
-
diff --git a/ui/views/FloatingActionButton/FloatingActionButtonBasic/settings.gradle b/ui/views/FloatingActionButton/FloatingActionButtonBasic/settings.gradle
index d22530e..9464a35 100644
--- a/ui/views/FloatingActionButton/FloatingActionButtonBasic/settings.gradle
+++ b/ui/views/FloatingActionButton/FloatingActionButtonBasic/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'FloatingActionButtonBasicSample'
+include 'Application'
diff --git a/ui/views/NavigationDrawer/CONTRIB.md b/ui/views/NavigationDrawer/CONTRIB.md
new file mode 100644
index 0000000..14a4fcf
--- /dev/null
+++ b/ui/views/NavigationDrawer/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Android Code Style Guide]
+ (https://source.android.com/source/code-style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/views/NavigationDrawer/LICENSE b/ui/views/NavigationDrawer/LICENSE
new file mode 100644
index 0000000..1af981f
--- /dev/null
+++ b/ui/views/NavigationDrawer/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ 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.
diff --git a/ui/views/NavigationDrawer/README.md b/ui/views/NavigationDrawer/README.md
new file mode 100644
index 0000000..26fb4d9
--- /dev/null
+++ b/ui/views/NavigationDrawer/README.md
@@ -0,0 +1,50 @@
+Android Navigation Drawer Sample
+==============================
+
+This example illustrates a common usage of the DrawerLayout widget in the Android
+support library.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-Navigation Drawer
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/views/NavigationDrawer/packaging.yaml b/ui/views/NavigationDrawer/packaging.yaml
new file mode 100644
index 0000000..f66fb11
--- /dev/null
+++ b/ui/views/NavigationDrawer/packaging.yaml
@@ -0,0 +1,15 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-Navigation Drawer
+level: BEGINNER
+icon: Navigation DrawerSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+license: apache2
diff --git a/ui/views/NavigationDrawer/settings.gradle b/ui/views/NavigationDrawer/settings.gradle
index feade60..9464a35 100644
--- a/ui/views/NavigationDrawer/settings.gradle
+++ b/ui/views/NavigationDrawer/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'NavigationDrawerSample'
+include 'Application'
diff --git a/ui/views/RecyclerView/Application/.gitignore b/ui/views/RecyclerView/Application/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/views/RecyclerView/Application/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/views/RecyclerView/Application/proguard-project.txt b/ui/views/RecyclerView/Application/proguard-project.txt
new file mode 100644
index 0000000..0d8f171
--- /dev/null
+++ b/ui/views/RecyclerView/Application/proguard-project.txt
@@ -0,0 +1,20 @@
+ To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/ui/views/RecyclerView/Application/src/androidTest/java/com/example/android/recyclerview/test/RecyclerViewSampleTests.java b/ui/views/RecyclerView/Application/src/androidTest/java/com/example/android/recyclerview/test/RecyclerViewSampleTests.java
new file mode 100644
index 0000000..6e63120
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/androidTest/java/com/example/android/recyclerview/test/RecyclerViewSampleTests.java
@@ -0,0 +1,70 @@
+/*
+* Copyright (C) 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.
+*/
+
+package com.example.android.recyclerview.test;
+
+import com.example.android.recyclerview.MainActivity;
+import com.example.android.recyclerview.R;
+import com.example.android.recyclerview.RecyclerViewFragment;
+
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.RecyclerView;
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+* Tests for RecyclerView sample.
+*/
+public class RecyclerViewSampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private RecyclerViewFragment mTestFragment;
+
+ public RecyclerViewSampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (RecyclerViewFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ public void testRecyclerViewElementCount() {
+ RecyclerView recyclerView =
+ (RecyclerView) mTestFragment.getView().findViewById(R.id.recyclerView);
+ int elementCount = recyclerView.getAdapter().getItemCount();
+ // There should be 60 elements in the RecyclerView's adapter.
+ assertEquals(60, elementCount);
+ }
+
+}
diff --git a/ui/views/RecyclerView/Application/src/main/AndroidManifest.xml b/ui/views/RecyclerView/Application/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b16c387
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/AndroidManifest.xml
@@ -0,0 +1,40 @@
+<?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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.recyclerview"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17" />
+
+ <application android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/AppTheme">
+
+ <activity android:name=".MainActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+
+</manifest>
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
new file mode 100644
index 0000000..f8e3bae
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/CustomAdapter.java
@@ -0,0 +1,91 @@
+/*
+* Copyright (C) 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.
+*/
+
+package com.example.android.recyclerview;
+
+import com.example.android.common.logger.Log;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+/**
+ * Provide views to RecyclerView with data from mDataSet.
+ */
+public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> {
+ private static final String TAG = "CustomAdapter";
+
+ private String[] mDataSet;
+
+ // BEGIN_INCLUDE(recyclerViewSampleViewHolder)
+ /**
+ * 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;
+
+ public ViewHolder(View v) {
+ super(v);
+ mTextView = (TextView) v.findViewById(R.id.textView);
+ }
+
+ public TextView getmTextView() {
+ return mTextView;
+ }
+ }
+ // END_INCLUDE(recyclerViewSampleViewHolder)
+ /**
+ * Initialize the dataset of the Adapter.
+ *
+ * @param dataSet String[] containing the data to populate views to be used by RecyclerView.
+ */
+ public CustomAdapter(String[] dataSet) {
+ mDataSet = dataSet;
+ }
+
+ // BEGIN_INCLUDE(recyclerViewOnCreateViewHolder)
+ // Create new views (invoked by the layout manager)
+ @Override
+ public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) {
+ // 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;
+ }
+ // 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) {
+ 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]);
+ }
+ // END_INCLUDE(recyclerViewOnBindViewHolder)
+
+ // Return the size of your dataset (invoked by the layout manager)
+ @Override
+ public int getItemCount() {
+ return mDataSet.length;
+ }
+}
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
new file mode 100644
index 0000000..4f4a596
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/java/com/example/android/recyclerview/RecyclerViewFragment.java
@@ -0,0 +1,81 @@
+/*
+* Copyright (C) 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.
+*/
+
+package com.example.android.recyclerview;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+/**
+ * Demonstrates the use of RecyclerView with a LinearLayoutManager.
+ */
+public class RecyclerViewFragment extends Fragment {
+
+ private static final String TAG = "RecyclerViewFragment";
+
+ protected RecyclerView mRecyclerView;
+ protected RecyclerView.Adapter mAdapter;
+ protected RecyclerView.LayoutManager mLayoutManager;
+ protected String[] mDataset;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Initialize dataset, this data would usually come from a local content provider or
+ // remote server.
+ initDataset();
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.recycler_view_frag, container, false);
+ rootView.setTag(TAG);
+
+ // BEGIN_INCLUDE(initializeRecyclerView)
+ mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerView);
+
+ // LinearLayoutManager is used here, this will layout the elements in a similar fashion
+ // to the way ListView would layout elements. The RecyclerView.LayoutManager defines how
+ // elements are laid out.
+ mLayoutManager = new LinearLayoutManager(getActivity());
+ mRecyclerView.setLayoutManager(mLayoutManager);
+
+ mAdapter = new CustomAdapter(mDataset);
+ // Set CustomAdapter as the adapter for RecyclerView.
+ mRecyclerView.setAdapter(mAdapter);
+ // END_INCLUDE(initializeRecyclerView)
+
+ return rootView;
+ }
+
+ /**
+ * 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[i] = "This is element #" + i;
+ }
+ }
+}
diff --git a/ui/views/RecyclerView/Application/src/main/res/drawable-hdpi/ic_launcher.png b/ui/views/RecyclerView/Application/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..bcb72b1
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/RecyclerView/Application/src/main/res/drawable-mdpi/ic_launcher.png b/ui/views/RecyclerView/Application/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..37e5bce
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/RecyclerView/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/views/RecyclerView/Application/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..1c4a85a
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/RecyclerView/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/views/RecyclerView/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b26545c
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
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
new file mode 100644
index 0000000..6682468
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/layout/recycler_view_frag.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <android.support.v7.widget.RecyclerView
+ android:id="@+id/recyclerView"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+</FrameLayout>
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
new file mode 100644
index 0000000..d552e0e
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/layout/text_row_item.xml
@@ -0,0 +1,31 @@
+<?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.
+-->
+
+<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">
+
+
+ <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
diff --git a/ui/views/RecyclerView/Application/src/main/res/values/strings.xml b/ui/views/RecyclerView/Application/src/main/res/values/strings.xml
new file mode 100644
index 0000000..179529c
--- /dev/null
+++ b/ui/views/RecyclerView/Application/src/main/res/values/strings.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>
+ <string name="element_text">Element</string>
+</resources>
\ No newline at end of file
diff --git a/ui/views/RecyclerView/CONTRIB.md b/ui/views/RecyclerView/CONTRIB.md
new file mode 100644
index 0000000..8ddb52d
--- /dev/null
+++ b/ui/views/RecyclerView/CONTRIB.md
@@ -0,0 +1,35 @@
+# How to become a contributor and submit your own code
+
+## Contributor License Agreements
+
+We'd love to accept your sample apps and patches! Before we can take them, we
+have to jump a couple of legal hurdles.
+
+Please fill out either the individual or corporate Contributor License Agreement (CLA).
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual CLA]
+ (https://developers.google.com/open-source/cla/individual).
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA]
+ (https://developers.google.com/open-source/cla/corporate).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it. Once we receive it, we'll be able to
+accept your pull requests.
+
+## Contributing A Patch
+
+1. Submit an issue describing your proposed change to the repo in question.
+1. The repo owner will respond to your issue promptly.
+1. If your proposed change is accepted, and you haven't already done so, sign a
+ Contributor License Agreement (see details above).
+1. Fork the desired repo, develop and test your code changes.
+1. Ensure that your code adheres to the existing style in the sample to which
+ you are contributing. Refer to the
+ [Google Cloud Platform Samples Style Guide]
+ (https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the
+ recommended coding standards for this organization.
+1. Ensure that your code has an appropriate set of unit tests which all pass.
+1. Submit a pull request.
+
diff --git a/ui/views/RecyclerView/LICENSE b/ui/views/RecyclerView/LICENSE
new file mode 100644
index 0000000..c02ca2f
--- /dev/null
+++ b/ui/views/RecyclerView/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2014 Google Inc.
+
+ 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.
diff --git a/ui/views/RecyclerView/README.md b/ui/views/RecyclerView/README.md
new file mode 100644
index 0000000..fdfa4f1
--- /dev/null
+++ b/ui/views/RecyclerView/README.md
@@ -0,0 +1,49 @@
+Android RecyclerView Sample
+===========================
+
+Demonstration of using RecyclerView with a LinearLayoutManager to create a vertical ListView.
+
+Pre-requisites
+--------------
+
+- Android SDK (L Developer Preview)
+- Android Build Tools v20
+- Android Support Repository
+
+Getting Started
+---------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+Support
+-------
+
+- Google+ Community: https://plus.google.com/communities/105153134372062985968
+- Stack Overflow: http://stackoverflow.com/questions/tagged/android
+
+If you've found an error in this sample, please file an issue:
+https://github.com/googlesamples/android-BasicAndroidKeyStore
+
+Patches are encouraged, and may be submitted by forking this project and
+submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
+
+License
+-------
+
+Copyright 2014 The Android Open Source Project, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you 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.
diff --git a/ui/views/RecyclerView/build.gradle b/ui/views/RecyclerView/build.gradle
new file mode 100644
index 0000000..be1fa82
--- /dev/null
+++ b/ui/views/RecyclerView/build.gradle
@@ -0,0 +1,14 @@
+
+
+
+
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+apply from: "../../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/views/RecyclerView/buildSrc/build.gradle b/ui/views/RecyclerView/buildSrc/build.gradle
new file mode 100644
index 0000000..e344a8c
--- /dev/null
+++ b/ui/views/RecyclerView/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/views/RecyclerView/gradle/wrapper/gradle-wrapper.jar b/ui/views/RecyclerView/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/views/RecyclerView/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/views/RecyclerView/gradle/wrapper/gradle-wrapper.properties b/ui/views/RecyclerView/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..65fb80a
--- /dev/null
+++ b/ui/views/RecyclerView/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Sep 08 13:53:18 PDT 2014
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
diff --git a/ui/views/RecyclerView/gradlew b/ui/views/RecyclerView/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/views/RecyclerView/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/views/RecyclerView/gradlew.bat b/ui/views/RecyclerView/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/ui/views/RecyclerView/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/views/RecyclerView/packaging.yaml b/ui/views/RecyclerView/packaging.yaml
new file mode 100644
index 0000000..8554a96
--- /dev/null
+++ b/ui/views/RecyclerView/packaging.yaml
@@ -0,0 +1,16 @@
+# 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: [UI]
+languages: [Java]
+solutions: [Mobile]
+github: googlesamples/android-RecyclerView
+level: INTERMEDIATE
+icon: RecyclerViewSample/src/main/res/drawable-xxhdpi/ic_launcher.png
+doc_refs:
+ - android:preview/material/ui-widgets.html
+license: apache2
diff --git a/ui/views/RecyclerView/settings.gradle b/ui/views/RecyclerView/settings.gradle
new file mode 100644
index 0000000..9464a35
--- /dev/null
+++ b/ui/views/RecyclerView/settings.gradle
@@ -0,0 +1 @@
+include 'Application'
diff --git a/ui/views/RecyclerView/template-params.xml b/ui/views/RecyclerView/template-params.xml
new file mode 100644
index 0000000..76fbd83
--- /dev/null
+++ b/ui/views/RecyclerView/template-params.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<sample>
+ <name>RecyclerView</name>
+ <group>UI</group>
+ <package>com.example.android.recyclerview</package>
+
+ <dependency>com.android.support:recyclerview-v7:+</dependency>
+
+ <!-- change minSdk if needed-->
+ <minSdk>7</minSdk>
+
+
+ <strings>
+ <intro>
+ <![CDATA[
+ Demonstration of using RecyclerView with a LayoutManager to create a vertical ListView.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <template src="FragmentView"/>
+ <common src="logger"/>
+ <common src="activities"/>
+</sample>
diff --git a/ui/views/RevealEffect/RevealEffectBasic/settings.gradle b/ui/views/RevealEffect/RevealEffectBasic/settings.gradle
index a52c8f3..9464a35 100644
--- a/ui/views/RevealEffect/RevealEffectBasic/settings.gradle
+++ b/ui/views/RevealEffect/RevealEffectBasic/settings.gradle
@@ -1,4 +1 @@
-
-
-
-include 'RevealEffectBasicSample'
+include 'Application'
diff --git a/ui/window/AdvancedImmersiveMode/Application/build.gradle b/ui/window/AdvancedImmersiveMode/Application/build.gradle
deleted file mode 100644
index 111d4f7..0000000
--- a/ui/window/AdvancedImmersiveMode/Application/build.gradle
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-buildscript {
- repositories {
- mavenCentral()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:0.12.+'
- }
-}
-
-apply plugin: 'com.android.application'
-
-
-dependencies {
-
- compile "com.android.support:support-v4:20.+"
- compile "com.android.support:support-v13:20.+"
-
-}
-
-// The sample build uses multiple directories to
-// keep boilerplate and common code separate from
-// the main sample code.
-List<String> dirs = [
- 'main', // main sample code; look here for the interesting stuff.
- 'common', // components that are reused by multiple samples
- 'template'] // boilerplate code that is generated by the sample template process
-
-android {
- compileSdkVersion 19
-
- buildToolsVersion "20.0.0"
-
- sourceSets {
- main {
- dirs.each { dir ->
- java.srcDirs "src/${dir}/java"
- res.srcDirs "src/${dir}/res"
- }
- }
- androidTest.setRoot('tests')
- androidTest.java.srcDirs = ['tests/src']
-
- }
-
-}
-// BEGIN_EXCLUDE
-// Tasks below this line will be hidden from release output
-
-task preflight (dependsOn: parent.preflight) {
- project.afterEvaluate {
- // Inject a preflight task into each variant so we have a place to hook tasks
- // that need to run before any of the android build tasks.
- //
- android.applicationVariants.each { variant ->
- tasks.getByPath("prepare${variant.name.capitalize()}Dependencies").dependsOn preflight
- }
- }
-}
-
-// END_EXCLUDE
diff --git a/wearable/wear/SynchronizedNotifications/Wearable/build.gradle b/wearable/wear/SynchronizedNotifications/Wearable/build.gradle
index 1d906b2..529a093 100644
--- a/wearable/wear/SynchronizedNotifications/Wearable/build.gradle
+++ b/wearable/wear/SynchronizedNotifications/Wearable/build.gradle
@@ -31,7 +31,7 @@
'template'] // boilerplate code that is generated by the sample template process
android {
- compileSdkVersion 'android-20'
+ compileSdkVersion 'android-L'
buildToolsVersion '20'
@@ -41,6 +41,9 @@
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
+ lintOptions {
+ abortOnError false
+ }
sourceSets {
main {
dirs.each { dir ->