List of usage examples for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN
int TRANSIT_FRAGMENT_OPEN
To view the source code for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN.
Click Source Link
From source file:com.app.opencity.activities.MainActivity.java
public void setProfile() { int position = mArray.getPosition("DashBoard"); mIsProfile = true;//w ww .j av a 2 s . c om mPlanetTitles[mArray.getPosition("Connexion")] = "Profil"; mArray.notifyDataSetChanged(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) .replace(R.id.content_frame, DashBoardFragment.newInstance(position)).commit(); mDrawerList.setItemChecked(position, true); setTitle(mPlanetTitles[position]); }
From source file:ab.util.AbDialogUtil.java
/** * /* ww w . j a va 2 s . co 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
/** * ??.//from ww w .j a v a 2s.co m * * @param context * the context * @param indeterminateDrawable * 0 * @param message * the message */ public static ProgressDialogFragment showProgressDialog(Context context, int indeterminateDrawable, String message) { FragmentActivity activity = (FragmentActivity) context; ProgressDialogFragment newFragment = ProgressDialogFragment.newInstance(indeterminateDrawable, message); FragmentTransaction ft = activity.getFragmentManager().beginTransaction(); // ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); newFragment.show(ft, mDialogTag); return newFragment; }
From source file:com.app.opencity.activities.MainActivity.java
public void disconnectUser() { int position = mArray.getPosition("DashBoard"); mIsProfile = false;/*www . j a v a2 s. c o m*/ mPlanetTitles[mArray.getPosition("Profil")] = "Connexion"; mArray.notifyDataSetChanged(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) .replace(R.id.content_frame, DashBoardFragment.newInstance(position)).commit(); mDrawerList.setItemChecked(position, true); setTitle(mPlanetTitles[position]); }
From source file:com.optimusinfo.elasticpath.cortex.common.EPFragmentActivity.java
/** * This method adds a fragment to the current activity * //from w w w .j a v a 2s. c o m * @param title * @param isNew * @param tag * @param fargmentContainerId * @param objFragment */ public void addFragmentToBreadCrumb(String title, int fargmentContainerId, EPFragment objFragment) { String breadTitle = title; if (title.length() > 16) { breadTitle = title.substring(0, 14).concat(getString(R.string.ellipsis)); } mStackLevel++; // Add the fragment to the activity, pushing this transaction // on to the back stack. FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.setBreadCrumbTitle(breadTitle); ft.replace(fargmentContainerId, objFragment); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); ft.addToBackStack(null); ft.commit(); }
From source file:com.ab.util.AbDialogUtil.java
/** * /* w ww . ja v a2 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.prasanna.android.stacknetwork.QuestionActivity.java
private void displayPostCommentFragment(String title, long id, int viewPagerPosition, String fragmentTag, String defaultText) {//from w ww. ja v a 2 s.co m postCommentFragment = new PostCommentFragment(); postCommentFragment.setPostId(id); postCommentFragment.setViewPagerPosition(viewPagerPosition); postCommentFragment.setTitle(title); postCommentFragment.setResultReceiver(resultReceiver); if (commentsDraft.get(fragmentTag) != null) postCommentFragment.setDraftText(commentsDraft.get(fragmentTag)); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.fragmentContainer, postCommentFragment, fragmentTag); transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); transaction.addToBackStack(fragmentTag); transaction.commit(); }
From source file:com.bangqu.eshow.util.ESDialogUtil.java
/** * ???dialog String./*w ww . ja va 2s.c om*/ * @param context * @param icon * @param title ? * @param view ??? */ public static ESAlertDialogFragment showAlertDialog(Context context, int icon, String title, String message) { FragmentActivity activity = (FragmentActivity) context; ESAlertDialogFragment newFragment = ESAlertDialogFragment.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:cn.org.eshow.framwork.util.AbDialogUtil.java
/** * ???dialog String./*www.j a v a 2 s.c o m*/ * @param context * @param icon * @param title ? * @param message ??? */ public static AbAlertDialogFragment showAlertDialog(Context context, int icon, String title, String message) { FragmentActivity activity = (FragmentActivity) context; AbAlertDialogFragment newFragment = AbAlertDialogFragment.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.example.android.cloudnotes.ui.HomeActivity.java
/** * This method controls both fragments, instructing them to display a * certain note./* ww w . j a v a 2 s.c o m*/ * * @param noteUri The {@link Uri} of the note to show. To create a new note, * pass {@code null}. */ private void showNote(final Uri noteUri) { if (mTwoPaneView) { // check if the NoteEditFragment has been added FragmentManager fm = getFragmentManager(); NoteEditFragment edit = (NoteEditFragment) fm.findFragmentByTag(NOTE_EDIT_TAG); final boolean editNoteAdded = (edit != null); if (editNoteAdded) { if (edit.mCurrentNote != null && edit.mCurrentNote.equals(noteUri)) { // clicked on the currently selected note return; } NoteEditFragment editFrag = (NoteEditFragment) fm.findFragmentByTag(NOTE_EDIT_TAG); if (noteUri != null) { // load an existing note editFrag.loadNote(noteUri); NoteListFragment list = (NoteListFragment) fm.findFragmentById(R.id.list); list.setActivatedNote(Long.valueOf(noteUri.getLastPathSegment())); } else { // creating a new note - clear the form & list // activation if (editNoteAdded) { editFrag.clear(); } NoteListFragment list = (NoteListFragment) fm.findFragmentById(R.id.list); list.clearActivation(); } } else { // add the NoteEditFragment to the container FragmentTransaction ft = fm.beginTransaction(); edit = new NoteEditFragment(); ft.add(R.id.note_detail_container, edit, NOTE_EDIT_TAG); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); ft.commit(); edit.loadNote(noteUri); } } else { startActivity(new Intent(NoteEditFragment.ACTION_VIEW_NOTE, noteUri)); } }