shanmulinxi %!s(int64=2) %!d(string=hai) anos
pai
achega
f6c509cd40

+ 2 - 0
app/src/main/java/com/sunwin/visitorapp/BaseApplication.java

@@ -6,6 +6,7 @@ import android.content.Context;
 import com.sunwin.visitorapp.db.DatabaseManager;
 import com.sunwin.visitorapp.db.UserManagerModel;
 import com.sunwin.visitorapp.utils.CacheUtil;
+import com.sunwin.visitorapp.utils.CrashExceptionHandler;
 import com.sunwin.visitorapp.utils.SystemTTS;
 import com.sunwin.visitorapp.utils.UniversalImageLoaderConfiguration;
 
@@ -26,6 +27,7 @@ public class BaseApplication extends Application {
     public void onCreate() {
         super.onCreate();
         mInstance = this;
+        CrashExceptionHandler.newInstance().init(this,"CrashLog");
         systemTTS = SystemTTS.getInstance(this);
         UniversalImageLoaderConfiguration.configure(this,R.mipmap.icon_loading);
         /**

+ 27 - 2
app/src/main/java/com/sunwin/visitorapp/SplashActivity.java

@@ -37,6 +37,7 @@ import com.sunwin.visitorapp.utils.SharePrefenceUtils;
 import com.sunwin.visitorapp.utils.ToastUtils;
 
 import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -82,13 +83,37 @@ public class SplashActivity extends BaseActivity {
         requestDevicePermission();
     }
 
+    private String getAssetCert(){
+        try {
+            InputStream is = getAssets().open("CBG_Android_Face_Reco---36502-Formal-one-stage.cert");
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+            int len = -1;
+            byte[] buffer = new byte[1024];
+            while ((len = is.read(buffer)) != -1) {
+                baos.write(buffer, 0, len);
+            }
+            String rel = baos.toString();
+            is.close();
+            return rel;
+        } catch (IOException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
     private void authPermission() {
 
 //        String cert = readExternal(CERT_PATH).trim();
         String cert = SharePrefenceUtils.getString(Constant.ISharePrefence.CERT, "");
         if (TextUtils.isEmpty(cert)) {
-            startAuthActivity();
-            return;
+            if(BuildConfig.DEBUG){
+                cert = getAssetCert();
+            }
+            if (TextUtils.isEmpty(cert)){
+                startAuthActivity();
+                return;
+            }
+
         }
 
         loadingDialog.showLoadingDialog("授权中,请等待...");

+ 83 - 4
app/src/main/java/com/sunwin/visitorapp/activity/VisitorRegisterAc.java

@@ -1,16 +1,25 @@
 package com.sunwin.visitorapp.activity;
 
+import android.annotation.SuppressLint;
 import android.os.Bundle;
+import android.text.Editable;
 import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
+import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.Spinner;
 import android.widget.TextView;
 
+import androidx.appcompat.app.AlertDialog;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 import com.jzxiang.pickerview.TimePickerDialog;
@@ -18,9 +27,14 @@ import com.jzxiang.pickerview.data.Type;
 import com.jzxiang.pickerview.listener.OnDateSetListener;
 import com.sunwin.visitorapp.BaseActivity;
 import com.sunwin.visitorapp.R;
+import com.sunwin.visitorapp.adapter.BaseRecyclerAdapter;
+import com.sunwin.visitorapp.adapter.BaseViewHolder;
 import com.sunwin.visitorapp.adapter.DepartmentAdapter;
 import com.sunwin.visitorapp.adapter.NetInfoAdapter;
+import com.sunwin.visitorapp.db.BlackUserModel;
 import com.sunwin.visitorapp.db.DatabaseManager;
+import com.sunwin.visitorapp.db.FollowPeopleModel;
+import com.sunwin.visitorapp.db.LogModel;
 import com.sunwin.visitorapp.db.UserInfoModel;
 import com.sunwin.visitorapp.face.FRImpl;
 import com.sunwin.visitorapp.model.DepartmentResult;
@@ -68,11 +82,12 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
     private TextView mEditVisitTimeBegin;
     private TextView mEditVisitTimeEnd;
     private EditText mEditVisitNumber;
-    private EditText mEditVisitPeopleCount;
+    private TextView mEditVisitPeopleCount;
     private EditText mEditICCode;
     private LinearLayout mViewFormVisitorBy;
     private EditText mEditByVisitPeople;
     private Spinner mEditByVisitDepartment;
+    private Button ButtonPeopleAdd,ButtonPeopleSub;
     private TextView mTextButtonSure;
     private Spinner sp_net;
     private TimePickerDialog timePickerDialog;
@@ -130,7 +145,8 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
             }
         }
     }
-
+    private BaseRecyclerAdapter<FollowPeopleModel> adapter;
+    private int followPeople = 0;
     private void initView() {
         mImageVisitorPhoto = (ImageView) findViewById(R.id.ImageVisitorPhoto);
         mTextVisitorName = (TextView) findViewById(R.id.TextVisitorName);
@@ -144,11 +160,13 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
         mEditVisitTimeBegin = findViewById(R.id.EditVisitTimeBegin);
         mEditVisitTimeEnd = findViewById(R.id.EditVisitTimeEnd);
         mEditVisitNumber = (EditText) findViewById(R.id.EditVisitNumber);
-        mEditVisitPeopleCount = (EditText) findViewById(R.id.EditVisitPeopleCount);
+        mEditVisitPeopleCount =  findViewById(R.id.EditVisitPeopleCount);
         mEditICCode = (EditText) findViewById(R.id.EditICCode);
         mViewFormVisitorBy = (LinearLayout) findViewById(R.id.ViewFormVisitorBy);
         mEditByVisitPeople = (EditText) findViewById(R.id.EditByVisitPeople);
         mEditByVisitDepartment = findViewById(R.id.EditByVisitDepartment);
+        ButtonPeopleAdd= findViewById(R.id.ButtonPeopleAdd);
+        ButtonPeopleSub= findViewById(R.id.ButtonPeopleSub);
         findViewById(R.id.TextButtonSure).setOnClickListener(this);
 
         mEditVisitTimeBegin.setOnClickListener(this);
@@ -157,6 +175,56 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
         sp_net = findViewById(R.id.sp_net);
         initViewInfo();
 
+
+        ButtonPeopleAdd.setOnClickListener(v->{
+            followPeople++;
+            mEditByVisitPeople.setText(String.valueOf(followPeople));
+
+            adapter.add(new FollowPeopleModel());
+        });
+
+        ButtonPeopleSub.setOnClickListener(v->{
+            if(followPeople<=0)return;
+            followPeople--;
+            mEditByVisitPeople.setText(String.valueOf(followPeople));
+            adapter.remove(adapter.getItemCount()-1);
+        });
+
+
+        RecyclerView followPeopleRecycler = findViewById(R.id.RecyclerFollowPeople);
+        adapter = new BaseRecyclerAdapter<FollowPeopleModel>() {
+            @Override
+            protected View getLayoutView(ViewGroup parent, int viewType) {
+                return LayoutInflater.from(parent.getContext()).inflate(R.layout.item_follow_people,parent,false);
+            }
+
+            @SuppressLint("UseCompatLoadingForDrawables")
+            @Override
+            public void bind(int position, FollowPeopleModel data, BaseViewHolder holder, int viewType) {
+
+                EditText EditName = holder.getView(R.id.EditName);
+                EditName.addTextChangedListener(new TextWatcher() {
+                    @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
+                    @Override public void onTextChanged(CharSequence s, int start, int before, int count) { }
+                    @Override public void afterTextChanged(Editable s) { data.name = s.toString().trim(); }
+                });
+                EditText EditPhone = holder.getView(R.id.EditPhone);
+                EditPhone.addTextChangedListener(new TextWatcher() {
+                    @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
+                    @Override public void onTextChanged(CharSequence s, int start, int before, int count) { }
+                    @Override public void afterTextChanged(Editable s) { data.photo = s.toString().trim(); }
+                });
+                EditText EditIdCode = holder.getView(R.id.EditIdCode);
+                EditIdCode.addTextChangedListener(new TextWatcher() {
+                    @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
+                    @Override public void onTextChanged(CharSequence s, int start, int before, int count) { }
+                    @Override public void afterTextChanged(Editable s) { data.id_card_code = s.toString().trim(); }
+                });
+            }
+        };
+        followPeopleRecycler.setAdapter(adapter);
+        followPeopleRecycler.setLayoutManager(new LinearLayoutManager(mContext,LinearLayoutManager.VERTICAL,false));
+
     }
 
     private void initViewInfo() {
@@ -204,7 +272,12 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
         String startTime = mEditVisitTimeBegin.getText().toString().trim();
         String endTime = mEditVisitTimeEnd.getText().toString().trim();
         String visitNum = mEditVisitNumber.getText().toString().trim();
-        String visitPeopleNum = mEditVisitPeopleCount.getText().toString().trim();
+        int visitPeopleNum = 0;
+        try{
+            visitPeopleNum = Integer.parseInt(mEditVisitPeopleCount.getText().toString().trim());
+        }catch (Exception ignored){
+
+        }
         String theVisitPerson = mEditByVisitPeople.getText().toString().trim();
 
         String comeReason = mComeReason.getText().toString().trim();
@@ -226,6 +299,7 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
         infoModel.setPostDate(startTime);
         infoModel.setLostDate(endTime);
         infoModel.setCardNo(cardNum);
+        infoModel.setVisitPeopleNum(visitPeopleNum);
         infoModel.setIdNum(userInfo.getIdNum());
         if (isLogin) {
             infoModel.setStatus(0);
@@ -275,6 +349,11 @@ public class VisitorRegisterAc extends BaseActivity implements View.OnClickListe
                         }
                         //存入数据库
                         long insert = DatabaseManager.getInstance().insert(infoModel);
+                        List<FollowPeopleModel> list =  adapter.getList();
+                        for (FollowPeopleModel m : list){
+                            m.user_id = insert;
+                            DatabaseManager.getInstance().insert(m);
+                        }
                         LogUtil.e(TAG, "存入用户" + insert);
                         ToastUtils.showToast("保存成功");
                         finish();

+ 21 - 0
app/src/main/java/com/sunwin/visitorapp/db/FollowPeopleModel.java

@@ -0,0 +1,21 @@
+package com.sunwin.visitorapp.db;
+
+import com.litesuits.orm.db.annotation.PrimaryKey;
+import com.litesuits.orm.db.annotation.Table;
+import com.litesuits.orm.db.enums.AssignType;
+
+@Table("BlackUser")
+public class FollowPeopleModel {
+
+    // 指定自增,每个对象需要有一个主键
+    @PrimaryKey(AssignType.AUTO_INCREMENT)
+    private long id;
+
+    public long user_id;
+
+    public String name;
+
+    public String id_card_code;
+
+    public String photo;
+}

+ 9 - 1
app/src/main/java/com/sunwin/visitorapp/db/UserInfoModel.java

@@ -57,7 +57,7 @@ public class UserInfoModel {
     private String birthday;
     private String phone;
     private String email;
-
+    private int visitPeopleNum;
     private String deptId;//网点ID,关联dept表
 
     public String getDeptName() {
@@ -367,4 +367,12 @@ public class UserInfoModel {
     private Integer isUse;//是否可用  0:禁用   1:可用
     private String inLpCode;
     private String visitorLpCode;
+
+    public int getVisitPeopleNum() {
+        return visitPeopleNum;
+    }
+
+    public void setVisitPeopleNum(int visitPeopleNum) {
+        this.visitPeopleNum = visitPeopleNum;
+    }
 }

+ 189 - 0
app/src/main/java/com/sunwin/visitorapp/utils/CrashExceptionHandler.java

@@ -0,0 +1,189 @@
+package com.sunwin.visitorapp.utils;
+
+
+import android.content.Context;
+import android.os.Environment;
+import android.os.Looper;
+import android.text.TextUtils;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import timber.log.Timber;
+
+/**
+ * 系统处理异常类,处理整个APP的异常
+ */
+public class CrashExceptionHandler implements Thread.UncaughtExceptionHandler{
+    public static final String TAG = CrashExceptionHandler.class.getSimpleName();
+    private Context mContext;
+
+    // 本类实例
+    private static CrashExceptionHandler myCrashHandler;
+
+    // 系统默认的UncaughtExceptionHandler
+    private Thread.UncaughtExceptionHandler mDefaultException;
+
+    // 保证只有一个实例
+    public CrashExceptionHandler() {
+    }
+    private static String sLogDirPath;
+    // 单例模式
+    public synchronized static CrashExceptionHandler newInstance(){
+        if (myCrashHandler == null){
+            myCrashHandler = new CrashExceptionHandler();
+        }
+        return myCrashHandler;
+    }
+
+
+    /**
+     * 初始化
+     * @param context
+     */
+    public void init(Context context, String logDirName){
+        if (context == null)
+            throw new IllegalArgumentException("LogWatcher: init failed, context can not be null");
+
+        if (TextUtils.isEmpty(logDirName))
+            throw new IllegalArgumentException("LogWatcher: init failed, logDirName can not be null");
+
+        this.mContext = context.getApplicationContext();
+        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+            File documentFileDir = mContext.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);
+            if (documentFileDir != null) {
+                sLogDirPath = documentFileDir.getAbsolutePath() + File.separator + logDirName;
+            } else {
+                Timber.e(TAG, "LogWatcher: init LogWatcher failed!");
+            }
+        } else {
+            sLogDirPath = mContext.getFilesDir().getAbsolutePath() + File.separator + logDirName;
+        }
+        // 系统默认处理类
+        this.mDefaultException = Thread.getDefaultUncaughtExceptionHandler();
+        // 将该类设置为系统默认处理类
+        Thread.setDefaultUncaughtExceptionHandler(this);
+    }
+    private File createNewLogFile() {
+        File logSaveDir = new File(sLogDirPath, "CrashHandler");
+        if (!logSaveDir.exists()) {
+            boolean mkdirs = logSaveDir.mkdirs();
+            if (!mkdirs) {
+                Timber.e(TAG, "LogWatcher: create new save dir failed");
+                return null;
+            }
+        }
+
+        String logFileName = getCurrentTimeStr();
+        File logFile = new File(logSaveDir, logFileName);
+
+        try {
+            boolean createRet = logFile.createNewFile();
+            if (!createRet) {
+                Timber.e(TAG, "LogWatcher: create new log file failed");
+                return null;
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+            return null;
+        }
+
+        return logFile;
+    }
+    private static String getCurrentTimeStr() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss", Locale.getDefault());
+        return sdf.format(new Date(System.currentTimeMillis()));
+    }
+
+    private static String getCurrentDateStr() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
+        return sdf.format(new Date(System.currentTimeMillis()));
+    }
+    @Override
+    public void uncaughtException(@NonNull Thread t, @NonNull Throwable e) {
+        if(!handleExample(e) && mDefaultException != null) { //判断异常是否已经被处理
+            mDefaultException.uncaughtException(t, e);
+        }
+        else {
+            // 睡眠3s主要是为了下面的Toast能够显示出来,否则,Toast是没有机会显示的
+            try {
+                Thread.sleep(3000);
+            } catch (Exception exception) {
+                exception.printStackTrace();
+            }
+//            //退出程序
+            android.os.Process.killProcess(android.os.Process.myPid());
+            System.exit(1);
+            if(mDefaultException != null)mDefaultException.uncaughtException(t, e);
+        }
+    }
+
+    /**
+     * 提示用户出现异常,将异常信息保存/上传
+     * @param ex
+     * @return
+     */
+    private boolean handleExample(Throwable ex){
+        if (ex == null){
+            return false;
+        }
+
+        new Thread(()->{
+            Looper.prepare();
+            // 不能使用这个ToastUtils.show(),不能即时的提示,会因为异常出现问题
+//            ToastUtils.show("很抱歉,程序出现异常,即将退出!");
+//            MyToast.toast(mContext, "很抱歉,程序出现异常,即将退出.", Toast.LENGTH_LONG);
+            Toast.makeText(mContext, "很抱歉,程序出现异常,即将退出", Toast.LENGTH_SHORT).show();
+
+            Looper.loop();
+
+        }).start();
+
+        saveCrashInfoToFile(ex);
+
+        return true;
+    }
+
+    /**
+     * 保存异常信息到本地
+     * @param ex
+     */
+    private void saveCrashInfoToFile(Throwable ex) {
+        Writer writer = new StringWriter();
+        PrintWriter printWriter = new PrintWriter(writer);
+        ex.printStackTrace(printWriter);
+        Throwable exCause = ex.getCause();
+        while (exCause != null) {
+            exCause.printStackTrace(printWriter);
+            exCause = exCause.getCause();
+        }
+        printWriter.close();
+
+
+        File fl = createNewLogFile();
+        //创建文件夹
+        if(fl!=null){
+            if(!fl.exists()) {
+                fl.mkdirs();
+            }
+            try {
+                FileOutputStream fileOutputStream = new FileOutputStream(fl);
+                fileOutputStream.write(writer.toString().getBytes());
+                fileOutputStream.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+    }
+}

+ 339 - 307
app/src/main/res/layout/ac_visitor_register.xml

@@ -78,334 +78,366 @@
                 android:text="完善访客信息"
                 android:textAlignment="center" />
 
-            <TextView
-                style="@style/StyleTextContent"
-                android:paddingHorizontal="15dp"
-                android:paddingVertical="5dp"
-                android:text="访客信息" />
-
-            <LinearLayout
-                android:id="@+id/ViewFormVisitor"
+            <ScrollView
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical"
-                android:paddingHorizontal="30dp"
-                android:paddingVertical="10dp">
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="手机号码" />
-
-                        <EditText
-                            android:id="@+id/EditPhone"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
-                            android:layout_height="wrap_content"
-                            android:layout_weight="2" />
-                    </LinearLayout>
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="来访事由" />
-
-                        <EditText
-                            android:id="@+id/comeReason"
-
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
-                            android:layout_height="match_parent"
-                            android:layout_weight="2" />
-                    </LinearLayout>
-                </LinearLayout>
-
+                android:layout_height="0dp"
+                android:layout_weight="1">
                 <LinearLayout
+                    android:orientation="vertical"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
+                    android:layout_height="wrap_content">
+                    <TextView
+                        style="@style/StyleTextContent"
+                        android:paddingHorizontal="15dp"
+                        android:paddingVertical="5dp"
+                        android:text="访客信息" />
 
                     <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="公司信息" />
-
-                        <EditText
-                            android:id="@+id/EditCompany"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
+                        android:id="@+id/ViewFormVisitor"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical"
+                        android:paddingHorizontal="30dp"
+                        android:paddingVertical="10dp">
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_weight="2" />
-                    </LinearLayout>
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="车牌信息" />
-
-                        <EditText
-                            android:id="@+id/EditCarPlate"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
+                            android:orientation="horizontal">
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="手机号码" />
+
+                                <EditText
+                                    android:id="@+id/EditPhone"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="来访事由" />
+
+                                <EditText
+                                    android:id="@+id/comeReason"
+
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="match_parent"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+                        </LinearLayout>
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_weight="2" />
-                    </LinearLayout>
-                </LinearLayout>
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="来访时间" />
-
-                        <TextView
-                            android:id="@+id/EditVisitTimeBegin"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
+                            android:orientation="horizontal">
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="公司信息" />
+
+                                <EditText
+                                    android:id="@+id/EditCompany"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="车牌信息" />
+
+                                <EditText
+                                    android:id="@+id/EditCarPlate"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+                        </LinearLayout>
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_weight="2" />
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="至"
-                            android:textAlignment="center" />
-
-                        <TextView
-                            android:id="@+id/EditVisitTimeEnd"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
+                            android:orientation="horizontal">
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="来访时间" />
+
+                                <TextView
+                                    android:id="@+id/EditVisitTimeBegin"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="至"
+                                    android:textAlignment="center" />
+
+                                <TextView
+                                    android:id="@+id/EditVisitTimeEnd"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+                        </LinearLayout>
+                        <LinearLayout
+                            android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_weight="2" />
-                    </LinearLayout>
-                </LinearLayout>
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal"
-                        android:visibility="gone">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="通行次数" />
-
-                        <EditText
-                            android:id="@+id/EditVisitNumber"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
+                            android:orientation="horizontal">
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="IC卡" />
+
+                                <EditText
+                                    android:id="@+id/EditICCode"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="5" />
+                            </LinearLayout>
+
+                        </LinearLayout>
+                        <LinearLayout
+                            android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_weight="2" />
-                    </LinearLayout>
+                            android:orientation="horizontal">
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal"
+                                android:visibility="gone">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="通行次数" />
+
+                                <EditText
+                                    android:id="@+id/EditVisitNumber"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="随行人数" />
+
+                                <Button
+                                    android:id="@+id/ButtonPeopleSub"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="减少"
+                                    style="@style/ButtonNormal"/>
+                                <TextView
+                                    android:id="@+id/EditVisitPeopleCount"
+                                    style="@style/StyleInputContent"
+
+                                    android:textAlignment="center"
+                                    android:text="0"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+                                <Button
+                                    android:id="@+id/ButtonPeopleAdd"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="增加"
+                                    style="@style/ButtonNormal"/>
+                            </LinearLayout>
+                        </LinearLayout>
+
+                        <androidx.recyclerview.widget.RecyclerView
+                            android:id="@+id/RecyclerFollowPeople"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"/>
 
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="随行人数" />
-
-                        <EditText
-                            android:id="@+id/EditVisitPeopleCount"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
-                            android:layout_height="wrap_content"
-                            android:layout_weight="2" />
                     </LinearLayout>
-                </LinearLayout>
 
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
+                    <TextView
+                        style="@style/StyleTextContent"
+                        android:paddingHorizontal="15dp"
+                        android:paddingVertical="5dp"
+                        android:text="被访人员信息" />
 
                     <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="IC卡" />
-
-                        <EditText
-                            android:id="@+id/EditICCode"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
+                        android:id="@+id/ViewFormVisitorBy"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical"
+                        android:paddingHorizontal="30dp"
+                        android:paddingVertical="10dp">
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_weight="5" />
-                    </LinearLayout>
-
-                </LinearLayout>
-            </LinearLayout>
-
-            <TextView
-                style="@style/StyleTextContent"
-                android:paddingHorizontal="15dp"
-                android:paddingVertical="5dp"
-                android:text="被访人员信息" />
-
-            <LinearLayout
-                android:id="@+id/ViewFormVisitorBy"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical"
-                android:paddingHorizontal="30dp"
-                android:paddingVertical="10dp">
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="被访员工" />
-
-                        <EditText
-                            android:id="@+id/EditByVisitPeople"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
+                            android:orientation="horizontal">
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="被访员工" />
+
+                                <EditText
+                                    android:id="@+id/EditByVisitPeople"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="wrap_content"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="被访部门" />
+
+                                <Spinner
+                                    android:id="@+id/EditByVisitDepartment"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="40dp"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+                        </LinearLayout>
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_weight="2" />
-                    </LinearLayout>
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="被访部门" />
-
-                        <Spinner
-                            android:id="@+id/EditByVisitDepartment"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
-                            android:layout_height="40dp"
-                            android:layout_weight="2" />
+                            android:orientation="horizontal">
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                                <TextView
+                                    style="@style/StyleTextContent"
+                                    android:layout_width="0dp"
+                                    android:layout_weight="1"
+                                    android:text="授权设备" />
+
+                                <Spinner
+                                    android:id="@+id/sp_net"
+                                    style="@style/StyleInputContent"
+                                    android:layout_width="0dp"
+                                    android:layout_height="40dp"
+                                    android:layout_weight="2" />
+                            </LinearLayout>
+
+                            <LinearLayout
+                                android:layout_width="0dp"
+                                android:layout_height="match_parent"
+                                android:layout_weight="1"
+                                android:gravity="center_vertical"
+                                android:orientation="horizontal">
+
+                            </LinearLayout>
+                        </LinearLayout>
                     </LinearLayout>
                 </LinearLayout>
+            </ScrollView>
 
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            style="@style/StyleTextContent"
-                            android:layout_width="0dp"
-                            android:layout_weight="1"
-                            android:text="授权设备" />
-
-                        <Spinner
-                            android:id="@+id/sp_net"
-                            style="@style/StyleInputContent"
-                            android:layout_width="0dp"
-                            android:layout_height="40dp"
-                            android:layout_weight="2" />
-                    </LinearLayout>
-
-                    <LinearLayout
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
 
-                    </LinearLayout>
-                </LinearLayout>
-            </LinearLayout>
 
             <TextView
                 android:id="@+id/TextButtonSure"

+ 81 - 0
app/src/main/res/layout/item_follow_people.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="horizontal"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
+    android:background="@drawable/border_gary">
+
+    <TextView
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+
+        android:id="@+id/TextIndex"
+        style="@style/StyleTextContent"
+
+        android:layout_width="100dp"
+        />
+    <TextView
+        android:text="姓名"
+        style="@style/StyleTextContent"
+        android:layout_width="0dp"
+        app:layout_constraintHorizontal_weight="1"
+        android:id="@+id/TextNameLabel"
+        app:layout_constraintStart_toEndOf="@id/TextIndex"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintEnd_toStartOf="@id/EditName"
+        />
+    <EditText
+        app:layout_constraintStart_toEndOf="@id/TextNameLabel"
+        app:layout_constraintBaseline_toBaselineOf="@id/TextNameLabel"
+        app:layout_constraintEnd_toStartOf="@id/TextPhoneLabel"
+        app:layout_constraintHorizontal_weight="3"
+        android:layout_width="0dp"
+        android:id="@+id/EditName"
+        style="@style/StyleInputContent"
+        />
+    <TextView
+        android:text="电话"
+        style="@style/StyleTextContent"
+        android:id="@+id/TextPhoneLabel"
+        android:layout_width="0dp"
+        app:layout_constraintHorizontal_weight="1"
+        app:layout_constraintStart_toEndOf="@id/EditName"
+        app:layout_constraintBaseline_toBaselineOf="@id/TextNameLabel"
+        app:layout_constraintEnd_toStartOf="@id/EditPhone"
+        />
+    <EditText
+        app:layout_constraintStart_toEndOf="@id/TextPhoneLabel"
+        app:layout_constraintBaseline_toBaselineOf="@id/TextPhoneLabel"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_weight="3"
+        android:layout_width="0dp"
+        android:id="@+id/EditPhone"
+        style="@style/StyleInputContent"
+        />
+    <TextView
+        android:text="身份证"
+        style="@style/StyleTextContent"
+
+        android:layout_width="0dp"
+        app:layout_constraintHorizontal_weight="1"
+        android:id="@+id/TextIdCodeLabel"
+
+        app:layout_constraintStart_toEndOf="@id/TextIndex"
+        app:layout_constraintTop_toBottomOf="@id/TextNameLabel"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toStartOf="@id/EditIdCode"
+        />
+    <EditText
+
+        app:layout_constraintBaseline_toBaselineOf="@id/TextIdCodeLabel"
+        app:layout_constraintStart_toEndOf="@id/TextIdCodeLabel"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_weight="7"
+        android:layout_width="0dp"
+        android:id="@+id/EditIdCode"
+        style="@style/StyleInputContent"
+        />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 7 - 0
app/src/main/res/values/style.xml

@@ -31,6 +31,13 @@
         <item name="android:paddingVertical">5dp</item>
         <item name="android:textColor">@color/ColorWhite</item>
     </style>
+    <style name="ButtonNormal" parent="StyleTextContent">
+        <item name="android:background">@drawable/button_normal</item>
+        <item name="android:textColor">@color/NormalTextColorBlack</item>
+        <item name="android:paddingHorizontal">15dp</item>
+        <item name="android:paddingVertical">5dp</item>
+        <item name="android:textAlignment">center</item>
+    </style>
     <style name="ButtonPrimaryLarge" parent="StyleTextLarge">
         <item name="android:background">@drawable/button_primary</item>
         <item name="android:textAlignment">center</item>