xuxiuxi
2017-04-18 4dcad62f9276d34d13ff6e35bd8b0a910a1df3f1
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/widget/checkin/CheckInRightVisitorCell.java
@@ -13,10 +13,27 @@
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import java.net.URI;
import cn.com.basic.face.discern.query.item.CheckInQueryItem;
import cn.com.basic.face.util.AppApi;
public class CheckInRightVisitorCell extends LinearLayout{
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_name)
    private TextView fragment_check_in_right_visitor_cell_name;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_company_name)
    private TextView fragment_check_in_right_visitor_cell_company_name;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_identity_number)
    private TextView fragment_check_in_right_visitor_cell_identity_number;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_photo)
    private ImageView fragment_check_in_right_visitor_cell_photo;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_mobile_phone)
    private TextView fragment_check_in_right_visitor_cell_mobile_phone;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_photo_placeholder)
    private TextView fragment_check_in_right_visitor_cell_photo_placeholder;
    private CheckInQueryItem item;
    public CheckInRightVisitorCell(Context context) {
@@ -31,27 +48,30 @@
        ViewUtils.inject(this, view);
    }
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_name)
    private TextView fragment_check_in_right_visitor_cell_name;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_company_name)
    private TextView fragment_check_in_right_visitor_cell_company_name;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_identity_number)
    private TextView fragment_check_in_right_visitor_cell_identity_number;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_photo)
    private ImageView fragment_check_in_right_visitor_cell_photo;
    @ViewInject(R.id.fragment_check_in_right_visitor_cell_mobile_phone)
    private TextView fragment_check_in_right_visitor_cell_mobile_phone;
    public void setVisitorInfo(CheckInQueryItem item) {
        this.item = item;
        fragment_check_in_right_visitor_cell_name.setText(item.getName());
        fragment_check_in_right_visitor_cell_name.setText(item.getUsername());
        fragment_check_in_right_visitor_cell_company_name.setText(item.getCompanyName());
        fragment_check_in_right_visitor_cell_identity_number.setText(item.getIdentify());
        fragment_check_in_right_visitor_cell_mobile_phone.setText(item.getPhone());
        fragment_check_in_right_visitor_cell_photo.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE + item.getImagePath()));
        fragment_check_in_right_visitor_cell_identity_number.setText(item.getIdentifyNum());
        fragment_check_in_right_visitor_cell_mobile_phone.setText(item.getMobilePhone());
        fragment_check_in_right_visitor_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE + item.getImagePath()));
        if (item.getImagePath() != null && !item.getImagePath().equals("")) {
            fragment_check_in_right_visitor_cell_photo_placeholder.setVisibility(INVISIBLE);
        } else {
            fragment_check_in_right_visitor_cell_photo_placeholder.setVisibility(VISIBLE);
        }
    }
    public CheckInQueryItem getVisitor() {
        return item;
    }
    public void resetForm() {
        fragment_check_in_right_visitor_cell_name.setText("");
        fragment_check_in_right_visitor_cell_company_name.setText("");
        fragment_check_in_right_visitor_cell_identity_number.setText("");
        fragment_check_in_right_visitor_cell_mobile_phone.setText("");
        fragment_check_in_right_visitor_cell_photo.setImageURI(null);
    }
}