Parcourir la source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/build.gradle
ifengouy il y a 2 ans
Parent
commit
03e2edf508

+ 6 - 3
app/src/main/java/com/sunwin/visitorapp/db/DatabaseManager.java

@@ -70,10 +70,13 @@ public class DatabaseManager {
      * @param value
      * @return
      */
-//    public <T> List<T> getQueryByWhere(Class<T> cla, String field, String[] value) {
-//        return liteOrm.<T>query(new QueryBuilder(cla).where(field + "=?", value));
-//    }
+    public <T> List<T> getQueryByWhere(Class<T> cla, String field, String[] value) {
+        return liteOrm.<T>query(new QueryBuilder(cla).where(field + "=?", value));
+    }
 
+    public <T> List<T> getQueryByLike(Class<T> cla, String field, String[] value) {
+        return liteOrm.<T>query(new QueryBuilder(cla).where(field + " like ?", value));
+    }
     /**
      * 查询  某字段 等于 Value的值  可以指定从1-20,就是分页
      * @param cla

+ 28 - 0
app/src/main/java/com/sunwin/visitorapp/db/UserManagerModel.java

@@ -0,0 +1,28 @@
+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("UserManager")
+public class UserManagerModel {
+
+    // 指定自增,每个对象需要有一个主键
+    @PrimaryKey(AssignType.AUTO_INCREMENT)
+    private int id;
+
+    public String account;
+
+    public String password;
+
+    public String name;
+
+    public int status = 1;
+
+    public String permission;
+
+    public long last_login_time;
+
+    public long valid_time = -1;
+
+}

+ 64 - 43
app/src/main/java/com/sunwin/visitorapp/fragment/BlackListManageFr.java

@@ -1,6 +1,8 @@
 package com.sunwin.visitorapp.fragment;
 
 import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
@@ -29,6 +31,7 @@ import com.sunwin.visitorapp.adapter.BaseRecyclerAdapter;
 import com.sunwin.visitorapp.adapter.BaseViewHolder;
 import com.sunwin.visitorapp.db.BlackUserModel;
 import com.sunwin.visitorapp.db.DatabaseManager;
+import com.sunwin.visitorapp.db.UserManagerModel;
 import com.sunwin.visitorapp.utils.FileUtil;
 import com.sunwin.visitorapp.utils.ToastUtils;
 import com.sunwin.visitorapp.view.itemDecoration.RVLinearItemDecoration;
@@ -43,6 +46,7 @@ import timber.log.Timber;
 public class BlackListManageFr extends Fragment {
 
     private View root;
+    private Context context;
     private Uri image_uri;
     private BaseRecyclerAdapter<BlackUserModel> adapter = new BaseRecyclerAdapter<BlackUserModel>() {
         @Override
@@ -55,11 +59,16 @@ public class BlackListManageFr extends Fragment {
         public void bind(int position, BlackUserModel data, BaseViewHolder holder, int viewType) {
 
             Glide.with(root.getContext()).load(data.photo).error(getResources().getDrawable(R.drawable.image_temp)).into((ImageView) holder.getView(R.id.ImageHead));
-            holder.setText(R.id.TextName,data.name);
-            holder.setText(R.id.TextICCode,data.id_card_code);
+            holder.setText(R.id.TextName,"人员姓名: "+data.name);
+            holder.setText(R.id.TextICCode,"身份证号:"+data.id_card_code);
             holder.getView(R.id.ButtonDelete).setOnClickListener(v->{
-                DatabaseManager.getInstance().delete(data);
-                refreshData();
+                new AlertDialog.Builder(context).setTitle("提示").setMessage("确定删除吗?").setPositiveButton("确定", (dialog, which) -> {
+                    DatabaseManager.getInstance().delete(data);
+                    refreshData();
+                }).setNegativeButton("取消",null).create().show();
+            });
+            holder.getView(R.id.ButtonEdit).setOnClickListener(v->{
+                createDialog(context, (ViewGroup) holder.itemView,data);
             });
         }
     };
@@ -67,7 +76,6 @@ public class BlackListManageFr extends Fragment {
 
     private void refreshData(){
         adapter.setList(DatabaseManager.getInstance().getQueryAll(BlackUserModel.class));
-        Timber.e("adapter.getList().size() "+adapter.getList().size());
     }
     @SuppressLint("ResourceAsColor")
     @Nullable
@@ -76,62 +84,75 @@ public class BlackListManageFr extends Fragment {
 
         if(root==null)root = inflater.inflate(R.layout.fr_blacklist,container,false);
 
+        context = root.getContext();
 
         RecyclerView RecyclerBlackList = root.findViewById(R.id.RecyclerBlackList);
         RecyclerBlackList.setAdapter(adapter);
-        RecyclerBlackList.setLayoutManager(new LinearLayoutManager(root.getContext(),LinearLayoutManager.VERTICAL,false));
+        RecyclerBlackList.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,false));
 //        RecyclerBlackList.addItemDecoration(new RVLinearItemDecoration.Builder(root.getContext()).color(R.color.ColorGray).dashWidth(2).create());
         refreshData();
         root.findViewById(R.id.ButtonAdd).setOnClickListener(v->{
-            View dialog_root = inflater.inflate(R.layout.dialog_blacklist_add,container,false);
-            EditText editName = dialog_root.findViewById(R.id.EditName);
-            EditText editICCode = dialog_root.findViewById(R.id.EditICCode);
-            ImageView photo = dialog_root.findViewById(R.id.ImagePhoto);
-            AlertDialog dialog = new AlertDialog.Builder(root.getContext()).setTitle("添加黑名单")
-                    .setView(dialog_root)
-                    .create();
+            createDialog(context,container,new BlackUserModel());
+        });
+        return root;
+    }
+
+
+    private void createDialog(Context context, ViewGroup parent, BlackUserModel model){
+        View dialog_root = LayoutInflater.from(context).inflate(R.layout.dialog_blacklist_add,parent,false);
+        EditText editName = dialog_root.findViewById(R.id.EditName);
+        editName.setText(model.name);
+        EditText editICCode = dialog_root.findViewById(R.id.EditICCode);
+        editICCode.setText(model.id_card_code);
+        ImageView photo = dialog_root.findViewById(R.id.ImagePhoto);
+
+        AlertDialog dialog = new AlertDialog.Builder(root.getContext()).setTitle("添加黑名单")
+                .setView(dialog_root)
+                .create();
+        if(!TextUtils.isEmpty(model.photo)){
+            image_uri = Uri.fromFile(new File(model.photo));
+            Glide.with(root.getContext()).load(image_uri).into(photo);
+        }else {
             image_uri = null;
-            photo.setOnClickListener(pv->{
-                ImagePicker.getInstance().startGallery(this, false, new PickCallback() {
-                    @Override
-                    public void onPermissionDenied(String[] permissions, String message) {
-                        ToastUtils.showToast(message);
-                    }
+        }
 
-                    @Override
-                    public void onPickImage(@Nullable Uri imageUri) {
-                        super.onPickImage(imageUri);
-                        if(imageUri!=null){
-                            Glide.with(root.getContext()).load(imageUri).into(photo);
-                            image_uri = imageUri;
-                        }
+        photo.setOnClickListener(pv->{
+            ImagePicker.getInstance().startGallery(this, false, new PickCallback() {
+                @Override
+                public void onPermissionDenied(String[] permissions, String message) {
+                    ToastUtils.showToast(message);
+                }
 
+                @Override
+                public void onPickImage(@Nullable Uri imageUri) {
+                    super.onPickImage(imageUri);
+                    if(imageUri!=null){
+                        Glide.with(root.getContext()).load(imageUri).into(photo);
+                        image_uri = imageUri;
                     }
-                });
-            });
-            dialog_root.findViewById(R.id.ButtonSure).setOnClickListener(b->{
 
-                if(TextUtils.isEmpty(editName.getText().toString().trim())&&TextUtils.isEmpty(editICCode.getText().toString().trim())
-                &&image_uri==null){
-                    ToastUtils.showToast("至少一项不为空");
-                    return;
                 }
-                BlackUserModel model = new BlackUserModel();
-                model.name = editName.getText().toString().trim();
-                model.id_card_code = editICCode.getText().toString().trim();
-                model.photo = FileUtil.copyToFilesDir(root.getContext(), image_uri);
-                DatabaseManager.getInstance().insert(model);
-                refreshData();
-                dialog.dismiss();
             });
-            dialog.show();
         });
-        return root;
+        dialog_root.findViewById(R.id.ButtonSure).setOnClickListener(b->{
+
+            if(TextUtils.isEmpty(editName.getText().toString().trim())&&TextUtils.isEmpty(editICCode.getText().toString().trim())
+                    &&image_uri==null){
+                ToastUtils.showToast("至少一项不为空");
+                return;
+            }
+            model.name = editName.getText().toString().trim();
+            model.id_card_code = editICCode.getText().toString().trim();
+            model.photo = FileUtil.copyToFilesDir(root.getContext(), image_uri);
+            DatabaseManager.getInstance().insert(model);
+            refreshData();
+            dialog.dismiss();
+        });
+        dialog.show();
     }
 
 
 
-
     @Override
     public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
         super.onActivityResult(requestCode, resultCode, data);

+ 196 - 0
app/src/main/java/com/sunwin/visitorapp/fragment/UserManageFr.java

@@ -1,25 +1,221 @@
 package com.sunwin.visitorapp.fragment;
 
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.net.Uri;
 import android.os.Bundle;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Spinner;
+import android.widget.TextView;
 
+import androidx.annotation.ContentView;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.appcompat.app.AlertDialog;
 import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
 
+import com.bumptech.glide.Glide;
+import com.github.gzuliyujiang.calendarpicker.CalendarPicker;
+import com.github.gzuliyujiang.calendarpicker.OnSingleDatePickListener;
+import com.github.gzuliyujiang.imagepicker.ImagePicker;
+import com.github.gzuliyujiang.imagepicker.PickCallback;
+import com.github.gzuliyujiang.wheelpicker.DatimePicker;
+import com.github.gzuliyujiang.wheelpicker.OptionPicker;
+import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
+import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode;
+import com.github.gzuliyujiang.wheelpicker.contract.OnDatimePickedListener;
+import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
+import com.github.gzuliyujiang.wheelpicker.contract.OnOptionSelectedListener;
+import com.github.gzuliyujiang.wheelpicker.entity.DateEntity;
+import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity;
+import com.github.gzuliyujiang.wheelpicker.entity.TimeEntity;
+import com.github.gzuliyujiang.wheelpicker.widget.DatimeWheelLayout;
 import com.sunwin.visitorapp.R;
+import com.sunwin.visitorapp.adapter.BaseRecyclerAdapter;
+import com.sunwin.visitorapp.adapter.BaseViewHolder;
+import com.sunwin.visitorapp.db.BlackUserModel;
+import com.sunwin.visitorapp.db.DatabaseManager;
+import com.sunwin.visitorapp.db.UserManagerModel;
+import com.sunwin.visitorapp.utils.FileUtil;
+import com.sunwin.visitorapp.utils.TimeUtils;
+import com.sunwin.visitorapp.utils.ToastUtils;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Objects;
+
+import timber.log.Timber;
 
 public class UserManageFr extends Fragment {
 
     private View root;
+    private Context context;
+    private BaseRecyclerAdapter<UserManagerModel> adapter ;
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
 
         if(root==null)root = inflater.inflate(R.layout.fr_user_manage,container,false);
+        context = root.getContext();
+        RecyclerView RecyclerBlackList = root.findViewById(R.id.RecyclerUserManagerList);
+        adapter = new BaseRecyclerAdapter<UserManagerModel>() {
+            @Override
+            protected View getLayoutView(ViewGroup parent, int viewType) {
+                return LayoutInflater.from(parent.getContext()).inflate(R.layout.item_managerlist,parent,false);
+            }
+
+            @SuppressLint("UseCompatLoadingForDrawables")
+            @Override
+            public void bind(int position, UserManagerModel data, BaseViewHolder holder, int viewType) {
+                holder.setText(R.id.TextAccount,data.account);
+                holder.setText(R.id.TextName,data.name);
+                holder.setText(R.id.TextStatus,statusLabelList[data.status]);
+                holder.setText(R.id.TextPermission,String.valueOf(data.permission));
+                holder.setText(R.id.TextLastLoginTime,String.valueOf(data.last_login_time));
+                holder.getView(R.id.ButtonEdit).setOnClickListener(v->{
+                    createDialog(context,container,data);
+                });
+                holder.getView(R.id.ButtonDelete).setOnClickListener(v->{
+                    new AlertDialog.Builder(context).setTitle("提示").setMessage("确定删除吗?").setPositiveButton("确定", (dialog, which) -> {
+                        DatabaseManager.getInstance().delete(data);
+                        refreshData();
+                    }).setNegativeButton("取消",null).create().show();
 
+                });
+
+            }
+        };
+        RecyclerBlackList.setAdapter(adapter);
+        RecyclerBlackList.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,false));
+//        RecyclerBlackList.addItemDecoration(new RVLinearItemDecoration.Builder(root.getContext()).color(R.color.ColorGray).dashWidth(2).create());
+        refreshData();
+        root.findViewById(R.id.ButtonAdd).setOnClickListener(v->{
+            createDialog(context,container,new UserManagerModel());
+        });
+        EditText EditSearchKey = root.findViewById(R.id.EditSearchKey);
+        root.findViewById(R.id.ButtonSearch).setOnClickListener(v->{
+            search(EditSearchKey.getText().toString().trim());
+        });
         return root;
     }
+
+    private void refreshData(){
+        adapter.setList(DatabaseManager.getInstance().getQueryAll(UserManagerModel.class));
+    }
+
+    private void search(String key){
+        adapter.setList(DatabaseManager.getInstance().getQueryByLike(UserManagerModel.class,"name",new String[]{key}));
+    }
+
+
+    private final String[] statusLabelList = new String[]{"无效", "有效"};
+    private void createDialog(Context context,ViewGroup parent,UserManagerModel model){
+        View dialog_root = LayoutInflater.from(context).inflate(R.layout.dialog_user_manger,parent,false);
+
+        EditText EditAccount = dialog_root.findViewById(R.id.EditAccount);
+        EditAccount.setText(model.account);
+        EditText EditName = dialog_root.findViewById(R.id.EditName);
+        EditName.setText(model.name);
+        EditText EditPassword = dialog_root.findViewById(R.id.EditPassword);
+        EditPassword.setText(model.password);
+        EditText EditConfirmPassword = dialog_root.findViewById(R.id.EditConfirmPassword);
+        TextView TextStatus = dialog_root.findViewById(R.id.TextStatus);
+        TextStatus.setText(statusLabelList[model.status]);
+        TextStatus.setOnClickListener(v->{
+            OptionPicker picker = new OptionPicker(requireActivity());
+            picker.setData((Object[]) statusLabelList);
+            picker.setDefaultValue(statusLabelList[model.status]);
+            picker.getTitleView().setText("用户状态");
+            picker.setOnOptionPickedListener(new OnOptionPickedListener() {
+                @Override
+                public void onOptionPicked(int position, Object item) {
+                    model.status = position;
+                    TextStatus.setText((String)item);
+                }
+            });
+//            picker.getWheelView().setStyle(R.style.WheelStyleDemo);
+            picker.show();
+        });
+        TextView TextValidTime = dialog_root.findViewById(R.id.TextValidTime);
+        if(model.valid_time<0){
+            TextValidTime.setText("无过期时间");
+        }else {
+            TextValidTime.setText(TimeUtils.stampToTime(model.valid_time));
+        }
+
+        TextValidTime.setOnClickListener(v->{
+            DatimePicker picker = new DatimePicker(requireActivity());
+            final DatimeWheelLayout wheelLayout = picker.getWheelLayout();
+            picker.setOnDatimePickedListener(new OnDatimePickedListener() {
+                @Override
+                public void onDatimePicked(int year, int month, int day, int hour, int minute, int second) {
+//                    String text = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
+//                    TextValidTime.setText(text);
+                    Calendar calendar = Calendar.getInstance();
+                    calendar.set(Calendar.YEAR,year);
+                    calendar.set(Calendar.MONTH,month-1);
+                    calendar.set(Calendar.DAY_OF_MONTH,day);
+                    calendar.set(Calendar.HOUR_OF_DAY,hour);
+                    calendar.set(Calendar.MINUTE,minute);
+                    model.valid_time = calendar.getTimeInMillis();
+                    TextValidTime.setText(TimeUtils.stampToTime(calendar.getTimeInMillis()));
+                }
+            });
+            if(model.valid_time>0){
+                DatimeEntity defaultDatetime = DatimeEntity.now();
+                defaultDatetime.setDate(DateEntity.target(new Date(model.valid_time)));
+                defaultDatetime.setTime(TimeEntity.target(new Date(model.valid_time)));
+                wheelLayout.setDefaultValue(defaultDatetime);
+            }
+            wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY);
+            wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND);
+            wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10));
+            wheelLayout.setDateLabel("年", "月", "日");
+            wheelLayout.setTimeLabel("时", "分", "秒");
+            picker.show();
+        });
+
+
+        AlertDialog dialog = new AlertDialog.Builder(root.getContext()).setTitle("添加账号")
+                .setView(dialog_root)
+                .create();
+        dialog_root.findViewById(R.id.ButtonCancel).setOnClickListener(pv->{
+            dialog.dismiss();
+        });
+        dialog_root.findViewById(R.id.ButtonSure).setOnClickListener(b->{
+
+            if(TextUtils.isEmpty(EditAccount.getText().toString().trim())){
+                ToastUtils.showToast("账号不能为空");return;
+            }
+            if(TextUtils.isEmpty(EditName.getText().toString().trim())){
+                ToastUtils.showToast("名称不能为空");return;
+            }
+            if(TextUtils.isEmpty(EditPassword.getText().toString().trim())){
+                ToastUtils.showToast("密码不能为空");return;
+            }
+            if(!TextUtils.equals(EditPassword.getText().toString().trim(),EditConfirmPassword.getText().toString().trim())){
+                ToastUtils.showToast("两次密码不相同");return;
+            }
+            model.account = EditAccount.getText().toString().trim();
+            model.name = EditName.getText().toString().trim();
+
+            model.password = EditPassword.getText().toString().trim();
+//            model.status = TextView.getSelectedItemPosition();
+//            model.valid_time = TextValidTime.getText().toString().trim();
+            DatabaseManager.getInstance().insert(model);
+            refreshData();
+            dialog.dismiss();
+        });
+        dialog.show();
+    }
+
+
 }

+ 3 - 1
app/src/main/java/com/sunwin/visitorapp/utils/TimeUtils.java

@@ -1,6 +1,8 @@
 package com.sunwin.visitorapp.utils;
 
 
+import android.annotation.SuppressLint;
+
 import androidx.annotation.NonNull;
 
 import java.text.DateFormat;
@@ -65,7 +67,7 @@ public class TimeUtils {
      */
     public static String stampToTime(long time) {
         String res;
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        @SuppressLint("SimpleDateFormat") SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Date date = new Date(time);
         res = simpleDateFormat.format(date);
         return res;

+ 58 - 0
app/src/main/res/drawable/button_normal.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item  android:state_pressed="true">
+        <shape >
+            <!--设置圆角-->
+            <!--  按顺序分别对应:左下角的角度、右下角的角度、左上角的角度、右上角的角度-->
+            <corners
+                android:bottomLeftRadius="@dimen/Normal_Card_Radius"
+                android:bottomRightRadius="@dimen/Normal_Card_Radius"
+                android:topLeftRadius="@dimen/Normal_Card_Radius"
+                android:topRightRadius="@dimen/Normal_Card_Radius" />
+            <!--设置圆角背景色-->
+            <solid android:color="@color/ColorWhite_O_6" />
+            <!--  设置边框大小与背景色-->
+            <stroke
+                android:width="2dp"
+                android:color="@color/ColorGray" />
+
+        </shape>
+    </item>
+    <item android:state_enabled="false" >
+        <shape >
+            <!--设置圆角-->
+            <!--  按顺序分别对应:左下角的角度、右下角的角度、左上角的角度、右上角的角度-->
+            <corners
+                android:bottomLeftRadius="@dimen/Normal_Card_Radius"
+                android:bottomRightRadius="@dimen/Normal_Card_Radius"
+                android:topLeftRadius="@dimen/Normal_Card_Radius"
+                android:topRightRadius="@dimen/Normal_Card_Radius" />
+            <!--设置圆角背景色-->
+            <solid android:color="@color/ColorGray" />
+            <!--  设置边框大小与背景色-->
+            <stroke
+                android:width="2dp"
+                android:color="@color/ColorGray" />
+
+        </shape>
+    </item>
+    <item>
+        <shape >
+            <!--设置圆角-->
+            <!--  按顺序分别对应:左下角的角度、右下角的角度、左上角的角度、右上角的角度-->
+            <corners
+                android:bottomLeftRadius="@dimen/Normal_Card_Radius"
+                android:bottomRightRadius="@dimen/Normal_Card_Radius"
+                android:topLeftRadius="@dimen/Normal_Card_Radius"
+                android:topRightRadius="@dimen/Normal_Card_Radius" />
+            <!--设置圆角背景色-->
+            <solid android:color="@color/ColorWhite" />
+            <!--  设置边框大小与背景色-->
+            <stroke
+                android:width="2dp"
+                android:color="@color/ColorGray" />
+
+        </shape>
+    </item>
+</selector>
+

+ 1 - 1
app/src/main/res/layout/dialog_blacklist_add.xml

@@ -67,7 +67,7 @@
     <Button
         android:id="@+id/ButtonSure"
         android:layout_gravity="center_horizontal"
-        style="@style/ButtonPrimaryLarge"
+        style="@style/ButtonPrimary"
         android:layout_width="match_parent"
         android:textAlignment="center"
         android:layout_margin="10dp"

+ 168 - 0
app/src/main/res/layout/dialog_user_manger.xml

@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="500dp"
+    android:focusableInTouchMode="true"
+    android:focusable="true"
+    android:padding="20dp"
+    android:layout_height="wrap_content">
+
+    <LinearLayout
+        android:layout_marginVertical="10dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:gravity="center_vertical"
+        android:layout_height="wrap_content">
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="150dp"
+            android:text="登录账号"
+            />
+        <EditText
+            android:id="@+id/EditAccount"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            android:maxLength="20"
+            style="@style/StyleInputContent"
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_marginVertical="10dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:gravity="center_vertical"
+        android:layout_height="wrap_content">
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="150dp"
+            android:text="用户名称"
+            />
+        <EditText
+            android:id="@+id/EditName"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            android:maxLength="20"
+            style="@style/StyleInputContent"
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_marginVertical="10dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:gravity="center_vertical"
+        android:layout_height="wrap_content">
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="150dp"
+            android:text="用户密码"
+            />
+        <EditText
+            android:id="@+id/EditPassword"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            android:maxLength="20"
+            android:inputType="textPassword"
+            style="@style/StyleInputContent"
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_marginVertical="10dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:gravity="center_vertical"
+        android:layout_height="wrap_content">
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="150dp"
+            android:text="确认密码"
+            />
+        <EditText
+            android:id="@+id/EditConfirmPassword"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            android:maxLength="20"
+            android:inputType="textPassword"
+            style="@style/StyleInputContent"
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_marginVertical="10dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:gravity="center_vertical"
+        android:layout_height="wrap_content">
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="150dp"
+            android:text="用户状态"
+            />
+        <TextView
+            android:id="@+id/TextStatus"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            style="@style/StyleInputContent"
+
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_marginVertical="10dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:gravity="center_vertical"
+        android:layout_height="wrap_content">
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="150dp"
+            android:text="用户角色"
+            />
+        <TextView
+            android:id="@+id/TextRole"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            style="@style/StyleInputContent"
+
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_marginVertical="10dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:gravity="center_vertical"
+        android:layout_height="wrap_content">
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="150dp"
+            android:text="过期时间"
+            />
+        <TextView
+            android:id="@+id/TextValidTime"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            style="@style/StyleInputContent"
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_gravity="center_horizontal"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <Button
+            android:id="@+id/ButtonSure"
+            android:layout_gravity="center_horizontal"
+            style="@style/ButtonPrimaryLarge"
+            android:layout_width="match_parent"
+            android:textAlignment="center"
+            android:layout_margin="10dp"
+            android:text="提交"
+            />
+        <Button
+            android:id="@+id/ButtonCancel"
+            android:layout_gravity="center_horizontal"
+            style="@style/ButtonNormalLarge"
+            android:layout_width="match_parent"
+            android:textAlignment="center"
+            android:layout_margin="10dp"
+            android:text="取消"
+            />
+    </LinearLayout>
+</LinearLayout>

+ 53 - 5
app/src/main/res/layout/fr_user_manage.xml

@@ -4,21 +4,21 @@
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingHorizontal="20dp">
+    android:paddingHorizontal="10dp">
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_marginVertical="10dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
         <Button
-            style="@style/ButtonPrimaryLarge"
+            android:id="@+id/ButtonAdd"
+            style="@style/ButtonPrimary"
 
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintBottom_toBottomOf="parent"
             android:layout_width="wrap_content"
             android:textAlignment="center"
-            android:textSize="@dimen/TextSizeContent"
             android:text="新增"
             />
         <LinearLayout
@@ -36,20 +36,68 @@
                 android:text="姓名"
                 />
             <EditText
+                android:id="@+id/EditSearchKey"
                 android:layout_width="150dp"
                 style="@style/StyleInputContent"
                 android:layout_height="wrap_content"/>
             <Button
-                style="@style/ButtonPrimaryLarge"
+                android:id="@+id/ButtonSearch"
+                style="@style/ButtonPrimary"
                 android:layout_width="wrap_content"
                 android:textAlignment="center"
-                android:textSize="@dimen/TextSizeContent"
                 android:text="搜索"
                 />
         </LinearLayout>
     </androidx.constraintlayout.widget.ConstraintLayout>
 
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_vertical"
+        android:layout_margin="1dp"
+        android:padding="10dp">
+
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:text="登录账号"
+            />
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:text="用户名称"
+            />
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="0dp"
+            android:layout_weight="0.5"
+            android:text="用户状态"
+            />
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:text="用户权限"
+            />
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:text="上传登录时间"
+            />
+        <TextView
+            style="@style/StyleTextContent"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:text="操作"
+            />
+
+    </LinearLayout>
     <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/RecyclerUserManagerList"
         android:layout_marginVertical="10dp"
         android:layout_width="match_parent"
         android:layout_height="0dp"

+ 59 - 0
app/src/main/res/layout/item_managerlist.xml

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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"
+    android:layout_margin="1dp"
+    android:padding="10dp">
+
+    <TextView
+        android:id="@+id/TextAccount"
+        style="@style/StyleTextContent"
+        android:layout_width="0dp"
+        android:layout_weight="1"
+        />
+    <TextView
+        android:id="@+id/TextName"
+        style="@style/StyleTextContent"
+        android:layout_width="0dp"
+        android:layout_weight="1"
+        />
+    <TextView
+        android:id="@+id/TextStatus"
+        style="@style/StyleTextContent"
+        android:layout_width="0dp"
+        android:layout_weight="0.5"
+        />
+    <TextView
+        android:id="@+id/TextPermission"
+        style="@style/StyleTextContent"
+        android:layout_width="0dp"
+        android:layout_weight="1"
+        />
+    <TextView
+        android:id="@+id/TextLastLoginTime"
+        style="@style/StyleTextContent"
+        android:layout_width="0dp"
+        android:layout_weight="1"
+        />
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="0dp"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:layout_height="wrap_content">
+        <Button
+            android:id="@+id/ButtonEdit"
+            android:text="编辑"
+            android:layout_marginEnd="10dp"
+            style="@style/ButtonPrimary"/>
+        <Button
+            android:id="@+id/ButtonDelete"
+            android:text="删除"
+            style="@style/ButtonPrimary"/>
+    </LinearLayout>
+
+</LinearLayout>

+ 11 - 2
app/src/main/res/values/style.xml

@@ -27,18 +27,27 @@
     <style name="ButtonPrimary" parent="StyleTextContent">
         <item name="android:background">@drawable/button_primary</item>
         <item name="android:textAlignment">center</item>
+        <item name="android:paddingHorizontal">15dp</item>
+        <item name="android:paddingVertical">5dp</item>
+        <item name="android:textColor">@color/ColorWhite</item>
+    </style>
+    <style name="ButtonPrimaryLarge" parent="StyleTextLarge">
+        <item name="android:background">@drawable/button_primary</item>
+        <item name="android:textAlignment">center</item>
         <item name="android:paddingHorizontal">18dp</item>
         <item name="android:paddingVertical">8dp</item>
         <item name="android:textColor">@color/ColorWhite</item>
     </style>
-    <style name="ButtonPrimaryLarge" parent="ButtonPrimary">
-        <item name="android:textSize">@dimen/TextSizeLarge</item>
+    <style name="ButtonNormalLarge" parent="ButtonPrimaryLarge">
+        <item name="android:background">@drawable/button_normal</item>
+        <item name="android:textColor">@color/NormalTextColorBlack</item>
     </style>
     <color name="NavBackgroundColor">#00FFFFFF</color>
     <dimen name="NavigationTitleTextSize">@dimen/TextSizeBig</dimen>
     <dimen name="CardInputRadius">4dp</dimen>
     <dimen name="Normal_Card_Radius">7dp</dimen>
     <color name="ColorWhite">#eeeeee</color>
+    <color name="ColorWhite_O_6">#66eeeeee</color>
     <color name="ColorPrimary">#409eff</color>
     <color name="ColorPrimary_O_6">#66409eff</color>
     <color name="ColorGray">#c9c9c9</color>

+ 2 - 1
gradle.properties

@@ -14,4 +14,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
 # AndroidX package structure to make it clearer which packages are bundled with the
 # Android operating system, and which are packaged with your app"s APK
 # https://developer.android.com/topic/libraries/support-library/androidx-rn
-android.useAndroidX=true
+android.useAndroidX=true
+android.enableJetifier=true