use of androidx.fragment.app.FragmentTransaction in project boilerplate by koush.
the class DrawerActivity method beginContentFragmentTransaction.
public FragmentTransaction beginContentFragmentTransaction(final Fragment content, final String breadcrumb) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
if (breadcrumb != null && null != getSupportFragmentManager().findFragmentById(R.id.main_content))
ft.addToBackStack(breadcrumb);
// ft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
// ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.replace(R.id.main_content, content);
return ft;
}
use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.
the class StartConversationActivity method showPublicChannelDialog.
private void showPublicChannelDialog() {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
CreatePublicChannelDialog dialog = CreatePublicChannelDialog.newInstance(mActivatedAccounts);
dialog.show(ft, FRAGMENT_TAG_DIALOG);
}
use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.
the class StartConversationActivity method showCreateContactDialog.
@SuppressLint("InflateParams")
protected void showCreateContactDialog(final String prefilledJid, final Invite invite) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
EnterJidDialog dialog = EnterJidDialog.newInstance(mActivatedAccounts, getString(R.string.add_contact), getString(R.string.add), prefilledJid, invite == null ? null : invite.account, invite == null || !invite.hasFingerprints(), true);
dialog.setOnEnterJidDialogPositiveListener((accountJid, contactJid) -> {
if (!xmppConnectionServiceBound) {
return false;
}
final Account account = xmppConnectionService.findAccountByJid(accountJid);
if (account == null) {
return true;
}
final Contact contact = account.getRoster().getContact(contactJid);
if (invite != null && invite.getName() != null) {
contact.setServerName(invite.getName());
}
if (contact.isSelf()) {
switchToConversation(contact);
return true;
} else if (contact.showInRoster()) {
throw new EnterJidDialog.JidError(getString(R.string.contact_already_exists));
} else {
final String preAuth = invite == null ? null : invite.getParameter(XmppUri.PARAMETER_PRE_AUTH);
xmppConnectionService.createContact(contact, true, preAuth);
if (invite != null && invite.hasFingerprints()) {
xmppConnectionService.verifyFingerprints(contact, invite.getFingerprints());
}
switchToConversationDoNotAppend(contact, invite == null ? null : invite.getBody());
return true;
}
});
dialog.show(ft, FRAGMENT_TAG_DIALOG);
}
use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.
the class StartConversationActivity method showCreatePrivateGroupChatDialog.
private void showCreatePrivateGroupChatDialog() {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
CreatePrivateGroupChatDialog createConferenceFragment = CreatePrivateGroupChatDialog.newInstance(mActivatedAccounts);
createConferenceFragment.show(ft, FRAGMENT_TAG_DIALOG);
}
use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.
the class StartConversationActivity method showJoinConferenceDialog.
@SuppressLint("InflateParams")
protected void showJoinConferenceDialog(final String prefilledJid) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
JoinConferenceDialog joinConferenceFragment = JoinConferenceDialog.newInstance(prefilledJid, mActivatedAccounts);
joinConferenceFragment.show(ft, FRAGMENT_TAG_DIALOG);
}
Aggregations