소스 검색

新建项目

ifengouy 2 년 전
부모
커밋
94fd1c5f0f
68개의 변경된 파일2462개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      app/.gitignore
  2. 39 0
      app/build.gradle
  3. 21 0
      app/proguard-rules.pro
  4. 26 0
      app/src/androidTest/java/com/sunwin/visitorapp/ExampleInstrumentedTest.java
  5. 31 0
      app/src/main/AndroidManifest.xml
  6. 55 0
      app/src/main/java/com/sunwin/visitorapp/BaseActivity.java
  7. 18 0
      app/src/main/java/com/sunwin/visitorapp/BaseApplication.java
  8. 39 0
      app/src/main/java/com/sunwin/visitorapp/LoginActivity.java
  9. 14 0
      app/src/main/java/com/sunwin/visitorapp/MainActivity.java
  10. 154 0
      app/src/main/java/com/sunwin/visitorapp/SplashActivity.java
  11. 47 0
      app/src/main/java/com/sunwin/visitorapp/activity/IdcardRegActivity.java
  12. 45 0
      app/src/main/java/com/sunwin/visitorapp/activity/VisitorRegActivity.java
  13. 186 0
      app/src/main/java/com/sunwin/visitorapp/utils/AppManager.java
  14. 30 0
      app/src/main/java/com/sunwin/visitorapp/utils/Constants.java
  15. 22 0
      app/src/main/java/com/sunwin/visitorapp/utils/DensityUtils.java
  16. 24 0
      app/src/main/java/com/sunwin/visitorapp/utils/KeyboardUtils.java
  17. 40 0
      app/src/main/java/com/sunwin/visitorapp/utils/LogUtil.java
  18. 78 0
      app/src/main/java/com/sunwin/visitorapp/utils/NetUtils.java
  19. 39 0
      app/src/main/java/com/sunwin/visitorapp/utils/RotateUtils.java
  20. 60 0
      app/src/main/java/com/sunwin/visitorapp/utils/SharePrefenceUtils.java
  21. 254 0
      app/src/main/java/com/sunwin/visitorapp/utils/TimeUtils.java
  22. 50 0
      app/src/main/java/com/sunwin/visitorapp/utils/ToastUtils.java
  23. 72 0
      app/src/main/java/com/sunwin/visitorapp/view/LoadingDialog.java
  24. 36 0
      app/src/main/java/com/sunwin/visitorapp/view/MyGridView.java
  25. 12 0
      app/src/main/res/anim/load_animation.xml
  26. 12 0
      app/src/main/res/anim/load_one_animation.xml
  27. 5 0
      app/src/main/res/anim/slide_in_from_bottom.xml
  28. 5 0
      app/src/main/res/anim/slide_out_from_bottom.xml
  29. 30 0
      app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  30. 9 0
      app/src/main/res/drawable/bg_view_click.xml
  31. 9 0
      app/src/main/res/drawable/ic_arrow_back_black_24dp.xml
  32. 170 0
      app/src/main/res/drawable/ic_launcher_background.xml
  33. 8 0
      app/src/main/res/drawable/login_button_normal.xml
  34. 7 0
      app/src/main/res/drawable/shape_bg_white_rectangle.xml
  35. 8 0
      app/src/main/res/drawable/shape_bg_white_yellow.xml
  36. 98 0
      app/src/main/res/layout/activity_id_card_reg.xml
  37. 106 0
      app/src/main/res/layout/activity_login.xml
  38. 18 0
      app/src/main/res/layout/activity_main.xml
  39. 6 0
      app/src/main/res/layout/activity_splash.xml
  40. 112 0
      app/src/main/res/layout/activity_visitor_reg.xml
  41. 23 0
      app/src/main/res/layout/dialog_loading.xml
  42. 38 0
      app/src/main/res/layout/title_layout.xml
  43. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  44. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  45. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  46. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  47. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  48. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  49. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  50. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  51. BIN
      app/src/main/res/mipmap-xhdpi/icon_loading.png
  52. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  53. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  54. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  55. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  56. 16 0
      app/src/main/res/values-night/themes.xml
  57. 14 0
      app/src/main/res/values/colors.xml
  58. 5 0
      app/src/main/res/values/dimens.xml
  59. 7 0
      app/src/main/res/values/strings.xml
  60. 30 0
      app/src/main/res/values/themes.xml
  61. 17 0
      app/src/test/java/com/sunwin/visitorapp/ExampleUnitTest.java
  62. 25 0
      build.gradle
  63. 17 0
      gradle.properties
  64. BIN
      gradle/wrapper/gradle-wrapper.jar
  65. 6 0
      gradle/wrapper/gradle-wrapper.properties
  66. 172 0
      gradlew
  67. 84 0
      gradlew.bat
  68. 2 0
      settings.gradle

+ 1 - 0
app/.gitignore

@@ -0,0 +1 @@
+/build

+ 39 - 0
app/build.gradle

@@ -0,0 +1,39 @@
+plugins {
+    id 'com.android.application'
+}
+
+android {
+    compileSdkVersion 28
+
+    defaultConfig {
+        applicationId "com.sunwin.visitorapp"
+        minSdkVersion 17
+        targetSdkVersion 26
+        versionCode 1
+        versionName "1.0"
+
+        vectorDrawables.useSupportLibrary = true
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+}
+
+dependencies {
+
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'com.google.android.material:material:1.2.1'
+    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+    testImplementation 'junit:junit:4.+'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+}

+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 26 - 0
app/src/androidTest/java/com/sunwin/visitorapp/ExampleInstrumentedTest.java

@@ -0,0 +1,26 @@
+package com.sunwin.visitorapp;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+        assertEquals("com.sunwin.visitorapp", appContext.getPackageName());
+    }
+}

+ 31 - 0
app/src/main/AndroidManifest.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.sunwin.visitorapp">
+    <!-- 网络请求权限 -->
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.CAMERA" />
+    <application
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:supportsRtl="true"
+        android:name=".BaseApplication"
+        android:theme="@style/AppTheme">
+        <activity android:name=".SplashActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity android:name=".LoginActivity" />
+        <activity android:name=".activity.VisitorRegActivity" />
+        <activity android:name=".activity.IdcardRegActivity" />
+    </application>
+
+</manifest>

+ 55 - 0
app/src/main/java/com/sunwin/visitorapp/BaseActivity.java

@@ -0,0 +1,55 @@
+package com.sunwin.visitorapp;
+
+import android.app.Activity;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.os.Bundle;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.sunwin.visitorapp.utils.AppManager;
+import com.sunwin.visitorapp.view.LoadingDialog;
+
+public class BaseActivity extends AppCompatActivity {
+
+    protected static String TAG = "";
+    protected Activity mContext;
+    protected LoadingDialog loadingDialog;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        AppManager.getAppManager().addActivity(this);
+        TAG = getClass().getSimpleName();
+        mContext = this;
+        loadingDialog = new LoadingDialog(this, "");
+    }
+
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        AppManager.getAppManager().removeActivity(this);
+    }
+
+    //设置android app 的字体大小不受系统字体大小改变的影响
+    @Override
+    public Resources getResources() {
+        Resources res = super.getResources();
+        Configuration config = new Configuration();
+        config.setToDefaults();
+        res.updateConfiguration(config, res.getDisplayMetrics());
+        return res;
+    }
+}

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

@@ -0,0 +1,18 @@
+package com.sunwin.visitorapp;
+
+import android.app.Application;
+import android.content.Context;
+
+public class BaseApplication extends Application {
+    private static BaseApplication mInstance;
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        mInstance = this;
+    }
+
+    public static Context getInstance() {
+        return mInstance;
+    }
+}

+ 39 - 0
app/src/main/java/com/sunwin/visitorapp/LoginActivity.java

@@ -0,0 +1,39 @@
+package com.sunwin.visitorapp;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+
+import com.sunwin.visitorapp.activity.VisitorRegActivity;
+
+public class LoginActivity extends BaseActivity implements View.OnClickListener {
+    private EditText mEtUserName;
+    private EditText mEtPwd;
+    private Button mBtnLogin;
+    private Button mBtnLoginBySelf;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_login);
+        initView();
+    }
+
+    private void initView() {
+        mEtUserName = (EditText) findViewById(R.id.et_user_name);
+        mEtPwd = (EditText) findViewById(R.id.et_pwd);
+        mBtnLogin = (Button) findViewById(R.id.btn_login);
+        findViewById(R.id.btn_login_by_self).setOnClickListener(this);
+    }
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.btn_login_by_self:
+                startActivity(new Intent(this, VisitorRegActivity.class));
+                break;
+        }
+    }
+}

+ 14 - 0
app/src/main/java/com/sunwin/visitorapp/MainActivity.java

@@ -0,0 +1,14 @@
+package com.sunwin.visitorapp;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+public class MainActivity extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+    }
+}

+ 154 - 0
app/src/main/java/com/sunwin/visitorapp/SplashActivity.java

@@ -0,0 +1,154 @@
+package com.sunwin.visitorapp;
+
+import android.Manifest;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+
+import com.sunwin.visitorapp.utils.AppManager;
+import com.sunwin.visitorapp.utils.Constants;
+import com.sunwin.visitorapp.utils.SharePrefenceUtils;
+import com.sunwin.visitorapp.utils.ToastUtils;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class SplashActivity extends AppCompatActivity {
+
+    private static final int REQUEST_FOR_PERMISSION = 100;
+    private static final String TAG = "SplashActivity";
+    private ArrayList<String> permissions;
+    MyHandler myHandler = new MyHandler(this);
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_splash);
+        AppManager.getAppManager().addActivity(this);
+        permissions = new ArrayList<>();
+        initData();
+        myHandler.sendEmptyMessageDelayed(0, 500);
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        AppManager.getAppManager().removeActivity(this);
+        if (myHandler != null) {
+            myHandler.removeMessages(0);
+        }
+    }
+
+    private void initData() {
+        initPermission();
+    }
+
+    private void initPermission() {
+
+        permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
+        permissions.add(Manifest.permission.READ_PHONE_STATE);
+        permissions.add(Manifest.permission.CAMERA);
+
+    }
+
+
+    static class MyHandler extends Handler {
+        WeakReference<SplashActivity> mWeakReference;
+
+        public MyHandler(SplashActivity activity) {
+            mWeakReference = new WeakReference<SplashActivity>(activity);
+        }
+
+        @Override
+        public void handleMessage(Message msg) {
+            final SplashActivity activity = mWeakReference.get();
+            if (activity != null) {
+                activity.getPermission();
+            }
+        }
+    }
+
+    private void getPermission() {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+            requestPer2();
+        } else {
+            openApplication();
+        }
+    }
+
+    private void requestPer2() {
+        Iterator<String> it = permissions.iterator();
+        while (it.hasNext()) {
+            String permission = it.next();
+            //检查权限是否已经申请
+            int hasPermission = ActivityCompat.checkSelfPermission(this, permission);//ActivityCompat.checkSelfPermission(this, permission)todo
+            if (hasPermission == PackageManager.PERMISSION_GRANTED) {
+                it.remove();
+            }
+        }
+        if (permissions.size() == 0) {
+            openApplication();
+            return;
+        }
+        String[] permissionStr = permissions.toArray(new String[0]);
+        //正式请求权限
+        ActivityCompat.requestPermissions(this, permissionStr, REQUEST_FOR_PERMISSION);
+
+    }
+
+
+
+
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+        switch (requestCode) {
+            case REQUEST_FOR_PERMISSION:
+                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+                    openApplication();
+                } else {
+                    ToastUtils.showToast("请您授予应用相应权限!");
+                }
+                return;
+
+            default:
+                break;
+        }
+    }
+
+
+    /**
+     * 进入应用程序
+     */
+    private void openApplication() {
+        boolean isLogin = SharePrefenceUtils.getBoolean(Constants.ISharePrefence.LOGINTAG, false);
+        if (isLogin) {
+            gotoMain();
+        } else {
+            gotoLogin();
+        }
+    }
+
+    private void gotoMain() {
+        Intent intent = new Intent(this, MainActivity.class);
+        startActivity(intent);
+        finish();
+    }
+
+    private void gotoLogin() {
+        Intent intent = new Intent(this, LoginActivity.class);
+        startActivity(intent);
+        finish();
+    }
+}

+ 47 - 0
app/src/main/java/com/sunwin/visitorapp/activity/IdcardRegActivity.java

@@ -0,0 +1,47 @@
+package com.sunwin.visitorapp.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sunwin.visitorapp.BaseActivity;
+import com.sunwin.visitorapp.R;
+import com.sunwin.visitorapp.view.MyGridView;
+
+public class IdcardRegActivity extends BaseActivity implements View.OnClickListener {
+    private ImageView mHeadIvBack;
+    private TextView mTvHeadTitle;
+    private TextView mTvRight;
+    private TextView mTvDate;
+    private LinearLayout mLlCardReg;
+    private MyGridView mGridview;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_id_card_reg);
+        initView();
+    }
+
+    private void initView() {
+        mHeadIvBack = (ImageView) findViewById(R.id.head_iv_back);
+        mTvHeadTitle = (TextView) findViewById(R.id.tv_head_title);
+        mTvRight = (TextView) findViewById(R.id.tv_right);
+        mTvDate = (TextView) findViewById(R.id.tv_date);
+       findViewById(R.id.ll_id_card_reg).setOnClickListener(this);
+        mGridview = (MyGridView) findViewById(R.id.gridview);
+    }
+//    startActivity(new Intent(this, VisitorRegActivity.class)/
+
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.ll_id_card_reg:
+                break;
+        }
+    }
+}

+ 45 - 0
app/src/main/java/com/sunwin/visitorapp/activity/VisitorRegActivity.java

@@ -0,0 +1,45 @@
+package com.sunwin.visitorapp.activity;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sunwin.visitorapp.BaseActivity;
+import com.sunwin.visitorapp.R;
+
+public class VisitorRegActivity extends BaseActivity implements View.OnClickListener {
+    private ImageView mHeadIvBack;
+    private TextView mTvHeadTitle;
+    private TextView mTvRight;
+    private TextView mTvDate;
+    private LinearLayout mLlCardReg;
+    private LinearLayout mLlNoCardReg;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_visitor_reg);
+        initView();
+    }
+
+    private void initView() {
+        mHeadIvBack = (ImageView) findViewById(R.id.head_iv_back);
+        mTvHeadTitle = (TextView) findViewById(R.id.tv_head_title);
+        mTvRight = (TextView) findViewById(R.id.tv_right);
+        mTvDate = (TextView) findViewById(R.id.tv_date);
+        findViewById(R.id.ll_card_reg).setOnClickListener(this);
+        findViewById(R.id.ll_no_card_reg).setOnClickListener(this);
+    }
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.ll_card_reg:
+                break;
+            case R.id.ll_no_card_reg:
+                break;
+        }
+    }
+}

+ 186 - 0
app/src/main/java/com/sunwin/visitorapp/utils/AppManager.java

@@ -0,0 +1,186 @@
+package com.sunwin.visitorapp.utils;
+
+import android.app.Activity;
+import android.app.ActivityManager;
+import android.content.Context;
+
+import java.util.Stack;
+
+public class AppManager {
+    private Stack<Activity> activityStack;
+    private static AppManager instance;
+
+    private AppManager() {
+    }
+
+    /**
+     * 功能描述:获取AppManager对象,单例模式
+     *
+     * @return
+     */
+    public static AppManager getAppManager() {
+        if (instance == null) {
+            instance = new AppManager();
+        }
+        return instance;
+    }
+
+    /**
+     * 功能描述: 添加Activity到堆栈
+     *
+     * @param activity
+     */
+    public void addActivity(Activity activity) {
+        if (activityStack == null) {
+            activityStack = new Stack<Activity>();
+        }
+        activityStack.add(activity);
+    }
+
+    /**
+     * 功能描述: 获取当前Activity(堆栈中最后一个压入的)
+     *
+     * @return
+     */
+    public Activity currentActivity() {
+        Activity activity = activityStack.lastElement();
+        return activity;
+    }
+
+    /**
+     * 功能描述: 结束当前Activity(堆栈中最后一个压入的)
+     */
+    public void finishActivity() {
+        Activity activity = activityStack.lastElement();
+        finishActivity(activity);
+    }
+
+    /**
+     * 功能描述: 结束指定的Activity
+     *
+     * @param activity
+     */
+    public void finishActivity(Activity activity) {
+        if (activity != null) {
+            activityStack.remove(activity);
+            activity.finish();
+            activity = null;
+        }
+    }
+
+    /**
+     * 功能描述: 移除指定的Activity
+     *
+     * @param activity
+     */
+    public void removeActivity(Activity activity) {
+        if (activity != null) {
+            activityStack.remove(activity);
+            activity = null;
+        }
+    }
+
+    /**
+     * @param c
+     */
+    public  boolean activityIsOpen(Class<?> c) {
+        for (Activity activity : activityStack) {
+            if (activity.getClass().equals(c)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 功能描述: 结束指定类名的Activity
+     *
+     * @param cls
+     */
+    public  void finishActivity(Class<?> cls) {
+        try {
+            Stack<Activity> activityStackTemp = new Stack<Activity>();
+            for (Activity activity : activityStack) {
+                if (activity.getClass().equals(cls)) {
+                    //判断activity是否已经消失,如果未消失,则消失activity,如果栈里面有activity,但是已经消失了,则从栈里面
+                    //移除该对象,为了防止多页面跳时,部分activity被错误加入.
+                    if (!activity.isFinishing()) {
+                        activityStackTemp.add(activity);
+                        activity.finish();
+                    }
+                }
+            }
+            //在list集合遍历的时候,不能删除list中的元素,否则会报java.util.ConcurrentModificationException异常
+            activityStack.removeAll(activityStackTemp);
+            // 在这里捕获空,当程序退出,又接收推送,点击推送,这个方法报空
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 功能描述: 结束所有Activity
+     */
+    public  void finishAllActivity() {
+        //这里可能会报数组越界的错误提前异常捕获
+        Stack<Activity> activityStackTemp = new Stack<Activity>();
+        activityStackTemp.addAll(activityStack);
+        try {
+            for (int i = 0, size = activityStackTemp.size(); i < size; i++) {
+                if (null != activityStackTemp.get(i)) {
+                    if (!activityStackTemp.get(i).isFinishing()) {
+                        activityStackTemp.get(i).finish();
+                    }
+                }
+            }
+            activityStack.clear();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 结束除了当前activity外的所有Activity
+     */
+    public void finishAllActivity(Class<?> a) {
+        //这里可能会报数组越界的错误提前异常捕获
+        Stack<Activity> activityStackTemp = new Stack<Activity>();
+        activityStackTemp.addAll(activityStack);
+        try {
+            for (int i = 0, size = activityStackTemp.size(); i < size; i++) {
+                if (null != activityStackTemp.get(i)) {
+                    if (!activityStackTemp.get(i).isFinishing()) {
+                        if (a != activityStack.get(i).getClass())
+                            activityStackTemp.get(i).finish();
+                    }
+                }
+            }
+            activityStack.clear();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 功能描述: 退出应用程序
+     *
+     * @param context      上下文
+     * @param isBackground 是否开启后台运行
+     */
+    public void AppExit(Context context, Boolean isBackground) {
+        try {
+            finishAllActivity();
+            ActivityManager activityMgr = (ActivityManager) context
+                    .getSystemService(Context.ACTIVITY_SERVICE);
+            activityMgr.killBackgroundProcesses(context.getPackageName());
+//			android.os.Process.killProcess(android.os.Process.myPid());
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            // 注意,如果您有后台程序运行,请不要支持此句子
+            if (!isBackground) {
+//				System.exit(0);    // 程序在下载时开启了下载service,此处不要杀掉任何进程
+            }
+        }
+    }
+}

+ 30 - 0
app/src/main/java/com/sunwin/visitorapp/utils/Constants.java

@@ -0,0 +1,30 @@
+package com.sunwin.visitorapp.utils;
+
+
+public class Constants {
+
+
+    public static String BASE_HOST = "http://119.39.226.171:20040/";//正式服务器
+
+    public static String getSERVER() {
+        String serverUrl = SharePrefenceUtils.getString(ISharePrefence.BASEURL, BASE_HOST);
+        return serverUrl;
+    }
+
+
+    public interface ISharePrefence {
+
+        String BASEURL = "baseurl";
+        String LOGINTAG = "logintag";
+    }
+
+    public interface ITable {//数据库表相关字段
+        String T_ACCOUNT = "t_account";
+    }
+
+    public interface IIntentValue {
+    }
+
+    public interface NumerValue {
+    }
+}

+ 22 - 0
app/src/main/java/com/sunwin/visitorapp/utils/DensityUtils.java

@@ -0,0 +1,22 @@
+package com.sunwin.visitorapp.utils;
+
+import android.content.Context;
+import android.util.TypedValue;
+
+public class DensityUtils {
+    /**
+     * dp转px
+     *
+     */
+    public static int dp2px(Context context, float dpVal) {
+        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpVal, context.getResources().getDisplayMetrics());
+    }
+
+    /**
+     * sp转px
+     */
+    public static int sp2px(Context context, float spVal) {
+        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spVal, context.getResources().getDisplayMetrics());
+    }
+
+}

+ 24 - 0
app/src/main/java/com/sunwin/visitorapp/utils/KeyboardUtils.java

@@ -0,0 +1,24 @@
+package com.sunwin.visitorapp.utils;
+
+import android.content.Context;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+
+public class KeyboardUtils {
+    public static void showKeyboard(View view) {
+        InputMethodManager imm = (InputMethodManager) view.getContext()
+                .getSystemService(Context.INPUT_METHOD_SERVICE);
+        if (imm != null) {
+            view.requestFocus();
+            imm.showSoftInput(view, 0);
+        }
+    }
+
+    public static void hideKeyboard(View view) {
+        InputMethodManager imm = (InputMethodManager) view.getContext()
+                .getSystemService(Context.INPUT_METHOD_SERVICE);
+        if (imm != null) {
+            imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
+        }
+    }
+}

+ 40 - 0
app/src/main/java/com/sunwin/visitorapp/utils/LogUtil.java

@@ -0,0 +1,40 @@
+package com.sunwin.visitorapp.utils;
+
+import android.util.Log;
+
+
+public class LogUtil {
+    public static final String TAG = "LogUtil";
+    public static boolean isDebug = false;
+
+    public static void debugLog(String msg) {
+        if (isDebug) {
+            Log.e(TAG, msg);
+        }
+
+    }
+
+    public static void debugLog(String tag, String msg) {
+        if (isDebug) {
+            Log.e(tag, msg);
+        }
+    }
+
+    public static void d(String tag, String msg) {
+        if (isDebug) {
+            Log.d(tag, msg);
+        }
+    }
+
+    public static void e(String tag, String msg) {
+        if (isDebug) {
+            Log.e(tag, msg);
+        }
+    }
+
+
+
+
+
+
+}

+ 78 - 0
app/src/main/java/com/sunwin/visitorapp/utils/NetUtils.java

@@ -0,0 +1,78 @@
+package com.sunwin.visitorapp.utils;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+/**
+ * 跟网络相关的工具类
+ *
+ *
+ *
+ */
+public class NetUtils
+{
+    private NetUtils()
+    {
+        /* cannot be instantiated */
+        throw new UnsupportedOperationException("cannot be instantiated");
+    }
+
+    /**
+     * 判断网络是否连接
+     *
+     * @param context
+     * @return
+     */
+    public static boolean isConnected(Context context)
+    {
+
+        ConnectivityManager connectivity = (ConnectivityManager) context
+                .getSystemService(Context.CONNECTIVITY_SERVICE);
+
+        if (null != connectivity)
+        {
+
+            NetworkInfo info = connectivity.getActiveNetworkInfo();
+            if (null != info && info.isConnected())
+            {
+                if (info.getState() == NetworkInfo.State.CONNECTED)
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 判断是否是wifi连接
+     */
+    public static boolean isWifi(Context context)
+    {
+        ConnectivityManager cm = (ConnectivityManager) context
+                .getSystemService(Context.CONNECTIVITY_SERVICE);
+
+        if (cm == null)
+            return false;
+        return cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI;
+
+    }
+
+    /**
+     * 打开网络设置界面
+     */
+    public static void openSetting(Activity activity)
+    {
+        Intent intent = new Intent("/");
+        ComponentName cm = new ComponentName("com.android.settings",
+                "com.android.settings.WirelessSettings");
+        intent.setComponent(cm);
+        intent.setAction("android.intent.action.VIEW");
+        activity.startActivityForResult(intent, 0);
+    }
+
+}

+ 39 - 0
app/src/main/java/com/sunwin/visitorapp/utils/RotateUtils.java

@@ -0,0 +1,39 @@
+package com.sunwin.visitorapp.utils;
+
+import android.view.animation.RotateAnimation;
+import android.widget.ImageView;
+
+public class RotateUtils {
+    private RotateUtils() {
+    }
+
+    /**
+     * 根据当前的状态来旋转箭头。
+     */
+
+    public static void rotateArrow(ImageView arrow, boolean flag) {
+        float pivotX = arrow.getWidth() / 2f;
+        float pivotY = arrow.getHeight() / 2f;
+        float fromDegrees = 0f;
+        float toDegrees = 0f;
+        // flag为true则向上
+        if (flag) {
+            fromDegrees = 180f;
+            toDegrees = 0f;
+        } else {
+            fromDegrees = 0f;
+            toDegrees = 180f;
+        }
+        //旋转动画效果   参数值 旋转的开始角度  旋转的结束角度  pivotX x轴伸缩值
+        RotateAnimation animation = new RotateAnimation(fromDegrees, toDegrees,
+                pivotX, pivotY);
+        //该方法用于设置动画的持续时间,以毫秒为单位
+        animation.setDuration(100);
+        //设置重复次数
+        //animation.setRepeatCount(int repeatCount);
+        //动画终止时停留在最后一帧
+        animation.setFillAfter(true);
+        //启动动画
+        arrow.startAnimation(animation);
+    }
+}

+ 60 - 0
app/src/main/java/com/sunwin/visitorapp/utils/SharePrefenceUtils.java

@@ -0,0 +1,60 @@
+package com.sunwin.visitorapp.utils;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+import com.sunwin.visitorapp.BaseApplication;
+
+public class SharePrefenceUtils {
+
+
+    public static boolean putString(String key, String value) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = settings.edit();
+        editor.putString(key, value);
+        return editor.commit();
+    }
+
+
+    public static String getString(String key, String defaultValue) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        return settings.getString(key, defaultValue);
+    }
+
+    public static long getLong(String key, long defaultValue) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        return settings.getLong(key, defaultValue);
+    }
+
+
+    public static boolean putBoolean(String key, boolean value) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = settings.edit();
+        editor.putBoolean(key, value);
+        return editor.commit();
+    }
+
+
+    public static boolean getBoolean(String key, boolean defaultValue) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        return settings.getBoolean(key, defaultValue);
+    }
+
+    public static boolean putLong(String key, long value) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = settings.edit();
+        editor.putLong(key, value);
+        return editor.commit();
+    }
+
+    public static boolean putInt(String key, int value) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = settings.edit();
+        editor.putInt(key, value);
+        return editor.commit();
+    }
+    public static int getInt(String key, int defaultValue) {
+        SharedPreferences settings = BaseApplication.getInstance().getSharedPreferences(BaseApplication.getInstance().getPackageName(), Context.MODE_PRIVATE);
+        return settings.getInt(key, defaultValue);
+    }
+}

+ 254 - 0
app/src/main/java/com/sunwin/visitorapp/utils/TimeUtils.java

@@ -0,0 +1,254 @@
+package com.sunwin.visitorapp.utils;
+
+
+import androidx.annotation.NonNull;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+
+public class TimeUtils {
+    public static String getTime(long date) {
+        SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
+        Date d = new Date(date);
+        return format.format(d);
+    }
+
+    /*
+     * 将时间戳转换为时间
+     */
+    public static String stampToDate(String s) {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        long lt = new Long(s);
+        Date date = new Date(lt);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    /*
+     * 将时间戳转换为时间
+     */
+    public static String stampToDate(long s) {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = new Date(s);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    public static String stampToChinaDate(long s) {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+        Date date = new Date(s);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    /*
+     * 将时间戳转换为时间
+     */
+    public static String stampToMinute(long time) {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+        Date date = new Date(time);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    /*
+     * 将时间戳转换为时间
+     */
+    public static String stampToTime(long time) {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date(time);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    /*
+     * 将时间戳转换为时间
+     */
+    public static String stampToTimeXq(long time) {
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss EEEE");
+        Date date = new Date(time);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    /**
+     * 根据提供的年月日获取该月份的第一天
+     *
+     * @param date
+     * @return
+     */
+    public static Long getBeginDayOfMonth(Date date) {
+        date.getTime();
+        Calendar startDate = Calendar.getInstance();
+        startDate.setTime(date);
+        startDate.set(Calendar.DAY_OF_MONTH, 1);
+        startDate.set(Calendar.HOUR_OF_DAY, 0);
+        startDate.set(Calendar.MINUTE, 0);
+        startDate.set(Calendar.SECOND, 0);
+        startDate.set(Calendar.MILLISECOND, 0);
+        Date firstDate = startDate.getTime();
+        return (firstDate.getTime());
+
+    }
+
+    /**
+     * 判断是否为今天(效率比较高)
+     *
+     * @param day 传入的 时间 为时间戳
+     * @return true今天 false不是
+     */
+    public static boolean isToday(long day) {
+//        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar pre = Calendar.getInstance();
+        Date predate = new Date(System.currentTimeMillis());
+        pre.setTime(predate);
+
+        Calendar cal = Calendar.getInstance();
+        Date date = new Date(day);
+        cal.setTime(date);
+
+        if (cal.get(Calendar.YEAR) == (pre.get(Calendar.YEAR))) {
+            int diffDay = cal.get(Calendar.DAY_OF_YEAR)
+                    - pre.get(Calendar.DAY_OF_YEAR);
+
+            if (diffDay == 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static boolean isRightTime(String time) {
+        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
+        long currentTimeMillis = System.currentTimeMillis();
+        String nowTime = sdf.format(currentTimeMillis);
+        try {
+            long start = sdf.parse(time).getTime();
+            long now = sdf.parse(nowTime).getTime();
+            if (now == start) {
+                return true;
+            } else {
+                return false;
+            }
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    /**
+     * 判断是否为昨天(效率比较高)
+     *
+     * @param day 传入的 时间  "2016-06-28 10:10:30" "2016-06-28" 都可以
+     * @return true今天 false不是
+     * @throws ParseException
+     */
+    public static boolean isYesterday(long day) {
+        Calendar pre = Calendar.getInstance();
+        Date predate = new Date(System.currentTimeMillis());
+        pre.setTime(predate);
+
+        Calendar cal = Calendar.getInstance();
+        Date date = new Date(day);
+        cal.setTime(date);
+
+        if (cal.get(Calendar.YEAR) == (pre.get(Calendar.YEAR))) {
+            int diffDay = cal.get(Calendar.DAY_OF_YEAR)
+                    - pre.get(Calendar.DAY_OF_YEAR);
+
+            if (diffDay == -1) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    public static long getRandomTime() {
+        int random = (int) (Math.random() * 10) + 1;
+        return random * 1000;
+    }
+
+    /**
+     * 将时间字符串转为时间戳
+     *
+     * @param time The formatted time string.
+     * @return the milliseconds
+     */
+    public static long string2Millis(final String time) {
+        return string2Millis(time, getDefaultFormat());
+    }
+
+    private static SimpleDateFormat getDefaultFormat() {
+        return getDateFormat("yyyy-MM-dd HH:mm:ss");
+    }
+
+    public static SimpleDateFormat getDateFormat(String pattern) {
+        SimpleDateFormat simpleDateFormat = SDF_THREAD_LOCAL.get();
+        if (simpleDateFormat == null) {
+            simpleDateFormat = new SimpleDateFormat(pattern, Locale.getDefault());
+            SDF_THREAD_LOCAL.set(simpleDateFormat);
+        } else {
+            simpleDateFormat.applyPattern(pattern);
+        }
+        return simpleDateFormat;
+    }
+
+    private static final ThreadLocal<SimpleDateFormat> SDF_THREAD_LOCAL = new ThreadLocal<>();
+
+    /**
+     * 将时间字符串转为时间戳
+     *
+     * @param time   The formatted time string.
+     * @param format The format.
+     * @return the milliseconds
+     */
+    public static long string2Millis(final String time, @NonNull final DateFormat format) {
+        try {
+            return format.parse(time).getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return -1;
+    }
+
+    public static void main(String[] art) {
+        String str = "109.23334,23.33344;109.45333,23.298333;109.3357766,23.676555;";
+        int index = str.indexOf(";");
+        str = str.substring(index + 1);
+        System.out.println("str = " + str);
+    }
+
+    public static String toDhmsStyle(long allSeconds) {
+        String DateTimes = "";
+
+        long days = allSeconds / (60 * 60 * 24);
+        long hours = (allSeconds % (60 * 60 * 24)) / (60 * 60);
+        long minutes = (allSeconds % (60 * 60)) / 60;
+        long seconds = allSeconds % 60;
+
+        if (days > 0) {
+            DateTimes = days + "天" + hours + "小时" + minutes + "分" + seconds + "秒";
+        } else if (hours > 0) {
+            DateTimes = hours + "小时" + minutes + "分" + seconds + "秒";
+        } else if (minutes > 0) {
+            DateTimes = minutes + "分" + seconds + "秒";
+        } else {
+            DateTimes = seconds + "秒";
+        }
+
+        return DateTimes;
+    }
+}

+ 50 - 0
app/src/main/java/com/sunwin/visitorapp/utils/ToastUtils.java

@@ -0,0 +1,50 @@
+package com.sunwin.visitorapp.utils;
+
+import android.content.Context;
+import android.view.Gravity;
+import android.widget.Toast;
+
+import com.sunwin.visitorapp.BaseApplication;
+
+public class ToastUtils {
+    private static Context sContext;
+    private static String oldMsg;
+    protected static Toast toast = null;
+    private static long oneTime = 0;
+    private static long twoTime = 0;
+
+    private ToastUtils() {
+        throw new RuntimeException("ToastUtils cannot be initialized!");
+    }
+
+    public static void init(Context context) {
+        sContext = context;
+    }
+
+    public static void showToast(Context context, String s) {//会导致内存泄露
+        if (toast == null) {
+            toast = Toast.makeText(context, s, Toast.LENGTH_SHORT);
+            toast.show();
+            oneTime = System.currentTimeMillis();
+        } else {
+            twoTime = System.currentTimeMillis();
+            if (s.equals(oldMsg)) {
+                if (twoTime - oneTime > Toast.LENGTH_SHORT) {
+                    toast.show();
+                }
+            } else {
+                oldMsg = s;
+                toast.setText(s);
+                toast.show();
+            }
+            oneTime = twoTime;
+        }
+    }
+
+    public static void showToast(String s) {
+        Toast toast = Toast.makeText(BaseApplication.getInstance(), s, Toast.LENGTH_SHORT);
+        toast.setGravity(Gravity.CENTER, 0, 0);
+        toast.show();
+    }
+
+}

+ 72 - 0
app/src/main/java/com/sunwin/visitorapp/view/LoadingDialog.java

@@ -0,0 +1,72 @@
+package com.sunwin.visitorapp.view;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.text.TextUtils;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.view.animation.LinearInterpolator;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.sunwin.visitorapp.R;
+
+public class LoadingDialog extends Dialog {
+
+    private Context mContent;
+    private ImageView imageView;
+    private TextView textView;
+    private String mText;
+    private Animation anim;
+
+    public LoadingDialog(Context context) {
+        super(context);
+
+    }
+
+    public LoadingDialog(Context context, String text) {
+        super(context);
+        mText = text;
+        init(context);
+        textView.setText(mText);
+    }
+
+    private void init(Context context) {
+        setContentView(R.layout.dialog_loading);
+        imageView = findViewById(R.id.loadingdialog_fiv_icon);
+        textView = findViewById(R.id.loadingdialog_htv_text);
+
+        anim = AnimationUtils.loadAnimation(context, R.anim.load_animation);
+        LinearInterpolator lin = new LinearInterpolator();
+        anim.setInterpolator(lin);
+        imageView.startAnimation(anim);
+        setCanceledOnTouchOutside(false);
+
+    }
+
+    public void showLoadingDialog(String text) {
+        if (TextUtils.isEmpty(text)) {
+            setText("玩命加载中...");
+        }else{
+            setText(text);
+        }
+        if (anim!=null){
+            imageView.startAnimation(anim);
+        }
+        show();
+    }
+
+    public void dismissLoadingDialog() {
+        if (isShowing()) {
+            dismiss();
+            imageView.clearAnimation();
+        }
+    }
+
+    private void setText(String text) {
+        mText = text;
+        textView.setText(mText);
+    }
+
+
+}

+ 36 - 0
app/src/main/java/com/sunwin/visitorapp/view/MyGridView.java

@@ -0,0 +1,36 @@
+package com.sunwin.visitorapp.view;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.GridView;
+
+public class MyGridView extends GridView {
+
+    public boolean isOnMeasure;
+
+    public MyGridView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MyGridView(Context context) {
+        super(context);
+    }
+
+    public MyGridView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    @Override
+    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        isOnMeasure = true;
+        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
+                MeasureSpec.AT_MOST);
+        super.onMeasure(widthMeasureSpec, expandSpec);
+    }
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        isOnMeasure = false;
+        super.onLayout(changed, l, t, r, b);
+    }
+
+}

+ 12 - 0
app/src/main/res/anim/load_animation.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rotate xmlns:android="http://schemas.android.com/apk/res/android">
+    <rotate
+        android:drawable="@mipmap/icon_loading"
+        android:fromDegrees="0"
+        android:toDegrees="359"
+        android:pivotX="50%"
+        android:pivotY="50%"
+        android:duration="1000"
+        android:repeatCount="-1">
+    </rotate>
+</rotate>

+ 12 - 0
app/src/main/res/anim/load_one_animation.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rotate xmlns:android="http://schemas.android.com/apk/res/android">
+    <rotate
+        android:drawable="@mipmap/icon_loading"
+        android:fromDegrees="0"
+        android:toDegrees="359"
+        android:pivotX="50%"
+        android:pivotY="50%"
+        android:duration="500"
+        android:repeatCount="-1">
+    </rotate>
+</rotate>

+ 5 - 0
app/src/main/res/anim/slide_in_from_bottom.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<translate xmlns:android="http://schemas.android.com/apk/res/android"
+           android:duration="500"
+           android:fromYDelta="100.0%"
+           android:toYDelta="0.0%" />

+ 5 - 0
app/src/main/res/anim/slide_out_from_bottom.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<translate xmlns:android="http://schemas.android.com/apk/res/android"
+           android:duration="500"
+           android:fromYDelta="0.0%"
+           android:toYDelta="100.0%" />

+ 30 - 0
app/src/main/res/drawable-v24/ic_launcher_foreground.xml

@@ -0,0 +1,30 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:aapt="http://schemas.android.com/aapt"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
+        <aapt:attr name="android:fillColor">
+            <gradient
+                android:endX="85.84757"
+                android:endY="92.4963"
+                android:startX="42.9492"
+                android:startY="49.59793"
+                android:type="linear">
+                <item
+                    android:color="#44000000"
+                    android:offset="0.0" />
+                <item
+                    android:color="#00000000"
+                    android:offset="1.0" />
+            </gradient>
+        </aapt:attr>
+    </path>
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="nonZero"
+        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
+        android:strokeWidth="1"
+        android:strokeColor="#00000000" />
+</vector>

+ 9 - 0
app/src/main/res/drawable/bg_view_click.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@color/bantranspant" android:state_pressed="true"/>
+    <item android:drawable="@android:color/transparent" android:state_focused="false" android:state_pressed="false"/>
+    <item android:drawable="@color/bantranspant"  android:state_focused="true"/>
+    <item android:drawable="@android:color/transparent" android:state_focused="false"/>
+
+</selector>

+ 9 - 0
app/src/main/res/drawable/ic_arrow_back_black_24dp.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
+</vector>

+ 170 - 0
app/src/main/res/drawable/ic_launcher_background.xml

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path
+        android:fillColor="#3DDC84"
+        android:pathData="M0,0h108v108h-108z" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M9,0L9,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,0L19,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,0L29,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,0L39,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,0L49,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,0L59,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,0L69,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,0L79,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M89,0L89,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M99,0L99,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,9L108,9"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,19L108,19"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,29L108,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,39L108,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,49L108,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,59L108,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,69L108,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,79L108,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,89L108,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,99L108,99"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,29L89,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,39L89,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,49L89,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,59L89,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,69L89,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,79L89,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,19L29,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,19L39,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,19L49,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,19L59,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,19L69,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,19L79,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+</vector>

+ 8 - 0
app/src/main/res/drawable/login_button_normal.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <gradient
+        android:angle="90"
+        android:startColor="#6A60EE"
+        android:endColor="#56EDFF"/>
+    <corners android:radius="5dp"/>
+</shape>

+ 7 - 0
app/src/main/res/drawable/shape_bg_white_rectangle.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="#ffffff" />
+
+</shape>

+ 8 - 0
app/src/main/res/drawable/shape_bg_white_yellow.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="#ff9933" />
+    <corners android:radius="5dp"/>
+
+</shape>

+ 98 - 0
app/src/main/res/layout/activity_id_card_reg.xml

@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/login_button_normal"
+    android:orientation="vertical">
+
+    <include layout="@layout/title_layout" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:orientation="horizontal">
+        <!--
+      android:layout_margin="120dp"
+              -->
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@color/color_efeeee"
+            android:gravity="center_horizontal"
+            android:orientation="vertical"
+            android:paddingTop="20dp"
+            android:paddingBottom="20dp">
+
+            <ImageView
+                android:layout_width="180dp"
+                android:layout_height="180dp"
+                android:src="@mipmap/ic_launcher" />
+
+            <TextClock
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="15dp"
+                android:text="fadsgadgadsg"
+                android:textColor="@color/color_333333"
+                android:textSize="@dimen/sp_25" />
+
+            <TextView
+                android:id="@+id/tv_date"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="15dp"
+                android:text="2022-8-26"
+                android:textColor="@color/color_333333"
+                android:textSize="@dimen/sp_20" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="50dp"
+            android:layout_weight="2"
+            android:padding="50dp"
+            android:background="@color/color_efeeee"
+            android:orientation="horizontal">
+
+            <LinearLayout
+                android:id="@+id/ll_id_card_reg"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:layout_weight="1"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:scaleType="fitXY"
+                    android:src="@mipmap/ic_launcher" />
+
+                <TextView
+                    android:textSize="@dimen/sp_25"
+                    android:layout_marginTop="10dp"
+                    android:textColor="@color/color_333333"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:text="请刷身份证" />
+            </LinearLayout>
+
+        </LinearLayout>
+
+
+    </LinearLayout>
+    <com.sunwin.visitorapp.view.MyGridView
+        android:id="@+id/gridview"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingTop="10dp"
+        android:paddingBottom="10dp"
+        android:horizontalSpacing="60dp"
+        android:numColumns="5"
+        android:overScrollMode="never"
+        android:scrollbars="none"
+        android:verticalSpacing="5dp" />
+</LinearLayout>

+ 106 - 0
app/src/main/res/layout/activity_login.xml

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/login_button_normal"
+    android:orientation="vertical">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="70dp"
+        android:layout_marginTop="70dp"
+        android:text="@string/web_site_name"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_20" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="50dp"
+        android:text="@string/login_title"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_20" />
+
+    <LinearLayout
+        android:layout_width="300dp"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="55dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:text="用户名"
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_20" />
+
+        <EditText
+            android:id="@+id/et_user_name"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/shape_bg_white_rectangle"
+            android:drawablePadding="5dp"
+            android:hint="请输入用户名"
+            android:imeOptions="actionNext"
+            android:inputType="text"
+            android:singleLine="true"
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_20" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="300dp"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="40dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:text="密码"
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_20" />
+
+        <EditText
+            android:id="@+id/et_pwd"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/shape_bg_white_rectangle"
+            android:drawablePadding="5dp"
+            android:hint="请输入密码"
+            android:imeOptions="actionNext"
+            android:inputType="text"
+            android:singleLine="true"
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_20" />
+    </LinearLayout>
+
+    <Button
+        android:id="@+id/btn_login"
+        android:layout_width="200dp"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="55dp"
+        android:background="@drawable/shape_bg_white_rectangle"
+        android:gravity="center"
+        android:padding="3dp"
+        android:text="@string/login"
+        android:textSize="@dimen/sp_20" />
+
+    <Button
+        android:id="@+id/btn_login_by_self"
+        android:layout_width="300dp"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="45dp"
+        android:background="@drawable/shape_bg_white_yellow"
+        android:gravity="center"
+        android:padding="3dp"
+        android:text="@string/login_byself"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_20" />
+</LinearLayout>

+ 18 - 0
app/src/main/res/layout/activity_main.xml

@@ -0,0 +1,18 @@
+<?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:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".MainActivity">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="Hello World!"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 6 - 0
app/src/main/res/layout/activity_splash.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 112 - 0
app/src/main/res/layout/activity_visitor_reg.xml

@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/login_button_normal"
+    android:orientation="vertical">
+
+    <include layout="@layout/title_layout" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="120dp"
+        android:layout_gravity="center_horizontal"
+        android:orientation="horizontal">
+        <!--
+      android:layout_margin="120dp"
+              -->
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@color/color_efeeee"
+            android:gravity="center_horizontal"
+            android:orientation="vertical"
+            android:paddingTop="20dp"
+            android:paddingBottom="20dp">
+
+            <ImageView
+                android:layout_width="180dp"
+                android:layout_height="180dp"
+                android:src="@mipmap/ic_launcher" />
+
+            <TextClock
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="15dp"
+                android:text="fadsgadgadsg"
+                android:textColor="@color/color_333333"
+                android:textSize="@dimen/sp_25" />
+
+            <TextView
+                android:id="@+id/tv_date"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="15dp"
+                android:text="2022-8-26"
+                android:textColor="@color/color_333333"
+                android:textSize="@dimen/sp_20" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="50dp"
+            android:layout_weight="2"
+            android:padding="50dp"
+            android:background="@color/color_efeeee"
+            android:orientation="horizontal">
+
+            <LinearLayout
+                android:id="@+id/ll_card_reg"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:layout_width="180dp"
+                    android:layout_height="90dp"
+                    android:scaleType="fitXY"
+                    android:src="@mipmap/ic_launcher" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:text="身份证" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_no_card_reg"
+                android:layout_marginLeft="50dp"
+                android:layout_marginRight="50dp"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:layout_width="180dp"
+                    android:layout_height="90dp"
+                    android:scaleType="fitXY"
+                    android:src="@mipmap/ic_launcher" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:text="无证登记" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:orientation="vertical" />
+        </LinearLayout>
+
+
+    </LinearLayout>
+</LinearLayout>

+ 23 - 0
app/src/main/res/layout/dialog_loading.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
+    android:padding="5dp"
+    android:orientation="horizontal">
+
+    <ImageView
+        android:id="@+id/loadingdialog_fiv_icon"
+        android:layout_width="30dip"
+        android:layout_height="30dip"
+        android:src="@mipmap/icon_loading" />
+
+    <TextView
+        android:id="@+id/loadingdialog_htv_text"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        android:gravity="left|center"
+        android:textColor="@color/black"
+        android:textSize="14sp" />
+</LinearLayout>

+ 38 - 0
app/src/main/res/layout/title_layout.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="50dp">
+
+
+    <ImageView
+        android:id="@+id/head_iv_back"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:background="@drawable/bg_view_click"
+        android:paddingLeft="12dp"
+        android:paddingRight="12dp"
+        android:scaleType="center"
+        app:srcCompat="@drawable/ic_arrow_back_black_24dp" />
+
+    <TextView
+        android:id="@+id/tv_head_title"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_centerInParent="true"
+        android:layout_margin="5dp"
+        android:ellipsize="end"
+        android:gravity="center"
+        android:textColor="#232323"
+        android:textSize="@dimen/sp_20" />
+
+    <TextView
+        android:id="@+id/tv_right"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_alignParentRight="true"
+        android:gravity="center"
+        android:padding="12dp"
+        android:textColor="#108EE9"
+        android:visibility="gone" />
+</RelativeLayout>

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background" />
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background" />
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>

BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xhdpi/icon_loading.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


+ 16 - 0
app/src/main/res/values-night/themes.xml

@@ -0,0 +1,16 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+    <!-- Base application theme. -->
+    <style name="Theme.VisitorApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
+        <!-- Primary brand color. -->
+        <item name="colorPrimary">@color/purple_200</item>
+        <item name="colorPrimaryVariant">@color/purple_700</item>
+        <item name="colorOnPrimary">@color/black</item>
+        <!-- Secondary brand color. -->
+        <item name="colorSecondary">@color/teal_200</item>
+        <item name="colorSecondaryVariant">@color/teal_200</item>
+        <item name="colorOnSecondary">@color/black</item>
+        <!-- Status bar color. -->
+        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
+        <!-- Customize your theme here. -->
+    </style>
+</resources>

+ 14 - 0
app/src/main/res/values/colors.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="purple_200">#FFBB86FC</color>
+    <color name="purple_500">#FF6200EE</color>
+    <color name="purple_700">#FF3700B3</color>
+    <color name="teal_200">#FF03DAC5</color>
+    <color name="teal_700">#FF018786</color>
+    <color name="black">#FF000000</color>
+    <color name="white">#FFFFFFFF</color>
+    <color name="login_bg_color">#6A60EE</color>
+    <color name="color_333333">#333</color>
+    <color name="bantranspant">#11000000</color>
+    <color name="color_efeeee">#efeeee</color>
+</resources>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="sp_20">20sp</dimen>
+    <dimen name="sp_25">25sp</dimen>
+</resources>

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

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

+ 30 - 0
app/src/main/res/values/themes.xml

@@ -0,0 +1,30 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+    <!-- Base application theme. -->
+    <style name="Theme.VisitorApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
+        <!-- Primary brand color. -->
+        <item name="colorPrimary">@color/purple_500</item>
+        <item name="colorPrimaryVariant">@color/purple_700</item>
+        <item name="colorOnPrimary">@color/white</item>
+        <!-- Secondary brand color. -->
+        <item name="colorSecondary">@color/teal_200</item>
+        <item name="colorSecondaryVariant">@color/teal_700</item>
+        <item name="colorOnSecondary">@color/black</item>
+        <!-- Status bar color. -->
+        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
+        <!-- Customize your theme here. -->
+    </style>
+
+    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
+        <!-- Primary brand color. -->
+        <item name="colorPrimary">@color/purple_500</item>
+        <item name="colorPrimaryVariant">@color/purple_700</item>
+        <item name="colorOnPrimary">@color/white</item>
+        <!-- Secondary brand color. -->
+        <item name="colorSecondary">@color/teal_200</item>
+        <item name="colorSecondaryVariant">@color/teal_700</item>
+        <item name="colorOnSecondary">@color/black</item>
+        <!-- Status bar color. -->
+        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
+        <!-- Customize your theme here. -->
+    </style>
+</resources>

+ 17 - 0
app/src/test/java/com/sunwin/visitorapp/ExampleUnitTest.java

@@ -0,0 +1,17 @@
+package com.sunwin.visitorapp;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() {
+        assertEquals(4, 2 + 2);
+    }
+}

+ 25 - 0
build.gradle

@@ -0,0 +1,25 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+    repositories {
+        google()
+        mavenCentral()
+    }
+    dependencies {
+        classpath "com.android.tools.build:gradle:4.2.2"
+
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
+allprojects {
+    repositories {
+        google()
+        mavenCentral()
+        jcenter() // Warning: this repository is going to shut down soon
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

+ 17 - 0
gradle.properties

@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# 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

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Tue Sep 13 13:31:19 CST 2022
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME

+ 172 - 0
gradlew

@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"

+ 84 - 0
gradlew.bat

@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 2 - 0
settings.gradle

@@ -0,0 +1,2 @@
+rootProject.name = "VisitorApp"
+include ':app'