summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2013-03-07 00:38:44 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2013-03-07 00:38:44 +0000
commit6fea1665a91dafa49b78d1c92c53bb0fa1736020 (patch)
tree8778c4d5422128c3e55a9aa2d5cebc3ab05b6fe6
parent768c5c4d9d736c55d7ef580142d602850f47a098 (diff)
parent1ab64b819ba3d4b974e63fcae5d21bb73ba5a6a6 (diff)
am 1ab64b81: Merge "Add new sample code for writing a ViewGroup." into jb-mr2-dev
* commit '1ab64b819ba3d4b974e63fcae5d21bb73ba5a6a6': Add new sample code for writing a ViewGroup.
-rw-r--r--core/java/android/view/ViewGroup.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index df07f3cbc46d..442dfdbee73e 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -70,6 +70,22 @@ import java.util.HashSet;
* <a href="{@docRoot}guide/topics/ui/declaring-layout.html">XML Layouts</a> developer
* guide.</p></div>
*
+ * <p>Here is a complete implementation of a custom ViewGroup that implements
+ * a simple {@link android.widget.FrameLayout} along with the ability to stack
+ * children in left and right gutters.</p>
+ *
+ * {@sample development/samples/ApiDemos/src/com/example/android/apis/view/CustomLayout.java
+ * Complete}
+ *
+ * <p>If you are implementing XML layout attributes as shown in the example, this is the
+ * corresponding definition for them that would go in <code>res/values/attrs.xml</code>:</p>
+ *
+ * {@sample development/samples/ApiDemos/res/values/attrs.xml CustomLayout}
+ *
+ * <p>Finally the layout manager can be used in an XML layout like so:</p>
+ *
+ * {@sample development/samples/ApiDemos/res/layout/custom_layout.xml Complete}
+ *
* @attr ref android.R.styleable#ViewGroup_clipChildren
* @attr ref android.R.styleable#ViewGroup_clipToPadding
* @attr ref android.R.styleable#ViewGroup_layoutAnimation