public class nUITabView extends nUIViewDisplay implements nUIEventListener
Modifier and Type | Field and Description |
---|---|
static int |
TAB_DYNAMIC
Denotes a tab area that can go beyond the view width, and scroll horizontally.
|
static int |
TAB_FIXED
Denotes that the tab area is of a fixed width, and that all tabs are expected to fit within the View width.
|
static int |
TEXT_COLOR_NORMAL |
static int |
TEXT_COLOR_SELECTED |
COLOR_BACKGROUND_NORMAL, COLOR_BLACK, COLOR_FOREGROUND_DARK, COLOR_FOREGROUND_LIGHT, COLOR_FOREGROUND_NORMAL, COLOR_TRANSPARENT, COLOR_WHITE, DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
bottom, center, centre, CREATE, CUSTOM_EVENT_CODE0, EVT_BACK_BUTTON, EVT_COMPLETED_EDIT, EVT_DOUBLE_TAP, EVT_GAIN_FOCUS, EVT_LONG_PRESS, EVT_LOSE_FOCUS, EVT_ON_ADDITION, EVT_PICKER_CANCEL, EVT_PICKER_OK, EVT_POST_EDIT, EVT_PRE_EDIT, EVT_SWIPE_LEFT, EVT_SWIPE_RIGHT, EVT_TIMER_COMPLETE, EVT_TRANSITION_FROM_COMPLETE, EVT_TRIGGER, EVT_TRIGGER_HTTP_FAIL, EVT_TRIGGER_HTTP_SUCCESS, GESTURE_DOUBLE_TAP, GESTURE_LONG_PRESS, GESTURE_NONE, GESTURE_SWIPE, left, MAX_DY_FOR_SWIPE, MIN_DX_FOR_SWIPE, MIN_SCROLL_START_THRESHOLD, NO_YES, OFF_ON, POINTER_STATE_DRAGGED, POINTER_STATE_PRESSED, POINTER_STATE_PRESSED_AND_RELEASED, POINTER_STATE_RELEASED, REMOVE, right, size_absolute, size_huge, size_large, size_medium, size_relative, size_small, size_tiny, style_bold, style_default, style_italic, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, top
Constructor and Description |
---|
nUITabView()
Create a new nUITabView with a default ID of -1.
|
nUITabView(java.util.Hashtable propeties) |
Modifier and Type | Method and Description |
---|---|
void |
enableIconHighlighting(boolean highlight)
Enables/disables icon highlighting.
|
int |
getIndicatorColor()
Get the ARGB color of the indicator used to highlight the currently active tab.
|
int |
getSelectedTab()
Gets the 0-based index of the currently active tab in the set.
|
IBackgroundDrawable |
getTabBackgroundColor()
Get the
IBackgroundDrawable responsible for |
nUIElementDisplay |
getTabElement(int idx)
Get the tab element at the specified index.
|
int |
getTabFontFace()
Get the current font style that is used to render tab headings.
|
float |
getTabFontSize()
Get the current font size, in device independent pixels.
|
int |
getTabMode()
Gets the current tab mode.
|
int |
getTabTextColor(int state)
Get the current color used for the tab text.
|
boolean |
isIconHighlightingEnabled()
Determine if icon highlighting has been enabled for this nUITabView.
|
boolean |
nUIEventCallback(nUIObject object,
int evt_type)
The callback method a developer can register for which will be called for all object events
|
void |
setChildFocus(nUIDisplayObject object) |
void |
setFocus(boolean focus) |
void |
setIndicatorColor(int anIndicatorColor)
Set the ARGB color of the indicator used to highlight the currently active tab.
|
void |
setIndicatorHeight(float anIndicatorHeight)
Set the height of the indicator highlighting the currently active tab.
|
void |
setSelectedTab(int idx)
Set the currently active tab.
|
void |
setTabBackgroundColor(IBackgroundDrawable aTabBackgroundColor)
Set the
IBackgroundDrawable responsible for
handling how the background of the tabs are drawn. |
void |
setTabFontFace(int aTabFontFace)
Set the font style used to render tab headings.
|
void |
setTabFontSize(float aTabFontSize)
Set the font size for tab headings, in device independent pixels.
|
void |
setTabMode(int aTabMode)
Set the current tab mode.
|
void |
setTabTextColor(int aTabTextColor,
int state)
Set the text color for tab labels.
|
void |
setTabTextColors(int aNormalColor,
int aSelectedColor)
Set the tab label's text color for both selected and normal states at the same time.
|
void |
setTabViewListener(ITabViewListener aListener)
Sets the Object that should be notified when the current tab changes.
|
void |
setTabViewProvider(ITabViewProvider aTabViewProvider)
Sets the Object that will provide tab information, such as the number of tabs,
their labels and their content.
|
getBgimageScroll, getHeaderBackground, getHeaderHeight, getHeadertext, getHscrollable, getInterElementYSpacing, getPopupDismissText, getVscrollable, onUISynced, setBgimageScroll, setHeaderBackground, setHeaderFgColor, setHeadertext, setHscrollable, setInterElementYSpacing, setPopupDismissText, setVscrollable, syncUI
getBackgroundDrawable, getBottom, getElementIdentifier, getFocusable, getGesturable, getHeight, getInnerHeight, getInnerWidth, getInnerX, getInnerY, getLeft, getMaxChildX, getMaxChildY, getProperties, getProperty, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getWidth, getX, getY, insertAtInternal, isEnabled, isVisible, onRemoved, remove, setBackgroundDrawable, setBottom, setElementIdentifier, setEnabled, setFocusable, setGesturable, setHeight, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setProperties, setProperty, setRight, setTop, setTriggerable, setVisible, setWidth, setX, setY
add, addEventListener, childElementAt, childIndexOf, getFirstChild, getId, getLastChild, getNextSibling, getParent, getPrevSibling, getTag, insertAfter, insertAt, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setId, setTag, setUnlinkChildrenOnRemoval
public static final int TAB_FIXED
public static final int TAB_DYNAMIC
public static final int TEXT_COLOR_NORMAL
public static final int TEXT_COLOR_SELECTED
public nUITabView()
public nUITabView(java.util.Hashtable propeties)
public void enableIconHighlighting(boolean highlight)
highlight
- - if true enables highlighting, otherwise disables it.public boolean isIconHighlightingEnabled()
true
if highlighting is enabled, false
otherwise.public int getSelectedTab()
public void setSelectedTab(int idx)
idx
- the index of the tab to make active.public void setTabViewListener(ITabViewListener aListener)
aListener
- the object implementing ITabViewListener
.public void setTabViewProvider(ITabViewProvider aTabViewProvider)
aTabViewProvider
- the Object implementing ITabViewProvider
ITabViewProvider
public int getTabTextColor(int state)
state
- the state for which the text color should be returned,
either TEXT_COLOR_NORMAL
or TEXT_COLOR_SELECTED
.public void setTabTextColor(int aTabTextColor, int state)
aTabTextColor
- an ARGB color to set.state
- the state for which the text color should be returned,
either TEXT_COLOR_NORMAL
or TEXT_COLOR_SELECTED
.public void setTabTextColors(int aNormalColor, int aSelectedColor)
aNormalColor
- an ARGB color that will be used when the tab is not selected.aSelectedColor
- an ARGB color that will be used when the tab is selected.public int getTabFontFace()
nUIConstants
(or more, in a bitwise OR).nUIConstants
public void setTabFontFace(int aTabFontFace)
aTabFontFace
- one of nUIConstants.style_bold
,
nUIConstants.style_italic
, nUIConstants.style_underlined
or
nUIConstants.style_default
nUIConstants
public float getTabFontSize()
public void setTabFontSize(float aTabFontSize)
aTabFontSize
- The size, in device-independent points.public int getTabMode()
TAB_FIXED
or TAB_DYNAMIC
.public void setTabMode(int aTabMode)
aTabMode
- One of either TAB_FIXED
or TAB_DYNAMIC
.public IBackgroundDrawable getTabBackgroundColor()
IBackgroundDrawable
responsible forIBackgroundDrawable
representing the current background.public void setTabBackgroundColor(IBackgroundDrawable aTabBackgroundColor)
IBackgroundDrawable
responsible for
handling how the background of the tabs are drawn.aTabBackgroundColor
- The IBackgroundDrawable
that is used to
define the background of this element.public int getIndicatorColor()
public void setIndicatorColor(int anIndicatorColor)
public void setIndicatorHeight(float anIndicatorHeight)
anIndicatorHeight
- a height specified in device-independent pixels.public nUIElementDisplay getTabElement(int idx)
idx
- the index position of the tab wanted (starting from 0)nUIElementDisplay
representing the requested tab, or null
public void setFocus(boolean focus)
public void setChildFocus(nUIDisplayObject object)
public boolean nUIEventCallback(nUIObject object, int evt_type)
nUIEventListener
nUIEventCallback
in interface nUIEventListener
object
- The object causing the eventevt_type
- The type of event