use of com.xabber.android.ui.activity.XabberAccountInfoActivity in project xabber-android by redsolution.
the class XabberAccountInfoFragment method showLogoutDialog.
private void showLogoutDialog() {
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_logout_xabber_account, null);
final CheckBox chbDeleteAccounts = (CheckBox) view.findViewById(R.id.chbDeleteAccounts);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.progress_title_quit).setMessage(R.string.logout_summary).setView(view).setPositiveButton(R.string.button_quit, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
((XabberAccountInfoActivity) getActivity()).onLogoutClick(chbDeleteAccounts.isChecked());
}
}).setNegativeButton(R.string.cancel, null);
Dialog dialog = builder.create();
dialog.show();
dialogShowed = false;
}
use of com.xabber.android.ui.activity.XabberAccountInfoActivity in project xabber-android by redsolution.
the class AccountSyncDialogFragment method onPositiveClick.
private void onPositiveClick(boolean needGoToMainActivity) {
// set accounts to sync map
if (!switchSyncAll.isChecked()) {
Map<String, Boolean> syncState = new HashMap<>();
for (XMPPAccountSettings account : xmppAccounts) {
if (account.getStatus() != XMPPAccountSettings.SyncStatus.local) {
syncState.put(account.getJid(), account.isSynchronization());
} else if (account.isSynchronization() || XabberAccountManager.getInstance().getAccountSyncState(account.getJid()) != null) {
syncState.put(account.getJid(), account.isSynchronization());
}
}
XabberAccountManager.getInstance().setAccountSyncState(syncState);
}
// update timestamp in accounts if timestamp was changed in dialog
for (XMPPAccountSettings account : xmppAccounts) {
AccountJid accountJid = XabberAccountManager.getInstance().getExistingAccount(account.getJid());
if (accountJid != null)
AccountManager.getInstance().setTimestamp(accountJid, account.getTimestamp());
}
// set sync all
SettingsManager.setSyncAllAccounts(switchSyncAll.isChecked());
// callback to sync-request
((XabberAccountInfoActivity) getActivity()).onSyncClick(needGoToMainActivity);
}
Aggregations