xuxiuxi
2017-07-14 bcefcf7249692e61574438d3857e737c2fd29ca7
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package cn.com.basic.face.widget.register;
 
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
 
import com.bsk.zhangbo.demoforbsk.R;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
 
import cn.com.basic.face.discern.common.CommonVariables;
import cn.com.basic.face.fragment.AttenderRegisterFragment;
import cn.com.basic.face.fragment.VisitorRegisterFragment;
 
public class RegisterRightFieldLabelView extends LinearLayout {
 
    @ViewInject(R.id.fragment_register_right_label_label)
    private TextView fragment_register_right_label_label;
 
    @ViewInject(R.id.fragment_register_right_label_text)
    private TextView fragment_register_right_label_text;
 
    public RegisterRightFieldLabelView(Context context) {
        super(context);
        init();
    }
 
    public RegisterRightFieldLabelView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RegisterRightFieldTextView, 0, 0);
 
        String label = a.getString(R.styleable.RegisterRightFieldTextView_label);
 
        fragment_register_right_label_label.setText(label);
 
        String text = a.getString(R.styleable.RegisterRightFieldTextView_text);
        fragment_register_right_label_text.setText(text);
    }
 
    public RegisterRightFieldLabelView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }
 
    public RegisterRightFieldLabelView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        init();
    }
 
    public void setLabel(String label) {
        fragment_register_right_label_label.setText(label);
    }
 
    public void setText(String text) {
        fragment_register_right_label_text.setText(text);
    }
 
    public String getText() {
        return fragment_register_right_label_text.getText().toString();
    }
 
    private void init() {
        View view = inflate(getContext(), R.layout.fragment_register_right_label, this);
        ViewUtils.inject(this, view);
    }
 
    public String getValue() {
        return fragment_register_right_label_text.getText().toString().trim();
    }
 
    public void setValue(String value) {
        fragment_register_right_label_text.setText(value);
    }
 
    @OnClick(R.id.fragment_register_right_label_image)
    public void fragment_register_right_label_image_click(View view) {
        String label = fragment_register_right_label_label.getText().toString();
        if ("性别:".equals(label)) {
            if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
                VisitorRegisterFragment.getInstance().fragment_visitor_register_gender_click(view);
            } else {
                AttenderRegisterFragment.getInstance().fragment_attender_register_gender_click(view);
            }
        }
        if ("证件类型:".equals(label)) {
            if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
                VisitorRegisterFragment.getInstance().fragment_visitor_register_id_class_click(view);
            } else {
                AttenderRegisterFragment.getInstance().fragment_attender_register_id_class_click(view);
            }
        }
        if ("国籍:".equals(label)) {
            VisitorRegisterFragment.getInstance().fragment_visitor_register_country_click(view);
        }
        if ("出生日期:".equals(label)) {
            VisitorRegisterFragment.getInstance().fragment_visitor_register_birthday_click(view);
        }
        if ("访客类型:".equals(label)) {
            VisitorRegisterFragment.getInstance().fragment_visitor_register_visitor_class_click(view);
        }
        if ("职务:".equals(label)) {
            AttenderRegisterFragment.getInstance().fragment_attender_register_post_click(view);
        }
        if ("部门/班级:".equals(label)) {
            AttenderRegisterFragment.getInstance().fragment_attender_register_department_click(view);
        }
    }
 
}