use of com.xabber.android.ui.adapter.XMPPAccountAdapter in project xabber-android by redsolution.
the class AccountSyncDialogFragment method setupView.
public View setupView() {
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_account_sync, null);
switchSyncAll = (Switch) view.findViewById(R.id.switchSyncAll);
switchSyncAll.setChecked(SettingsManager.isSyncAllAccounts());
switchSyncAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (adapter != null)
adapter.setAllChecked(b);
}
});
if (AccountManager.getInstance().haveNotAllowedSyncAccounts())
switchSyncAll.setEnabled(false);
setXmppAccounts(XabberAccountManager.getInstance().getXmppAccountsForSync());
adapter = new XMPPAccountAdapter(getActivity());
adapter.setItems(xmppAccounts);
if (adapter != null && SettingsManager.isSyncAllAccounts())
adapter.setAllChecked(true);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
return view;
}
use of com.xabber.android.ui.adapter.XMPPAccountAdapter in project xabber-android by redsolution.
the class AccountSyncFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
tvLastSyncDate = (TextView) view.findViewById(R.id.tvLastSyncDate);
switchSyncAll = (Switch) view.findViewById(R.id.switchSyncAll);
switchSyncAll.setChecked(SettingsManager.isSyncAllAccounts());
switchSyncAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (adapter != null)
adapter.setAllChecked(b);
saveSyncSettings();
}
});
if (AccountManager.getInstance().haveNotAllowedSyncAccounts())
switchSyncAll.setEnabled(false);
setXmppAccounts(XabberAccountManager.getInstance().getXmppAccountsForSync());
adapter = new XMPPAccountAdapter(getActivity(), this);
adapter.setItems(xmppAccounts);
if (adapter != null && SettingsManager.isSyncAllAccounts())
adapter.setAllChecked(true);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
}
Aggregations