VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/PhoneCallFragment.java
@@ -42,10 +42,10 @@ fragment_phone_call_left_row_dept.setTextColor(MainActivity.getInstance().getResources().getColor(R.color.colorText_b)); } final PhoneCallQueryItem item = getItem(position); fragment_phone_call_left_row_name.setText(item.getUsername()); fragment_phone_call_left_row_dept.setText(item.getDeptName()); fragment_phone_call_left_row_name.setText(item.getCallee()); fragment_phone_call_left_row_dept.setText(item.getCallerDept()); SimpleDraweeView fragment_phone_call_left_row_photo = viewHolder.findViewById(R.id.fragment_phone_call_left_row_photo); fragment_phone_call_left_row_photo.setImageURI(AppApi.IMAGE_URL_BASE +item.getImagePath()); fragment_phone_call_left_row_photo.setImageURI(AppApi.IMAGE_URL_BASE +item.getCallerImage()); RelativeLayout fragment_phone_call_left_row_relativeLayout = viewHolder.findViewById(R.id.fragment_phone_call_left_row_relativeLayout); fragment_phone_call_left_row_relativeLayout.setOnClickListener(new View.OnClickListener(){ @Override VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/query/condition/PhoneCallQueryCondition.java
@@ -7,28 +7,28 @@ /** * 人员名字 */ public static final String name = "name"; public static final String username = "username"; } // 人员名字 private String name; private String username; /** * Get 人员名字 */ public String getName() { return name; public String getUsername() { return username; } /** * Set 人员名字 */ public void setName(String name) { this.name = name; public void setUsername(String username) { this.username = username; } public String toString() { return ",人员名字 =" + name ; return ",人员名字 =" + username ; } } VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/query/item/PhoneCallQueryItem.java
@@ -3,139 +3,79 @@ public class PhoneCallQueryItem { // 人员主键 private String registerId; // 人员名字 private String username; // 图片地址 private String imagePath; // 公司名称 private String companyName; // 座机电话 private String tel; // 证件编号 private String identifyNum; private String caller; // 人员名字 private String callee; // 部门名称 private String deptName; // 公司主键 private String companyId; private String callerDept; // 部门名称 private String calleeDept; // 职位名称 private String postName; // 图片地址 private String callerImage; // 图片地址 private String calleeImage; // 移动电话 private String mobilePhone; // private String type; // 座机电话 private String tel; /** * Get 人员主键 * Get 人员名字 */ public String getRegisterId() { return registerId; public String getCaller() { return caller; } /** * Set 人员主键 * Set 人员名字 */ public void setRegisterId(String registerId) { this.registerId = registerId; public void setCaller(String caller) { this.caller = caller; } /** * Get 人员名字 */ public String getUsername() { return username; public String getCallee() { return callee; } /** * Set 人员名字 */ public void setUsername(String username) { this.username = username; } /** * Get 图片地址 */ public String getImagePath() { return imagePath; } /** * Set 图片地址 */ public void setImagePath(String imagePath) { this.imagePath = imagePath; } /** * Get 公司名称 */ public String getCompanyName() { return companyName; } /** * Set 公司名称 */ public void setCompanyName(String companyName) { this.companyName = companyName; } /** * Get 座机电话 */ public String getTel() { return tel; } /** * Set 座机电话 */ public void setTel(String tel) { this.tel = tel; } /** * Get 证件编号 */ public String getIdentifyNum() { return identifyNum; } /** * Set 证件编号 */ public void setIdentifyNum(String identifyNum) { this.identifyNum = identifyNum; public void setCallee(String callee) { this.callee = callee; } /** * Get 部门名称 */ public String getDeptName() { return deptName; } /** * Set 部门名称 */ public void setDeptName(String deptName) { this.deptName = deptName; public String getCallerDept() { return callerDept; } /** * Get 公司主键 * Set 部门名称 */ public String getCompanyId() { return companyId; public void setCallerDept(String callerDept) { this.callerDept = callerDept; } /** * Set 公司主键 * Get 部门名称 */ public void setCompanyId(String companyId) { this.companyId = companyId; public String getCalleeDept() { return calleeDept; } /** * Set 部门名称 */ public void setCalleeDept(String calleeDept) { this.calleeDept = calleeDept; } /** @@ -144,7 +84,7 @@ public String getPostName() { return postName; } /** * Set 职位名称 */ @@ -153,12 +93,40 @@ } /** * Get 图片地址 */ public String getCallerImage() { return callerImage; } /** * Set 图片地址 */ public void setCallerImage(String callerImage) { this.callerImage = callerImage; } /** * Get 图片地址 */ public String getCalleeImage() { return calleeImage; } /** * Set 图片地址 */ public void setCalleeImage(String calleeImage) { this.calleeImage = calleeImage; } /** * Get 移动电话 */ public String getMobilePhone() { return mobilePhone; } /** * Set 移动电话 */ @@ -167,24 +135,24 @@ } /** * Get * Get 座机电话 */ public String getType() { return type; public String getTel() { return tel; } /** * Set * Set 座机电话 */ public void setType(String type) { this.type = type; public void setTel(String tel) { this.tel = tel; } public String toString() { return ",人员主键 =" + registerId + ",人员名字 =" + username + ",图片地址 =" + imagePath + ",公司名称 =" + companyName + ",座机电话 =" + tel + ",证件编号 =" + identifyNum + ",部门名称 =" + deptName + ",公司主键 =" + companyId + ",职位名称 =" + postName + ",移动电话 =" + mobilePhone + ", =" + type ; return ",人员名字 =" + caller + ",人员名字 =" + callee + ",部门名称 =" + callerDept + ",部门名称 =" + calleeDept + ",职位名称 =" + postName + ",图片地址 =" + callerImage + ",图片地址 =" + calleeImage + ",移动电话 =" + mobilePhone + ",座机电话 =" + tel ; } } VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java
@@ -24,7 +24,7 @@ public void findPhoneCallLeftList(final boolean isSortByDept, String searchText) { RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.PHONE_CALL_QUERY); params.addBodyParameter(PhoneCallQueryCondition.FieldNames.name, searchText); params.addBodyParameter(PhoneCallQueryCondition.FieldNames.username, searchText); x.http().post(params, new BaseCommonCallBack() { public void success() { List<PhoneCallQueryItem> list = getList(PhoneCallQueryItem.class); @@ -36,12 +36,12 @@ PhoneCallQueryItem item = list.get(i); try { if (isSortByDept) { if (item.getDeptName() != null && item.getDeptName().length() > 0) { name = CharacterParser.getInstance().getSelling(item.getDeptName()).substring(0, 1); if (item.getCallerDept() != null && item.getCallerDept().length() > 0) { name = CharacterParser.getInstance().getSelling(item.getCallerDept()).substring(0, 1); } } else { if (item.getUsername() != null && item.getUsername().length() > 0) { name = CharacterParser.getInstance().getSelling(item.getUsername()).substring(0, 1); if (item.getCaller() != null && item.getCaller().length() > 0) { name = CharacterParser.getInstance().getSelling(item.getCaller()).substring(0, 1); } } } catch (Exception e) { @@ -63,8 +63,8 @@ @Override public int compare(PhoneCallQueryItem t1, PhoneCallQueryItem t2) { if (sortedByDept) { String dept1Name = t1.getDeptName()==null?"":t1.getDeptName(); String dept2Name = t2.getDeptName()==null?"":t2.getDeptName(); String dept1Name = t1.getCallerDept()==null?"":t1.getCallerDept(); String dept2Name = t2.getCallerDept()==null?"":t2.getCallerDept(); if(!dept1Name.equals(dept2Name)) { String dept1Name_a = dept1Name.trim(); String dept1Name_b = dept2Name.trim(); @@ -75,8 +75,8 @@ return dept1Name_a.compareTo(dept1Name_b); } } String name1 = t1.getUsername()==null?"":t1.getUsername(); String name2 = t2.getUsername()==null?"":t2.getUsername(); String name1 = t1.getCaller()==null?"":t1.getCaller(); String name2 = t2.getCaller()==null?"":t2.getCaller(); String dept1Name_a = name1.trim(); String dept1Name_b = name2.trim(); if (dept1Name_a.length() > 0 && dept1Name_b.length() > 0) { VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/NativeImgIdx.java
New file @@ -0,0 +1,13 @@ package cn.com.basic.face.util; /** * Created by houxiao on 2017/4/12. */ public class NativeImgIdx { public int offset; public int size; public int type; public int width; public int height; } VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/RtspFaceNative.java
@@ -7,11 +7,13 @@ import java.io.File; import java.io.FileOutputStream; import java.util.ArrayList; import cn.com.basic.face.base.BaseApplication; import cn.com.basic.face.service.RegisterMng; public class RtspFaceNative { public static native void init(); public static native void setSurface(int cameraIdx, Surface surface); @@ -22,43 +24,58 @@ public static native void lockFace(int cameraIdx); public static native void releaseFace(int cameraIdx); public static native int getFaceList(int cameraIdx, byte[] faceListPb); public static native int getFaceImages(int cameraIdx, int[] faceImagesIdx, byte[] faceImages); public static native ArrayList<NativeImgIdx> getFaceImages(int cameraIdx, byte[] faceImages); static int i = 1; public static void faceCallBack(int cameraIdx, int count) { lockFace(cameraIdx); byte[] faceListPb = new byte[1024 * 1024 * 1]; int s = getFaceList(cameraIdx, faceListPb); //;byte(faceListPb,s) int[] faceImagesIdx = new int[10]; byte[] faceImages = new byte[1024 * 1024 * 1]; int c = getFaceImages(cameraIdx, faceImagesIdx, faceImages); try { File path = BaseApplication.getInstance().getFilesDir(); File f1 = new File(path, ""+i); if (!f1.exists()) { f1.createNewFile(); } FileOutputStream f = new FileOutputStream(f1); f.write(faceImages); f.close(); RequestParams params = new RequestParams(); String encodedImage = Base64.encodeToString(faceImages, Base64.DEFAULT); params.addBodyParameter("choosePhoto", encodedImage); RegisterMng.getInstance().add(params); } catch (Exception e) { e.printStackTrace(); } ArrayList<NativeImgIdx> faceImagesIdx = getFaceImages(cameraIdx, faceImages); int c = faceImagesIdx.size(); releaseFace(cameraIdx); } // static int i = 1; // public static void faceCallBack(int cameraIdx, int count) // { // lockFace(cameraIdx); // // byte[] faceListPb = new byte[1024 * 1024 * 1]; // int s = getFaceList(cameraIdx, faceListPb); // // //;byte(faceListPb,s) // // // int[] faceImagesIdx = new int[10]; // byte[] faceImages = new byte[1024 * 1024 * 1]; // int c = getFaceImages(cameraIdx, faceImagesIdx, faceImages); // // try { // File path = BaseApplication.getInstance().getFilesDir(); // File f1 = new File(path, ""+i); // if (!f1.exists()) { // f1.createNewFile(); // } // FileOutputStream f = new FileOutputStream(f1); // f.write(faceImages); // f.close(); // RequestParams params = new RequestParams(); // String encodedImage = Base64.encodeToString(faceImages, Base64.DEFAULT); // params.addBodyParameter("choosePhoto", encodedImage); // RegisterMng.getInstance().add(params); // } catch (Exception e) { // e.printStackTrace(); // } // // releaseFace(cameraIdx); // } // public static void init() {}; // public static void setSurface(int cameraIdx, Surface surface){}; // public static boolean createPlayer(int cameraIdx, String uri){return true;}; VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/widget/phonecall/PhoneCallRightIntervieweeCell.java
@@ -21,14 +21,14 @@ public class PhoneCallRightIntervieweeCell 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_phone_call_right_interviewee_cell_name) private TextView fragment_phone_call_right_interviewee_cell_name; @ViewInject(R.id.fragment_phone_call_right_interviewee_cell_dept) private TextView fragment_phone_call_right_interviewee_cell_dept; @ViewInject(R.id.fragment_phone_call_right_interviewee_cell_post) private TextView fragment_phone_call_right_interviewee_cell_post; @ViewInject(R.id.fragment_phone_call_right_interviewee_cell_photo) private ImageView fragment_phone_call_right_interviewee_cell_photo; private PhoneCallQueryItem item = new PhoneCallQueryItem(); @@ -39,26 +39,26 @@ public PhoneCallRightIntervieweeCell(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.fragment_check_in_right_interviewee,this); View view = inflater.inflate(R.layout.fragment_phone_call_right_interviewee,this); ViewUtils.inject(this, view); } public void setIntervieweeInfo(final PhoneCallQueryItem item) { if (item == null) return; this.item = item; 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_phone_call_right_interviewee_cell_name.setText(item.getCallee()); fragment_phone_call_right_interviewee_cell_dept.setText(item.getCalleeDept()); fragment_phone_call_right_interviewee_cell_post.setText(item.getPostName()); fragment_phone_call_right_interviewee_cell_photo.setImageURI(Uri.parse(AppApi.IMAGE_URL_BASE + item.getCalleeImage())); } @OnClick(R.id.fragment_check_in_right_interviewee_cell_call_tel) public void fragment_check_in_right_interviewee_cell_call_tel_click(View view) { @OnClick(R.id.fragment_phone_call_right_interviewee_cell_call_tel) public void fragment_phone_call_right_interviewee_cell_call_tel_click(View view) { Toast.makeText(MainActivity.getInstance(), "正在呼叫座机"+item.getTel(), Toast.LENGTH_SHORT).show(); } @OnClick(R.id.fragment_check_in_right_interviewee_cell_call_mobile) public void fragment_check_in_right_interviewee_cell_call_mobile_click(View view) { @OnClick(R.id.fragment_phone_call_right_interviewee_cell_call_mobile) public void fragment_phone_call_right_interviewee_cell_call_mobile_click(View view) { Toast.makeText(MainActivity.getInstance(), "正在呼叫手机"+item.getMobilePhone(), Toast.LENGTH_SHORT).show(); } VisitFace/DemoForBsk/app/src/main/res/layout/fragment_phone_call_right_interviewee.xml
New file @@ -0,0 +1,102 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:fresco="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/card_bcg" android:gravity="center_horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/fragment_phone_call_right_interviewee_cell_name" android:textColor="@color/colorText_5" android:paddingTop="@dimen/view_size_5" android:paddingBottom="@dimen/view_size_5" android:textSize="24sp"/> <View android:layout_width="match_parent" android:layout_height="@dimen/view_size_1" android:background="@color/colorText_b"/> <LinearLayout android:id="@+id/visitor_to_ll" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/fragment_phone_call_right_interviewee_cell_photo" android:layout_width="100dp" android:layout_height="100dp" fresco:roundAsCircle = "true" android:layout_gravity="center_horizontal" android:layout_marginTop="@dimen/view_size_25" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="40dp" android:layout_gravity="center_horizontal" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="部门:" android:textSize="@dimen/text_size_big" android:textColor="@color/colorText_5"/> <TextView android:id="@+id/fragment_phone_call_right_interviewee_cell_dept" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:textSize="@dimen/text_size_big" android:textColor="@color/colorText_b"/> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="25dp" android:layout_gravity="center_horizontal" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="职务:" android:textSize="@dimen/text_size_big" android:textColor="@color/colorText_5"/> <TextView android:id="@+id/fragment_phone_call_right_interviewee_cell_post" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:textSize="@dimen/text_size_big" android:textColor="@color/colorText_b"/> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/view_size_25" android:gravity="center_horizontal" android:orientation="horizontal"> <TextView android:id="@+id/fragment_phone_call_right_interviewee_cell_call_mobile" android:layout_width="90dp" android:layout_height="36dp" android:gravity="center" android:textColor="@android:color/white" android:background="@drawable/main_btn_bcg" android:text="呼叫手机"/> <TextView android:id="@+id/fragment_phone_call_right_interviewee_cell_call_tel" android:layout_width="90dp" android:layout_height="36dp" android:gravity="center" android:layout_marginLeft="@dimen/view_size_10" android:textColor="@android:color/white" android:background="@drawable/main_btn_bcg" android:text="呼叫座机"/> </LinearLayout> </LinearLayout> </LinearLayout>