From b9c422a7c5ae8c4fab482c7d76a492499d41e67a Mon Sep 17 00:00:00 2001 From: zhanghaochen Date: Mon, 29 Jan 2024 10:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 15 + .idea/.gitignore | 3 + .idea/compiler.xml | 6 + .idea/gradle.xml | 23 + .idea/jarRepositories.xml | 45 + .idea/misc.xml | 51 + .idea/vcs.xml | 6 + README | 0 app/.gitignore | 1 + app/build.gradle | 42 + app/proguard-rules.pro | 21 + app/src/main/AndroidManifest.xml | 71 ++ .../main/java/com/hjx/parent/AccountActivity.java | 52 + .../java/com/hjx/parent/AddStudentActivity.java | 197 +++ .../java/com/hjx/parent/ChangePwdActivity.java | 125 ++ .../main/java/com/hjx/parent/LoginActivity.java | 213 ++++ app/src/main/java/com/hjx/parent/MainActivity.java | 112 ++ .../main/java/com/hjx/parent/MyApplication.java | 18 + app/src/main/java/com/hjx/parent/NianActivity.java | 56 + app/src/main/java/com/hjx/parent/NickActivity.java | 58 + app/src/main/java/com/hjx/parent/QRActivity.java | 127 ++ .../main/java/com/hjx/parent/RegisterActivity.java | 269 ++++ app/src/main/java/com/hjx/parent/SexActivity.java | 72 ++ app/src/main/java/com/hjx/parent/ShenActivity.java | 157 +++ app/src/main/java/com/hjx/parent/UserActivity.java | 43 + .../main/java/com/hjx/parent/YinsiActivity.java | 43 + .../java/com/hjx/parent/bean/RegisterBean.java | 43 + .../java/com/hjx/parent/bean/RegisterDataBean.java | 149 +++ .../main/java/com/hjx/parent/bean/StudentBean.java | 171 +++ .../java/com/hjx/parent/fragment/HomeFragment.java | 107 ++ .../java/com/hjx/parent/fragment/MeFragment.java | 306 +++++ app/src/main/res/drawable/bg_solid_btn.xml | 11 + app/src/main/res/drawable/bg_solid_btn_grad.xml | 11 + app/src/main/res/drawable/bg_solid_white.xml | 11 + app/src/main/res/drawable/bg_solid_white_10.xml | 11 + .../main/res/drawable/bg_solid_white_10_bottom.xml | 12 + app/src/main/res/drawable/bg_solid_white_10_or.xml | 15 + .../main/res/drawable/bg_solid_white_10_top.xml | 12 + app/src/main/res/drawable/bg_solid_white_20.xml | 12 + app/src/main/res/drawable/checked_xc.xml | 11 + .../main/res/drawable/ic_launcher_background.xml | 170 +++ app/src/main/res/drawable/select_b_1.xml | 6 + app/src/main/res/drawable/select_b_2.xml | 6 + app/src/main/res/drawable/select_t_1.xml | 6 + app/src/main/res/drawable/welcome_bg.xml | 22 + app/src/main/res/layout/activity_add_stu.xml | 247 ++++ app/src/main/res/layout/activity_changem.xml | 230 ++++ app/src/main/res/layout/activity_login.xml | 238 ++++ app/src/main/res/layout/activity_main.xml | 111 ++ app/src/main/res/layout/activity_me.xml | 165 +++ app/src/main/res/layout/activity_qr.xml | 56 + app/src/main/res/layout/activity_register.xml | 303 +++++ app/src/main/res/layout/activity_sao.xml | 38 + app/src/main/res/layout/activity_select_stu.xml | 45 + app/src/main/res/layout/activity_set_jia.xml | 271 ++++ app/src/main/res/layout/activity_set_nian.xml | 146 +++ app/src/main/res/layout/activity_set_nick.xml | 90 ++ app/src/main/res/layout/activity_set_sex.xml | 155 +++ app/src/main/res/layout/activity_setac.xml | 156 +++ app/src/main/res/layout/activity_yin.xml | 45 + app/src/main/res/layout/fragment_home.xml | 230 ++++ app/src/main/res/layout/fragment_me.xml | 349 ++++++ app/src/main/res/mipmap-hdpi/abcdss.jpg | Bin 0 -> 21125 bytes app/src/main/res/mipmap-hdpi/banb.png | Bin 0 -> 573 bytes app/src/main/res/mipmap-hdpi/bg.png | Bin 0 -> 46244 bytes app/src/main/res/mipmap-hdpi/eco.png | Bin 0 -> 15471 bytes app/src/main/res/mipmap-hdpi/ffsj.png | Bin 0 -> 4645 bytes app/src/main/res/mipmap-hdpi/gx.png | Bin 0 -> 847 bytes app/src/main/res/mipmap-hdpi/gywmm.png | Bin 0 -> 492 bytes app/src/main/res/mipmap-hdpi/hoss.png | Bin 0 -> 847 bytes app/src/main/res/mipmap-hdpi/hous.png | Bin 0 -> 832 bytes app/src/main/res/mipmap-hdpi/icon.png | Bin 0 -> 84260 bytes app/src/main/res/mipmap-hdpi/icon_back.png | Bin 0 -> 694 bytes app/src/main/res/mipmap-hdpi/icon_qd.png | Bin 0 -> 107748 bytes app/src/main/res/mipmap-hdpi/mm.png | Bin 0 -> 959 bytes app/src/main/res/mipmap-hdpi/mrtx.png | Bin 0 -> 3812 bytes app/src/main/res/mipmap-hdpi/sbgl.png | Bin 0 -> 5318 bytes app/src/main/res/mipmap-hdpi/sc.png | Bin 0 -> 732 bytes app/src/main/res/mipmap-hdpi/sjh.png | Bin 0 -> 767 bytes app/src/main/res/mipmap-hdpi/smdlaa.png | Bin 0 -> 148683 bytes app/src/main/res/mipmap-hdpi/ssss.png | Bin 0 -> 141984 bytes app/src/main/res/mipmap-hdpi/szz.png | Bin 0 -> 775 bytes app/src/main/res/mipmap-hdpi/tjxss.png | Bin 0 -> 3453 bytes app/src/main/res/mipmap-hdpi/txz.png | Bin 0 -> 13614 bytes app/src/main/res/mipmap-hdpi/wmss.png | Bin 0 -> 1227 bytes app/src/main/res/mipmap-hdpi/wmus.png | Bin 0 -> 1277 bytes app/src/main/res/mipmap-hdpi/wsyq.png | Bin 0 -> 563 bytes app/src/main/res/mipmap-hdpi/xb_n.png | Bin 0 -> 796 bytes app/src/main/res/mipmap-hdpi/xb_nv.png | Bin 0 -> 799 bytes app/src/main/res/mipmap-hdpi/xs.png | Bin 0 -> 1541 bytes app/src/main/res/mipmap-hdpi/xxan.png | Bin 0 -> 348 bytes app/src/main/res/mipmap-hdpi/xxxt.png | Bin 0 -> 5134 bytes app/src/main/res/mipmap-hdpi/yc.png | Bin 0 -> 1564 bytes app/src/main/res/mipmap-hdpi/ycaj.png | Bin 0 -> 362 bytes app/src/main/res/mipmap-hdpi/yincs.png | Bin 0 -> 700 bytes app/src/main/res/mipmap-hdpi/yyxz.png | Bin 0 -> 4367 bytes app/src/main/res/mipmap-hdpi/zwjh.png | Bin 0 -> 11119 bytes app/src/main/res/mipmap-mdpi/icon.png | Bin 0 -> 35782 bytes app/src/main/res/mipmap-xhdpi/icon.png | Bin 0 -> 139241 bytes app/src/main/res/mipmap-xxhdpi/icon.png | Bin 0 -> 362283 bytes app/src/main/res/mipmap-xxxhdpi/icon.png | Bin 0 -> 646912 bytes app/src/main/res/values-night/themes.xml | 16 + app/src/main/res/values/colors.xml | 12 + app/src/main/res/values/strings.xml | 3 + app/src/main/res/values/styles.xml | 25 + app/src/main/res/values/themes.xml | 16 + build.gradle | 105 ++ config.gradle | 24 + gradle.properties | 19 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 185 +++ gradlew.bat | 89 ++ libs/common/.gitignore | 1 + libs/common/build.gradle | 52 + libs/common/consumer-rules.pro | 0 libs/common/libs/bdasr_V3_20191210_81acdf5.jar | Bin 0 -> 153425 bytes libs/common/proguard-rules.pro | 21 + libs/common/src/main/AndroidManifest.xml | 6 + .../src/main/assets/app-config-area-type.json | 63 + .../common/src/main/assets/app-config-default.json | 20 + libs/common/src/main/assets/app-config-dev.json | 5 + .../java/com/prws/common/CommonApplication.java | 38 + .../com/prws/common/adapter/CommonAdapter.java | 70 ++ .../com/prws/common/adapter/CommonViewHolder.java | 169 +++ .../java/com/prws/common/base/BaseActivity.java | 379 ++++++ .../java/com/prws/common/base/BaseContract.java | 52 + .../java/com/prws/common/base/BaseFragment.java | 93 ++ .../main/java/com/prws/common/base/BaseModel.java | 27 + .../java/com/prws/common/base/BasePresenter.java | 57 + .../main/java/com/prws/common/base/BaseView.java | 12 + .../main/java/com/prws/common/bean/BaseEntity.java | 53 + .../prws/common/bean/NavigationBarStatusBean.java | 44 + .../java/com/prws/common/config/AppConfig.java | 76 ++ .../java/com/prws/common/config/AppConstant.java | 37 + .../java/com/prws/common/config/CleanConfig.java | 22 + .../java/com/prws/common/config/CloudConfig.java | 91 ++ .../java/com/prws/common/config/DevicesConfig.java | 7 + .../java/com/prws/common/config/SettingConfig.java | 97 ++ .../java/com/prws/common/config/WorkConfig.java | 22 + .../prws/common/interfaces/DownTimerInterface.java | 11 + .../com/prws/common/manager/DialogManager.java | 56 + .../prws/common/net/ByteProgressRequestBody.java | 49 + .../com/prws/common/net/DownloadInterceptor.java | 24 + .../com/prws/common/net/DownloadResponseBody.java | 91 ++ .../java/com/prws/common/net/DownloadUtils.java | 98 ++ .../prws/common/net/FileProgressRequestBody.java | 67 + .../main/java/com/prws/common/net/INetEvent.java | 10 + .../com/prws/common/net/LoggingInterceptor.java | 114 ++ .../main/java/com/prws/common/net/NetWorks.java | 220 ++++ .../java/com/prws/common/net/OkHttp3Utils.java | 146 +++ .../prws/common/net/OkHttpRetryInterceptor.java | 72 ++ .../com/prws/common/net/PersistentCookieStore.java | 212 ++++ .../java/com/prws/common/net/ResponseCode.java | 13 + .../java/com/prws/common/net/RetrofitUtils.java | 147 +++ .../prws/common/net/SerializableOkHttpCookies.java | 62 + .../java/com/prws/common/net/SignInterceptor.java | 36 + .../java/com/prws/common/opc/OpcCheckResult.java | 95 ++ .../main/java/com/prws/common/opc/OpcHelper.java | 307 +++++ .../main/java/com/prws/common/opc/OpcUtils.java | 272 ++++ .../com/prws/common/opc/PmNumericalReading.java | 268 ++++ .../java/com/prws/common/opc/PmReadingRecord.java | 47 + .../java/com/prws/common/router/RouterConfig.java | 81 ++ .../prws/common/router/RouterFragmentUtils.java | 114 ++ .../java/com/prws/common/router/RouterUtils.java | 116 ++ .../main/java/com/prws/common/utils/Base64E.java | 95 ++ .../com/prws/common/utils/BeanPropertiesUtil.java | 148 +++ .../main/java/com/prws/common/utils/Common.java | 279 +++++ .../java/com/prws/common/utils/FileIOUtils.java | 733 +++++++++++ .../main/java/com/prws/common/utils/FileUtils.java | 216 ++++ .../java/com/prws/common/utils/GlideHelper.java | 107 ++ .../main/java/com/prws/common/utils/GsonUtil.java | 144 +++ .../main/java/com/prws/common/utils/LogUtil.java | 267 ++++ .../java/com/prws/common/utils/LogcatHelper.java | 204 +++ .../main/java/com/prws/common/utils/NetUtil.java | 119 ++ .../java/com/prws/common/utils/ScreenUtils.java | 120 ++ .../prws/common/utils/SharedPreferencesUtil.java | 265 ++++ .../common/utils/acmanager/ActivityManager.java | 190 +++ .../prws/common/utils/acmanager/ActivityName.java | 26 + .../utils/acmanager/LifecycleCallbackImpl.java | 67 + .../common/utils/crash/ActivityKillerV15_V20.java | 80 ++ .../common/utils/crash/ActivityKillerV21_V23.java | 80 ++ .../common/utils/crash/ActivityKillerV24_V25.java | 89 ++ .../prws/common/utils/crash/ActivityKillerV26.java | 80 ++ .../prws/common/utils/crash/ActivityKillerV28.java | 90 ++ .../com/prws/common/utils/crash/Cockroach.java | 240 ++++ .../prws/common/utils/crash/ExceptionHandler.java | 62 + .../prws/common/utils/crash/IActivityKiller.java | 20 + .../com/prws/common/utils/crash/PositionUtils.java | 111 ++ .../common/utils/dialog/PopupButtonListener.java | 8 + .../main/java/com/prws/common/view/DialogView.java | 24 + .../main/java/com/prws/common/view/LabelsView.java | 1293 ++++++++++++++++++++ .../java/com/prws/common/view/LoadingView.java | 76 ++ .../java/com/prws/common/view/MarqueeTextView.java | 30 + .../com/prws/common/view/MaxLimitRecyclerView.java | 73 ++ .../com/prws/common/view/RecycleViewDivider.java | 132 ++ .../java/com/prws/common/widget/ProgressView.java | 146 +++ .../widget/circleView/MatrixTranslateLayout.java | 50 + .../src/main/res/anim/cycle_interpolator.xml | 3 + libs/common/src/main/res/anim/shanke.xml | 6 + .../src/main/res/drawable/bg_solid_white.xml | 11 + .../src/main/res/drawable/default_label_bg.xml | 8 + libs/common/src/main/res/drawable/loading_anim.xml | 155 +++ .../main/res/drawable/select_map_position_type.xml | 6 + .../src/main/res/drawable/shape_dialog_bg.xml | 6 + .../src/main/res/mipmap-mdpi/icon_clean1.png | Bin 0 -> 2425 bytes .../src/main/res/mipmap-mdpi/icon_shoudong_a.png | Bin 0 -> 1893 bytes .../src/main/res/mipmap-mdpi/icon_zidong_a.png | Bin 0 -> 1993 bytes libs/common/src/main/res/mipmap-mdpi/js_1.png | Bin 0 -> 626 bytes libs/common/src/main/res/mipmap-mdpi/js_2.png | Bin 0 -> 561 bytes .../src/main/res/mipmap-mdpi/loading_00000.png | Bin 0 -> 12682 bytes .../src/main/res/mipmap-mdpi/loading_00001.png | Bin 0 -> 12755 bytes .../src/main/res/mipmap-mdpi/loading_00002.png | Bin 0 -> 11812 bytes .../src/main/res/mipmap-mdpi/loading_00003.png | Bin 0 -> 11202 bytes .../src/main/res/mipmap-mdpi/loading_00004.png | Bin 0 -> 11065 bytes .../src/main/res/mipmap-mdpi/loading_00005.png | Bin 0 -> 11385 bytes .../src/main/res/mipmap-mdpi/loading_00006.png | Bin 0 -> 11259 bytes .../src/main/res/mipmap-mdpi/loading_00007.png | Bin 0 -> 11021 bytes .../src/main/res/mipmap-mdpi/loading_00008.png | Bin 0 -> 10252 bytes .../src/main/res/mipmap-mdpi/loading_00009.png | Bin 0 -> 9464 bytes .../src/main/res/mipmap-mdpi/loading_00010.png | Bin 0 -> 8912 bytes .../src/main/res/mipmap-mdpi/loading_00011.png | Bin 0 -> 7265 bytes .../src/main/res/mipmap-mdpi/loading_00012.png | Bin 0 -> 5543 bytes .../src/main/res/mipmap-mdpi/loading_00013.png | Bin 0 -> 4710 bytes .../src/main/res/mipmap-mdpi/loading_00014.png | Bin 0 -> 4821 bytes .../src/main/res/mipmap-mdpi/loading_00015.png | Bin 0 -> 4556 bytes .../src/main/res/mipmap-mdpi/loading_00016.png | Bin 0 -> 4008 bytes .../src/main/res/mipmap-mdpi/loading_00017.png | Bin 0 -> 3627 bytes .../src/main/res/mipmap-mdpi/loading_00018.png | Bin 0 -> 3060 bytes .../src/main/res/mipmap-mdpi/loading_00019.png | Bin 0 -> 2938 bytes .../src/main/res/mipmap-mdpi/loading_00020.png | Bin 0 -> 3017 bytes .../src/main/res/mipmap-mdpi/loading_00021.png | Bin 0 -> 3100 bytes .../src/main/res/mipmap-mdpi/loading_00022.png | Bin 0 -> 2939 bytes .../src/main/res/mipmap-mdpi/loading_00023.png | Bin 0 -> 2854 bytes .../src/main/res/mipmap-mdpi/loading_00024.png | Bin 0 -> 2797 bytes .../src/main/res/mipmap-mdpi/loading_00025.png | Bin 0 -> 2555 bytes .../src/main/res/mipmap-mdpi/loading_00026.png | Bin 0 -> 2779 bytes .../src/main/res/mipmap-mdpi/loading_00027.png | Bin 0 -> 2787 bytes .../src/main/res/mipmap-mdpi/loading_00028.png | Bin 0 -> 2881 bytes .../src/main/res/mipmap-mdpi/loading_00029.png | Bin 0 -> 2992 bytes .../src/main/res/mipmap-mdpi/loading_00030.png | Bin 0 -> 2969 bytes .../src/main/res/mipmap-mdpi/loading_00031.png | Bin 0 -> 2899 bytes .../src/main/res/mipmap-mdpi/loading_00032.png | Bin 0 -> 3154 bytes .../src/main/res/mipmap-mdpi/loading_00033.png | Bin 0 -> 3620 bytes .../src/main/res/mipmap-mdpi/loading_00034.png | Bin 0 -> 4050 bytes .../src/main/res/mipmap-mdpi/loading_00035.png | Bin 0 -> 4421 bytes .../src/main/res/mipmap-mdpi/loading_00036.png | Bin 0 -> 4636 bytes .../src/main/res/mipmap-mdpi/loading_00037.png | Bin 0 -> 4319 bytes .../src/main/res/mipmap-mdpi/loading_00038.png | Bin 0 -> 4863 bytes .../src/main/res/mipmap-mdpi/loading_00039.png | Bin 0 -> 6082 bytes .../src/main/res/mipmap-mdpi/loading_00040.png | Bin 0 -> 7546 bytes .../src/main/res/mipmap-mdpi/loading_00041.png | Bin 0 -> 8293 bytes .../src/main/res/mipmap-mdpi/loading_00042.png | Bin 0 -> 9146 bytes .../src/main/res/mipmap-mdpi/loading_00043.png | Bin 0 -> 10245 bytes .../src/main/res/mipmap-mdpi/loading_00044.png | Bin 0 -> 11087 bytes .../src/main/res/mipmap-mdpi/loading_00045.png | Bin 0 -> 11619 bytes .../src/main/res/mipmap-mdpi/loading_00046.png | Bin 0 -> 11297 bytes .../src/main/res/mipmap-mdpi/loading_00047.png | Bin 0 -> 11429 bytes .../src/main/res/mipmap-mdpi/loading_00048.png | Bin 0 -> 12017 bytes .../src/main/res/mipmap-mdpi/loading_00049.png | Bin 0 -> 12863 bytes libs/common/src/main/res/mipmap-mdpi/ps_1.png | Bin 0 -> 602 bytes libs/common/src/main/res/mipmap-mdpi/ps_22.png | Bin 0 -> 681 bytes libs/common/src/main/res/values/attrs.xml | 80 ++ libs/common/src/main/res/values/strings.xml | 521 ++++++++ libs/common/src/main/res/values/styles.xml | 16 + libs/common/src/main/res/values/themes.xml | 12 + settings.gradle | 3 + 267 files changed, 17026 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 README create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/hjx/parent/AccountActivity.java create mode 100644 app/src/main/java/com/hjx/parent/AddStudentActivity.java create mode 100644 app/src/main/java/com/hjx/parent/ChangePwdActivity.java create mode 100644 app/src/main/java/com/hjx/parent/LoginActivity.java create mode 100644 app/src/main/java/com/hjx/parent/MainActivity.java create mode 100644 app/src/main/java/com/hjx/parent/MyApplication.java create mode 100644 app/src/main/java/com/hjx/parent/NianActivity.java create mode 100644 app/src/main/java/com/hjx/parent/NickActivity.java create mode 100644 app/src/main/java/com/hjx/parent/QRActivity.java create mode 100644 app/src/main/java/com/hjx/parent/RegisterActivity.java create mode 100644 app/src/main/java/com/hjx/parent/SexActivity.java create mode 100644 app/src/main/java/com/hjx/parent/ShenActivity.java create mode 100644 app/src/main/java/com/hjx/parent/UserActivity.java create mode 100644 app/src/main/java/com/hjx/parent/YinsiActivity.java create mode 100644 app/src/main/java/com/hjx/parent/bean/RegisterBean.java create mode 100644 app/src/main/java/com/hjx/parent/bean/RegisterDataBean.java create mode 100644 app/src/main/java/com/hjx/parent/bean/StudentBean.java create mode 100644 app/src/main/java/com/hjx/parent/fragment/HomeFragment.java create mode 100644 app/src/main/java/com/hjx/parent/fragment/MeFragment.java create mode 100644 app/src/main/res/drawable/bg_solid_btn.xml create mode 100644 app/src/main/res/drawable/bg_solid_btn_grad.xml create mode 100644 app/src/main/res/drawable/bg_solid_white.xml create mode 100644 app/src/main/res/drawable/bg_solid_white_10.xml create mode 100644 app/src/main/res/drawable/bg_solid_white_10_bottom.xml create mode 100644 app/src/main/res/drawable/bg_solid_white_10_or.xml create mode 100644 app/src/main/res/drawable/bg_solid_white_10_top.xml create mode 100644 app/src/main/res/drawable/bg_solid_white_20.xml create mode 100644 app/src/main/res/drawable/checked_xc.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/drawable/select_b_1.xml create mode 100644 app/src/main/res/drawable/select_b_2.xml create mode 100644 app/src/main/res/drawable/select_t_1.xml create mode 100644 app/src/main/res/drawable/welcome_bg.xml create mode 100644 app/src/main/res/layout/activity_add_stu.xml create mode 100644 app/src/main/res/layout/activity_changem.xml create mode 100644 app/src/main/res/layout/activity_login.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/activity_me.xml create mode 100644 app/src/main/res/layout/activity_qr.xml create mode 100644 app/src/main/res/layout/activity_register.xml create mode 100644 app/src/main/res/layout/activity_sao.xml create mode 100644 app/src/main/res/layout/activity_select_stu.xml create mode 100644 app/src/main/res/layout/activity_set_jia.xml create mode 100644 app/src/main/res/layout/activity_set_nian.xml create mode 100644 app/src/main/res/layout/activity_set_nick.xml create mode 100644 app/src/main/res/layout/activity_set_sex.xml create mode 100644 app/src/main/res/layout/activity_setac.xml create mode 100644 app/src/main/res/layout/activity_yin.xml create mode 100644 app/src/main/res/layout/fragment_home.xml create mode 100644 app/src/main/res/layout/fragment_me.xml create mode 100644 app/src/main/res/mipmap-hdpi/abcdss.jpg create mode 100644 app/src/main/res/mipmap-hdpi/banb.png create mode 100644 app/src/main/res/mipmap-hdpi/bg.png create mode 100644 app/src/main/res/mipmap-hdpi/eco.png create mode 100644 app/src/main/res/mipmap-hdpi/ffsj.png create mode 100644 app/src/main/res/mipmap-hdpi/gx.png create mode 100644 app/src/main/res/mipmap-hdpi/gywmm.png create mode 100644 app/src/main/res/mipmap-hdpi/hoss.png create mode 100644 app/src/main/res/mipmap-hdpi/hous.png create mode 100644 app/src/main/res/mipmap-hdpi/icon.png create mode 100644 app/src/main/res/mipmap-hdpi/icon_back.png create mode 100644 app/src/main/res/mipmap-hdpi/icon_qd.png create mode 100644 app/src/main/res/mipmap-hdpi/mm.png create mode 100644 app/src/main/res/mipmap-hdpi/mrtx.png create mode 100644 app/src/main/res/mipmap-hdpi/sbgl.png create mode 100644 app/src/main/res/mipmap-hdpi/sc.png create mode 100644 app/src/main/res/mipmap-hdpi/sjh.png create mode 100644 app/src/main/res/mipmap-hdpi/smdlaa.png create mode 100644 app/src/main/res/mipmap-hdpi/ssss.png create mode 100644 app/src/main/res/mipmap-hdpi/szz.png create mode 100644 app/src/main/res/mipmap-hdpi/tjxss.png create mode 100644 app/src/main/res/mipmap-hdpi/txz.png create mode 100644 app/src/main/res/mipmap-hdpi/wmss.png create mode 100644 app/src/main/res/mipmap-hdpi/wmus.png create mode 100644 app/src/main/res/mipmap-hdpi/wsyq.png create mode 100644 app/src/main/res/mipmap-hdpi/xb_n.png create mode 100644 app/src/main/res/mipmap-hdpi/xb_nv.png create mode 100644 app/src/main/res/mipmap-hdpi/xs.png create mode 100644 app/src/main/res/mipmap-hdpi/xxan.png create mode 100644 app/src/main/res/mipmap-hdpi/xxxt.png create mode 100644 app/src/main/res/mipmap-hdpi/yc.png create mode 100644 app/src/main/res/mipmap-hdpi/ycaj.png create mode 100644 app/src/main/res/mipmap-hdpi/yincs.png create mode 100644 app/src/main/res/mipmap-hdpi/yyxz.png create mode 100644 app/src/main/res/mipmap-hdpi/zwjh.png create mode 100644 app/src/main/res/mipmap-mdpi/icon.png create mode 100644 app/src/main/res/mipmap-xhdpi/icon.png create mode 100644 app/src/main/res/mipmap-xxhdpi/icon.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/icon.png create mode 100644 app/src/main/res/values-night/themes.xml create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 app/src/main/res/values/themes.xml create mode 100644 build.gradle create mode 100644 config.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 libs/common/.gitignore create mode 100644 libs/common/build.gradle create mode 100644 libs/common/consumer-rules.pro create mode 100644 libs/common/libs/bdasr_V3_20191210_81acdf5.jar create mode 100644 libs/common/proguard-rules.pro create mode 100644 libs/common/src/main/AndroidManifest.xml create mode 100644 libs/common/src/main/assets/app-config-area-type.json create mode 100644 libs/common/src/main/assets/app-config-default.json create mode 100644 libs/common/src/main/assets/app-config-dev.json create mode 100644 libs/common/src/main/java/com/prws/common/CommonApplication.java create mode 100644 libs/common/src/main/java/com/prws/common/adapter/CommonAdapter.java create mode 100644 libs/common/src/main/java/com/prws/common/adapter/CommonViewHolder.java create mode 100644 libs/common/src/main/java/com/prws/common/base/BaseActivity.java create mode 100644 libs/common/src/main/java/com/prws/common/base/BaseContract.java create mode 100644 libs/common/src/main/java/com/prws/common/base/BaseFragment.java create mode 100644 libs/common/src/main/java/com/prws/common/base/BaseModel.java create mode 100644 libs/common/src/main/java/com/prws/common/base/BasePresenter.java create mode 100644 libs/common/src/main/java/com/prws/common/base/BaseView.java create mode 100644 libs/common/src/main/java/com/prws/common/bean/BaseEntity.java create mode 100644 libs/common/src/main/java/com/prws/common/bean/NavigationBarStatusBean.java create mode 100644 libs/common/src/main/java/com/prws/common/config/AppConfig.java create mode 100644 libs/common/src/main/java/com/prws/common/config/AppConstant.java create mode 100644 libs/common/src/main/java/com/prws/common/config/CleanConfig.java create mode 100644 libs/common/src/main/java/com/prws/common/config/CloudConfig.java create mode 100644 libs/common/src/main/java/com/prws/common/config/DevicesConfig.java create mode 100644 libs/common/src/main/java/com/prws/common/config/SettingConfig.java create mode 100644 libs/common/src/main/java/com/prws/common/config/WorkConfig.java create mode 100644 libs/common/src/main/java/com/prws/common/interfaces/DownTimerInterface.java create mode 100644 libs/common/src/main/java/com/prws/common/manager/DialogManager.java create mode 100644 libs/common/src/main/java/com/prws/common/net/ByteProgressRequestBody.java create mode 100644 libs/common/src/main/java/com/prws/common/net/DownloadInterceptor.java create mode 100644 libs/common/src/main/java/com/prws/common/net/DownloadResponseBody.java create mode 100644 libs/common/src/main/java/com/prws/common/net/DownloadUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/net/FileProgressRequestBody.java create mode 100644 libs/common/src/main/java/com/prws/common/net/INetEvent.java create mode 100644 libs/common/src/main/java/com/prws/common/net/LoggingInterceptor.java create mode 100644 libs/common/src/main/java/com/prws/common/net/NetWorks.java create mode 100644 libs/common/src/main/java/com/prws/common/net/OkHttp3Utils.java create mode 100644 libs/common/src/main/java/com/prws/common/net/OkHttpRetryInterceptor.java create mode 100644 libs/common/src/main/java/com/prws/common/net/PersistentCookieStore.java create mode 100644 libs/common/src/main/java/com/prws/common/net/ResponseCode.java create mode 100644 libs/common/src/main/java/com/prws/common/net/RetrofitUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/net/SerializableOkHttpCookies.java create mode 100644 libs/common/src/main/java/com/prws/common/net/SignInterceptor.java create mode 100644 libs/common/src/main/java/com/prws/common/opc/OpcCheckResult.java create mode 100644 libs/common/src/main/java/com/prws/common/opc/OpcHelper.java create mode 100644 libs/common/src/main/java/com/prws/common/opc/OpcUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/opc/PmNumericalReading.java create mode 100644 libs/common/src/main/java/com/prws/common/opc/PmReadingRecord.java create mode 100644 libs/common/src/main/java/com/prws/common/router/RouterConfig.java create mode 100644 libs/common/src/main/java/com/prws/common/router/RouterFragmentUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/router/RouterUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/Base64E.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/BeanPropertiesUtil.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/Common.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/FileIOUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/FileUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/GlideHelper.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/GsonUtil.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/LogUtil.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/LogcatHelper.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/NetUtil.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/ScreenUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/SharedPreferencesUtil.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/acmanager/ActivityManager.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/acmanager/ActivityName.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/acmanager/LifecycleCallbackImpl.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/ActivityKillerV15_V20.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/ActivityKillerV21_V23.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/ActivityKillerV24_V25.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/ActivityKillerV26.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/ActivityKillerV28.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/Cockroach.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/ExceptionHandler.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/IActivityKiller.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/crash/PositionUtils.java create mode 100644 libs/common/src/main/java/com/prws/common/utils/dialog/PopupButtonListener.java create mode 100644 libs/common/src/main/java/com/prws/common/view/DialogView.java create mode 100644 libs/common/src/main/java/com/prws/common/view/LabelsView.java create mode 100644 libs/common/src/main/java/com/prws/common/view/LoadingView.java create mode 100644 libs/common/src/main/java/com/prws/common/view/MarqueeTextView.java create mode 100644 libs/common/src/main/java/com/prws/common/view/MaxLimitRecyclerView.java create mode 100644 libs/common/src/main/java/com/prws/common/view/RecycleViewDivider.java create mode 100644 libs/common/src/main/java/com/prws/common/widget/ProgressView.java create mode 100644 libs/common/src/main/java/com/prws/common/widget/circleView/MatrixTranslateLayout.java create mode 100644 libs/common/src/main/res/anim/cycle_interpolator.xml create mode 100644 libs/common/src/main/res/anim/shanke.xml create mode 100644 libs/common/src/main/res/drawable/bg_solid_white.xml create mode 100644 libs/common/src/main/res/drawable/default_label_bg.xml create mode 100644 libs/common/src/main/res/drawable/loading_anim.xml create mode 100644 libs/common/src/main/res/drawable/select_map_position_type.xml create mode 100644 libs/common/src/main/res/drawable/shape_dialog_bg.xml create mode 100644 libs/common/src/main/res/mipmap-mdpi/icon_clean1.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/icon_shoudong_a.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/icon_zidong_a.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/js_1.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/js_2.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00000.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00001.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00002.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00003.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00004.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00005.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00006.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00007.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00008.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00009.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00010.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00011.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00012.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00013.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00014.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00015.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00016.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00017.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00018.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00019.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00020.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00021.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00022.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00023.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00024.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00025.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00026.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00027.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00028.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00029.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00030.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00031.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00032.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00033.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00034.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00035.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00036.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00037.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00038.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00039.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00040.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00041.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00042.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00043.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00044.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00045.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00046.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00047.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00048.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/loading_00049.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/ps_1.png create mode 100644 libs/common/src/main/res/mipmap-mdpi/ps_22.png create mode 100644 libs/common/src/main/res/values/attrs.xml create mode 100644 libs/common/src/main/res/values/strings.xml create mode 100644 libs/common/src/main/res/values/styles.xml create mode 100644 libs/common/src/main/res/values/themes.xml create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..745ffe5 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..8d17fee --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0f34fef --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,51 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..bda3af8 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,42 @@ +apply plugin: 'com.android.application' +apply from: '../config.gradle' + + +def androidId = rootProject.ext.androidId +def support = rootProject.ext.dependencies +def url = rootProject.ext.url + + +android { + compileSdk 32 + + defaultConfig { + applicationId "com.hjx.parent" + minSdk 24 + targetSdk 32 + versionCode 1 + versionName "1.0" + + 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 { + support.each { k, v -> implementation v } + api project(path: ':libs:common') + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..fe14d75 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/AccountActivity.java b/app/src/main/java/com/hjx/parent/AccountActivity.java new file mode 100644 index 0000000..975eef2 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/AccountActivity.java @@ -0,0 +1,52 @@ +package com.hjx.parent; + +import android.widget.TextView; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.utils.SharedPreferencesUtil; + +public class AccountActivity extends BaseActivity { + + @Override + protected int layoutResId() { + return R.layout.activity_setac; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + + TextView tv_6; + @Override + protected void initView() { + tv_6 = findViewById(R.id.tv_6); + String phone = (String) SharedPreferencesUtil.getData("phone", ""); + if (phone != null && phone.length() > 0) + tv_6.setText(phone); + } + + @Override + protected void initListener() { + findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); + + findViewById(R.id.tv_7).setOnClickListener(view -> startActivity(ChangePwdActivity.class)); + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/AddStudentActivity.java b/app/src/main/java/com/hjx/parent/AddStudentActivity.java new file mode 100644 index 0000000..b9df720 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/AddStudentActivity.java @@ -0,0 +1,197 @@ +package com.hjx.parent; + +import android.graphics.Color; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; +import android.widget.Toast; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.net.NetWorks; +import com.prws.common.utils.LogUtil; +import com.prws.common.utils.SharedPreferencesUtil; + +import org.json.JSONObject; + +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.Observer; +import io.reactivex.disposables.Disposable; +import okhttp3.ResponseBody; + +public class AddStudentActivity extends BaseActivity { + @Override + protected int layoutResId() { + return R.layout.activity_add_stu; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + View view_2; + View view_3; + View view_4; + View view_5; + Button btn_next; + TextView tv_name, tv_sex, tv_nian, tv_shen; + + @Override + protected void initView() { + view_2 = findViewById(R.id.view_2); + view_3 = findViewById(R.id.view_3); + view_4 = findViewById(R.id.view_4); + view_5 = findViewById(R.id.view_5); + tv_name = findViewById(R.id.tv_name); + tv_sex = findViewById(R.id.tv_sex); + tv_nian = findViewById(R.id.tv_nian); + tv_shen = findViewById(R.id.tv_shen); + + + btn_next = findViewById(R.id.btn_next); + } + + boolean isName = false; + boolean isSex = false; + boolean isNian = false; + boolean isShen = false; + + @Override + protected void onStart() { + super.onStart(); + String name = (String) SharedPreferencesUtil.getData("setName", ""); + String sex = (String) SharedPreferencesUtil.getData("setSex", ""); + String nian = (String) SharedPreferencesUtil.getData("setNian", ""); + String shen = (String) SharedPreferencesUtil.getData("setShen", ""); + + if (name != null && name.length() > 0) { + tv_name.setText(name); + isName = true; + } else { + isName = false; + } + if (sex != null && sex.length() > 0) { + tv_sex.setText(sex); + isSex = true; + } else { + isSex = false; + } + if (nian != null && nian.length() > 0) { + tv_nian.setText(nian); + isNian = true; + } else { + isNian = false; + } + if (shen != null && shen.length() > 0) { + tv_shen.setText(shen); + isShen = true; + } else { + isShen = false; + } + + if (isName && isSex && isNian && isShen) { + btn_next.setTextColor(Color.WHITE); + btn_next.setBackground(getResources().getDrawable(R.drawable.bg_solid_btn)); + } + + } + + @Override + protected void initListener() { + view_2.setOnClickListener(view -> startActivity(NickActivity.class)); + view_3.setOnClickListener(view -> startActivity(SexActivity.class)); + view_4.setOnClickListener(view -> startActivity(NianActivity.class)); + view_5.setOnClickListener(view -> startActivity(ShenActivity.class)); + findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); + btn_next.setOnClickListener(view -> { + if (isName && isSex && isNian && isShen) { + addStudent(); + } else { + Toast.makeText(this, "请完成设置后点击", Toast.LENGTH_SHORT).show(); + } + }); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + SharedPreferencesUtil.putData("setName", ""); + SharedPreferencesUtil.putData("setSex", ""); + SharedPreferencesUtil.putData("setNian", ""); + SharedPreferencesUtil.putData("setShen", ""); + SharedPreferencesUtil.putData("setXueq", ""); + + } + public void addStudent() { + String name = (String) SharedPreferencesUtil.getData("setName", ""); + String sex = (String) SharedPreferencesUtil.getData("setSex", ""); + String nian = (String) SharedPreferencesUtil.getData("setNian", ""); + String shen = (String) SharedPreferencesUtil.getData("setShen", ""); + String xueq = (String) SharedPreferencesUtil.getData("setXueq", ""); + + + Map map = new HashMap(); + map.put("nickName", name); + map.put("gender", "1"); + map.put("gradeId", 1); + map.put("parentIdentity", shen); + map.put("term", xueq); + + + NetWorks.registerStudent(NetWorks.getMapRequestBody(map), new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(ResponseBody responseBody) { + try { + + String str = responseBody.string().toString(); + LogUtil.e(TAG, "----" + str); + JSONObject jo = new JSONObject(str); + boolean isSucceed = jo.getBoolean("success"); + if (isSucceed) { + finish(); + } else { + Toast.makeText(AddStudentActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); + } + } catch (Exception e) { + e.printStackTrace(); + Toast.makeText(AddStudentActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); + } + + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + + }); + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} diff --git a/app/src/main/java/com/hjx/parent/ChangePwdActivity.java b/app/src/main/java/com/hjx/parent/ChangePwdActivity.java new file mode 100644 index 0000000..3e9a9da --- /dev/null +++ b/app/src/main/java/com/hjx/parent/ChangePwdActivity.java @@ -0,0 +1,125 @@ +package com.hjx.parent; + +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.net.NetWorks; +import com.prws.common.utils.LogUtil; +import com.prws.common.utils.SharedPreferencesUtil; + +import org.json.JSONObject; + +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.Observer; +import io.reactivex.disposables.Disposable; +import okhttp3.ResponseBody; + +public class ChangePwdActivity extends BaseActivity { + + @Override + protected int layoutResId() { + return R.layout.activity_changem; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + + + EditText et_pwd; + @Override + protected void initView() { + + + et_pwd = findViewById(R.id.et_pwd); + } + + @Override + protected void initListener() { + findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); + + findViewById(R.id.btn_next).setOnClickListener(view -> { + String pwd = et_pwd.getText().toString().trim(); + if (pwd == null || pwd.length() == 0){ + Toast.makeText(this,"密码不能为空",Toast.LENGTH_SHORT).show(); + return; + } + + changePwd(pwd); + + }); + + } + + public void changePwd(String pwd){ + String userId = (String) SharedPreferencesUtil.getData("userId", ""); + Map map = new HashMap(); + map.put("userId",userId); + map.put("password",pwd); + + + NetWorks.changePassword(NetWorks.getMapRequestBody(map), new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(ResponseBody responseBody) { + try { + + String str = responseBody.string().toString(); + + + LogUtil.e(TAG,"----"+str); + JSONObject jo = new JSONObject(str); + boolean isSucceed = jo.getBoolean("success"); + if (isSucceed){ + Toast.makeText(ChangePwdActivity.this, "修改成功", Toast.LENGTH_SHORT).show(); + finish(); + + }else { + Toast.makeText(ChangePwdActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); + } + }catch (Exception e){ + e.printStackTrace(); + Toast.makeText(ChangePwdActivity.this,"服务繁忙,请重试",Toast.LENGTH_SHORT).show(); + } + + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/LoginActivity.java b/app/src/main/java/com/hjx/parent/LoginActivity.java new file mode 100644 index 0000000..5bfc715 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/LoginActivity.java @@ -0,0 +1,213 @@ +package com.hjx.parent; + +import android.os.Bundle; +import android.telephony.PhoneNumberUtils; +import android.text.InputType; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.appcompat.app.AppCompatActivity; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.bean.BaseEntity; +import com.prws.common.net.NetWorks; +import com.prws.common.utils.LogUtil; +import com.prws.common.utils.SharedPreferencesUtil; +import com.prws.common.utils.acmanager.ActivityManager; + +import org.json.JSONObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.Observer; +import io.reactivex.disposables.Disposable; +import okhttp3.ResponseBody; + + +public class LoginActivity extends BaseActivity { + + + EditText et_phone; + EditText et_pwd; + ImageView iv_show; + ImageView iv_delete; + Button btn_login; + TextView tv_reg; + CheckBox cb_1; + TextView tv_user; + TextView tv_ys; + + + + @Override + protected int layoutResId() { + return R.layout.activity_login; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + + @Override + protected void initView() { + et_phone = findViewById(R.id.et_phone); + et_pwd = findViewById(R.id.et_pwd); + iv_show = findViewById(R.id.iv_4); + iv_delete = findViewById(R.id.iv_2); + btn_login = findViewById(R.id.btn_1); + tv_reg = findViewById(R.id.tv_2); + cb_1 = findViewById(R.id.cb_1); + tv_user = findViewById(R.id.tv_4); + tv_ys = findViewById(R.id.tv_6); + + + String role = (String) SharedPreferencesUtil.getData("role",""); + + if (role != null && role.length()> 0){ + LogUtil.e(TAG,"role 不是空----"); + startActivity(MainActivity.class); + finish(); + return; + }else { + LogUtil.e(TAG,"role 是空----"); + } + + + + + } + + @Override + protected void initListener() { + iv_delete.setOnClickListener(view -> { + et_phone.setText(""); + }); + iv_show.setOnClickListener(view -> { + + if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())){ + iv_show.setBackgroundResource(R.mipmap.yc); + et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); + }else { + iv_show.setBackgroundResource(R.mipmap.xs); + et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); + } + + + }); + + + btn_login.setOnClickListener(view -> { + + String phone = et_phone.getText().toString().trim(); + String pwd = et_pwd.getText().toString().trim(); + if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0){ + Toast.makeText(this,"手机号以及密码不能为空",Toast.LENGTH_SHORT).show(); + return; + } + + if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())){ + Toast.makeText(this,"请输入正确的手机号码",Toast.LENGTH_SHORT).show(); + return; + } + + if (!cb_1.isChecked()){ + Toast.makeText(this,"请勾选协议",Toast.LENGTH_SHORT).show(); + return; + } + + login(phone,pwd); + + }); + + tv_reg.setOnClickListener(view -> { + startActivity(RegisterActivity.class); + finish(); + }); + + tv_ys.setOnClickListener(view -> { + startActivity(YinsiActivity.class); + }); + tv_user.setOnClickListener(view -> { + startActivity(UserActivity.class); + }); + } + + public void login(final String phone ,String pwd){ + + Map map = new HashMap(); + map.put("username",phone); + map.put("password",pwd); + + + NetWorks.login(NetWorks.getMapRequestBody(map), new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(ResponseBody responseBody) { + try { + + String str = responseBody.string().toString(); + + + LogUtil.e(TAG,"----"+str); + JSONObject jo = new JSONObject(str); + boolean isSucceed = jo.getBoolean("success"); + if (isSucceed){ + JSONObject jo2 = jo.getJSONObject("data"); + SharedPreferencesUtil.putData("phone",phone); + SharedPreferencesUtil.putData("role",jo2.getString("role")); + SharedPreferencesUtil.putData("userId",jo2.getString("userId")); + SharedPreferencesUtil.putData("token",jo2.getString("token")); + + startActivity(MainActivity.class); + + }else { + Toast.makeText(LoginActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); + } + }catch (Exception e){ + e.printStackTrace(); + Toast.makeText(LoginActivity.this,"服务繁忙,请重试",Toast.LENGTH_SHORT).show(); + } + + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + } + + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/MainActivity.java b/app/src/main/java/com/hjx/parent/MainActivity.java new file mode 100644 index 0000000..c3aac8c --- /dev/null +++ b/app/src/main/java/com/hjx/parent/MainActivity.java @@ -0,0 +1,112 @@ +package com.hjx.parent; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.constraintlayout.widget.ConstraintLayout; + +import android.graphics.Color; +import android.os.Bundle; +import android.widget.ImageView; +import android.widget.TextView; + +import com.hjx.parent.fragment.HomeFragment; +import com.hjx.parent.fragment.MeFragment; +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; + +public class MainActivity extends BaseActivity { + + @Override + protected int layoutResId() { + return R.layout.activity_main; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + + + + HomeFragment homeFragment; + MeFragment meFragment; + ConstraintLayout cl_home; + ConstraintLayout cl_me; + ImageView iv_3,iv_4; + TextView tv_1,tv_4; + + @Override + protected void initView() { + showFragment(getHomeFragment(),R.id.rl_content); + cl_home = findViewById(R.id.cl_home); + cl_me = findViewById(R.id.cl_me); + iv_3 = findViewById(R.id.iv_3); + iv_4 = findViewById(R.id.iv_4); + tv_1 = findViewById(R.id.tv_1); + tv_4 = findViewById(R.id.tv_4); + + + iv_3.setBackgroundResource(R.mipmap.hoss); + tv_1.setTextColor(Color.parseColor("#FE5E09")); + + + + } + + public HomeFragment getHomeFragment(){ + if (homeFragment == null) + homeFragment = new HomeFragment(); + return homeFragment; + } + + public MeFragment getMeFragment(){ + if (meFragment == null) + meFragment = new MeFragment(); + return meFragment; + } + + + + @Override + protected void initListener() { + cl_home.setOnClickListener(view -> { + showFragment(getHomeFragment(),R.id.rl_content); + iv_3.setBackgroundResource(R.mipmap.hoss); + tv_1.setTextColor(Color.parseColor("#FE5E09")); + + + iv_4.setBackgroundResource(R.mipmap.wmus); + tv_4.setTextColor(Color.parseColor("#333333")); + + + }); + + cl_me.setOnClickListener(view -> { + showFragment(getMeFragment(),R.id.rl_content); + + iv_3.setBackgroundResource(R.mipmap.hous); + tv_1.setTextColor(Color.parseColor("#333333")); + + + iv_4.setBackgroundResource(R.mipmap.wmss); + tv_4.setTextColor(Color.parseColor("#FE5E09")); + + + }); + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/MyApplication.java b/app/src/main/java/com/hjx/parent/MyApplication.java new file mode 100644 index 0000000..a03eeb3 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/MyApplication.java @@ -0,0 +1,18 @@ +package com.hjx.parent; + +import com.prws.common.CommonApplication; +import com.prws.common.utils.SharedPreferencesUtil; +import com.uuzuche.lib_zxing.activity.ZXingLibrary; + +public class MyApplication extends CommonApplication { + + @Override + public void onCreate() { + super.onCreate(); + + SharedPreferencesUtil.getInstance(this,"config"); + + ZXingLibrary.initDisplayOpinion(this); + + } +} diff --git a/app/src/main/java/com/hjx/parent/NianActivity.java b/app/src/main/java/com/hjx/parent/NianActivity.java new file mode 100644 index 0000000..b61996d --- /dev/null +++ b/app/src/main/java/com/hjx/parent/NianActivity.java @@ -0,0 +1,56 @@ +package com.hjx.parent; + +import android.widget.TextView; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.utils.SharedPreferencesUtil; + +public class NianActivity extends BaseActivity { + @Override + protected int layoutResId() { + return R.layout.activity_set_nian; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + TextView tv_nian; + TextView tv_xq; + + @Override + protected void initView() { + tv_nian = findViewById(R.id.tv_nian); + tv_xq = findViewById(R.id.tv_xq); + findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); + findViewById(R.id.tv_ok).setOnClickListener(view -> { + SharedPreferencesUtil.putData("setNian", tv_nian.getText()); + SharedPreferencesUtil.putData("setXueq", tv_xq.getText()); + finish(); + }); + + + } + + @Override + protected void initListener() { + + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} diff --git a/app/src/main/java/com/hjx/parent/NickActivity.java b/app/src/main/java/com/hjx/parent/NickActivity.java new file mode 100644 index 0000000..1d134a1 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/NickActivity.java @@ -0,0 +1,58 @@ +package com.hjx.parent; + +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.utils.SharedPreferencesUtil; + +public class NickActivity extends BaseActivity { + @Override + protected int layoutResId() { + return R.layout.activity_set_nick; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + EditText et_1; + + @Override + protected void initView() { + et_1 = findViewById(R.id.et_1); + findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); + findViewById(R.id.tv_ok).setOnClickListener(view -> { + String name = et_1.getText().toString().trim(); + if (name != null && name.length() > 0){ + SharedPreferencesUtil.putData("setName",name); + finish(); + }else { + Toast.makeText(this,"请设置昵称",Toast.LENGTH_SHORT).show(); + } + }); + } + + @Override + protected void initListener() { + + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} diff --git a/app/src/main/java/com/hjx/parent/QRActivity.java b/app/src/main/java/com/hjx/parent/QRActivity.java new file mode 100644 index 0000000..a2c4361 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/QRActivity.java @@ -0,0 +1,127 @@ +package com.hjx.parent; + +import android.graphics.Bitmap; +import android.widget.Toast; + +import com.google.gson.Gson; +import com.hjx.parent.bean.RegisterBean; +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.net.NetWorks; +import com.prws.common.utils.LogUtil; +import com.prws.common.utils.SharedPreferencesUtil; +import com.uuzuche.lib_zxing.activity.CaptureFragment; +import com.uuzuche.lib_zxing.activity.CodeUtils; + +import org.json.JSONObject; + +import java.io.IOException; + +import io.reactivex.Observer; +import io.reactivex.disposables.Disposable; +import okhttp3.ResponseBody; + +public class QRActivity extends BaseActivity { + @Override + protected int layoutResId() { + return R.layout.activity_qr; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + @Override + protected void initView() { + + findViewById(R.id.iv_back).setOnClickListener(view -> startActivity(MainActivity.class)); + + CaptureFragment captureFragment = new CaptureFragment(); + + captureFragment.setAnalyzeCallback(new CodeUtils.AnalyzeCallback() { + @Override + public void onAnalyzeSuccess(Bitmap mBitmap, String result) { + LogUtil.e(TAG,"result----:"+result); + + loginAnd(result); + + } + + @Override + public void onAnalyzeFailed() { + + } + }); + + + getSupportFragmentManager().beginTransaction().replace(R.id.rl_content, captureFragment).commit(); + + + } + + public void loginAnd(String str){ + NetWorks.scanAndLogin(str, new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(ResponseBody responseBody) { + try { + + String str = responseBody.string().toString(); + LogUtil.e(TAG,"----"+str); + JSONObject jo = new JSONObject(str); + boolean isSucceed = jo.getBoolean("success"); + if (isSucceed){ + startActivity(MainActivity.class); + finish(); + }else { + Toast.makeText(QRActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); + } + }catch (Exception e){ + e.printStackTrace(); + Toast.makeText(QRActivity.this,"服务繁忙,请重试",Toast.LENGTH_SHORT).show(); + startActivity(MainActivity.class); + } + + + + + + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + } + + @Override + protected void initListener() { + + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} diff --git a/app/src/main/java/com/hjx/parent/RegisterActivity.java b/app/src/main/java/com/hjx/parent/RegisterActivity.java new file mode 100644 index 0000000..b00a006 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/RegisterActivity.java @@ -0,0 +1,269 @@ +package com.hjx.parent; + +import android.content.Intent; +import android.os.Bundle; +import android.telephony.PhoneNumberUtils; +import android.text.InputType; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.hjq.permissions.OnPermissionCallback; +import com.hjq.permissions.Permission; +import com.hjq.permissions.XXPermissions; +import com.hjx.parent.bean.RegisterBean; +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.bean.BaseEntity; +import com.prws.common.net.NetWorks; +import com.prws.common.utils.GsonUtil; +import com.prws.common.utils.LogUtil; +import com.prws.common.utils.SharedPreferencesUtil; +import com.uuzuche.lib_zxing.activity.CaptureActivity; +import com.uuzuche.lib_zxing.activity.CodeUtils; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.Observer; +import io.reactivex.disposables.Disposable; +import okhttp3.ResponseBody; + +public class RegisterActivity extends BaseActivity { + + EditText et_phone; + EditText et_pwd; + EditText et_pwd_2; + ImageView iv_show; + ImageView iv_show_2; + ImageView iv_delete; + Button btn_reg; + TextView tv_log; + CheckBox cb_1; + TextView tv_user; + TextView tv_ys; + + + @Override + protected int layoutResId() { + return R.layout.activity_register; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + @Override + protected void initView() { + et_phone = findViewById(R.id.et_phone); + et_pwd = findViewById(R.id.et_pwd); + iv_show = findViewById(R.id.iv_4); + iv_show_2 = findViewById(R.id.iv_6); + et_pwd_2 = findViewById(R.id.et_pwd_2); + iv_delete = findViewById(R.id.iv_2); + btn_reg = findViewById(R.id.btn_1); + tv_log = findViewById(R.id.tv_2); + cb_1 = findViewById(R.id.cb_1); + tv_user = findViewById(R.id.tv_4); + tv_ys = findViewById(R.id.tv_6); + + + } + + @Override + protected void initListener() { + iv_delete.setOnClickListener(view -> { + et_phone.setText(""); + }); + iv_show.setOnClickListener(view -> { + + if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { + iv_show.setBackgroundResource(R.mipmap.yc); + et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); + } else { + iv_show.setBackgroundResource(R.mipmap.xs); + et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); + } + + + }); + + iv_show_2.setOnClickListener(view -> { + + if (iv_show_2.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { + iv_show_2.setBackgroundResource(R.mipmap.yc); + et_pwd_2.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); + } else { + iv_show_2.setBackgroundResource(R.mipmap.xs); + et_pwd_2.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); + } + + + }); + + + btn_reg.setOnClickListener(view -> { + + String phone = et_phone.getText().toString().trim(); + String pwd = et_pwd.getText().toString().trim(); + String pwd2 = et_pwd_2.getText().toString().trim(); + if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0) { + Toast.makeText(this, "手机号以及密码不能为空", Toast.LENGTH_SHORT).show(); + return; + } + + if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())) { + Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_SHORT).show(); + return; + } + + if (!cb_1.isChecked()) { + Toast.makeText(this, "请勾选协议", Toast.LENGTH_SHORT).show(); + return; + } + if (!pwd.equals(pwd2)) { + Toast.makeText(this, "两次密码需要一致", Toast.LENGTH_SHORT).show(); + return; + } + + reg(phone, pwd); + + }); + + tv_log.setOnClickListener(view -> { + startActivity(LoginActivity.class); + finish(); + }); + + tv_ys.setOnClickListener(view -> { + startActivity(YinsiActivity.class); + }); + tv_user.setOnClickListener(view -> { + startActivity(UserActivity.class); + }); + } + + public void reg(final String phone, String pwd) { + + Map map = new HashMap(); + map.put("username", phone); + map.put("password", pwd); + + + NetWorks.registerParent(NetWorks.getMapRequestBody(map), new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(ResponseBody responseBody) { + String str = null; + try { + str = responseBody.string(); + } catch (IOException e) { + e.printStackTrace(); + } + + if (str == null || str.length() == 0) { + Toast.makeText(RegisterActivity.this, "服务器繁忙", Toast.LENGTH_SHORT).show(); + return; + } + + RegisterBean registerBean = new Gson().fromJson(str, RegisterBean.class); + + if (!registerBean.isSuccess()) { + Toast.makeText(RegisterActivity.this, registerBean.getMsg(), Toast.LENGTH_SHORT).show(); + return; + } + + if (registerBean.getData().getUserName() != null && registerBean.getData().getUserName().length() > 0) { + SharedPreferencesUtil.putData("phone",phone); + SharedPreferencesUtil.putData("role",registerBean.getData().getUserName()); + SharedPreferencesUtil.putData("userId",registerBean.getData().getUserName()); + + //进入扫码界面 + goQRView(); + + } + + + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + } + + public void goQRView() { + + if (!XXPermissions.isGranted(this, Permission.CAMERA)) { + XXPermissions.with(this) + // 申请多个权限 + .permission(Permission.CAMERA) + .request(new OnPermissionCallback() { + @Override + public void onGranted(List permissions, boolean all) { + if (all) { + //开启扫码界面 + startQRView(); + + } else { + Toast.makeText(RegisterActivity.this, "需要相机权限", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onDenied(List permissions, boolean never) { + XXPermissions.startPermissionActivity(RegisterActivity.this, permissions); + } + }); + + + } else { + startQRView(); + } + + + } + + public void startQRView() { + + startActivity(QRActivity.class); + finish(); + + } + + + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/SexActivity.java b/app/src/main/java/com/hjx/parent/SexActivity.java new file mode 100644 index 0000000..b8af458 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/SexActivity.java @@ -0,0 +1,72 @@ +package com.hjx.parent; + +import android.view.View; +import android.widget.ImageView; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.utils.SharedPreferencesUtil; + +public class SexActivity extends BaseActivity { + @Override + protected int layoutResId() { + return R.layout.activity_set_sex; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + View view_nv; + View view_nan; + boolean isNv = true; + ImageView cb_1,cb_2; + @Override + protected void initView() { + view_nv = findViewById(R.id.view_2); + view_nan = findViewById(R.id.view_3); + cb_1 = findViewById(R.id.cb_1); + cb_2 = findViewById(R.id.cb_2); + + findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); + findViewById(R.id.tv_ok).setOnClickListener(view -> { + SharedPreferencesUtil.putData("setSex", isNv?"女":"男"); + finish(); + }); + view_nv.setOnClickListener(view -> { + view_nv.setBackgroundResource(R.drawable.bg_solid_white_10_or); + view_nan.setBackgroundResource(R.drawable.bg_solid_white_10); + cb_1.setBackgroundResource(R.mipmap.gx); + cb_2.setBackgroundResource(R.mipmap.wsyq); + isNv = true; + }); + view_nan.setOnClickListener(view -> { + view_nv.setBackgroundResource(R.drawable.bg_solid_white_10); + view_nan.setBackgroundResource(R.drawable.bg_solid_white_10_or); + cb_1.setBackgroundResource(R.mipmap.wsyq); + cb_2.setBackgroundResource(R.mipmap.gx); + isNv = false; + }); + } + + @Override + protected void initListener() { + + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} diff --git a/app/src/main/java/com/hjx/parent/ShenActivity.java b/app/src/main/java/com/hjx/parent/ShenActivity.java new file mode 100644 index 0000000..39262b9 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/ShenActivity.java @@ -0,0 +1,157 @@ +package com.hjx.parent; + +import android.view.View; +import android.widget.ImageView; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; +import com.prws.common.utils.SharedPreferencesUtil; + +public class ShenActivity extends BaseActivity { + @Override + protected int layoutResId() { + return R.layout.activity_set_jia; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + View view_1; + View view_2,view_3,view_4,view_5,view_6; + ImageView iv_1,iv_2,iv_3,iv_4,iv_5,iv_6; + + String shen = "爸爸"; + @Override + protected void initView() { + findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); + findViewById(R.id.tv_ok).setOnClickListener(view -> { + SharedPreferencesUtil.putData("setShen", shen); + finish(); + }); + view_1 = findViewById(R.id.view_2); + view_2 = findViewById(R.id.view_3); + view_3 = findViewById(R.id.view_4); + view_4 = findViewById(R.id.view_5); + view_5 = findViewById(R.id.view_6); + view_6 = findViewById(R.id.view_7); + iv_1 = findViewById(R.id.iv_1); + iv_2 = findViewById(R.id.iv_2); + iv_3 = findViewById(R.id.iv_3); + iv_4 = findViewById(R.id.iv_4); + iv_5 = findViewById(R.id.iv_5); + iv_6 = findViewById(R.id.iv_6); + + view_1.setOnClickListener(view -> { + view_1.setBackgroundResource(R.drawable.bg_solid_white_10_or); + view_2.setBackgroundResource(R.drawable.bg_solid_white_10); + view_3.setBackgroundResource(R.drawable.bg_solid_white_10); + view_4.setBackgroundResource(R.drawable.bg_solid_white_10); + view_5.setBackgroundResource(R.drawable.bg_solid_white_10); + view_6.setBackgroundResource(R.drawable.bg_solid_white_10); + iv_1.setBackgroundResource(R.mipmap.gx); + iv_2.setBackgroundResource(R.mipmap.wsyq); + iv_3.setBackgroundResource(R.mipmap.wsyq); + iv_4.setBackgroundResource(R.mipmap.wsyq); + iv_5.setBackgroundResource(R.mipmap.wsyq); + iv_6.setBackgroundResource(R.mipmap.wsyq); + shen = "爸爸"; + }); + view_2.setOnClickListener(view -> { + view_1.setBackgroundResource(R.drawable.bg_solid_white_10); + view_2.setBackgroundResource(R.drawable.bg_solid_white_10_or); + view_3.setBackgroundResource(R.drawable.bg_solid_white_10); + view_4.setBackgroundResource(R.drawable.bg_solid_white_10); + view_5.setBackgroundResource(R.drawable.bg_solid_white_10); + view_6.setBackgroundResource(R.drawable.bg_solid_white_10); + shen = "妈妈"; + iv_1.setBackgroundResource(R.mipmap.wsyq); + iv_2.setBackgroundResource(R.mipmap.gx); + iv_3.setBackgroundResource(R.mipmap.wsyq); + iv_4.setBackgroundResource(R.mipmap.wsyq); + iv_5.setBackgroundResource(R.mipmap.wsyq); + iv_6.setBackgroundResource(R.mipmap.wsyq); + }); + view_3.setOnClickListener(view -> { + view_1.setBackgroundResource(R.drawable.bg_solid_white_10); + view_2.setBackgroundResource(R.drawable.bg_solid_white_10); + view_3.setBackgroundResource(R.drawable.bg_solid_white_10_or); + view_4.setBackgroundResource(R.drawable.bg_solid_white_10); + view_5.setBackgroundResource(R.drawable.bg_solid_white_10); + view_6.setBackgroundResource(R.drawable.bg_solid_white_10); + shen = "爷爷"; + iv_1.setBackgroundResource(R.mipmap.wsyq); + iv_2.setBackgroundResource(R.mipmap.wsyq); + iv_3.setBackgroundResource(R.mipmap.gx); + iv_4.setBackgroundResource(R.mipmap.wsyq); + iv_5.setBackgroundResource(R.mipmap.wsyq); + iv_6.setBackgroundResource(R.mipmap.wsyq); + }); + view_4.setOnClickListener(view -> { + view_1.setBackgroundResource(R.drawable.bg_solid_white_10); + view_2.setBackgroundResource(R.drawable.bg_solid_white_10); + view_3.setBackgroundResource(R.drawable.bg_solid_white_10); + view_4.setBackgroundResource(R.drawable.bg_solid_white_10_or); + view_5.setBackgroundResource(R.drawable.bg_solid_white_10); + view_6.setBackgroundResource(R.drawable.bg_solid_white_10); + shen = "奶奶"; + iv_1.setBackgroundResource(R.mipmap.wsyq); + iv_2.setBackgroundResource(R.mipmap.wsyq); + iv_3.setBackgroundResource(R.mipmap.wsyq); + iv_4.setBackgroundResource(R.mipmap.gx); + iv_5.setBackgroundResource(R.mipmap.wsyq); + iv_6.setBackgroundResource(R.mipmap.wsyq); + }); + view_5.setOnClickListener(view -> { + view_1.setBackgroundResource(R.drawable.bg_solid_white_10); + view_2.setBackgroundResource(R.drawable.bg_solid_white_10); + view_3.setBackgroundResource(R.drawable.bg_solid_white_10); + view_4.setBackgroundResource(R.drawable.bg_solid_white_10); + view_5.setBackgroundResource(R.drawable.bg_solid_white_10_or); + view_6.setBackgroundResource(R.drawable.bg_solid_white_10); + shen = "外公"; + iv_1.setBackgroundResource(R.mipmap.wsyq); + iv_2.setBackgroundResource(R.mipmap.wsyq); + iv_3.setBackgroundResource(R.mipmap.wsyq); + iv_4.setBackgroundResource(R.mipmap.wsyq); + iv_5.setBackgroundResource(R.mipmap.gx); + iv_6.setBackgroundResource(R.mipmap.wsyq); + }); + view_6.setOnClickListener(view -> { + view_1.setBackgroundResource(R.drawable.bg_solid_white_10); + view_2.setBackgroundResource(R.drawable.bg_solid_white_10); + view_3.setBackgroundResource(R.drawable.bg_solid_white_10); + view_4.setBackgroundResource(R.drawable.bg_solid_white_10); + view_5.setBackgroundResource(R.drawable.bg_solid_white_10); + view_6.setBackgroundResource(R.drawable.bg_solid_white_10_or); + shen = "外婆"; + iv_1.setBackgroundResource(R.mipmap.wsyq); + iv_2.setBackgroundResource(R.mipmap.wsyq); + iv_3.setBackgroundResource(R.mipmap.wsyq); + iv_4.setBackgroundResource(R.mipmap.wsyq); + iv_5.setBackgroundResource(R.mipmap.wsyq); + iv_6.setBackgroundResource(R.mipmap.gx); + }); + + } + + @Override + protected void initListener() { + + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} diff --git a/app/src/main/java/com/hjx/parent/UserActivity.java b/app/src/main/java/com/hjx/parent/UserActivity.java new file mode 100644 index 0000000..5673e1d --- /dev/null +++ b/app/src/main/java/com/hjx/parent/UserActivity.java @@ -0,0 +1,43 @@ +package com.hjx.parent; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; + +public class UserActivity extends BaseActivity { + + @Override + protected int layoutResId() { + return R.layout.activity_me; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + + @Override + protected void initView() { + + } + + @Override + protected void initListener() { + findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/YinsiActivity.java b/app/src/main/java/com/hjx/parent/YinsiActivity.java new file mode 100644 index 0000000..1a2ed03 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/YinsiActivity.java @@ -0,0 +1,43 @@ +package com.hjx.parent; + +import com.prws.common.base.BaseActivity; +import com.prws.common.base.BasePresenter; + +public class YinsiActivity extends BaseActivity { + + @Override + protected int layoutResId() { + return R.layout.activity_yin; + } + + @Override + public Object getContract() { + return null; + } + + @Override + public BasePresenter getPresenter() { + return null; + } + + + @Override + protected void initView() { + + } + + @Override + protected void initListener() { + findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); + } + + @Override + protected void initData() { + + } + + @Override + public void onNetChanged(int netWorkState) { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hjx/parent/bean/RegisterBean.java b/app/src/main/java/com/hjx/parent/bean/RegisterBean.java new file mode 100644 index 0000000..d8ebfa1 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/bean/RegisterBean.java @@ -0,0 +1,43 @@ +package com.hjx.parent.bean; + +import java.io.Serializable; + +public class RegisterBean implements Serializable { + + Integer code; + String msg; + RegisterDataBean data; + boolean success; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public RegisterDataBean getData() { + return data; + } + + public void setData(RegisterDataBean data) { + this.data = data; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } +} diff --git a/app/src/main/java/com/hjx/parent/bean/RegisterDataBean.java b/app/src/main/java/com/hjx/parent/bean/RegisterDataBean.java new file mode 100644 index 0000000..a581da5 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/bean/RegisterDataBean.java @@ -0,0 +1,149 @@ +package com.hjx.parent.bean; + +public class RegisterDataBean { + Integer id; + String userName; + String account; + String password; + String nickName; + String phone; + String mail; + String identity; + String photo; + String qrCode; + Integer sex; + Integer createBy; + String createTime; + Integer updateBy; + String updateTime; + Integer delFlag; + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getMail() { + return mail; + } + + public void setMail(String mail) { + this.mail = mail; + } + + public String getIdentity() { + return identity; + } + + public void setIdentity(String identity) { + this.identity = identity; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getQrCode() { + return qrCode; + } + + public void setQrCode(String qrCode) { + this.qrCode = qrCode; + } + + public Integer getSex() { + return sex; + } + + public void setSex(Integer sex) { + this.sex = sex; + } + + public Integer getCreateBy() { + return createBy; + } + + public void setCreateBy(Integer createBy) { + this.createBy = createBy; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public Integer getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(Integer updateBy) { + this.updateBy = updateBy; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } +} diff --git a/app/src/main/java/com/hjx/parent/bean/StudentBean.java b/app/src/main/java/com/hjx/parent/bean/StudentBean.java new file mode 100644 index 0000000..62ad040 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/bean/StudentBean.java @@ -0,0 +1,171 @@ +package com.hjx.parent.bean; + +public class StudentBean { + + String stuId; + String stuName; + int gender; + String term; + String account; + String nickName; + String address; + String phone; + String photo; + int fromType; + int gradeId; + String oriSchool; + String parentPhone; + String parentIdentity; + String teacherName; + int teacherId; + + @Override + public String toString() { + return "StudentBean{" + + "stuId='" + stuId + '\'' + + ", stuName='" + stuName + '\'' + + ", gender=" + gender + + ", term='" + term + '\'' + + ", account='" + account + '\'' + + ", nickName='" + nickName + '\'' + + ", address='" + address + '\'' + + ", phone='" + phone + '\'' + + ", photo='" + photo + '\'' + + ", fromType=" + fromType + + ", gradeId=" + gradeId + + ", oriSchool='" + oriSchool + '\'' + + ", parentPhone='" + parentPhone + '\'' + + ", parentIdentity='" + parentIdentity + '\'' + + ", teacherName='" + teacherName + '\'' + + ", teacherId=" + teacherId + + '}'; + } + + public String getStuId() { + return stuId; + } + + public void setStuId(String stuId) { + this.stuId = stuId; + } + + public String getStuName() { + return stuName; + } + + public void setStuName(String stuName) { + this.stuName = stuName; + } + + public int getGender() { + return gender; + } + + public void setGender(int gender) { + this.gender = gender; + } + + public String getTerm() { + return term; + } + + public void setTerm(String term) { + this.term = term; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public int getFromType() { + return fromType; + } + + public void setFromType(int fromType) { + this.fromType = fromType; + } + + public int getGradeId() { + return gradeId; + } + + public void setGradeId(int gradeId) { + this.gradeId = gradeId; + } + + public String getOriSchool() { + return oriSchool; + } + + public void setOriSchool(String oriSchool) { + this.oriSchool = oriSchool; + } + + public String getParentPhone() { + return parentPhone; + } + + public void setParentPhone(String parentPhone) { + this.parentPhone = parentPhone; + } + + public String getParentIdentity() { + return parentIdentity; + } + + public void setParentIdentity(String parentIdentity) { + this.parentIdentity = parentIdentity; + } + + public String getTeacherName() { + return teacherName; + } + + public void setTeacherName(String teacherName) { + this.teacherName = teacherName; + } + + public int getTeacherId() { + return teacherId; + } + + public void setTeacherId(int teacherId) { + this.teacherId = teacherId; + } +} diff --git a/app/src/main/java/com/hjx/parent/fragment/HomeFragment.java b/app/src/main/java/com/hjx/parent/fragment/HomeFragment.java new file mode 100644 index 0000000..44bb604 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/fragment/HomeFragment.java @@ -0,0 +1,107 @@ +package com.hjx.parent.fragment; + +import android.content.Intent; +import android.os.Bundle; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.hjq.permissions.OnPermissionCallback; +import com.hjq.permissions.Permission; +import com.hjq.permissions.XXPermissions; +import com.hjx.parent.R; +import com.prws.common.base.BaseFragment; +import com.prws.common.utils.SharedPreferencesUtil; +import com.uuzuche.lib_zxing.activity.CaptureActivity; +import com.uuzuche.lib_zxing.activity.CodeUtils; + +import java.util.List; + +public class HomeFragment extends BaseFragment { + @Override + protected int getLayoutRes() { + return R.layout.fragment_home; + } + + ImageView iv_sapmiao; + TextView tv_name; + @Override + protected void initDatas() { + super.initDatas(); + iv_sapmiao = mRootView.findViewById(R.id.iv_sapmiao); + tv_name = mRootView.findViewById(R.id.tv_name); + iv_sapmiao.setOnClickListener(view -> { + + if (!XXPermissions.isGranted(getActivity(), Permission.CAMERA)){ + XXPermissions.with(getActivity()) + // 申请多个权限 + .permission(Permission.CAMERA) + .request(new OnPermissionCallback() { + @Override + public void onGranted(List permissions, boolean all) { + if (all){ + //开启扫码界面 + startQRView(); + + + }else { + Toast.makeText(getActivity(),"需要相机权限",Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onDenied(List permissions, boolean never) { + XXPermissions.startPermissionActivity(getActivity(), permissions); + } + }); + + + + + }else { + startQRView(); + } + + + }); + + String role = (String) SharedPreferencesUtil.getData("role",""); + String userId = (String) SharedPreferencesUtil.getData("userId",""); + String token = (String) SharedPreferencesUtil.getData("token",""); + String phone = (String) SharedPreferencesUtil.getData("phone",""); + if (role != null && role.length() > 0) + tv_name.setText(role); + + } + + public void startQRView(){ + + + startActivityForResult(new Intent(getActivity(), CaptureActivity.class),101); + + + } + + @Override + public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 101){ + if (null != data) { + Bundle bundle = data.getExtras(); + if (bundle == null) { + return; + } + if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) { + String result = bundle.getString(CodeUtils.RESULT_STRING); + Toast.makeText(getActivity(), "解析结果:" + result, Toast.LENGTH_LONG).show(); + } else if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_FAILED) { + Toast.makeText(getActivity(), "解析二维码失败", Toast.LENGTH_LONG).show(); + } + } + } + + + } +} diff --git a/app/src/main/java/com/hjx/parent/fragment/MeFragment.java b/app/src/main/java/com/hjx/parent/fragment/MeFragment.java new file mode 100644 index 0000000..dfad160 --- /dev/null +++ b/app/src/main/java/com/hjx/parent/fragment/MeFragment.java @@ -0,0 +1,306 @@ +package com.hjx.parent.fragment; + +import android.content.Intent; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.constraintlayout.widget.Group; + +import com.bumptech.glide.Glide; +import com.developer.wang.utils.PermissionUtils; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.hjq.permissions.OnPermissionCallback; +import com.hjq.permissions.Permission; +import com.hjq.permissions.XXPermissions; +import com.hjx.parent.AccountActivity; +import com.hjx.parent.AddStudentActivity; +import com.hjx.parent.LoginActivity; +import com.hjx.parent.MainActivity; +import com.hjx.parent.QRActivity; +import com.hjx.parent.R; +import com.hjx.parent.UserActivity; +import com.hjx.parent.YinsiActivity; +import com.hjx.parent.bean.StudentBean; +import com.prws.common.base.BaseFragment; +import com.prws.common.net.NetWorks; +import com.prws.common.utils.LogUtil; +import com.prws.common.utils.SharedPreferencesUtil; + +import org.json.JSONArray; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.reactivex.Observer; +import io.reactivex.disposables.Disposable; +import okhttp3.ResponseBody; + +public class MeFragment extends BaseFragment { + @Override + protected int getLayoutRes() { + return R.layout.fragment_me; + } + + ImageView iv_bann; + Group group_1; + TextView tv_name; + TextView tv_phone; + ImageView iv_21, iv_22, iv_23; + TextView tv_21, tv_22, tv_23; + + + @Override + protected void initDatas() { + super.initDatas(); + + + iv_bann = mRootView.findViewById(R.id.iv_bann); + group_1 = mRootView.findViewById(R.id.group_1); + + String role = (String) SharedPreferencesUtil.getData("role", ""); + String userId = (String) SharedPreferencesUtil.getData("userId", ""); + String token = (String) SharedPreferencesUtil.getData("token", ""); + String phone = (String) SharedPreferencesUtil.getData("phone", ""); + if (role == null || role.length() == 0) { + iv_bann.setVisibility(View.VISIBLE); + group_1.setVisibility(View.GONE); + + iv_bann.setOnClickListener(view -> { + + if (!XXPermissions.isGranted(getActivity(), Permission.CAMERA)) { + XXPermissions.with(getActivity()) + // 申请多个权限 + .permission(Permission.CAMERA) + .request(new OnPermissionCallback() { + @Override + public void onGranted(List permissions, boolean all) { + if (all) { + //开启扫码界面 + startActivity(new Intent(getActivity(), QRActivity.class)); + getActivity().finish(); + } else { + Toast.makeText(getActivity(), "需要相机权限", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onDenied(List permissions, boolean never) { + XXPermissions.startPermissionActivity(getActivity(), permissions); + } + }); + + + } + + + }); + return; + } else { + iv_bann.setVisibility(View.GONE); + group_1.setVisibility(View.VISIBLE); + } + tv_name = mRootView.findViewById(R.id.tv_name); + tv_phone = mRootView.findViewById(R.id.tv_phone); + iv_21 = mRootView.findViewById(R.id.iv_21); + iv_22 = mRootView.findViewById(R.id.iv_22); + iv_23 = mRootView.findViewById(R.id.iv_23); + tv_21 = mRootView.findViewById(R.id.tv_21); + tv_22 = mRootView.findViewById(R.id.tv_22); + tv_23 = mRootView.findViewById(R.id.tv_23); + + tv_phone.setText(phone); + tv_name.setText(role); + + iv_21.setOnClickListener(view -> { + if (iv_21.getBackground().getConstantState().equals(getActivity().getDrawable(R.mipmap.tjxss).getConstantState())) { + startActivity(new Intent(getActivity(), AddStudentActivity.class)); + } + + }); + + iv_22.setOnClickListener(view -> { + if (iv_22.getBackground().getConstantState().equals(getActivity().getDrawable(R.mipmap.tjxss).getConstantState())) { + startActivity(new Intent(getActivity(), AddStudentActivity.class)); + + } + }); + iv_23.setOnClickListener(view -> { + if (iv_23.getBackground().getConstantState().equals(getActivity().getDrawable(R.mipmap.tjxss).getConstantState())) { + startActivity(new Intent(getActivity(), AddStudentActivity.class)); + } + }); + + + } + + @Override + public void onResume() { + super.onResume(); + loadChildList(); + } + + ArrayList alist = new ArrayList<>(); + + public void loadChildList() { + + + NetWorks.listChildren(new Observer() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onNext(ResponseBody responseBody) { + try { + + String str = responseBody.string().toString(); + + + LogUtil.e("TAG", "----" + str); + JSONObject jo = new JSONObject(str); + boolean isSucceed = jo.getBoolean("success"); + if (isSucceed) { + JSONArray jarr = jo.getJSONArray("data"); + alist.clear(); + for (int i = 0; i < jarr.length(); i++) { + JSONObject jo2 = jarr.getJSONObject(i); + StudentBean sb = new StudentBean(); + try { + sb.setStuId(jo2.getString("stuId")); + } catch (Exception e) { + } + try { + sb.setStuName(jo2.getString("stuName")); + } catch (Exception e) { + } + try { + sb.setGender(jo2.getInt("gender")); + } catch (Exception e) { + } + try { + sb.setTerm(jo2.getString("term")); + } catch (Exception e) { + } + try { + sb.setAccount(jo2.getString("account")); + } catch (Exception e) { + } + try { + sb.setNickName(jo2.getString("nickName")); + } catch (Exception e) { + } + try { + sb.setAddress(jo2.getString("address")); + } catch (Exception e) { + } + try { + sb.setPhone(jo2.getString("phone")); + } catch (Exception e) { + } + try { + sb.setPhoto(jo2.getString("photo")); + } catch (Exception e) { + } + try { + sb.setFromType(jo2.getInt("fromType")); + } catch (Exception e) { + } + try { + sb.setGradeId(jo2.getInt("gradeId")); + } catch (Exception e) { + } + try { + sb.setTeacherId(jo2.getInt("teacherId")); + } catch (Exception e) { + } + try { + sb.setOriSchool(jo2.getString("oriSchool")); + } catch (Exception e) { + } + try { + sb.setParentPhone(jo2.getString("parentPhone")); + } catch (Exception e) { + } + try { + sb.setParentIdentity(jo2.getString("parentIdentity")); + } catch (Exception e) { + } + try { + sb.setTeacherName(jo2.getString("teacherName")); + } catch (Exception e) { + } + alist.add(sb); + } + + if (alist.size() > 0) + loadList(); + + } else { + + } + } catch (Exception e) { + e.printStackTrace(); + + } + + } + + @Override + public void onError(Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + + + mRootView.findViewById(R.id.view_4).setOnClickListener(view -> startActivity(new Intent(getActivity(), YinsiActivity.class))); + mRootView.findViewById(R.id.view_5).setOnClickListener(view -> startActivity(new Intent(getActivity(), UserActivity.class))); + mRootView.findViewById(R.id.view_3).setOnClickListener(view -> startActivity(new Intent(getActivity(), AccountActivity.class))); + + } + + public void loadList() { + iv_21.setBackgroundResource(R.mipmap.tjxss); + tv_21.setText("添加学生"); + + + iv_22.setBackgroundResource(R.mipmap.tjxss); + tv_22.setText("添加学生"); + + iv_23.setBackgroundResource(R.mipmap.tjxss); + tv_23.setText("添加学生"); + + if (alist.size() >= 1) { +// if (alist.get(0).getPhoto() != null && alist.get(0).getPhoto().length() > 0) +// Glide.with(getActivity()).load(alist.get(0).getPhoto()).into(iv_21); +// else + iv_21.setBackgroundResource(R.mipmap.txz); + tv_21.setText(alist.get(0).getStuName()); + } + if (alist.size() >= 2) { +// if (alist.get(1).getPhoto() != null && alist.get(1).getPhoto().length() > 0) +// Glide.with(getActivity()).load(alist.get(1).getPhoto()).into(iv_22); +// else + iv_22.setBackgroundResource(R.mipmap.txz); + tv_22.setText(alist.get(1).getStuName()); + } + if (alist.size() >= 3) { +// if (alist.get(2).getPhoto() != null && alist.get(2).getPhoto().length() > 0) +// Glide.with(getActivity()).load(alist.get(2).getPhoto()).into(iv_23); +// else + iv_23.setBackgroundResource(R.mipmap.txz); + tv_23.setText(alist.get(2).getStuName()); + } + } +} diff --git a/app/src/main/res/drawable/bg_solid_btn.xml b/app/src/main/res/drawable/bg_solid_btn.xml new file mode 100644 index 0000000..0191239 --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_btn.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_solid_btn_grad.xml b/app/src/main/res/drawable/bg_solid_btn_grad.xml new file mode 100644 index 0000000..ab3dd2f --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_btn_grad.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_solid_white.xml b/app/src/main/res/drawable/bg_solid_white.xml new file mode 100644 index 0000000..a79f693 --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_white.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_solid_white_10.xml b/app/src/main/res/drawable/bg_solid_white_10.xml new file mode 100644 index 0000000..1c19ebd --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_white_10.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_solid_white_10_bottom.xml b/app/src/main/res/drawable/bg_solid_white_10_bottom.xml new file mode 100644 index 0000000..ed04f68 --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_white_10_bottom.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_solid_white_10_or.xml b/app/src/main/res/drawable/bg_solid_white_10_or.xml new file mode 100644 index 0000000..33c8b03 --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_white_10_or.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_solid_white_10_top.xml b/app/src/main/res/drawable/bg_solid_white_10_top.xml new file mode 100644 index 0000000..70e3d75 --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_white_10_top.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_solid_white_20.xml b/app/src/main/res/drawable/bg_solid_white_20.xml new file mode 100644 index 0000000..8858698 --- /dev/null +++ b/app/src/main/res/drawable/bg_solid_white_20.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/checked_xc.xml b/app/src/main/res/drawable/checked_xc.xml new file mode 100644 index 0000000..aa77125 --- /dev/null +++ b/app/src/main/res/drawable/checked_xc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/select_b_1.xml b/app/src/main/res/drawable/select_b_1.xml new file mode 100644 index 0000000..50af681 --- /dev/null +++ b/app/src/main/res/drawable/select_b_1.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/select_b_2.xml b/app/src/main/res/drawable/select_b_2.xml new file mode 100644 index 0000000..7602b37 --- /dev/null +++ b/app/src/main/res/drawable/select_b_2.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/select_t_1.xml b/app/src/main/res/drawable/select_t_1.xml new file mode 100644 index 0000000..682c1fc --- /dev/null +++ b/app/src/main/res/drawable/select_t_1.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/welcome_bg.xml b/app/src/main/res/drawable/welcome_bg.xml new file mode 100644 index 0000000..4fe45f3 --- /dev/null +++ b/app/src/main/res/drawable/welcome_bg.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_add_stu.xml b/app/src/main/res/layout/activity_add_stu.xml new file mode 100644 index 0000000..52594bb --- /dev/null +++ b/app/src/main/res/layout/activity_add_stu.xml @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +