xuxiuxi
2017-04-24 c34f11fb7407594f7c1eb69b11f84a45d13cfa1a
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/widget/checkin/CheckInRightIntervieweeCell.java
@@ -11,17 +11,38 @@
import android.widget.Toast;
import com.bsk.zhangbo.demoforbsk.R;
import com.facebook.drawee.view.SimpleDraweeView;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import org.xutils.http.RequestParams;
import java.text.SimpleDateFormat;
import java.util.Date;
import cn.com.basic.face.base.BaseApplication;
import cn.com.basic.face.base.MainActivity;
import cn.com.basic.face.discern.entity.PhoneCall;
import cn.com.basic.face.discern.query.item.CheckInQueryItem;
import cn.com.basic.face.fragment.CheckInFragment;
import cn.com.basic.face.service.PhoneCallMng;
import cn.com.basic.face.util.AppApi;
public class CheckInRightIntervieweeCell extends LinearLayout{
    private CheckInQueryItem item = new CheckInQueryItem();
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_name)
    private TextView fragment_check_in_right_interviewee_cell_name;
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_dept)
    private TextView fragment_check_in_right_interviewee_cell_dept;
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_post)
    private TextView fragment_check_in_right_interviewee_cell_post;
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_photo)
    private ImageView fragment_check_in_right_interviewee_cell_photo;
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_photo_placeholder)
    private TextView fragment_check_in_right_interviewee_cell_photo_placeholder;
    private CheckInQueryItem item;
    public CheckInRightIntervieweeCell(Context context) {
        super(context);
@@ -34,22 +55,19 @@
        ViewUtils.inject(this, view);
    }
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_name)
    private TextView fragment_check_in_right_interviewee_cell_name;
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_dept)
    private TextView fragment_check_in_right_interviewee_cell_dept;
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_post)
    private TextView fragment_check_in_right_interviewee_cell_post;
    @ViewInject(R.id.fragment_check_in_right_interviewee_cell_photo)
    private ImageView fragment_check_in_right_interviewee_cell_photo;
    public void setIntervieweeInfo(final CheckInQueryItem item) {
        if (item == null) return;
        this.item = item;
        fragment_check_in_right_interviewee_cell_name.setText(item.getName());
        fragment_check_in_right_interviewee_cell_name.setText(item.getUsername());
        fragment_check_in_right_interviewee_cell_dept.setText(item.getDeptName());
        fragment_check_in_right_interviewee_cell_post.setText(item.getPostName());
        fragment_check_in_right_interviewee_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE + item.getImagePath()));
        fragment_check_in_right_interviewee_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE + item.getSurveillancePhoto()));
        if (item.getSurveillancePhoto() != null && !item.getSurveillancePhoto().equals("")) {
            fragment_check_in_right_interviewee_cell_photo_placeholder.setVisibility(INVISIBLE);
        } else {
            fragment_check_in_right_interviewee_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE + "u45.png"));
        }
    }
    public CheckInQueryItem getInterviewee() {
@@ -58,12 +76,21 @@
    @OnClick(R.id.fragment_check_in_right_interviewee_cell_call_tel)
    public void fragment_check_in_right_interviewee_cell_call_tel_click(View view) {
        Toast.makeText(MainActivity.getInstance(), "正在呼叫座机"+item.getPhone(), Toast.LENGTH_SHORT).show();
        PhoneCallMng.getInstance().addPhoneCall(CheckInFragment.getInstance().getFragment_check_in_right_visitor_cell().getVisitor(), item);
    }
    @OnClick(R.id.fragment_check_in_right_interviewee_cell_call_mobile)
    public void fragment_check_in_right_interviewee_cell_call_mobile_click(View view) {
        Toast.makeText(MainActivity.getInstance(), "正在呼叫手机"+item.getPhone(), Toast.LENGTH_SHORT).show();
        PhoneCallMng.getInstance().addPhoneCall(CheckInFragment.getInstance().getFragment_check_in_right_visitor_cell().getVisitor(), item);
    }
    public void resetForm() {
        fragment_check_in_right_interviewee_cell_name.setText("被访人员姓名");
        fragment_check_in_right_interviewee_cell_dept.setText("");
        fragment_check_in_right_interviewee_cell_post.setText("");
        fragment_check_in_right_interviewee_cell_photo_placeholder.setText("添加\n被访人员");
        fragment_check_in_right_interviewee_cell_photo_placeholder.setVisibility(VISIBLE);
        fragment_check_in_right_interviewee_cell_photo.setImageURI(null);
    }
}