use of com.xabber.android.ui.adapter.BlockedListAdapter in project xabber-android by redsolution.
the class BlockedListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
account = getAccount(getIntent());
if (account == null) {
finish();
return;
}
setContentView(R.layout.activity_with_toolbar_and_container);
toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.inflateMenu(R.menu.toolbar_block_list);
toolbar.setOnMenuItemClickListener(this);
barPainter = new BarPainter(this, toolbar);
RecyclerView recyclerView = new RecyclerView(this);
((RelativeLayout) findViewById(R.id.fragment_container)).addView(recyclerView);
adapter = new BlockedListAdapter(account);
adapter.setListener(this);
if (savedInstanceState != null) {
final ArrayList<String> checkedContacts = savedInstanceState.getStringArrayList(SAVED_CHECKED_CONTACTS);
if (checkedContacts != null) {
List<UserJid> checkedJids = new ArrayList<>();
for (String contactString : checkedContacts) {
try {
checkedJids.add(UserJid.from(contactString));
} catch (UserJid.UserJidCreateException e) {
LogManager.exception(this, e);
}
}
adapter.setCheckedContacts(checkedJids);
}
}
previousSize = -1;
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}
Aggregations