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 |
SAVED_POINTER_LOCATIONS
COLOR_BACKGROUND_NORMAL, COLOR_BLACK, COLOR_FOREGROUND_DARK, COLOR_FOREGROUND_LIGHT, COLOR_FOREGROUND_NORMAL, COLOR_TRANSPARENT, COLOR_WHITE, DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
event_listener, event_listener_exclusive, first_child, last_child, next_sibling, nuiid, parent, prev_sibling, unlink_children_on_removal_from_parent
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, style_underlined, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, top
Constructor and Description |
---|
nUITabView()
Create a new nUITabView with a default ID of -1.
|
nUITabView(int nuiid)
Create a new nUITabView, specifiying an ID.
|
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 |
getScreenInnerX() |
int |
getScreenInnerY() |
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)
Sets which child object is currently focused on - automatically unfocuses any previous selection
|
void |
setFocus(boolean focus)
Sets whether this object has focus.
|
void |
setHeaderBgcolor(int headerbgcolor)
Sets the header colour of this view.
|
void |
setHeaderFgColor(int headerFgcolor)
Sets the header colour of this view.
|
void |
setHeight(int height)
Sets the pixel height of this object.
|
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.
|
void |
setWidth(int width)
Sets the pixel width of this object.
|
getBgimage, getBgimageScroll, getBgimageTileH, getBgimageTileV, getHeaderBgcolor, getHeaderHeight, getHeaderimage, getHeadertext, getHscrollable, getInnerHeight, getInterElementYSpacing, getPopupDismissText, getVscrollable, getX, getY, insertAt, onUISynced, resetHeaderFgColor, setBgimage, setBgimageScroll, setBgimageTileH, setBgimageTileV, setHeaderimage, setHeadertext, setHscrollable, setInterElementYSpacing, setPopupDismissText, setVscrollable
getBackgroundDrawable, getBgcolor, getBottom, getFocus, getFocusable, getGesturable, getHeight, getInnerWidth, getInnerX, getInnerY, getLeft, getMaxChildX, getMaxChildY, getRight, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getWidth, insertAtInternal, isEnabled, onRemoved, remove, setBackgroundDrawable, setBgcolor, setBottom, setEnabled, setFocusable, setGesturable, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setRight, setTop, setTriggerable, setX, setY
add, addEventListener, childElementAt, childIndexOf, getTag, insertAfter, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setTag
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(int nuiid)
nuiid
- the id to use.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 setWidth(int width)
nUIDisplayObject
setWidth
in class nUIDisplayObject
width
- Width in pixelspublic void setHeaderBgcolor(int headerbgcolor)
nUIViewDisplay
setHeaderBgcolor
in class nUIViewDisplay
headerbgcolor
- an ARGB color.public void setHeaderFgColor(int headerFgcolor)
nUIViewDisplay
setHeaderFgColor
in class nUIViewDisplay
headerFgcolor
- an ARGB color.public void setHeight(int height)
nUIDisplayObject
setHeight
in class nUIDisplayObject
height
- height in pixelspublic void setFocus(boolean focus)
nUIDisplayObject
setFocus
in class nUIDisplayObject
focus
- true
if this object should have focus.public void setChildFocus(nUIDisplayObject object)
nUIDisplayObject
setChildFocus
in class nUIDisplayObject
object
- The new focus objectpublic int getScreenInnerY()
getScreenInnerY
in class nUIViewDisplay
public int getScreenInnerX()
getScreenInnerX
in class nUIViewDisplay
public boolean nUIEventCallback(nUIObject object, int evt_type)
nUIEventListener
nUIEventCallback
in interface nUIEventListener
object
- The object causing the eventevt_type
- The type of event