当前位置: 首页>>代码示例>>Java>>正文


Java FragmentTransaction.isEmpty方法代码示例

本文整理汇总了Java中android.support.v4.app.FragmentTransaction.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java FragmentTransaction.isEmpty方法的具体用法?Java FragmentTransaction.isEmpty怎么用?Java FragmentTransaction.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.app.FragmentTransaction的用法示例。


在下文中一共展示了FragmentTransaction.isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onTabReselected

import android.support.v4.app.FragmentTransaction; //导入方法依赖的package包/类
@Override
public void onTabReselected(android.app.ActionBar.Tab tab, android.app.FragmentTransaction ft) {
    if (mListener != null) {
        FragmentTransaction trans = null;
        if (mActivity instanceof FragmentActivity) {
            trans = ((FragmentActivity)mActivity).getSupportFragmentManager().beginTransaction()
                    .disallowAddToBackStack();
        }

        mListener.onTabReselected(this, trans);

        if (trans != null && !trans.isEmpty()) {
            trans.commit();
        }
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:17,代码来源:ActionBarWrapper.java

示例2: selectTab

import android.support.v4.app.FragmentTransaction; //导入方法依赖的package包/类
@Override
public void selectTab(Tab tab) {
    if (getNavigationMode() != NAVIGATION_MODE_TABS) {
        mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
        return;
    }

    FragmentTransaction trans = null;
    if (mActivity instanceof FragmentActivity) {
        trans = ((FragmentActivity)mActivity).getSupportFragmentManager().beginTransaction()
                .disallowAddToBackStack();
    }

    if (mSelectedTab == tab) {
        if (mSelectedTab != null) {
            mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans);
            mTabScrollView.animateToTab(tab.getPosition());
        }
    } else {
        mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION);
        if (mSelectedTab != null) {
            mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans);
        }
        mSelectedTab = (TabImpl) tab;
        if (mSelectedTab != null) {
            mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans);
        }
    }

    if (trans != null && !trans.isEmpty()) {
        trans.commit();
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:34,代码来源:ActionBarImpl.java

示例3: selectTab

import android.support.v4.app.FragmentTransaction; //导入方法依赖的package包/类
public void selectTab(Tab tab) {
    int i = -1;
    if (getNavigationMode() != 2) {
        this.mSavedTabPosition = tab != null ? tab.getPosition() : -1;
        return;
    }
    FragmentTransaction trans;
    if (!(this.mActivity instanceof FragmentActivity) || this.mDecorToolbar.getViewGroup().isInEditMode()) {
        trans = null;
    } else {
        trans = ((FragmentActivity) this.mActivity).getSupportFragmentManager().beginTransaction().disallowAddToBackStack();
    }
    if (this.mSelectedTab != tab) {
        ScrollingTabContainerView scrollingTabContainerView = this.mTabScrollView;
        if (tab != null) {
            i = tab.getPosition();
        }
        scrollingTabContainerView.setTabSelected(i);
        if (this.mSelectedTab != null) {
            this.mSelectedTab.getCallback().onTabUnselected(this.mSelectedTab, trans);
        }
        this.mSelectedTab = (TabImpl) tab;
        if (this.mSelectedTab != null) {
            this.mSelectedTab.getCallback().onTabSelected(this.mSelectedTab, trans);
        }
    } else if (this.mSelectedTab != null) {
        this.mSelectedTab.getCallback().onTabReselected(this.mSelectedTab, trans);
        this.mTabScrollView.animateToTab(tab.getPosition());
    }
    if (trans != null && !trans.isEmpty()) {
        trans.commit();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:34,代码来源:WindowDecorActionBar.java


注:本文中的android.support.v4.app.FragmentTransaction.isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。