| AndBase开发框架 1.6

- 首页
- 相关页面
- 命名空间
- 类
- 文件

- 类列表
- 类索引
- 类继承关系
- 类成员

全部 类 命名空间 文件 函数 变量 枚举值 页
类 | Public 成员函数 | Public 属性 | Private 成员函数 | Private 属性 | 所有成员列表
com.ab.view.sliding.AbSlidingTabView类 参考
类 com.ab.view.sliding.AbSlidingTabView 继承关系图:

## 类
class | MyOnPageChangeListener

## Public 成员函数
| AbSlidingTabView (Context context)
| AbSlidingTabView (Context context, AttributeSet attrs)
void | onMeasure (int widthMeasureSpec, int heightMeasureSpec)
void | onAttachedToWindow ()
void | onDetachedFromWindow ()
void | notifyTabDataSetChanged ()
void | setCurrentItem (int item)
void | setOnPageChangeListener (ViewPager.OnPageChangeListener listener)
void | setTabTextColor (int tabColor)
void | setTabSelectColor (int tabColor)
void | setTabTextSize (int tabTextSize)
void | setTabBackgroundResource (int resid)
void | setTabLayoutBackgroundResource (int resid)
void | addItemViews (List< String > tabTexts, List< Fragment > fragments)
void | addItemViews (List< String > tabTexts, List< Fragment > fragments, List< Drawable > drawables)
void | addItemView (String tabText, Fragment fragment)
void | addItemView (String tabText, Fragment fragment, Drawable drawable)
void | removeItemView (int index)
void | removeAllItemViews ()
ViewPager | getViewPager ()
void | setTabPadding (int left, int top, int right, int bottom)

## Public 属性
int | mMaxTabWidth

## Private 成员函数
void | animateToTab (final int position)
void | addTab (String text, int index)
void | addTab (String text, int index, Drawable top)

## Private 属性
Context | context
Runnable | mTabSelector
ViewPager.OnPageChangeListener | mListener
int | mSelectedTabIndex
int | tabBackgroundResource = -1
int | tabTextSize = 30
int | tabTextColor = Color.BLACK
int | tabSelectColor = Color.BLACK
LinearLayout | mTabLayout = null
HorizontalScrollView | mTabScrollView = null
ViewPager | mViewPager
List< String > | tabItemTextList = null
List< Drawable > | tabItemDrawableList = null
ArrayList< Fragment > | pagerItemList = null
ArrayList< TextView > | tabItemList = null
AbFragmentPagerAdapter | mFragmentPagerAdapter = null
OnClickListener | mTabClickListener

## 详细描述

© 2012 amsoft.cn 名称：AbSlidingTabView.java 描述：滑动的tab,tab不固定超出后可滑动.

作者
  还如一梦中

版本
  v1.0

日期
  ：2013-05-17 下午6:46:29

## 构造及析构函数说明

com.ab.view.sliding.AbSlidingTabView.AbSlidingTabView | ( | Context | context | ) |
| inline

Instantiates a new ab sliding tab view.

参数

  context | the context

com.ab.view.sliding.AbSlidingTabView.AbSlidingTabView | ( | Context | context,
|  | AttributeSet | attrs
| ) |  |
| inline

Instantiates a new ab sliding tab view.

参数

  context | the context
  attrs | the attrs

## 成员函数说明

void com.ab.view.sliding.AbSlidingTabView.addItemView | ( | String | tabText,
|  | Fragment | fragment
| ) |  |
| inline

描述：增加一个内容与tab.

参数

  tabText | the tab text
  fragment | the fragment

void com.ab.view.sliding.AbSlidingTabView.addItemView | ( | String | tabText,
|  | Fragment | fragment,
|  | Drawable | drawable
| ) |  |
| inline

描述：增加一个内容与tab.

参数

  tabText | the tab text
  fragment | the fragment
  drawable | the drawable

void com.ab.view.sliding.AbSlidingTabView.addItemViews | ( | List< String > | tabTexts,
|  | List< Fragment > | fragments
| ) |  |
| inline

描述：增加一组内容与tab.

参数

  tabTexts | the tab texts
  fragments | the fragments

void com.ab.view.sliding.AbSlidingTabView.addItemViews | ( | List< String > | tabTexts,
|  | List< Fragment > | fragments,
|  | List< Drawable > | drawables
| ) |  |
| inline

描述：增加一组内容与tab.

参数

  tabTexts | the tab texts
  fragments | the fragments
  drawables | the drawables

void com.ab.view.sliding.AbSlidingTabView.addTab | ( | String | text,
|  | int | index
| ) |  |
| inline private

描述：创造一个Tab.

参数

  text | the text
  index | the index

void com.ab.view.sliding.AbSlidingTabView.addTab | ( | String | text,
|  | int | index,
|  | Drawable | top
| ) |  |
| inline private

描述：创造一个Tab.

参数

  text | the text
  index | the index
  top | the top

void com.ab.view.sliding.AbSlidingTabView.animateToTab | ( | final int | position | ) |
| inline private

Animate to tab.

参数

  position | the position

ViewPager com.ab.view.sliding.AbSlidingTabView.getViewPager | ( |  | ) |
| inline

描述：获取这个View的ViewPager.

返回
  the view pager

void com.ab.view.sliding.AbSlidingTabView.notifyTabDataSetChanged | ( |  | ) |
| inline

描述：tab有变化刷新.

void com.ab.view.sliding.AbSlidingTabView.onAttachedToWindow | ( |  | ) |
| inline

void com.ab.view.sliding.AbSlidingTabView.onDetachedFromWindow | ( |  | ) |
| inline

void com.ab.view.sliding.AbSlidingTabView.onMeasure | ( | int | widthMeasureSpec,
|  | int | heightMeasureSpec
| ) |  |
| inline

void com.ab.view.sliding.AbSlidingTabView.removeAllItemViews | ( |  | ) |
| inline

描述：删除所有.

void com.ab.view.sliding.AbSlidingTabView.removeItemView | ( | int | index | ) |
| inline

描述：删除某一个.

参数

  index | the index

void com.ab.view.sliding.AbSlidingTabView.setCurrentItem | ( | int | item | ) |
| inline

描述：设置显示哪一个.

参数

  item | the new current item

void com.ab.view.sliding.AbSlidingTabView.setOnPageChangeListener | ( | ViewPager.OnPageChangeListener | listener | ) |
| inline

描述：设置一个外部的监听器.

参数

  listener | the new on page change listener

void com.ab.view.sliding.AbSlidingTabView.setTabBackgroundResource | ( | int | resid | ) |
| inline

描述：设置单个tab的背景选择器.

参数

  resid | the new tab background resource

void com.ab.view.sliding.AbSlidingTabView.setTabLayoutBackgroundResource | ( | int | resid | ) |
| inline

描述：设置Tab的背景.

参数

  resid | the new tab layout background resource

void com.ab.view.sliding.AbSlidingTabView.setTabPadding | ( | int | left,
|  | int | top,
|  | int | right,
|  | int | bottom
| ) |  |
| inline

描述：设置每个tab的边距.

参数

  left | the left
  top | the top
  right | the right
  bottom | the bottom

void com.ab.view.sliding.AbSlidingTabView.setTabSelectColor | ( | int | tabColor | ) |
| inline

描述：设置选中的颜色.

参数

  tabColor | the new tab select color

void com.ab.view.sliding.AbSlidingTabView.setTabTextColor | ( | int | tabColor | ) |
| inline

描述：设置tab文字的颜色.

参数

  tabColor | the new tab text color

void com.ab.view.sliding.AbSlidingTabView.setTabTextSize | ( | int | tabTextSize | ) |
| inline

描述：设置文字大小.

参数

  tabTextSize | the new tab text size

## 类成员变量说明

Context com.ab.view.sliding.AbSlidingTabView.context
| private

The context.

AbFragmentPagerAdapter com.ab.view.sliding.AbSlidingTabView.mFragmentPagerAdapter = null
| private

内容区域的适配器.

ViewPager.OnPageChangeListener com.ab.view.sliding.AbSlidingTabView.mListener
| private

The m listener.

int com.ab.view.sliding.AbSlidingTabView.mMaxTabWidth

The m max tab width.

int com.ab.view.sliding.AbSlidingTabView.mSelectedTabIndex
| private

The m selected tab index.

OnClickListener com.ab.view.sliding.AbSlidingTabView.mTabClickListener
| private

初始值:
= new OnClickListener() {
public void onClick(View view) {
AbTabItemView tabView = (AbTabItemView)view;
mViewPager.setCurrentItem(tabView.getIndex());
}
}

The m tab click listener.

LinearLayout com.ab.view.sliding.AbSlidingTabView.mTabLayout = null
| private

tab的线性布局.

HorizontalScrollView com.ab.view.sliding.AbSlidingTabView.mTabScrollView = null
| private

tab的线性布局父.

Runnable com.ab.view.sliding.AbSlidingTabView.mTabSelector
| private

The m tab selector.

ViewPager com.ab.view.sliding.AbSlidingTabView.mViewPager
| private

The m view pager.

ArrayList<Fragment> com.ab.view.sliding.AbSlidingTabView.pagerItemList = null
| private

内容的View.

int com.ab.view.sliding.AbSlidingTabView.tabBackgroundResource = -1
| private

tab的背景.

List<Drawable> com.ab.view.sliding.AbSlidingTabView.tabItemDrawableList = null
| private

tab的图标.

ArrayList<TextView> com.ab.view.sliding.AbSlidingTabView.tabItemList = null
| private

tab的列表.

List<String> com.ab.view.sliding.AbSlidingTabView.tabItemTextList = null
| private

tab的文字.

int com.ab.view.sliding.AbSlidingTabView.tabSelectColor = Color.BLACK
| private

tab的选中文字颜色.

int com.ab.view.sliding.AbSlidingTabView.tabTextColor = Color.BLACK
| private

tab的文字颜色.

int com.ab.view.sliding.AbSlidingTabView.tabTextSize = 30
| private

tab的文字大小.

该类的文档由以下文件生成:

- src/com/ab/view/sliding/AbSlidingTabView.java