aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/ui/CreateConferenceDialog.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java7
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java4
3 files changed, 11 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/CreateConferenceDialog.java b/src/main/java/de/pixart/messenger/ui/CreateConferenceDialog.java
index 0cb6e294f..da0fe37de 100644
--- a/src/main/java/de/pixart/messenger/ui/CreateConferenceDialog.java
+++ b/src/main/java/de/pixart/messenger/ui/CreateConferenceDialog.java
@@ -21,13 +21,15 @@ import de.pixart.messenger.services.XmppConnectionService;
public class CreateConferenceDialog extends DialogFragment {
private static final String ACCOUNTS_LIST_KEY = "activated_accounts_list";
+ private static final String MULTIPLE_ACCOUNTS = "multiple_accounts_enabled";
public XmppConnectionService xmppConnectionService;
private CreateConferenceDialogListener mListener;
- public static CreateConferenceDialog newInstance(List<String> accounts) {
+ public static CreateConferenceDialog newInstance(List<String> accounts, boolean multipleAccounts) {
CreateConferenceDialog dialog = new CreateConferenceDialog();
Bundle bundle = new Bundle();
bundle.putStringArrayList(ACCOUNTS_LIST_KEY, (ArrayList<String>) accounts);
+ bundle.putBoolean(MULTIPLE_ACCOUNTS, multipleAccounts);
dialog.setArguments(bundle);
return dialog;
}
@@ -48,7 +50,7 @@ public class CreateConferenceDialog extends DialogFragment {
//final Spinner spinner = dialogView.findViewById(R.id.account);
//final EditText subject = dialogView.findViewById(R.id.subject);
CreateConferenceDialogBinding binding = DataBindingUtil.inflate(getActivity().getLayoutInflater(), R.layout.create_conference_dialog, null, false);
- if (xmppConnectionService != null && xmppConnectionService.multipleAccounts()) {
+ if (getArguments().getBoolean(MULTIPLE_ACCOUNTS)) {
binding.yourAccount.setVisibility(View.VISIBLE);
binding.account.setVisibility(View.VISIBLE);
} else {
diff --git a/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java b/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java
index 21b6ff743..c35a95438 100644
--- a/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java
+++ b/src/main/java/de/pixart/messenger/ui/JoinConferenceDialog.java
@@ -28,15 +28,18 @@ public class JoinConferenceDialog extends DialogFragment implements OnBackendCon
private static final String PREFILLED_JID_KEY = "prefilled_jid";
private static final String ACCOUNTS_LIST_KEY = "activated_accounts_list";
+ private static final String MULTIPLE_ACCOUNTS = "multiple_accounts_enabled";
public XmppConnectionService xmppConnectionService;
private JoinConferenceDialogListener mListener;
private KnownHostsAdapter knownHostsAdapter;
- public static JoinConferenceDialog newInstance(String prefilledJid, List<String> accounts) {
+ public static JoinConferenceDialog newInstance(String prefilledJid, List<String> accounts, boolean multipleAccounts) {
JoinConferenceDialog dialog = new JoinConferenceDialog();
Bundle bundle = new Bundle();
bundle.putString(PREFILLED_JID_KEY, prefilledJid);
+ bundle.putBoolean(MULTIPLE_ACCOUNTS, multipleAccounts);
bundle.putStringArrayList(ACCOUNTS_LIST_KEY, (ArrayList<String>) accounts);
+
dialog.setArguments(bundle);
return dialog;
}
@@ -60,7 +63,7 @@ public class JoinConferenceDialog extends DialogFragment implements OnBackendCon
if (prefilledJid != null) {
binding.jid.append(prefilledJid);
}
- if (xmppConnectionService != null && xmppConnectionService.multipleAccounts()) {
+ if (getArguments().getBoolean(MULTIPLE_ACCOUNTS)) {
binding.yourAccount.setVisibility(View.VISIBLE);
binding.account.setVisibility(View.VISIBLE);
} else {
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index a46c2a6c3..85ae80f84 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -494,7 +494,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
ft.remove(prev);
}
ft.addToBackStack(null);
- JoinConferenceDialog joinConferenceFragment = JoinConferenceDialog.newInstance(prefilledJid, mActivatedAccounts);
+ JoinConferenceDialog joinConferenceFragment = JoinConferenceDialog.newInstance(prefilledJid, mActivatedAccounts, xmppConnectionService.multipleAccounts());
joinConferenceFragment.show(ft, FRAGMENT_TAG_DIALOG);
}
@@ -505,7 +505,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
ft.remove(prev);
}
ft.addToBackStack(null);
- CreateConferenceDialog createConferenceFragment = CreateConferenceDialog.newInstance(mActivatedAccounts);
+ CreateConferenceDialog createConferenceFragment = CreateConferenceDialog.newInstance(mActivatedAccounts, xmppConnectionService.multipleAccounts());
createConferenceFragment.show(ft, FRAGMENT_TAG_DIALOG);
}