-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainActivity.java
More file actions
29 lines (24 loc) · 1.04 KB
/
MainActivity.java
File metadata and controls
29 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class MainActivity extends AppCompatActivity implements HKBaseRecyclerAdapter.OnRowClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
List<TestItem> items = new ArrayList<>();
for (int i = 0; i< 100;i++){
TestItem item1 = new TestItem();
item1.setAge(i);
item1.setName("Mihi");
items.add(item1);
}
RecyclerView recyclerView = findViewById(R.id.recycler_view);
TestAdapter adapter = new TestAdapter();
adapter.setItems(items);
HKBaseRecyclerAdapter.OnRowClickListener onRowClickListener = this;
adapter.setOnRowClickListener(onRowClickListener);
recyclerView.setAdapter(adapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
}
@Override
public void onRowClicked(View view, int position, Object item, boolean isChildView) {
}
}