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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package cn.flightfeather.thirdapp.adapter;
 
import android.content.Context;
import android.support.constraint.ConstraintLayout;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
 
import cn.flightfeather.thirdapp.R;
import cn.flightfeather.thirdapp.util.ScreenUtils;
import cn.flightfeather.thirdapp.util.slideswaphelper.Extension;
 
 
/**
 * Created by note_ff_1602 on 2017/9/14.
 */
 
public class TaskListHolder extends RecyclerView.ViewHolder implements Extension {
 
    private Context context;
 
    TextView txt_date;
    TextView txt_total_task_count;
    TextView txt_complete_task_count;
    TextView txt_changed_task_count;
 
    TextView mtv_name;
    TextView mtv_address;
    TextView mtv_time;
    TextView mtv_staff;
    TextView mtv_check_status;
    ImageView img_status;
    public ConstraintLayout slideLayout;
 
    public TaskListHolder(View itemView, Context context, int viewType) {
        super(itemView);
        this.context = context;
        if (viewType == TaskListAdapter.ITEM_VIEW_TYPE_HEAD) {
            txt_date = itemView.findViewById(R.id.txt_date);
            txt_total_task_count = itemView.findViewById(R.id.txt_total_task_count);
            txt_complete_task_count = itemView.findViewById(R.id.txt_complete_task_count);
            txt_changed_task_count = itemView.findViewById(R.id.txt_changed_task_count);
        } else if (viewType == TaskListAdapter.ITEM_VIEW_TYPE_CONTENT){
            mtv_time = itemView.findViewById(R.id.tv_item_task_list_time);
            mtv_name = itemView.findViewById(R.id.tv_item_task_list_name);
            mtv_address = itemView.findViewById(R.id.tv_item_task_list_address);
            mtv_staff = itemView.findViewById(R.id.tv_task_staff);
            img_status = itemView.findViewById(R.id.img_task_status);
            slideLayout = itemView.findViewById(R.id.cl_item);
            mtv_check_status = itemView.findViewById(R.id.tv_check_status);
        }
    }
 
    @Override
    public float getActionWidth() {
        return ScreenUtils.dp2px(context, 100);
    }
}