| | |
| | | package cn.com.basic.face.widget.checkin;
|
| | |
|
| | | import android.content.Context;
|
| | | import android.graphics.Bitmap;
|
| | | import android.net.Uri;
|
| | | import android.util.AttributeSet;
|
| | | import android.util.TypedValue;
|
| | | import android.view.LayoutInflater;
|
| | | import android.view.View;
|
| | | import android.widget.ImageView;
|
| | |
| | | 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;
|
| | | import cn.com.basic.face.util.FileUtil;
|
| | |
|
| | | public class CheckInRightIntervieweeCell extends LinearLayout{
|
| | |
|
| | | @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;
|
| | |
|
| | |
| | | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
| | | View view = inflater.inflate(R.layout.fragment_check_in_right_interviewee,this);
|
| | | ViewUtils.inject(this, view);
|
| | | }
|
| | | float x = fragment_check_in_right_interviewee_cell_name.getTextSize();
|
| | |
|
| | | @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;
|
| | | //fragment_check_in_right_interviewee_cell_name.setTextSize(TypedValue.COMPLEX_UNIT_PX, 50f);
|
| | | //float y = fragment_check_in_right_interviewee_cell_name.getTextSize();
|
| | | //System.out.println("h");
|
| | | }
|
| | |
|
| | | public void setIntervieweeInfo(final CheckInQueryItem item) {
|
| | | if (item == null) return;
|
| | |
| | | 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()));
|
| | | if (item.getSurveillancePhoto() != null && !item.getSurveillancePhoto().equals("")) {
|
| | | Bitmap bitmap = FileUtil.loadBitmap(item.getSurveillancePhoto());
|
| | | if (bitmap != null) {
|
| | | fragment_check_in_right_interviewee_cell_photo.setImageBitmap(bitmap);
|
| | | } else {
|
| | | fragment_check_in_right_interviewee_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE + item.getSurveillancePhoto()));
|
| | | }
|
| | | 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"));
|
| | | fragment_check_in_right_interviewee_cell_photo_placeholder.setVisibility(INVISIBLE);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public CheckInQueryItem getInterviewee() {
|
| | |
| | |
|
| | | @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.getMobilePhone(), Toast.LENGTH_SHORT).show();
|
| | | PhoneCallMng.getInstance().addPhoneCall(CheckInFragment.getInstance().getFragment_check_in_right_visitor_cell().getVisitor(), item, false);
|
| | | }
|
| | |
|
| | | @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.getMobilePhone(), Toast.LENGTH_SHORT).show();
|
| | | PhoneCallMng.getInstance().addPhoneCall(CheckInFragment.getInstance().getFragment_check_in_right_visitor_cell().getVisitor(), item, true);
|
| | | }
|
| | |
|
| | | 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);
|
| | | item = null;
|
| | | }
|
| | |
|
| | | }
|