Search in sources :

Example 11 with FragmentTransaction

use of android.app.FragmentTransaction in project k-9 by k9mail.

the class MessageList method openMessage.

@Override
public void openMessage(MessageReference messageReference) {
    Preferences prefs = Preferences.getPreferences(getApplicationContext());
    Account account = prefs.getAccount(messageReference.getAccountUuid());
    String folderName = messageReference.getFolderName();
    if (folderName.equals(account.getDraftsFolderName())) {
        MessageActions.actionEditDraft(this, messageReference);
    } else {
        mMessageViewContainer.removeView(mMessageViewPlaceHolder);
        if (mMessageListFragment != null) {
            mMessageListFragment.setActiveMessage(messageReference);
        }
        MessageViewFragment fragment = MessageViewFragment.newInstance(messageReference);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.replace(R.id.message_view_container, fragment);
        mMessageViewFragment = fragment;
        ft.commit();
        if (mDisplayMode != DisplayMode.SPLIT_VIEW) {
            showMessageView();
        }
    }
}
Also used : SearchAccount(com.fsck.k9.search.SearchAccount) Account(com.fsck.k9.Account) FragmentTransaction(android.app.FragmentTransaction) MessageViewFragment(com.fsck.k9.ui.messageview.MessageViewFragment) Preferences(com.fsck.k9.Preferences)

Example 12 with FragmentTransaction

use of android.app.FragmentTransaction in project k-9 by k9mail.

the class MessageList method removeMessageViewFragment.

/**
     * Remove MessageViewFragment if necessary.
     */
private void removeMessageViewFragment() {
    if (mMessageViewFragment != null) {
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.remove(mMessageViewFragment);
        mMessageViewFragment = null;
        ft.commit();
        showDefaultTitleView();
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

Example 13 with FragmentTransaction

use of android.app.FragmentTransaction in project k-9 by k9mail.

the class MessageList method addMessageListFragment.

private void addMessageListFragment(MessageListFragment fragment, boolean addToBackStack) {
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.replace(R.id.message_list_container, fragment);
    if (addToBackStack)
        ft.addToBackStack(null);
    mMessageListFragment = fragment;
    int transactionId = ft.commit();
    if (transactionId >= 0 && mFirstBackStackId < 0) {
        mFirstBackStackId = transactionId;
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction) SuppressLint(android.annotation.SuppressLint)

Example 14 with FragmentTransaction

use of android.app.FragmentTransaction in project superCleanMaster by joyoyao.

the class DialogUtil method showAlertDialog.

/**
	 * 显示一个一般的对话框(标题,String内容,确认,取消).
	 * @param context
	 * @param title 对话框标题内容
	 * @param message 对话框提示内容
	 * @param onClickListener 点击确认按钮的事件监听
	 */
public static AlertDialogFragment showAlertDialog(Context context, String title, String message, AlertDialogFragment.DialogOnClickListener onClickListener) {
    FragmentActivity activity = (FragmentActivity) context;
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, title, message, null, onClickListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画   
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction)

Example 15 with FragmentTransaction

use of android.app.FragmentTransaction in project superCleanMaster by joyoyao.

the class DialogUtil method showAlertDialog.

/**
	 * 显示一个一般的对话框(View内容).
	 * @param view 对话框标题内容
	 */
public static AlertDialogFragment showAlertDialog(View view) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, null, null, view, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画   
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction)

Aggregations

FragmentTransaction (android.app.FragmentTransaction)419 Fragment (android.app.Fragment)125 FragmentManager (android.app.FragmentManager)120 Bundle (android.os.Bundle)56 Test (org.junit.Test)36 FragmentActivity (android.support.v4.app.FragmentActivity)27 Intent (android.content.Intent)25 DialogFragment (android.app.DialogFragment)22 View (android.view.View)20 PreferenceFragment (android.support.v14.preference.PreferenceFragment)13 TextView (android.widget.TextView)12 MapCalibrationFragment (com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment)8 MapImportFragment (com.peterlaurence.trekadvisor.menu.mapimport.MapImportFragment)8 MapListFragment (com.peterlaurence.trekadvisor.menu.maplist.MapListFragment)8 MapSettingsFragment (com.peterlaurence.trekadvisor.menu.maplist.MapSettingsFragment)8 MapViewFragment (com.peterlaurence.trekadvisor.menu.mapview.MapViewFragment)8 MarkerManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.markermanage.MarkerManageFragment)8 TracksManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.tracksmanage.TracksManageFragment)8 RecordFragment (com.peterlaurence.trekadvisor.menu.record.RecordFragment)8 Uri (android.net.Uri)7