use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class FileDisplayActivity method createMinFragments.
private void createMinFragments(Bundle savedInstanceState) {
if (savedInstanceState == null) {
OCFileListFragment listOfFiles = new OCFileListFragment();
Bundle args = new Bundle();
args.putBoolean(OCFileListFragment.ARG_ALLOW_CONTEXTUAL_ACTIONS, true);
listOfFiles.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.left_fragment_container, listOfFiles, TAG_LIST_OF_FILES);
transaction.commit();
} else {
getSupportFragmentManager().findFragmentByTag(TAG_LIST_OF_FILES);
}
}
use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class FileDisplayActivity method setSecondFragment.
/**
* Replaces the second fragment managed by the activity with the received as a parameter.
* <p>
* Assumes never will be more than two fragments managed at the same time.
*
* @param fragment New second Fragment to set.
*/
// in future no dual pane
@Deprecated
private void setSecondFragment(Fragment fragment) {
if (searchView != null) {
searchView.post(new Runnable() {
@Override
public void run() {
searchView.setQuery(searchQuery, true);
}
});
}
setDrawerIndicatorEnabled(false);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.right_fragment_container, fragment, TAG_SECOND_FRAGMENT);
transaction.commit();
}
use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class FolderPickerActivity method createFragments.
protected void createFragments() {
OCFileListFragment listOfFiles = new OCFileListFragment();
Bundle args = new Bundle();
args.putBoolean(OCFileListFragment.ARG_ONLY_FOLDERS_CLICKABLE, true);
args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true);
args.putBoolean(OCFileListFragment.ARG_HIDE_ITEM_OPTIONS, true);
args.putBoolean(OCFileListFragment.ARG_SEARCH_ONLY_FOLDER, mSearchOnlyFolders);
listOfFiles.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
transaction.commit();
}
use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class FileActivity method showUntrustedCertDialog.
/**
* Show untrusted cert dialog
*/
public void showUntrustedCertDialog(RemoteOperationResult result) {
// Show a dialog with the certificate info
FragmentManager fm = getSupportFragmentManager();
SslUntrustedCertDialog dialog = (SslUntrustedCertDialog) fm.findFragmentByTag(DIALOG_UNTRUSTED_CERT);
if (dialog == null) {
dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException) result.getException());
FragmentTransaction ft = fm.beginTransaction();
dialog.show(ft, DIALOG_UNTRUSTED_CERT);
}
}
use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class FilePickerActivity method createFragments.
@Override
protected void createFragments() {
OCFileListFragment listOfFiles = new OCFileListFragment();
Bundle args = new Bundle();
args.putBoolean(OCFileListFragment.ARG_ONLY_FOLDERS_CLICKABLE, true);
args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true);
args.putBoolean(OCFileListFragment.ARG_HIDE_ITEM_OPTIONS, true);
args.putBoolean(OCFileListFragment.ARG_SEARCH_ONLY_FOLDER, false);
args.putBoolean(OCFileListFragment.ARG_FILE_SELECTABLE, true);
args.putString(OCFileListFragment.ARG_MIMETYPE, getIntent().getStringExtra(OCFileListFragment.ARG_MIMETYPE));
listOfFiles.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
transaction.commit();
}
Aggregations