Skip to content

Commit 2fb4028

Browse files
author
Gilles Debunne
committed
API fix in CheckedTextView
Bug 6103310 Change-Id: Ic144ed99199a296df3ef1a16f59caff08af58fd9
1 parent 2f87014 commit 2fb4028

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

api/current.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26885,6 +26885,7 @@ package android.widget {
2688526885
ctor public CheckedTextView(android.content.Context);
2688626886
ctor public CheckedTextView(android.content.Context, android.util.AttributeSet);
2688726887
ctor public CheckedTextView(android.content.Context, android.util.AttributeSet, int);
26888+
method public android.graphics.drawable.Drawable getCheckMarkDrawable();
2688826889
method public boolean isChecked();
2688926890
method public void setCheckMarkDrawable(int);
2689026891
method public void setCheckMarkDrawable(android.graphics.drawable.Drawable);

core/java/android/widget/CheckedTextView.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
* {@link android.widget.ListView#setChoiceMode(int) setChoiceMode} has been set to
3636
* something other than {@link android.widget.ListView#CHOICE_MODE_NONE CHOICE_MODE_NONE}.
3737
*
38+
* @attr ref android.R.styleable#CheckedTextView_checked
39+
* @attr ref android.R.styleable#CheckedTextView_checkMark
3840
*/
3941
public class CheckedTextView extends TextView implements Checkable {
4042
private boolean mChecked;
@@ -100,6 +102,11 @@ public void setChecked(boolean checked) {
100102
* when {@link #isChecked()} is true.
101103
*
102104
* @param resid The Drawable to use for the checkmark.
105+
*
106+
* @see #setCheckMarkDrawable(Drawable)
107+
* @see #getCheckMarkDrawable()
108+
*
109+
* @attr ref android.R.styleable#CheckedTextView_checkMark
103110
*/
104111
public void setCheckMarkDrawable(int resid) {
105112
if (resid != 0 && resid == mCheckMarkResource) {
@@ -119,6 +126,11 @@ public void setCheckMarkDrawable(int resid) {
119126
* Set the checkmark to a given Drawable. This will be drawn when {@link #isChecked()} is true.
120127
*
121128
* @param d The Drawable to use for the checkmark.
129+
*
130+
* @see #setCheckMarkDrawable(int)
131+
* @see #getCheckMarkDrawable()
132+
*
133+
* @attr ref android.R.styleable#CheckedTextView_checkMark
122134
*/
123135
public void setCheckMarkDrawable(Drawable d) {
124136
if (mCheckMarkDrawable != null) {
@@ -142,6 +154,20 @@ public void setCheckMarkDrawable(Drawable d) {
142154
resolvePadding();
143155
}
144156

157+
/**
158+
* Gets the checkmark drawable
159+
*
160+
* @return The drawable use to represent the checkmark, if any.
161+
*
162+
* @see #setCheckMarkDrawable(Drawable)
163+
* @see #setCheckMarkDrawable(int)
164+
*
165+
* @attr ref android.R.styleable#CheckedTextView_checkMark
166+
*/
167+
public Drawable getCheckMarkDrawable() {
168+
return mCheckMarkDrawable;
169+
}
170+
145171
@Override
146172
public void onPaddingChanged(int layoutDirection) {
147173
int newPadding = (mCheckMarkDrawable != null) ?

0 commit comments

Comments
 (0)