本文整理汇总了Java中com.actionbarsherlock.app.ActionBar.Tab.getPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Tab.getPosition方法的具体用法?Java Tab.getPosition怎么用?Java Tab.getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.actionbarsherlock.app.ActionBar.Tab
的用法示例。
在下文中一共展示了Tab.getPosition方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTabSelected
import com.actionbarsherlock.app.ActionBar.Tab; //导入方法依赖的package包/类
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
// TODO Auto-generated method stub
switch(tab.getPosition()) {
case 0:
NormalFragment frag = new NormalFragment();
ft.replace(android.R.id.content, frag);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#33b5e5")));
enableNormal();
break;
case 1:
BatteryFragment frag1 = new BatteryFragment();
ft.replace(android.R.id.content, frag1);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ff5858")));
enableBattery();
break;
}
}
示例2: onTabSelected
import com.actionbarsherlock.app.ActionBar.Tab; //导入方法依赖的package包/类
@Override
public void onTabSelected(Tab tab, FragmentTransaction transaction) {
switch (tab.getPosition()) {
case POSITION_TAB_NUMERIC:
mWebViewTab1.setVisibility(View.VISIBLE);
mWebViewTab2.setVisibility(View.GONE);
mWebViewTab3.setVisibility(View.GONE);
break;
case POSITION_TAB_QUICKNAV:
mWebViewTab1.setVisibility(View.GONE);
mWebViewTab2.setVisibility(View.VISIBLE);
mWebViewTab3.setVisibility(View.GONE);
break;
case POSITION_TAB_ADVANCED:
mWebViewTab1.setVisibility(View.GONE);
mWebViewTab2.setVisibility(View.GONE);
mWebViewTab3.setVisibility(View.VISIBLE);
break;
default:
break;
}
}
示例3: onTabSelected
import com.actionbarsherlock.app.ActionBar.Tab; //导入方法依赖的package包/类
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
clearDetails();
if (mViewPager.getCurrentItem() != tab.getPosition()) {
mViewPager.setCurrentItem(tab.getPosition(), true);
}
}
示例4: onTabSelected
import com.actionbarsherlock.app.ActionBar.Tab; //导入方法依赖的package包/类
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
SherlockFragment toShow = null;
if (tab.getPosition() == 0){
toShow = new LoginFragment();
}else{
toShow = new RegisterFragment();
}
ft.replace(android.R.id.content, toShow); // <----- Content view is set here
}
示例5: addTab
import com.actionbarsherlock.app.ActionBar.Tab; //导入方法依赖的package包/类
private void addTab(int expectedTabIndex, int icon, int description) {
final Tab tab = mActionBar.newTab();
tab.setTabListener(mTabListener);
if (mShowTabsAsText) {
tab.setText(description);
} else {
tab.setIcon(icon);
tab.setContentDescription(description);
}
mActionBar.addTab(tab);
if (expectedTabIndex != tab.getPosition()) {
throw new IllegalStateException("Tabs must be created in the right order");
}
}
示例6: onTabSelected
import com.actionbarsherlock.app.ActionBar.Tab; //导入方法依赖的package包/类
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
if (mViewPager.getCurrentItem() != tab.getPosition()) {
mViewPager.setCurrentItem(tab.getPosition(), true);
}
}
示例7: onTabSelected
import com.actionbarsherlock.app.ActionBar.Tab; //导入方法依赖的package包/类
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
if(mViewPager.getCurrentItem() != tab.getPosition())
mViewPager.setCurrentItem(tab.getPosition());
}