public class

CarouselHost

extends FrameLayout
implements ViewTreeObserver.OnTouchModeChangeListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.htc.widget.CarouselHost

This class is deprecated.
Not supported class

Class Overview

Container for a tabbed window view. This object holds two children: a set of tab labels that the user clicks to select a specific tab, and a FrameLayout object that displays the contents of that page. The individual elements are typically controlled using this container object, rather than setting values on the child elements themselves. CarouselHost is a modification version of TabSwitchHost for supporting edit mode window

Summary

Constants
int TASK_STATE_DEFAULT TASK_STATE_DEFAULT: in CarouselWidget initially and can be dragged to pool
int TASK_STATE_POOL TASK_STATE_POOL: in pool initially and can be dragged back to the pool once in CarouselWidget
int TASK_STATE_UNREMOVABLE TASK_STATE_UNREMOVABLE: in CarouselWidget initially and can't be dragged to the pool
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
Fields
protected String mBackupCurrentTag
protected String mCurrentTabTag
[Expand]
Inherited Fields
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
Public Constructors
CarouselHost(Context context)
CarouselHost(Context context, AttributeSet attrs)
Public Methods
void addPanelView(View panelView)
void addTab(String tag, Context context, int title, int rest, int on, int overlay, Intent intent)
A simplified version of addTab().
void addTab(String tag, Context context, int title, int rest, int on, int overlay, Intent intent, int state)
Another version of addTab() with the ability to specify which to contain the newly added tab indicator initially.
boolean dispatchKeyEvent(KeyEvent event)
CarouselWidget getCarouselWidget()
Returns the TabSwitchWidget
int getCurrentTab()
Returns the index of current tab
String getCurrentTabTag()
Returns the tag of the current tab
View getCurrentTabView()
Returns the view of the current tab
View getCurrentView()
Returns the current view
FrameLayout getTabContentView()
Gets the FrameLayout which holds tab content
boolean onInterceptTouchEvent(MotionEvent ev)
boolean onTouchEvent(MotionEvent ev)
void onTouchModeChanged(boolean isInTouchMode)
void removeTabByTag(String tag)
Removes a tab from Database.
void setAlternativeTabName(String tag, CharSequence text)
void setCountText(String tag, CharSequence text)
void setCountVisibility(String tag, boolean enable)
void setCurrentTabByTag(String tag)
Sets current tab to the specified tag
void setTabHintEnabled(boolean tabHint)
Enables or disables the tab hint
void startDrag(View view, DragSource source, Object dragInfo, int dragAction)
void switchPanelView()
void useDefaultTabName(String tag)
Protected Methods
void dispatchDraw(Canvas canvas)
void onAttachedToWindow()
void onConfigurationChanged(Configuration newConfig)
void onDetachedFromWindow()
void onMeasure(int width, int height)
void onSizeChanged(int w, int h, int oldw, int oldh)
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.graphics.drawable.Drawable.Callback2
From interface android.view.HtcIfViewGroup
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.ViewTreeObserver.OnTouchModeChangeListener
From interface android.view.accessibility.AccessibilityEventSource

Constants

public static final int TASK_STATE_DEFAULT

Since: API Level 2.0

TASK_STATE_DEFAULT: in CarouselWidget initially and can be dragged to pool

Constant Value: 99 (0x00000063)

public static final int TASK_STATE_POOL

Since: API Level 2.0

TASK_STATE_POOL: in pool initially and can be dragged back to the pool once in CarouselWidget

Constant Value: 100 (0x00000064)

public static final int TASK_STATE_UNREMOVABLE

Since: API Level 2.0

TASK_STATE_UNREMOVABLE: in CarouselWidget initially and can't be dragged to the pool

Constant Value: 101 (0x00000065)

Fields

protected String mBackupCurrentTag

Since: API Level 2.0

protected String mCurrentTabTag

Since: API Level 2.0

Public Constructors

public CarouselHost (Context context)

Since: API Level 2.0

public CarouselHost (Context context, AttributeSet attrs)

Since: API Level 2.0

Public Methods

public void addPanelView (View panelView)

Since: API Level 2.0

public void addTab (String tag, Context context, int title, int rest, int on, int overlay, Intent intent)

Since: API Level 2.0

A simplified version of addTab(). The default condition is that the added tab indicator is in the CarouselWidget and it can be move to the pool by the users.

Parameters
tag The label text on the tab indicator that should be unique at whole application
context The context
title Resource ID of the title
rest Resource ID of the rest Icon
on Resource ID of the On Icon
overlay Resource ID of the overlay icon
intent The intent which starts the activity

public void addTab (String tag, Context context, int title, int rest, int on, int overlay, Intent intent, int state)

Since: API Level 2.0

Another version of addTab() with the ability to specify which to contain the newly added tab indicator initially.

Parameters
tag The label text on the tab indicator that should be unique at whole application
context The context
title Resource ID of the title
rest Resource ID of the rest Icon
on Resource ID of the On Icon
overlay Resource ID of the overlay icon
intent The intent which starts the activity
state The state of the indicator: TASK_STATE_DEFAULT, TASK_STATE_POOL or TASK_STATE_UNREMOVABLE.

public boolean dispatchKeyEvent (KeyEvent event)

Since: API Level

public CarouselWidget getCarouselWidget ()

Since: API Level 2.0

Returns the TabSwitchWidget

Returns
  • The TabSwitchWidget

public int getCurrentTab ()

Since: API Level 2.0

Returns the index of current tab

Returns
  • The index of current tab

public String getCurrentTabTag ()

Since: API Level 2.0

Returns the tag of the current tab

Returns
  • The tag of the current tab

public View getCurrentTabView ()

Since: API Level 2.0

Returns the view of the current tab

Returns
  • The view of the current tab

public View getCurrentView ()

Since: API Level 2.0

Returns the current view

Returns
  • The current view

public FrameLayout getTabContentView ()

Since: API Level 2.0

Gets the FrameLayout which holds tab content

Returns
  • The FrameLayout which holds tab content

public boolean onInterceptTouchEvent (MotionEvent ev)

Since: API Level

public boolean onTouchEvent (MotionEvent ev)

Since: API Level

public void onTouchModeChanged (boolean isInTouchMode)

Since: API Level 2.0

public void removeTabByTag (String tag)

Since: API Level 2.0

Removes a tab from Database.

public void setAlternativeTabName (String tag, CharSequence text)

Since: API Level 2.0

public void setCountText (String tag, CharSequence text)

Since: API Level 2.0

public void setCountVisibility (String tag, boolean enable)

Since: API Level 2.0

public void setCurrentTabByTag (String tag)

Since: API Level 2.0

Sets current tab to the specified tag

Parameters
tag The tag name of the tab

public void setTabHintEnabled (boolean tabHint)

Since: API Level 2.0

Enables or disables the tab hint

Parameters
tabHint true to enable the tab hint, false otherwise

public void startDrag (View view, DragSource source, Object dragInfo, int dragAction)

Since: API Level 2.0

public void switchPanelView ()

Since: API Level 2.0

public void useDefaultTabName (String tag)

Since: API Level 2.0

Protected Methods

protected void dispatchDraw (Canvas canvas)

Since: API Level

protected void onAttachedToWindow ()

Since: API Level

protected void onConfigurationChanged (Configuration newConfig)

Since: API Level

protected void onDetachedFromWindow ()

Since: API Level

protected void onMeasure (int width, int height)

Since: API Level

protected void onSizeChanged (int w, int h, int oldw, int oldh)

Since: API Level