use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class ConflictsResolveActivity method startDialog.
private void startDialog() {
Optional<User> userOptional = getUser();
if (!userOptional.isPresent()) {
Log_OC.e(TAG, "User not present");
showErrorAndFinish();
}
// Check whether the file is contained in the current Account
Fragment prev = getSupportFragmentManager().findFragmentByTag("conflictDialog");
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
if (prev != null) {
fragmentTransaction.remove(prev);
}
if (existingFile != null && getStorageManager().fileExists(newFile.getRemotePath())) {
ConflictsResolveDialog dialog = ConflictsResolveDialog.newInstance(existingFile, newFile, userOptional.get());
dialog.show(fragmentTransaction, "conflictDialog");
} else {
// Account was changed to a different one - just finish
Log_OC.e(TAG, "Account was changed, finishing");
showErrorAndFinish();
}
}
use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class ContactsPreferenceActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.contacts_preference);
// setup toolbar
setupToolbar();
// setup drawer
// setupDrawer(R.id.nav_contacts); // TODO needed?
// show sidebar?
boolean showSidebar = getIntent().getBooleanExtra(EXTRA_SHOW_SIDEBAR, true);
if (!showSidebar) {
setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
if (mDrawerToggle != null) {
mDrawerToggle.setDrawerIndicatorEnabled(false);
}
}
Intent intent = getIntent();
if (savedInstanceState == null) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
if (intent == null || intent.getParcelableExtra(EXTRA_FILE) == null || intent.getParcelableExtra(EXTRA_USER) == null) {
BackupFragment fragment = BackupFragment.create(showSidebar);
transaction.add(R.id.frame_container, fragment);
} else {
OCFile file = intent.getParcelableExtra(EXTRA_FILE);
User user = intent.getParcelableExtra(EXTRA_USER);
BackupListFragment contactListFragment = BackupListFragment.newInstance(file, user);
transaction.add(R.id.frame_container, contactListFragment);
}
transaction.commit();
}
}
use of androidx.fragment.app.FragmentTransaction 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);
}
use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class DisplayUtils method openSortingOrderDialogFragment.
public static void openSortingOrderDialogFragment(FragmentManager supportFragmentManager, FileSortOrder sortOrder) {
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
fragmentTransaction.addToBackStack(null);
SortingOrderDialogFragment.newInstance(sortOrder).show(fragmentTransaction, SORTING_ORDER_FRAGMENT);
}
use of androidx.fragment.app.FragmentTransaction 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");
}
Aggregations