use of com.h6ah4i.android.example.advrecyclerview.common.adapter.OnListItemClickMessageListener in project android-advancedrecyclerview by h6ah4i.
the class MinimalHeaderFooterExampleActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_minimal);
OnListItemClickMessageListener clickListener = new OnListItemClickMessageListener() {
@Override
public void onItemClicked(String message) {
View container = findViewById(R.id.container);
Snackbar.make(container, message, Snackbar.LENGTH_SHORT).show();
}
};
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
RecyclerView.Adapter adapter;
adapter = new SimpleDemoItemAdapter(clickListener);
adapter = new DemoHeaderFooterAdapter(adapter, clickListener);
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}
Aggregations