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.aoppp.gatewaymaster.dialogs.DialogUtil.java

/**
 * ???dialog View./*from ww  w . j  av a2 s  .  c o  m*/
 * @param title ?
 * @param view  ???
 */
public static AlertDialogFragment showAlertDialog(String title, View view) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, title, null, view, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

From source file:devfest2015.asciimmo.MainActivity.java

private void updateFragments() {
    if (isChangingConfigurations() || isFinishing() || isDestroyed()) {
        return;//from  w w w. ja va  2 s  .  com
    }

    Fragment fragment;
    if (hasPlayerConnected()) {
        fragment = mAsciiMmoFragment;
    } else {
        fragment = mCastConnectionFragment;
    }
    getFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commitAllowingStateLoss();
}

From source file:com.google.cast.samples.games.starcast.MainActivity.java

private void updateFragments() {
    if (isChangingConfigurations() || isFinishing() || isDestroyed()) {
        return;/*from   w  w w . j  a  va 2 s .  c  o m*/
    }

    Fragment fragment;
    if (hasPlayerConnected()) {
        fragment = mStarCastFragment;
    } else {
        fragment = mCastConnectionFragment;
    }
    getFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commitAllowingStateLoss();
}

From source file:com.google.cast.samples.games.spritedemo.MainActivity.java

private void updateFragments() {
    if (isChangingConfigurations() || isFinishing() || isDestroyed()) {
        return;//from   w  w w .  ja v a2 s. c o  m
    }

    Fragment fragment;
    CastConnectionManager manager = SpritedemoApplication.getInstance().getCastConnectionManager();
    if (manager.isConnectedToReceiver()) {
        fragment = mSpriteDemoFragment;
    } else {
        fragment = mCastConnectionFragment;
    }
    getFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commitAllowingStateLoss();
}

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

/**
 * /* w w  w .jav a2s  .  c o  m*/
 * ???().
 * @param view
 * @param gravity ?
 * @param onCancelListener?
 * @return
 */
public static AbSampleDialogFragment showDialog(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_Holo_Light_Dialog, 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.aoppp.gatewaymaster.dialogs.DialogUtil.java

/**
 * ?View?.//from w  w w . ja v  a  2s . c  o m
 * @param title ?
 * @param view ???
 * @param onClickListener ?
 */
public static AlertDialogFragment showAlertDialog(String title, View view,
        AlertDialogFragment.DialogOnClickListener onClickListener) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, title, null, view, onClickListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

From source file:com.aoppp.gatewaymaster.dialogs.DialogUtil.java

/**
 * ???dialog String./*from   ww  w.j  av a2  s . c om*/
 * @param context
 * @param title ?
 *
 */
public static AlertDialogFragment showAlertDialog(Context context, String title, String message) {
    FragmentActivity activity = (FragmentActivity) context;
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, title, message, null, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

From source file:com.example.android.touroflondon.MainActivity.java

/**
 * Called when an option item is selected.
 *
 * @param item//  ww w. j ava2  s. c  o  m
 * @return
 */
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.menu_poi: {
        // Show the POI fragment

        // Initialise if required
        if (mPoiListFragment == null) {
            mPoiListFragment = new PoiListFragment();
        }

        // Display the fragment
        getFragmentManager().beginTransaction().replace(R.id.fragment_container, mPoiListFragment)
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).addToBackStack(null).commit();

        // Hide the POI action item
        item.setVisible(false);

        // Enable up navigation from POI fragment
        getActionBar().setDisplayHomeAsUpEnabled(true);
        getActionBar().setTitle(R.string.menu_poi_home_action);

        return true;
    }
    case android.R.id.home: {
        // Home action item, close POI fragment
        closePoiFragment();
        return true;
    }
    case R.id.menu_about:
        // Display about dialog
        new AboutDialog().show(getFragmentManager(), null);
        return true;
    }
    return super.onOptionsItemSelected(item);
}

From source file:com.notriddle.budget.EnvelopesActivity.java

public void switchFragment(Class<?> cls, String name, Bundle args) {
    Fragment frag = Fragment.instantiate(this, cls.getName(), args);
    FragmentManager fragmentManager = getFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.content_frame, frag).addToBackStack(name)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commit();
    fragmentManager.executePendingTransactions();
    configureFragment(frag);/*w ww .j a  v a  2s.com*/
}

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

@Override
public void showConversationList(ConversationListContext listContext) {
    super.showConversationList(listContext);
    enableCabMode();// ww  w .  j ava2s  . c  o m
    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;
}