Search in sources :

Example 51 with FragmentManager

use of androidx.fragment.app.FragmentManager in project android by nextcloud.

the class AuthenticatorActivity method showUntrustedCertDialog.

/**
 * Show untrusted cert dialog
 */
private void showUntrustedCertDialog(RemoteOperationResult result) {
    // Show a dialog with the certificate info
    SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException) result.getException());
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    ft.addToBackStack(null);
    dialog.show(ft, UNTRUSTED_CERT_DIALOG_TAG);
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) SslUntrustedCertDialog(com.owncloud.android.ui.dialog.SslUntrustedCertDialog)

Example 52 with FragmentManager

use of androidx.fragment.app.FragmentManager in project android by nextcloud.

the class ActivityInjector method onActivityCreated.

@Override
public final void onActivityCreated(Activity activity, Bundle savedInstanceState) {
    if (activity instanceof Injectable) {
        AndroidInjection.inject(activity);
    }
    if (activity instanceof FragmentActivity) {
        final FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
        fm.registerFragmentLifecycleCallbacks(new FragmentInjector(), true);
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentActivity(androidx.fragment.app.FragmentActivity)

Example 53 with FragmentManager

use of androidx.fragment.app.FragmentManager in project android by nextcloud.

the class ReceiveExternalFilesActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    prepareStreamsToUpload();
    if (savedInstanceState != null) {
        String parentPath = savedInstanceState.getString(KEY_PARENTS);
        if (parentPath != null) {
            mParents.addAll(Arrays.asList(parentPath.split(OCFile.PATH_SEPARATOR)));
        }
        mFile = savedInstanceState.getParcelable(KEY_FILE);
    }
    mAccountManager = (AccountManager) getSystemService(Context.ACCOUNT_SERVICE);
    super.onCreate(savedInstanceState);
    // Listen for sync messages
    IntentFilter syncIntentFilter = new IntentFilter(RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED);
    syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED);
    mSyncBroadcastReceiver = new SyncBroadcastReceiver();
    localBroadcastManager.registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
    // Init Fragment without UI to retain AsyncTask across configuration changes
    FragmentManager fm = getSupportFragmentManager();
    TaskRetainerFragment taskRetainerFragment = (TaskRetainerFragment) fm.findFragmentByTag(TaskRetainerFragment.FTAG_TASK_RETAINER_FRAGMENT);
    if (taskRetainerFragment == null) {
        taskRetainerFragment = new TaskRetainerFragment();
        fm.beginTransaction().add(taskRetainerFragment, TaskRetainerFragment.FTAG_TASK_RETAINER_FRAGMENT).commit();
    }
// else, Fragment already created and retained across configuration change
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) IntentFilter(android.content.IntentFilter) TaskRetainerFragment(com.owncloud.android.ui.fragment.TaskRetainerFragment)

Example 54 with FragmentManager

use of androidx.fragment.app.FragmentManager in project android by nextcloud.

the class FileOperationsHelper method sendFiles.

public void sendFiles(Set<OCFile> files) {
    // Show dialog
    FragmentManager fm = fileActivity.getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    ft.addToBackStack(null);
    SendFilesDialog sendFilesDialog = SendFilesDialog.newInstance(files);
    sendFilesDialog.show(ft, "TAG_SEND_SHARE_DIALOG");
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) SendFilesDialog(com.owncloud.android.ui.dialog.SendFilesDialog)

Example 55 with FragmentManager

use of androidx.fragment.app.FragmentManager in project Signal-Android by signalapp.

the class MmsPreferencesActivity method onCreate.

@Override
protected void onCreate(Bundle icicle, boolean ready) {
    assert getSupportActionBar() != null;
    this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Fragment fragment = new MmsPreferencesFragment();
    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.replace(android.R.id.content, fragment);
    fragmentTransaction.commit();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment)

Aggregations

FragmentManager (androidx.fragment.app.FragmentManager)163 FragmentTransaction (androidx.fragment.app.FragmentTransaction)55 Fragment (androidx.fragment.app.Fragment)42 Bundle (android.os.Bundle)28 Test (org.junit.Test)15 Intent (android.content.Intent)13 FragmentActivity (androidx.fragment.app.FragmentActivity)10 Activity (android.app.Activity)6 View (android.view.View)6 DialogFragment (androidx.fragment.app.DialogFragment)6 TaskRetainerFragment (com.owncloud.android.ui.fragment.TaskRetainerFragment)5 Context (android.content.Context)4 DialogInterface (android.content.DialogInterface)3 LayoutInflater (android.view.LayoutInflater)3 MenuInflater (android.view.MenuInflater)3 Window (android.view.Window)3 TextView (android.widget.TextView)3 AlertDialog (androidx.appcompat.app.AlertDialog)3 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)3 ViewModelProvider (androidx.lifecycle.ViewModelProvider)3