|
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.AnalogClock
public class AnalogClock
This widget display an analogic clock with two hands for hours and minutes.
| Nested Class Summary |
|---|
| 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 | |
|---|---|
AnalogClock(Context context)
|
|
AnalogClock(Context context,
AttributeSet attrs)
|
|
AnalogClock(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
protected void |
onAttachedToWindow()
This is called when the view is attached to a window. |
protected void |
onDetachedFromWindow()
This is called when the view is detached from a window. |
protected void |
onDraw(Canvas canvas)
Implement this to do your drawing. |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
Measure the view and its content to determine the measured width and the measured height. |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh)
This is called during layout when the size of this view has changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnalogClock(Context context)
public AnalogClock(Context context,
AttributeSet attrs)
public AnalogClock(Context context,
AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
protected void onAttachedToWindow()
ViewView.onDraw(android.graphics.Canvas), however it may be called
any time before the first onDraw -- including before or after
View.onMeasure(int, int).
onAttachedToWindow in class ViewView.onDetachedFromWindow()protected void onDetachedFromWindow()
View
onDetachedFromWindow in class ViewView.onAttachedToWindow()
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
View
Measure the view and its content to determine the measured width and the
measured height. This method is invoked by View.measure(int, int) and
should be overriden by subclasses to provide accurate and efficient
measurement of their contents.
CONTRACT: When overriding this method, you
must call View.setMeasuredDimension(int, int) to store the
measured width and height of this view. Failure to do so will trigger an
IllegalStateException, thrown by
View.measure(int, int). Calling the superclass'
View.onMeasure(int, int) is a valid use.
The base class implementation of measure defaults to the background size,
unless a larger size is allowed by the MeasureSpec. Subclasses should
override View.onMeasure(int, int) to provide better measurements of
their content.
If this method is overridden, it is the subclass's responsibility to make
sure the measured height and width are at least the view's minimum height
and width (View.getSuggestedMinimumHeight() and
View.getSuggestedMinimumWidth()).
onMeasure in class ViewwidthMeasureSpec - horizontal space requirements as imposed by the parent.
The requirements are encoded with
View.MeasureSpec.heightMeasureSpec - vertical space requirements as imposed by the parent.
The requirements are encoded with
View.MeasureSpec.View.getMeasuredWidth(),
View.getMeasuredHeight(),
View.setMeasuredDimension(int, int),
View.getSuggestedMinimumHeight(),
View.getSuggestedMinimumWidth(),
View.MeasureSpec.getMode(int),
View.MeasureSpec.getSize(int)
protected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
View
onSizeChanged in class Vieww - Current width of this view.h - Current height of this view.oldw - Old width of this view.oldh - Old height of this view.protected void onDraw(Canvas canvas)
View
onDraw in class Viewcanvas - the canvas on which the background will be drawn
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||