|
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.view.ViewGroup
android.widget.LinearLayout
android.widget.TabWidget
public class TabWidget
Displays a list of tab labels representing each page in the parent's tab
collection. The container object for this widget is
TabHost. When the user selects a tab, this
object sends a message to the parent container, TabHost, to tell it to switch
the displayed page. You typically won't use many methods directly on this
object. The container TabHost is used to add labels, add the callback
handler, and manage callbacks. You might call this object to iterate the list
of tabs, or to tweak the layout of the tab list, but most methods should be
called on the containing TabHost object.
| Nested Class Summary | |
|---|---|
(package private) static interface |
TabWidget.OnTabSelectionChanged
Let TabHost know that the user clicked on a tab indicator. |
| Nested classes/interfaces inherited from class android.widget.LinearLayout |
|---|
LinearLayout.LayoutParams |
| Nested classes/interfaces inherited from class android.view.ViewGroup |
|---|
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener |
| 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 |
|---|
| Fields inherited from class android.widget.LinearLayout |
|---|
HORIZONTAL, VERTICAL |
| Constructor Summary | |
|---|---|
TabWidget(Context context)
|
|
TabWidget(Context context,
AttributeSet attrs)
|
|
TabWidget(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
void |
addView(View child)
Adds a child view. |
void |
childDrawableStateChanged(View child)
If {link #addStatesFromChildren} is true, refreshes this group's drawable state (to include the states from its children). |
void |
dispatchDraw(Canvas canvas)
Called by draw to draw the child views. |
void |
focusCurrentTab(int index)
Sets the current tab and focuses the UI on it. |
void |
onFocusChange(View v,
boolean hasFocus)
Called when the focus state of a view has changed. |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh)
This is called during layout when the size of this view has changed. |
void |
setCurrentTab(int index)
Sets the current tab. |
void |
setEnabled(boolean enabled)
Set the enabled state of this view. |
(package private) void |
setTabSelectionListener(TabWidget.OnTabSelectionChanged listener)
Provides a way for TabHost to be notified that the user clicked on a tab indicator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface android.view.ViewParent |
|---|
createContextMenu, getParent, isLayoutRequested, requestLayout |
| Constructor Detail |
|---|
public TabWidget(Context context)
public TabWidget(Context context,
AttributeSet attrs)
public TabWidget(Context context,
AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
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.public void childDrawableStateChanged(View child)
ViewGroup
childDrawableStateChanged in interface ViewParentchildDrawableStateChanged in class ViewGroupchild - The child whose drawable state has changed.public void dispatchDraw(Canvas canvas)
ViewGroup
dispatchDraw in class ViewGroupcanvas - the canvas on which to draw the viewpublic void setCurrentTab(int index)
setCurrentTab(int). Normally, the view logic takes care of
adjusting the focus, so unless you're circumventing the UI,
you'll probably just focus your interest here.
index - The tab that you want to indicate as the selected
tab (tab brought to the front of the widget)focusCurrentTab(int)public void focusCurrentTab(int index)
setCurrentTab(int). Normally this would not
be an issue if we go through the UI, since the UI is responsible
for calling TabWidget.onFocusChanged(), but in the case where we
are selecting the tab programmatically, we'll need to make sure
focus keeps up.
index - The tab that you want focused (highlighted in orange)
and selected (tab brought to the front of the widget)setCurrentTab(int)public void setEnabled(boolean enabled)
View
setEnabled in class Viewenabled - True if this view is enabled, false otherwise.public void addView(View child)
ViewGroup
addView in class ViewGroupchild - the child view to addViewGroup.generateDefaultLayoutParams()void setTabSelectionListener(TabWidget.OnTabSelectionChanged listener)
TabHost to be notified that the user clicked on a tab indicator.
public void onFocusChange(View v,
boolean hasFocus)
View.OnFocusChangeListener
onFocusChange in interface View.OnFocusChangeListenerv - The view whose state has changed.hasFocus - The new focus state of v.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||