public class

CarouselHost

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

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 drag 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 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 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()
Get the FrameLayout which holds tab content
boolean onInterceptTouchEvent(MotionEvent ev)
boolean onTouchEvent(MotionEvent ev)
void onTouchModeChanged(boolean isInTouchMode)
void removeTabByTag(String tag)
remove a tab from Database.
void setCurrentTabByTag(String tag)
Sets current tab to the specified tag
void setTabHintEnabled(boolean tabHint)
Enable or disable the tab hint
Protected Methods
void dispatchDraw(Canvas canvas)
void onAttachedToWindow()
void onConfigurationChanged(Configuration newConfig)
void onDetachedFromWindow()
void onMeasure(int w, int h)
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.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
From interface com.htc.tracker.ObjectTracker.Visitor

Constants

public static final int TASK_STATE_DEFAULT

TASK_STATE_DEFAULT: in CarouselWidget initially and can be drag to pool

Constant Value: 99 (0x00000063)

public static final int TASK_STATE_POOL

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

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

Constant Value: 101 (0x00000065)

Fields

protected String mCurrentTabTag

Public Constructors

public CarouselHost (Context context)

public CarouselHost (Context context, AttributeSet attrs)

Public Methods

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

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)

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)

public CarouselWidget getCarouselWidget ()

Returns the TabSwitchWidget

Returns
  • The TabSwitchWidget

public int getCurrentTab ()

Returns the index of current tab

Returns
  • The index of current tab

public String getCurrentTabTag ()

Returns the tag of the current tab

Returns
  • The tag of the current tab

public View getCurrentTabView ()

Returns the view of the current tab

Returns
  • The view of the current tab

public View getCurrentView ()

Returns the current view

Returns
  • The current view

public FrameLayout getTabContentView ()

Get the FrameLayout which holds tab content

Returns
  • The FrameLayout which holds tab content

public boolean onInterceptTouchEvent (MotionEvent ev)

public boolean onTouchEvent (MotionEvent ev)

public void onTouchModeChanged (boolean isInTouchMode)

public void removeTabByTag (String tag)

remove a tab from Database.

public void setCurrentTabByTag (String tag)

Sets current tab to the specified tag

Parameters
tag The tag name of the tab

public void setTabHintEnabled (boolean tabHint)

Enable or disable the tab hint

Parameters
tabHint true to enable the tab hint, false otherwise

Protected Methods

protected void dispatchDraw (Canvas canvas)

protected void onAttachedToWindow ()

protected void onConfigurationChanged (Configuration newConfig)

protected void onDetachedFromWindow ()

protected void onMeasure (int w, int h)

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