summaryrefslogtreecommitdiff
path: root/core/java/android/widget/CheckedTextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/widget/CheckedTextView.java')
-rw-r--r--core/java/android/widget/CheckedTextView.java47
1 files changed, 26 insertions, 21 deletions
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 84f0ee556b2e..22e079c175e8 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -34,10 +34,13 @@ import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
/**
- * An extension to TextView that supports the {@link android.widget.Checkable} interface.
- * This is useful when used in a {@link android.widget.ListView ListView} where the it's
- * {@link android.widget.ListView#setChoiceMode(int) setChoiceMode} has been set to
- * something other than {@link android.widget.ListView#CHOICE_MODE_NONE CHOICE_MODE_NONE}.
+ * An extension to {@link TextView} that supports the {@link Checkable}
+ * interface and displays.
+ * <p>
+ * This is useful when used in a {@link android.widget.ListView ListView} where
+ * the {@link android.widget.ListView#setChoiceMode(int) setChoiceMode} has
+ * been set to something other than
+ * {@link android.widget.ListView#CHOICE_MODE_NONE CHOICE_MODE_NONE}.
*
* @attr ref android.R.styleable#CheckedTextView_checked
* @attr ref android.R.styleable#CheckedTextView_checkMark
@@ -116,9 +119,10 @@ public class CheckedTextView extends TextView implements Checkable {
}
/**
- * <p>Changes the checked state of this text view.</p>
+ * Sets the checked state of this view.
*
- * @param checked true to check the text, false to uncheck it
+ * @param checked {@code true} set the state to checked, {@code false} to
+ * uncheck
*/
public void setChecked(boolean checked) {
if (mChecked != checked) {
@@ -129,24 +133,24 @@ public class CheckedTextView extends TextView implements Checkable {
}
}
-
/**
- * Set the checkmark to a given Drawable, identified by its resourece id. This will be drawn
- * when {@link #isChecked()} is true.
- *
- * @param resid The Drawable to use for the checkmark.
+ * Sets the check mark to the drawable with the specified resource ID.
+ * <p>
+ * When this view is checked, the drawable's state set will include
+ * {@link android.R.attr#state_checked}.
*
+ * @param resId the resource identifier of drawable to use as the check
+ * mark
+ * @attr ref android.R.styleable#CheckedTextView_checkMark
* @see #setCheckMarkDrawable(Drawable)
* @see #getCheckMarkDrawable()
- *
- * @attr ref android.R.styleable#CheckedTextView_checkMark
*/
- public void setCheckMarkDrawable(@DrawableRes int resid) {
- if (resid != 0 && resid == mCheckMarkResource) {
+ public void setCheckMarkDrawable(@DrawableRes int resId) {
+ if (resId != 0 && resId == mCheckMarkResource) {
return;
}
- mCheckMarkResource = resid;
+ mCheckMarkResource = resId;
Drawable d = null;
if (mCheckMarkResource != 0) {
@@ -156,14 +160,15 @@ public class CheckedTextView extends TextView implements Checkable {
}
/**
- * Set the checkmark to a given Drawable. This will be drawn when {@link #isChecked()} is true.
- *
- * @param d The Drawable to use for the checkmark.
+ * Set the check mark to the specified drawable.
+ * <p>
+ * When this view is checked, the drawable's state set will include
+ * {@link android.R.attr#state_checked}.
*
+ * @param d the drawable to use for the check mark
+ * @attr ref android.R.styleable#CheckedTextView_checkMark
* @see #setCheckMarkDrawable(int)
* @see #getCheckMarkDrawable()
- *
- * @attr ref android.R.styleable#CheckedTextView_checkMark
*/
public void setCheckMarkDrawable(Drawable d) {
if (mCheckMarkDrawable != null) {