use of com.xabber.android.ui.widget.SimpleItemTouchHelperCallback in project xabber-android by redsolution.
the class AccountListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_list);
toolbar = (Toolbar) findViewById(R.id.toolbar_default);
toolbar.setNavigationIcon(R.drawable.ic_clear_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(AccountListActivity.this);
}
});
toolbar.setTitle(R.string.title_reordering_account);
toolbar.inflateMenu(R.menu.toolbar_account_list);
toolbar.setOnMenuItemClickListener(this);
barPainter = new BarPainter(this, toolbar);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.account_list_recycler_view);
tvSummary = (TextView) findViewById(R.id.tvSummary);
accountListAdapter = new AccountListReorderAdapter(this, this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(accountListAdapter);
ItemTouchHelper.Callback callback = new SimpleItemTouchHelperCallback(accountListAdapter);
touchHelper = new ItemTouchHelper(callback);
touchHelper.attachToRecyclerView(recyclerView);
}
Aggregations