Example usage for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN

List of usage examples for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN

Introduction

In this page you can find the example usage for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN.

Prototype

int TRANSIT_FRAGMENT_OPEN

To view the source code for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN.

Click Source Link

Document

Fragment is being added onto the stack

Usage

From source file:com.tony.selene.dialog.AbDialogUtil.java

/**
 * ???dialog String./*from w  w  w .  ja  v  a2  s  . c  o m*/
 * 
 * @param context
 * @param icon
 * @param title
 *            ?
 * @param view
 *            ???
 */
public static TCAlertDialogFragment showAlertDialog(Context context, int icon, String title, String message) {
    FragmentActivity activity = (FragmentActivity) context;
    TCAlertDialogFragment newFragment = TCAlertDialogFragment.newInstance(icon, title, message, null, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

From source file:com.ab.util.AbDialogUtil.java

/**
 * ?()//  w w  w.java 2 s  .  c  om
 * @param view
 * @param onCancelListener
 * @return
 */
public static AbSampleDialogFragment showPanel(View view, int gravity,
        DialogInterface.OnCancelListener onCancelListener) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Light_Panel, gravity);
    newFragment.setContentView(view);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.setOnCancelListener(onCancelListener);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

From source file:com.chen.mail.ui.OnePaneController.java

@Override
protected void showConversation(Conversation conversation, boolean inLoaderCallbacks) {
    super.showConversation(conversation, inLoaderCallbacks);
    mConversationListVisible = false;/*w w  w .  ja  va2s  .co m*/
    if (conversation == null) {
        transitionBackToConversationListMode();
        return;
    }
    disableCabMode();
    if (ConversationListContext.isSearchResult(mConvListContext)) {
        mViewMode.enterSearchResultsConversationMode();
    } else {
        mViewMode.enterConversationMode();
    }
    final FragmentManager fm = mActivity.getFragmentManager();
    final FragmentTransaction ft = fm.beginTransaction();
    // Switching to conversation view is an incongruous transition:
    // we are not replacing a fragment with another fragment as
    // usual. Instead, reveal the heretofore inert conversation
    // ViewPager and just remove the previously visible fragment
    // e.g. conversation list, or possibly label list?).
    final Fragment f = fm.findFragmentById(R.id.content_pane);
    // FragmentManager#findFragmentById can return fragments that are not added to the activity.
    // We want to make sure that we don't attempt to remove fragments that are not added to the
    // activity, as when the transaction is popped off, the FragmentManager will attempt to
    // readd the same fragment twice
    if (f != null && f.isAdded()) {
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        ft.remove(f);
        ft.commitAllowingStateLoss();
        fm.executePendingTransactions();
    }
    mPagerController.show(mAccount, mFolder, conversation, true /* changeVisibility */);
    onConversationVisibilityChanged(true);
    onConversationListVisibilityChanged(false);
}

From source file:com.tct.mail.ui.OnePaneController.java

@Override
public void showConversationList(ConversationListContext listContext) {
    super.showConversationList(listContext);
    // TS: tao.gan 2015-09-21 EMAIL FEATURE-559893 ADD_S
    //we change from ConversationViewFramgent to ConversationListFragment, should let the toolbar show
    animateShow(null);//from ww  w.  ja v a 2s .  com
    // TS: tao.gan 2015-09-21 EMAIL FEATURE-559893 ADD_E
    enableCabMode();
    mConversationListVisible = true;
    if (ConversationListContext.isSearchResult(listContext)) {
        mViewMode.enterSearchResultsListMode();
    } else {
        mViewMode.enterConversationListMode();
    }
    final int transition = mConversationListNeverShown ? FragmentTransaction.TRANSIT_FRAGMENT_FADE
            : FragmentTransaction.TRANSIT_FRAGMENT_OPEN;
    final Fragment conversationListFragment = ConversationListFragment.newInstance(listContext);

    if (!inInbox(mAccount, listContext)) {
        // Maintain fragment transaction history so we can get back to the
        // fragment used to launch this list.
        // AM: Kexue.Geng 2015-03-23 EMAIL BUGFIX_953177 MOD_S
        // mLastConversationListTransactionId = replaceFragment(conversationListFragment,
        //         transition, TAG_CONVERSATION_LIST, R.id.content_pane);
        try {
            mLastConversationListTransactionId = replaceFragment(conversationListFragment, transition,
                    TAG_CONVERSATION_LIST, R.id.content_pane);
        } catch (IllegalStateException e) {
            e.printStackTrace();
            mLastConversationListTransactionId = INVALID_ID;
        }
        // AM: Kexue.Geng 2015-03-23 EMAIL BUGFIX_953177 MOD_E
    } else {
        // If going to the inbox, clear the folder list transaction history.
        mInbox = listContext.folder;
        // TS: zhaotianyong 2015-05-21 EMAIL BUGFIX_1008675 MOD_S
        try {
            replaceFragment(conversationListFragment, transition, TAG_CONVERSATION_LIST, R.id.content_pane);
        } catch (IllegalStateException e) {
            LogUtils.e(LogUtils.TAG, e, "showConversationList error"); //TS: zheng.zou 2015-07-01 EMAIL BUGFIX-1033368 MOD
        }
        // TS: zhaotianyong 2015-05-21 EMAIL BUGFIX_1008675 MOD_E

        // If we ever to to the inbox, we want to unset the transation id for any other
        // non-inbox folder.
        mLastConversationListTransactionId = INVALID_ID;
    }
    //TS: zheng.zou 2015-07-01 EMAIL BUGFIX-1033368 MOD_S
    if (!mActivity.isDestroyed()) {
        try {
            mActivity.getFragmentManager().executePendingTransactions();
        } catch (IllegalStateException e) {
            LogUtils.e(LogUtils.TAG, e, "showConversationList error");
        }
    } else {
        LogUtils.w(LOG_TAG, "showConversationList activity is destroyed");
    }
    //TS: zheng.zou 2015-07-01 EMAIL BUGFIX-1033368 MOD_E

    onConversationVisibilityChanged(false);
    onConversationListVisibilityChanged(true);
    mConversationListNeverShown = false;
}

From source file:com.bangqu.eshow.util.ESDialogUtil.java

/**
 * ?string?./*from ww w.ja  va2  s  .c o m*/
 * @param context
 * @param icon
 * @param title ?
 * @param message ???
 * @param onClickListener ?
 */
public static ESAlertDialogFragment showAlertDialog(Context context, int icon, String title, String message,
        AbDialogOnClickListener onClickListener) {
    FragmentActivity activity = (FragmentActivity) context;
    ESAlertDialogFragment newFragment = ESAlertDialogFragment.newInstance(icon, title, message, null,
            onClickListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

From source file:cn.org.eshow.framwork.util.AbDialogUtil.java

/**
 * ?string?.//from   w w w  .j a  v  a  2s.com
 * @param context
 * @param icon
 * @param title ?
 * @param message ???
 * @param onClickListener ?
 */
public static AbAlertDialogFragment showAlertDialog(Context context, int icon, String title, String message,
        AbDialogOnClickListener onClickListener) {
    FragmentActivity activity = (FragmentActivity) context;
    AbAlertDialogFragment newFragment = AbAlertDialogFragment.newInstance(icon, title, message, null,
            onClickListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

From source file:net.hockeyapp.android.internal.CheckUpdateTask.java

private void showUpdateFragment(final JSONArray updateInfo) {
    FragmentTransaction fragmentTransaction = activity.getFragmentManager().beginTransaction();
    fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);

    Fragment existingFragment = activity.getFragmentManager().findFragmentByTag("hockey_update_dialog");
    if (existingFragment != null) {
        fragmentTransaction.remove(existingFragment);
    }/*from   w w w. j av  a  2 s  . c  om*/
    fragmentTransaction.addToBackStack(null);

    // Create and show the dialog
    Class<? extends UpdateFragment> fragmentClass = UpdateFragment.class;
    if (listener != null) {
        fragmentClass = listener.getUpdateFragmentClass();
    }

    try {
        Method method = fragmentClass.getMethod("newInstance", JSONArray.class, String.class);
        DialogFragment updateFragment = (DialogFragment) method.invoke(null, updateInfo, getURLString("apk"));
        updateFragment.show(fragmentTransaction, "hockey_update_dialog");
    } catch (Exception e) {
        Log.d(Constants.TAG, "An exception happened while showing the update fragment:");
        e.printStackTrace();
        Log.d(Constants.TAG, "Showing update activity instead.");
        startUpdateIntent(updateInfo, false);
    }
}

From source file:ab.util.AbDialogUtil.java

/**
 * //from   w w  w .j  a  v  a  2  s  .  c o  m
 * ???().
 * 
 * @param view
 * @param gravity
 * @return
 */
public static AbSampleDialogFragment showPanel(View view, int gravity) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Light_Panel, gravity);
    newFragment.setContentView(view);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

From source file:com.android.mail.ui.OnePaneController.java

@Override
protected void showConversationList(ConversationListContext listContext) {
    enableCabMode();/*w  w w  .  ja v a2s  .c  om*/
    mConversationListVisible = true;
    if (ConversationListContext.isSearchResult(listContext)) {
        mViewMode.enterSearchResultsListMode();
    } else {
        mViewMode.enterConversationListMode();
    }
    final int transition = mConversationListNeverShown ? FragmentTransaction.TRANSIT_FRAGMENT_FADE
            : FragmentTransaction.TRANSIT_FRAGMENT_OPEN;
    final Fragment conversationListFragment = ConversationListFragment.newInstance(listContext);

    if (!inInbox(mAccount, listContext)) {
        // Maintain fragment transaction history so we can get back to the
        // fragment used to launch this list.
        mLastConversationListTransactionId = replaceFragment(conversationListFragment, transition,
                TAG_CONVERSATION_LIST, R.id.content_pane);
    } else {
        // If going to the inbox, clear the folder list transaction history.
        mInbox = listContext.folder;
        replaceFragment(conversationListFragment, transition, TAG_CONVERSATION_LIST, R.id.content_pane);

        // If we ever to to the inbox, we want to unset the transation id for any other
        // non-inbox folder.
        mLastConversationListTransactionId = INVALID_ID;
    }

    mActivity.getFragmentManager().executePendingTransactions();

    onConversationVisibilityChanged(false);
    onConversationListVisibilityChanged(true);
    mConversationListNeverShown = false;
}

From source file:com.chen.mail.ui.OnePaneController.java

@Override
public void showWaitForInitialization() {
    super.showWaitForInitialization();
    replaceFragment(getWaitFragment(), FragmentTransaction.TRANSIT_FRAGMENT_OPEN, TAG_WAIT, R.id.content_pane);
}