浏览代码

设置页面以及主页图标

shanmulinxi 2 年之前
父节点
当前提交
743c99ff83

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

@@ -3,6 +3,7 @@ package com.sunwin.visitorapp;
 import android.app.Application;
 import android.content.Context;
 
+import com.sunwin.visitorapp.utils.CacheUtil;
 import com.sunwin.visitorapp.utils.PresentationManager;
 import com.sunwin.visitorapp.utils.SystemTTS;
 import com.sunwin.visitorapp.utils.UniversalImageLoaderConfiguration;
@@ -30,7 +31,8 @@ public class BaseApplication extends Application {
 
         Timber.plant(new Timber.DebugTree());
 
-//        PresentationManager.checkAndShow(this);
+        CacheUtil.init(this);
+        PresentationManager.checkAndShow(this);
     }
 
     public static Context getInstance() {

+ 30 - 7
app/src/main/java/com/sunwin/visitorapp/activity/SettingAc.java

@@ -1,7 +1,6 @@
 package com.sunwin.visitorapp.activity;
 
 import android.os.Bundle;
-import android.view.View;
 import android.widget.RadioGroup;
 
 import androidx.annotation.NonNull;
@@ -19,6 +18,8 @@ import static androidx.fragment.app.FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CU
 
 public class SettingAc extends BaseActivity {
 
+    private ViewPager ViewPagerSetting;
+    private RadioGroup RadioGroupMenu;
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -27,8 +28,8 @@ public class SettingAc extends BaseActivity {
         nav.setData(this,"系统设置");
 
 
-        ViewPager viewPager = findViewById(R.id.ViewPagerSetting);
-        viewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager(),BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
+        ViewPagerSetting = findViewById(R.id.ViewPagerSetting);
+        ViewPagerSetting.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager(),BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
             @NonNull
             @Override
             public Fragment getItem(int position) {
@@ -49,13 +50,35 @@ public class SettingAc extends BaseActivity {
                 return 6;
             }
         });
-        RadioGroup group = findViewById(R.id.RadioView);
-        group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+        RadioGroupMenu = findViewById(R.id.RadioGroupMenu);
+
+        ViewPagerSetting.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+            }
+
             @Override
-            public void onCheckedChanged(RadioGroup group, int checkedId) {
-                viewPager.setCurrentItem(group.indexOfChild(group.findViewById(checkedId)),false);
+            public void onPageSelected(int position) {
+                RadioGroupMenu.setOnCheckedChangeListener(null);
+                RadioGroupMenu.check(RadioGroupMenu.getChildAt(position).getId());
+                RadioGroupMenu.setOnCheckedChangeListener(menuCheckListener);
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+
             }
         });
 
+        RadioGroupMenu.setOnCheckedChangeListener(menuCheckListener);
+
     }
+    private final RadioGroup.OnCheckedChangeListener menuCheckListener = new RadioGroup.OnCheckedChangeListener() {
+        @Override
+        public void onCheckedChanged(RadioGroup group, int checkedId) {
+            ViewPagerSetting.setCurrentItem(group.indexOfChild(group.findViewById(checkedId)),false);
+        }
+    };
+
 }

+ 29 - 0
app/src/main/java/com/sunwin/visitorapp/fragment/PageManageFr.java

@@ -1,24 +1,53 @@
 package com.sunwin.visitorapp.fragment;
 
 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.TextView;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
 
 import com.sunwin.visitorapp.R;
+import com.sunwin.visitorapp.utils.CacheUtil;
 
 public class PageManageFr  extends Fragment {
     private View root;
+    private EditText EditLoginPageTitle,EditWelcomePageTip;
+    private TextView TextButtonSure;
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
 
         if(root==null)root = inflater.inflate(R.layout.fr_page_manage,container,false);
 
+        EditLoginPageTitle = root.findViewById(R.id.EditLoginPageTitle);
+        EditWelcomePageTip = root.findViewById(R.id.EditWelcomePageTip);
+
+        TextButtonSure = root.findViewById(R.id.TextButtonSure);
+        TextButtonSure.setOnClickListener(v->{
+            SureClick();
+        });
         return root;
     }
+
+    public final static String Key_LoginPageTitle = "Key_LoginPageTitle";
+    public final static String Key_WelcomePageTip = "Key_WelcomePageTip";
+    private void SureClick(){
+        String _loginPageTitle = EditLoginPageTitle.getEditableText().toString().trim();
+
+        if(!TextUtils.isEmpty(_loginPageTitle)){
+            CacheUtil.put(Key_LoginPageTitle,_loginPageTitle);
+        }
+        String _welcomePageTip = EditWelcomePageTip.getEditableText().toString().trim();
+       if(!TextUtils.isEmpty(_welcomePageTip)){
+           CacheUtil.put(Key_WelcomePageTip,_welcomePageTip);
+       }
+
+
+    }
 }

+ 93 - 0
app/src/main/java/com/sunwin/visitorapp/utils/CacheUtil.java

@@ -0,0 +1,93 @@
+package com.sunwin.visitorapp.utils;
+
+
+import android.content.Context;
+import android.os.Parcelable;
+import android.text.TextUtils;
+
+import com.tencent.mmkv.MMKV;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import timber.log.Timber;
+
+public class CacheUtil {
+    public static void init (Context context){
+        MMKV.initialize(context);
+    }
+    public static boolean put(@NotNull String key, @Nullable Object value) {
+
+        if (TextUtils.isEmpty(key)) {
+            Timber.v("key 为空");
+            return false;
+        } else if (value == null) {
+            MMKV.defaultMMKV().removeValueForKey(key);
+            Timber.v("value 为 null 删除存储值");
+            return false;
+        } else if (value instanceof Integer) {
+            MMKV.defaultMMKV().encode(key, ((Number)value).intValue());
+            return true;
+        } else if (value instanceof String) {
+            MMKV.defaultMMKV().encode(key, (String)value);
+            return true;
+        } else if (value instanceof Double) {
+            MMKV.defaultMMKV().encode(key, ((Number)value).doubleValue());
+            return true;
+        } else if (value instanceof Float) {
+            MMKV.defaultMMKV().encode(key, ((Number)value).floatValue());
+            return true;
+        } else if (value instanceof byte[]) {
+            MMKV.defaultMMKV().encode(key, (byte[])value);
+            return true;
+        } else if (value instanceof Boolean) {
+            MMKV.defaultMMKV().encode(key, (Boolean)value);
+            return true;
+        } else if (value instanceof Long) {
+            MMKV.defaultMMKV().encode(key, ((Number)value).longValue());
+            return true;
+        } else if (value instanceof Parcelable) {
+            MMKV.defaultMMKV().encode(key, (Parcelable)value);
+            return true;
+        } else {
+            Timber.w("value 类型不符合存储要求");
+            return false;
+        }
+    }
+    public static Object get(@NotNull String key, Object defaultValue) {
+        if (MMKV.defaultMMKV().containsKey(key)) {
+            if (defaultValue instanceof Integer) {
+                return MMKV.defaultMMKV().decodeInt(key, ((Number)defaultValue).intValue());
+            } else if (defaultValue instanceof String) {
+                return MMKV.defaultMMKV().decodeString(key, (String)defaultValue);
+            } else if (defaultValue instanceof Double) {
+                return MMKV.defaultMMKV().decodeDouble(key, ((Number)defaultValue).doubleValue());
+            } else if (defaultValue instanceof Float) {
+                return MMKV.defaultMMKV().decodeFloat(key, ((Number)defaultValue).floatValue());
+            } else if (defaultValue instanceof byte[]) {
+                return MMKV.defaultMMKV().decodeBytes(key, (byte[])defaultValue);
+            } else if (defaultValue instanceof Boolean) {
+                return MMKV.defaultMMKV().decodeBool(key, (Boolean)defaultValue);
+            } else if (defaultValue instanceof Long) {
+                return MMKV.defaultMMKV().decodeLong(key, ((Number)defaultValue).longValue());
+            } else {
+                Timber.w("defaultValue 类型不符合存储要求");
+                return defaultValue;
+            }
+        } else {
+            Timber.w("key: " + key + " 不存在");
+            return defaultValue;
+        }
+    }
+
+    @Nullable
+    public static Parcelable get(@NotNull String key, @NotNull Class tClass) {
+        return MMKV.defaultMMKV().decodeParcelable(key, tClass);
+    }
+
+    @Nullable
+    public static Parcelable get(@NotNull String key, @NotNull Class tClass, @NotNull Parcelable defaultValue) {
+
+        return MMKV.defaultMMKV().decodeParcelable(key, tClass, defaultValue);
+    }
+}

+ 200 - 0
app/src/main/java/com/sunwin/visitorapp/utils/GsonUtil.java

@@ -0,0 +1,200 @@
+package com.sunwin.visitorapp.utils;
+
+import android.annotation.SuppressLint;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+import com.google.gson.JsonSyntaxException;
+
+import java.lang.reflect.Type;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class GsonUtil {
+    private static Gson gson;
+
+    /**
+     * json字符串转对象,解析失败,不会抛出异常,会直接返回null
+     *
+     * @param json json字符串
+     * @param type 对象类类型
+     * @param <T>  返回类型
+     * @return T,返回对象有可能为空
+     */
+    @Nullable
+    public static <T> T getObject(String json, Type type) {
+        try {
+            return fromJson(json, type);
+        } catch (Exception ignore) {
+            return null;
+        }
+    }
+
+//    @Nullable
+//    public static <T> T getObject(Object obj, Type type) {
+//        try {
+//            return fromJson(GsonUtil.toJson(obj), type);
+//        } catch (Exception ignore) {
+//            return null;
+//        }
+//    }
+
+    /**
+     * json字符串转对象,解析失败,将抛出对应的{@link JsonSyntaxException}异常,根据异常可查找原因
+     *
+     * @param json json字符串
+     * @param type 对象类类型
+     * @param <T>  返回类型
+     * @return T,返回对象不为空
+     */
+    @NonNull
+    public static <T> T fromJson(String json, Type type) {
+        Gson gson = buildGson();
+        return gson.fromJson(json, type);
+    }
+
+    public static String toJson(Object object) {
+        return buildGson().toJson(object);
+    }
+
+    public static Gson buildGson() {
+        if (gson == null) {
+            gson = new GsonBuilder()
+                    .disableHtmlEscaping()
+                    .registerTypeAdapter(String.class, new StringAdapter())
+                    .registerTypeAdapter(Integer.class, new IntegerDefault0Adapter())
+                    .registerTypeAdapter(int.class, new IntegerDefault0Adapter())
+                    .registerTypeAdapter(Double.class, new DoubleDefault0Adapter())
+                    .registerTypeAdapter(double.class, new DoubleDefault0Adapter())
+                    .registerTypeAdapter(Long.class, new LongDefault0Adapter())
+                    .registerTypeAdapter(long.class, new LongDefault0Adapter())
+                    .registerTypeAdapter(Calendar.class,new CalendarDefaultAdapter())
+                    .create();
+        }
+        return gson;
+    }
+
+    private static class StringAdapter implements JsonSerializer<String>, JsonDeserializer<String> {
+        @Override
+        public String deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+                throws JsonParseException {
+            if (json instanceof JsonPrimitive) {
+                return json.getAsString();
+            } else {
+                return json.toString();
+            }
+        }
+
+        @Override
+        public JsonElement serialize(String src, Type typeOfSrc, JsonSerializationContext context) {
+            return new JsonPrimitive(src);
+        }
+    }
+
+    private static class IntegerDefault0Adapter implements JsonSerializer<Integer>, JsonDeserializer<Integer> {
+        @Override
+        public Integer deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+                throws JsonParseException {
+            try {
+                if (json.getAsString().equals("") || json.getAsString().equals("null")) {//定义为int类型,如果后台返回""或者null,则返回0
+                    return 0;
+                }
+            } catch (Exception ignore) {
+            }
+            try {
+                return json.getAsInt();
+            } catch (NumberFormatException e) {
+                throw new JsonSyntaxException(e);
+            }
+        }
+
+        @Override
+        public JsonElement serialize(Integer src, Type typeOfSrc, JsonSerializationContext context) {
+            return new JsonPrimitive(src);
+        }
+    }
+
+    private static class DoubleDefault0Adapter implements JsonSerializer<Double>, JsonDeserializer<Double> {
+        @Override
+        public Double deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
+            try {
+                if (json.getAsString().equals("") || json.getAsString().equals("null")) {//定义为double类型,如果后台返回""或者null,则返回0.00
+                    return 0.00;
+                }
+            } catch (Exception ignore) {
+            }
+            try {
+                return json.getAsDouble();
+            } catch (NumberFormatException e) {
+                throw new JsonSyntaxException(e);
+            }
+        }
+
+        @Override
+        public JsonElement serialize(Double src, Type typeOfSrc, JsonSerializationContext context) {
+            return new JsonPrimitive(src);
+        }
+    }
+
+    private static class LongDefault0Adapter implements JsonSerializer<Long>, JsonDeserializer<Long> {
+        @Override
+        public Long deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+                throws JsonParseException {
+            try {
+                if (json.getAsString().equals("") || json.getAsString().equals("null")) {//定义为long类型,如果后台返回""或者null,则返回0
+                    return 0L;
+                }
+            } catch (Exception ignore) {
+            }
+            try {
+                return json.getAsLong();
+            } catch (NumberFormatException e) {
+                throw new JsonSyntaxException(e);
+            }
+        }
+
+        @Override
+        public JsonElement serialize(Long src, Type typeOfSrc, JsonSerializationContext context) {
+            return new JsonPrimitive(src);
+        }
+    }
+
+    private static class CalendarDefaultAdapter implements JsonSerializer<Calendar>, JsonDeserializer<Calendar> {
+        @SuppressLint("SimpleDateFormat")
+        SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ;
+        @Override
+        public Calendar deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
+            if (json.getAsString().equals("") || json.getAsString().equals("null")) {
+                return null;
+            }
+            try {
+                Date date = sdf.parse(json.getAsString());
+                if(date==null)return null;
+                Calendar calendar = Calendar.getInstance();
+                calendar.setTime(date);
+                return calendar;
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            return null;
+
+        }
+
+        @Override
+        public JsonElement serialize(Calendar src, Type typeOfSrc, JsonSerializationContext context) {
+            return new JsonPrimitive(sdf.format(src));
+        }
+    }
+}

+ 28 - 24
app/src/main/java/com/sunwin/visitorapp/utils/PresentationManager.java

@@ -6,6 +6,7 @@ import android.app.Presentation;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.graphics.Rect;
 import android.hardware.display.DisplayManager;
 import android.net.Uri;
 import android.os.Build;
@@ -33,35 +34,38 @@ public class PresentationManager {
     }
 
     public static void checkAndShow(Context context){
-//        Timber.e("checkAndShow");
-//        if(PresentationManager.canMuteScreen(context)){
-//            Timber.e("canMuteScreen");
-//            if(PresentationManager.permissionsMuteScreen(context)){
-//                Timber.e("permissionsMuteScreen");
-//                if(!PresentationManager.hasInit())PresentationManager.instanceInit(DisplayWelcome.class,context);
-//                PresentationManager.show();
-//            }else{
-//                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
-//                    new AlertDialog.Builder(context).setTitle("开启副屏权限")
-//                            .setMessage("需要打开在其他应用上层显示,请去设置中开启此权限")
-//                            .setNegativeButton("取消",null)
-//                            .setPositiveButton("开启", new DialogInterface.OnClickListener() {
-//                                @Override
-//                                public void onClick(DialogInterface dialog, int which) {
-//                                    Intent intent  = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
-//                                    intent.setData(Uri.parse("package:" + context.getPackageName()));
-//                                    context.startActivity(intent);
-//                                }
-//                            }).create().show();
-//                }
-//
-//            }
-//        }
+        Timber.e("checkAndShow");
+        if(PresentationManager.canMuteScreen(context)){
+            Timber.e("canMuteScreen");
+            if(PresentationManager.permissionsMuteScreen(context)){
+                Timber.e("permissionsMuteScreen");
+                if(!PresentationManager.hasInit())PresentationManager.instanceInit(DisplayWelcome.class,context);
+                PresentationManager.show();
+            }else{
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
+                    new AlertDialog.Builder(context).setTitle("开启副屏权限")
+                            .setMessage("需要打开在其他应用上层显示,请去设置中开启此权限")
+                            .setNegativeButton("取消",null)
+                            .setPositiveButton("开启", new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int which) {
+                                    Intent intent  = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
+                                    intent.setData(Uri.parse("package:" + context.getPackageName()));
+                                    context.startActivity(intent);
+                                }
+                            }).create().show();
+                }
+
+            }
+        }
     }
 
     public static boolean canMuteScreen(Context context){
         DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
         Display[] presentationDisplays = displayManager.getDisplays();
+        Rect r = new Rect();
+        presentationDisplays[0].getRectSize(r);
+
         return presentationDisplays.length > 1;
     }
 

+ 19 - 0
app/src/main/res/drawable/ui_vector_check.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+
+    android:width="15dp"
+    android:height="15dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024"
+
+    >
+    <group android:rotation="0" android:pivotX="512" android:pivotY="512"
+        >
+        <path
+            android:fillColor="@color/NormalTextColorBlack"
+            android:pathData=
+                "M959.965003 223.038575v238.189392a533.078353 533.078353 0 0 1-33.91735 187.697336 601.553004 601.553004 0 0 1-235.501602 294.313007A549.525068 549.525068 0 0 1 512 1018.75241a549.397078 549.397078 0 0 1-178.546051-75.5141 600.913054 600.913054 0 0 1-235.501602-294.377002A532.630388 532.630388 0 0 1 64.034997 461.291962V223.038575a63.995 63.995 0 0 1 39.484916-59.13138l383.970002-158.963581a63.995 63.995 0 0 1 49.02017 0l383.970002 158.963581a63.995 63.995 0 0 1 39.484916 59.13138zM512 505.640497V95.880509L163.099258 241.341145V505.640497H512v415.327552a414.495618 414.495618 0 0 0 128.949926-59.38736 491.801578 491.801578 0 0 0 103.6719-96.056496 513.943848 513.943848 0 0 0 116.278916-259.819701H512z"
+            />
+
+    </group>
+</vector>

+ 19 - 0
app/src/main/res/drawable/ui_vector_leave.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+
+    android:width="15dp"
+    android:height="15dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024"
+
+    >
+    <group android:rotation="0" android:pivotX="512" android:pivotY="512"
+        >
+        <path
+            android:fillColor="@color/NormalTextColorBlack"
+            android:pathData=
+                "M312.128 798.4L833.28 279.04l-521.344 405.76L0 512l1024-512-120.832 1024-283.968-164.16L312.128 1024v-225.6z m517.12-514.944l-0.512-0.64 4.544-3.712-4.032 4.352z"
+            />
+
+    </group>
+</vector>

+ 19 - 0
app/src/main/res/drawable/ui_vector_record.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+
+    android:width="15dp"
+    android:height="15dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024"
+
+    >
+    <group android:rotation="0" android:pivotX="512" android:pivotY="512"
+        >
+        <path
+            android:fillColor="@color/NormalTextColorBlack"
+            android:pathData=
+                "M64 356.16h896v311.68H64v-311.68zM64 0h896v311.68H64V0z m0 712.32h896V1024H64v-311.68z m134.4-578.752v44.544h89.6v-44.544H198.4z m0 356.16v44.544h89.6v-44.544H198.4z m0 356.16v44.544h89.6v-44.544H198.4z"
+            />
+
+    </group>
+</vector>

+ 20 - 0
app/src/main/res/drawable/ui_vector_register.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+
+    android:width="15dp"
+    android:height="15dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024"
+
+    >
+    <group android:rotation="0" android:pivotX="512" android:pivotY="512"
+        >
+        <path
+            android:fillColor="@color/NormalTextColorBlack"
+            android:pathData=
+                "M409.6 128c113.152 0 204.8 93.056 204.8 208S522.752 544 409.6 544c-113.152 0-204.8-93.056-204.8-208S296.448 128 409.6 128z m0 475.456c136.704 0 409.6 68.224 409.6 203.712V960H0v-152.832C0 671.68 272.896 603.52 409.6 603.52zM887.488 960v-168c0-115.456-133.12-197.248-276.288-214.464 24.832-3.008 74.368 0 94.592 0 136.704 0 318.208 78.976 318.208 214.464V960h-136.512zM576 532.16a207.808 207.808 0 0 0 136.512-196.16c0-90.624-56.96-167.68-136.512-196.16 21.376-7.68 44.352-11.84 68.288-11.84 113.152 0 204.8 93.056 204.8 208s-91.648 208-204.8 208c-23.936 0-46.912-4.16-68.288-11.84z"
+
+            />
+
+    </group>
+</vector>

+ 19 - 0
app/src/main/res/drawable/ui_vector_setting.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+
+    android:width="15dp"
+    android:height="15dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024"
+
+    >
+    <group android:rotation="0" android:pivotX="512" android:pivotY="512"
+        >
+        <path
+            android:fillColor="@color/NormalTextColorBlack"
+            android:pathData=
+                "M903.232 562.176l119.232 94.912-127.168 209.728-143.168-50.176a407.296 407.296 0 0 1-88.96 50.176L633.92 1024H394.688l-33.664-157.184a387.328 387.328 0 0 1-88.96-50.176l-144 50.176-127.872-209.728L120.96 562.176A395.136 395.136 0 0 1 117.312 512c0-16.896 1.6-33.792 3.712-50.176L0.192 359.168l116.032-204.544 155.84 52.736a407.296 407.296 0 0 1 88.96-50.176L396.352 0h237.568l29.248 157.184c32.128 12.8 61.568 29.696 88.96 50.176l158.08-52.736 113.664 204.544-120.64 102.656c2.048 16.384 3.648 32.768 3.648 50.176 0 11.584-1.28 28.352-3.648 50.176zM512 320a192 192 0 1 0 0 384 192 192 0 1 0 0-384z"
+            />
+
+    </group>
+</vector>

+ 19 - 0
app/src/main/res/drawable/ui_vector_sign.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+
+    android:width="15dp"
+    android:height="15dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024"
+
+    >
+    <group android:rotation="0" android:pivotX="512" android:pivotY="512"
+        >
+        <path
+            android:fillColor="@color/NormalTextColorBlack"
+            android:pathData=
+                "M592.64 581.568A255.296 255.296 0 0 0 512 768a255.36 255.36 0 0 0 86.656 192H64v-164.544C64 649.536 362.496 576 512 576c23.68 0 51.2 1.856 80.64 5.568zM512 64c123.776 0 224 100.224 224 224S635.776 512 512 512a223.936 223.936 0 0 1-224-224C288 164.224 388.224 64 512 64z m320 512v128h128v128h-128v128h-128v-128H576v-128h128V576h128z"
+            />
+
+    </group>
+</vector>

+ 19 - 0
app/src/main/res/drawable/ui_vector_status.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+
+    android:width="15dp"
+    android:height="15dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024"
+
+    >
+    <group android:rotation="0" android:pivotX="512" android:pivotY="512"
+        >
+        <path
+            android:fillColor="@color/NormalTextColorBlack"
+            android:pathData=
+                "M85.312 0v1024H0V0h85.312zM1024 256H170.688V0H1024v256z m0 768H170.688v-256H1024v256z m-170.688-384H170.688V384h682.624v256z"
+            />
+
+    </group>
+</vector>

+ 2 - 1
app/src/main/res/layout/ac_setting.xml

@@ -26,7 +26,7 @@
             android:background="@drawable/card_gary"
             >
             <RadioGroup
-                android:id="@+id/RadioView"
+                android:id="@+id/RadioGroupMenu"
                 android:orientation="vertical"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content">
@@ -65,6 +65,7 @@
             <androidx.viewpager.widget.ViewPager
                 android:id="@+id/ViewPagerSetting"
                 android:isScrollContainer="false"
+
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"/>
         </LinearLayout>

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

@@ -342,7 +342,7 @@
             <TextView
                 android:id="@+id/TextButtonSure"
                 android:layout_gravity="center_horizontal"
-                style="@style/StyleInputContent"
+                style="@style/TextButtonPrimary"
 
                 android:layout_marginHorizontal="100dp"
                 android:layout_width="match_parent"

+ 92 - 82
app/src/main/res/layout/activity_home.xml

@@ -1,166 +1,176 @@
 <?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"
     xmlns:tool="http://schemas.android.com/tools"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:background="@drawable/login_button_normal"
     android:orientation="vertical">
 
-    <TextView
-        android:id="@+id/TextTitle"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
+    <FrameLayout
+        android:id="@+id/FragmentView"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginEnd="40dp"
+        app:layout_constraintBottom_toBottomOf="@id/ViewClock"
         app:layout_constraintEnd_toEndOf="parent"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="66766"
-        android:padding="15dp"
-        android:textColor="@color/black"
-        android:textSize="@dimen/sp_25" />
+        app:layout_constraintHorizontal_weight="5"
+
+
+        app:layout_constraintStart_toEndOf="@id/ViewClock"
+        app:layout_constraintTop_toTopOf="@id/ViewClock"
+
+
+        >
+
+
+    </FrameLayout>
 
     <ImageView
-        android:id="@+id/ImageSetting"
+        android:id="@+id/ImageStatus"
         android:layout_width="0dp"
         android:layout_height="0dp"
-        app:layout_constraintDimensionRatio="1:1"
+        android:layout_marginEnd="10dp"
         android:padding="10dp"
-        app:layout_constraintTop_toTopOf="@id/TextTitle"
-        app:layout_constraintBottom_toBottomOf="@id/TextTitle"
-        app:layout_constraintEnd_toEndOf="parent"
         android:scaleType="fitCenter"
-        android:src="@mipmap/icon_setting"
-        />
+        android:src="@drawable/ui_vector_status"
+        app:layout_constraintBottom_toBottomOf="@id/TextTitle"
+        app:layout_constraintDimensionRatio="1:1"
+        app:layout_constraintEnd_toStartOf="@id/ImageSetting"
+        app:layout_constraintTop_toTopOf="@id/TextTitle" />
+
     <ImageView
-        android:id="@+id/ImageStatus"
+        android:id="@+id/ImageSetting"
         android:layout_width="0dp"
         android:layout_height="0dp"
-        app:layout_constraintDimensionRatio="1:1"
+        android:layout_marginEnd="20dp"
         android:padding="10dp"
-        app:layout_constraintTop_toTopOf="@id/TextTitle"
-        app:layout_constraintBottom_toBottomOf="@id/TextTitle"
-        app:layout_constraintEnd_toStartOf="@id/ImageSetting"
         android:scaleType="fitCenter"
-        android:src="@mipmap/icon_status"
-        />
+        android:src="@drawable/ui_vector_setting"
+        app:layout_constraintBottom_toBottomOf="@id/TextTitle"
+        app:layout_constraintDimensionRatio="1:1"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@id/TextTitle" />
 
     <LinearLayout
         android:id="@+id/ViewClock"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintBottom_toTopOf="@id/ViewMenu"
-        app:layout_constraintTop_toBottomOf="@id/TextTitle"
-
-        app:layout_constraintEnd_toStartOf="@id/FragmentView"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
         android:layout_marginStart="40dp"
-        android:layout_marginEnd="10dp"
+
         android:layout_marginTop="10dp"
+        android:layout_marginEnd="10dp"
         android:layout_marginBottom="10dp"
+        android:background="@drawable/card_white"
+        app:layout_constraintBottom_toTopOf="@id/ViewMenu"
+        app:layout_constraintEnd_toStartOf="@id/FragmentView"
         app:layout_constraintHorizontal_weight="2"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
+        app:layout_constraintStart_toStartOf="parent"
 
-        android:background="@drawable/card_white"
+        app:layout_constraintTop_toBottomOf="@id/TextTitle"
 
         >
 
     </LinearLayout>
-    <FrameLayout
-        android:id="@+id/FragmentView"
-        app:layout_constraintStart_toEndOf="@id/ViewClock"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@id/ViewClock"
-        app:layout_constraintBottom_toBottomOf="@id/ViewClock"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="40dp"
-        app:layout_constraintHorizontal_weight="5"
-
-
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-
-
-
-        >
-
-
-    </FrameLayout>
 
     <LinearLayout
-        android:layout_marginStart="30dp"
-        android:layout_marginEnd="30dp"
-        android:layout_marginTop="20dp"
-        android:layout_marginBottom="20dp"
         android:id="@+id/ViewMenu"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginStart="30dp"
+        android:layout_marginTop="20dp"
+        android:layout_marginEnd="30dp"
+        android:layout_marginBottom="20dp"
         android:orientation="horizontal"
-        app:layout_constraintTop_toBottomOf="@id/ViewClock"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
-        >
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/ViewClock">
+
         <LinearLayout
             android:id="@+id/MenuItemRecord"
             style="@style/Home_Menu_Item_View">
+
             <ImageView
+                style="@style/Home_Menu_Item_Icon"
                 android:background="@drawable/menu_orange"
-                android:src="@mipmap/icon_list"
-                style="@style/Home_Menu_Item_Icon"/>
+                android:src="@drawable/ui_vector_record" />
+
             <TextView
                 style="@style/Home_Menu_Item_Label"
-                android:text="访客记录"
-                />
+                android:text="访客记录" />
         </LinearLayout>
+
         <LinearLayout
             android:id="@+id/MenuItemSign"
             style="@style/Home_Menu_Item_View">
+
             <ImageView
+                style="@style/Home_Menu_Item_Icon"
                 android:background="@drawable/menu_green"
-                android:src="@mipmap/icon_sign"
-                style="@style/Home_Menu_Item_Icon"/>
+                android:src="@drawable/ui_vector_sign" />
+
             <TextView
                 style="@style/Home_Menu_Item_Label"
-                android:text="访客签到"
-                />
+                android:text="访客签到" />
         </LinearLayout>
+
         <LinearLayout
             android:id="@+id/MenuItemRegister"
             style="@style/Home_Menu_Item_View">
+
             <ImageView
+                style="@style/Home_Menu_Item_Icon"
                 android:background="@drawable/menu_yellow"
-                android:src="@mipmap/icon_people"
-                style="@style/Home_Menu_Item_Icon"/>
+                android:src="@drawable/ui_vector_register" />
+
             <TextView
                 style="@style/Home_Menu_Item_Label"
-                android:text="访客登记"
-                />
+                android:text="访客登记" />
         </LinearLayout>
+
         <LinearLayout
             android:id="@+id/MenuItemLeave"
             style="@style/Home_Menu_Item_View">
+
             <ImageView
+                style="@style/Home_Menu_Item_Icon"
                 android:background="@drawable/menu_red"
-                android:src="@mipmap/icon_leave"
-                style="@style/Home_Menu_Item_Icon"/>
+                android:src="@drawable/ui_vector_leave" />
+
             <TextView
                 style="@style/Home_Menu_Item_Label"
-                android:text="访客签离"
-                />
+                android:text="访客签离" />
         </LinearLayout>
+
         <LinearLayout
             android:id="@+id/MenuItemCheck"
             style="@style/Home_Menu_Item_View">
+
             <ImageView
+                style="@style/Home_Menu_Item_Icon"
                 android:background="@drawable/menu_gray"
-                android:src="@mipmap/icon_check"
-                style="@style/Home_Menu_Item_Icon"/>
+                android:src="@drawable/ui_vector_check" />
+
             <TextView
                 style="@style/Home_Menu_Item_Label"
-                android:text="快速核验"
-                />
+                android:text="快速核验" />
         </LinearLayout>
     </LinearLayout>
 
+    <TextView
+        android:id="@+id/TextTitle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="15dp"
+        android:text="@string/app_name"
+        android:textColor="@color/black"
+        android:textSize="@dimen/sp_25"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 37 - 11
app/src/main/res/layout/fr_page_manage.xml

@@ -14,10 +14,11 @@
         android:layout_height="wrap_content">
         <TextView
             style="@style/StyleTextContent"
-            android:layout_width="200dp"
+            android:layout_width="250dp"
             android:text="登录页面"
             />
         <EditText
+            android:id="@+id/EditLoginPageTitle"
             android:layout_weight="1"
             android:layout_width="0dp"
             style="@style/StyleInputContent"
@@ -31,10 +32,11 @@
         android:layout_height="wrap_content">
         <TextView
             style="@style/StyleTextContent"
-            android:layout_width="200dp"
+            android:layout_width="250dp"
             android:text="副屏页面"
             />
         <EditText
+            android:id="@+id/EditWelcomePageTip"
             android:layout_weight="1"
             android:layout_width="0dp"
             style="@style/StyleInputContent"
@@ -46,23 +48,47 @@
         android:layout_width="match_parent"
         android:gravity="center_vertical"
         android:layout_height="wrap_content">
-        <TextView
-            style="@style/StyleTextContent"
-            android:layout_width="200dp"
-            android:text="待机图片"
-            />
         <LinearLayout
-            android:layout_weight="1"
-            android:orientation="vertical"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content">
+            android:layout_width="250dp"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+            <TextView
+                style="@style/StyleTextContent"
+                android:layout_width="wrap_content"
+                android:text="待机图片"
+                />
             <Button
+                android:id="@+id/ButtonAddWelcomePhoto"
+                android:textSize="@dimen/TextSizeContent"
                 android:text="添加图片"
+                android:layout_margin="10dp"
+                android:textAlignment="center"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_weight="1"
+            android:orientation="vertical"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content">
+
             <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/RecyclerWelcomePhoto"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"/>
         </LinearLayout>
     </LinearLayout>
+    <TextView
+        android:id="@+id/TextButtonSure"
+        android:layout_gravity="center_horizontal"
+        style="@style/TextButtonPrimary"
+
+        android:layout_marginHorizontal="100dp"
+        android:layout_width="match_parent"
+        android:textAlignment="center"
+        android:layout_marginTop="20dp"
+        android:text="提交"
+        />
 </LinearLayout>

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -1,5 +1,5 @@
 <resources>
-    <string name="app_name">VisitorApp</string>
+    <string name="app_name">访客登记一体机</string>
     <string name="web_site_name">招商银行松下路网点</string>
     <string name="login_title">欢迎使用智能访客登记系统</string>
     <string name="login">登录</string>

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

@@ -24,6 +24,11 @@
         <item name="android:layout_marginHorizontal">5dp</item>
         <item name="android:background">@drawable/card_input</item>
     </style>
+    <style name="TextButtonPrimary" parent="StyleTextLarge">
+        <item name="android:background">@drawable/card_primary</item>
+        <item name="android:padding">12dp</item>
+        <item name="android:textColor">@color/ColorWhite</item>
+    </style>
     <color name="NavBackgroundColor">#00FFFFFF</color>
     <dimen name="NavigationTitleTextSize">@dimen/TextSizeBig</dimen>
     <dimen name="CardInputRadius">4dp</dimen>