|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.View
android.widget.TextView
android.widget.CheckedTextView
public abstract class CheckedTextView
An extension to TextView that supports the Checkable interface.
This is useful when used in a ListView where the it's
setChoiceMode has been set to
something other than CHOICE_MODE_NONE.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.widget.TextView |
|---|
TextView.BufferType, TextView.SavedState |
| Nested classes/interfaces inherited from class android.view.View |
|---|
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
CheckedTextView(Context context)
|
|
CheckedTextView(Context context,
AttributeSet attrs)
|
|
CheckedTextView(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
protected void |
drawableStateChanged()
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown. |
boolean |
isChecked()
|
protected int[] |
onCreateDrawableState(int extraSpace)
Generate the new Drawable state for
this view. |
protected void |
onDraw(Canvas canvas)
Implement this to do your drawing. |
void |
setChecked(boolean checked)
Changes the checked state of this text view. |
void |
setCheckMarkDrawable(Drawable d)
Set the checkmark to a given Drawable. |
void |
setCheckMarkDrawable(int resid)
Set the checkmark to a given Drawable, identified by its resourece id. |
void |
setPadding(int left,
int top,
int right,
int bottom)
Sets the padding. |
void |
toggle()
Change the checked state of the view to the inverse of its current state |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CheckedTextView(Context context)
public CheckedTextView(Context context,
AttributeSet attrs)
public CheckedTextView(Context context,
AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
public void toggle()
Checkable
toggle in interface Checkablepublic boolean isChecked()
isChecked in interface Checkablepublic void setChecked(boolean checked)
Changes the checked state of this text view.
setChecked in interface Checkablechecked - true to check the text, false to uncheck itpublic void setCheckMarkDrawable(int resid)
isChecked() is true.
resid - The Drawable to use for the checkmark.public void setCheckMarkDrawable(Drawable d)
isChecked() is true.
d - The Drawable to use for the checkmark.
public void setPadding(int left,
int top,
int right,
int bottom)
ViewView.getPaddingLeft(), View.getPaddingTop(),
View.getPaddingRight() and View.getPaddingBottom() may be different
from the values set in this call.
setPadding in class TextViewleft - the left padding in pixelstop - the top padding in pixelsright - the right padding in pixelsbottom - the bottom padding in pixelsprotected void onDraw(Canvas canvas)
View
onDraw in class TextViewcanvas - the canvas on which the background will be drawnprotected int[] onCreateDrawableState(int extraSpace)
ViewDrawable state for
this view. This is called by the view
system when the cached Drawable state is determined to be invalid. To
retrieve the current state, you should use View.getDrawableState().
onCreateDrawableState in class ViewextraSpace - if non-zero, this is the number of extra entries you
would like in the returned array in which you can place your own
states.
Drawable state of
the view.View.mergeDrawableStates(int[], int[])protected void drawableStateChanged()
ViewBe sure to call through to the superclass when overriding this function.
drawableStateChanged in class TextViewDrawable.setState(int[])
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||