當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。