-
Notifications
You must be signed in to change notification settings - Fork 7
/
QuickFlowActivity.java
42 lines (34 loc) · 1.21 KB
/
QuickFlowActivity.java
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
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.liyi.example;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.liyi.flow.FlowView;
import com.liyi.flow.adapter.BaseFlowHolder;
import com.liyi.flow.adapter.QuickFlowAdapter;
public class QuickFlowActivity extends Activity {
private FlowView flowView;
private FlowAdapter mAdapter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quick_flow);
flowView = findViewById(R.id.flowVi);
mAdapter = new FlowAdapter();
mAdapter.setData(Utils.getData1());
flowView.setAdapter(mAdapter);
}
private class FlowAdapter extends QuickFlowAdapter<String, BaseFlowHolder> {
public FlowAdapter() {
super();
addItemType(0, R.layout.flow_view_item_simple_text);
}
@Override
public int onHandleViewType(int position) {
return 0;
}
@Override
public void onHandleViewHolder(BaseFlowHolder holder, int position, String item) {
holder.getTextView(R.id.tv_flow_view_simple_text).setText(item);
}
}
}