summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Main <smain@google.com>2010-01-08 12:21:00 -0800
committerScott Main <smain@google.com>2010-01-08 12:35:11 -0800
commitaa3b5961c0142fe2fe87a5e4f67a12b3728f1bea (patch)
tree0b1e55f8e1c6623118d933e9c8bc46b287c2e493
parent3fb4ee4e03351078ceadf3d8dd05789ae152e8dd (diff)
downloadframeworks_base-aa3b5961c0142fe2fe87a5e4f67a12b3728f1bea.zip
frameworks_base-aa3b5961c0142fe2fe87a5e4f67a12b3728f1bea.tar.gz
frameworks_base-aa3b5961c0142fe2fe87a5e4f67a12b3728f1bea.tar.bz2
javadoc change: fix the selector sample XML in the class
description (was broken due to improper ordering)
-rw-r--r--core/java/android/widget/ImageButton.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/widget/ImageButton.java b/core/java/android/widget/ImageButton.java
index d417e40..5c05170 100644
--- a/core/java/android/widget/ImageButton.java
+++ b/core/java/android/widget/ImageButton.java
@@ -44,11 +44,11 @@ import java.util.Map;
* <pre>
* &lt;?xml version="1.0" encoding="utf-8"?&gt;
* &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
- * &lt;item android:drawable="@drawable/button_normal" /&gt; &lt;!-- default --&gt;
* &lt;item android:state_pressed="true"
* android:drawable="@drawable/button_pressed" /&gt; &lt;!-- pressed --&gt;
* &lt;item android:state_focused="true"
* android:drawable="@drawable/button_focused" /&gt; &lt;!-- focused --&gt;
+ * &lt;item android:drawable="@drawable/button_normal" /&gt; &lt;!-- default --&gt;
* &lt;/selector&gt;</pre>
*
* <p>Save the XML file in your project {@code res/drawable/} folder and then
@@ -57,6 +57,11 @@ import java.util.Map;
* based on the state of the button and the corresponding images
* defined in the XML.</p>
*
+ * <p>The order of the {@code &lt;item>} elements is important because they are
+ * evaluated in order. This is why the "normal" button image comes last, because
+ * it will only be applied after {@code android:state_pressed} and {@code
+ * android:state_focused} have both evaluated false.</p>
+ *
* <p><strong>XML attributes</strong></p>
* <p>
* See {@link android.R.styleable#ImageView Button Attributes},