Commit 21a03311cbe7e2f8d32be55b3c6f95a6c5969d0b
1 parent
02c11a0c1f
Exists in
master
BUG修改
Showing
18 changed files
with
715 additions
and
28 deletions
Show diff stats
.idea/deploymentTargetDropDown.xml
File was created | 1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <project version="4"> | ||
3 | <component name="deploymentTargetDropDown"> | ||
4 | <value> | ||
5 | <entry key="app"> | ||
6 | <State /> | ||
7 | </entry> | ||
8 | </value> | ||
9 | </component> | ||
10 | </project> |
.idea/gradle.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <project version="4"> | 2 | <project version="4"> |
3 | <component name="GradleMigrationSettings" migrationVersion="1" /> | 3 | <component name="GradleMigrationSettings" migrationVersion="1" /> |
4 | <component name="GradleSettings"> | 4 | <component name="GradleSettings"> |
5 | <option name="linkedExternalProjectsSettings"> | 5 | <option name="linkedExternalProjectsSettings"> |
6 | <GradleProjectSettings> | 6 | <GradleProjectSettings> |
7 | <option name="testRunner" value="GRADLE" /> | ||
8 | <option name="distributionType" value="DEFAULT_WRAPPED" /> | ||
9 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> | 7 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> |
10 | <option name="gradleHome" value="$USER_HOME$/.gradle/wrapper/dists/gradle-8.0-bin/ca5e32bp14vu59qr306oxotwh/gradle-8.0" /> | 8 | <option name="gradleJvm" value="#JAVA_HOME" /> |
11 | <option name="gradleJvm" value="1.8" /> | ||
12 | <option name="modules"> | 9 | <option name="modules"> |
13 | <set> | 10 | <set> |
14 | <option value="$PROJECT_DIR$" /> | 11 | <option value="$PROJECT_DIR$" /> |
15 | <option value="$PROJECT_DIR$/app" /> | 12 | <option value="$PROJECT_DIR$/app" /> |
16 | <option value="$PROJECT_DIR$/libs" /> | 13 | <option value="$PROJECT_DIR$/libs" /> |
17 | <option value="$PROJECT_DIR$/libs/common" /> | 14 | <option value="$PROJECT_DIR$/libs/common" /> |
18 | </set> | 15 | </set> |
19 | </option> | 16 | </option> |
17 | <option name="resolveExternalAnnotations" value="false" /> | ||
20 | </GradleProjectSettings> | 18 | </GradleProjectSettings> |
21 | </option> | 19 | </option> |
22 | </component> | 20 | </component> |
.idea/misc.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <project version="4"> | 1 | <project version="4"> |
3 | <component name="DesignSurface"> | 2 | <component name="DesignSurface"> |
4 | <option name="filePathToZoomLevelMap"> | 3 | <option name="filePathToZoomLevelMap"> |
5 | <map> | 4 | <map> |
6 | <entry key="app/src/main/res/drawable/bg_solid_btn.xml" value="0.29907407407407405" /> | 5 | <entry key="app/src/main/res/drawable/bg_solid_btn.xml" value="0.29907407407407405" /> |
7 | <entry key="app/src/main/res/drawable/bg_solid_btn_grad.xml" value="0.29907407407407405" /> | 6 | <entry key="app/src/main/res/drawable/bg_solid_btn_grad.xml" value="0.29907407407407405" /> |
8 | <entry key="app/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> | 7 | <entry key="app/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> |
9 | <entry key="app/src/main/res/drawable/bg_solid_white_10.xml" value="0.29907407407407405" /> | 8 | <entry key="app/src/main/res/drawable/bg_solid_white_10.xml" value="0.29907407407407405" /> |
10 | <entry key="app/src/main/res/drawable/bg_solid_white_10_bottom.xml" value="0.2388888888888889" /> | 9 | <entry key="app/src/main/res/drawable/bg_solid_white_10_bottom.xml" value="0.2388888888888889" /> |
11 | <entry key="app/src/main/res/drawable/bg_solid_white_10_or.xml" value="0.24814814814814815" /> | 10 | <entry key="app/src/main/res/drawable/bg_solid_white_10_or.xml" value="0.24814814814814815" /> |
12 | <entry key="app/src/main/res/drawable/bg_solid_white_10_top.xml" value="0.2388888888888889" /> | 11 | <entry key="app/src/main/res/drawable/bg_solid_white_10_top.xml" value="0.2388888888888889" /> |
13 | <entry key="app/src/main/res/drawable/bg_solid_white_20.xml" value="0.25555555555555554" /> | 12 | <entry key="app/src/main/res/drawable/bg_solid_white_20.xml" value="0.25555555555555554" /> |
14 | <entry key="app/src/main/res/drawable/checked_xc.xml" value="0.29907407407407405" /> | 13 | <entry key="app/src/main/res/drawable/checked_xc.xml" value="0.29907407407407405" /> |
15 | <entry key="app/src/main/res/drawable/select_b_1.xml" value="0.25555555555555554" /> | 14 | <entry key="app/src/main/res/drawable/select_b_1.xml" value="0.25555555555555554" /> |
16 | <entry key="app/src/main/res/drawable/select_b_2.xml" value="0.25555555555555554" /> | 15 | <entry key="app/src/main/res/drawable/select_b_2.xml" value="0.25555555555555554" /> |
17 | <entry key="app/src/main/res/drawable/select_t_1.xml" value="0.25555555555555554" /> | 16 | <entry key="app/src/main/res/drawable/select_t_1.xml" value="0.25555555555555554" /> |
18 | <entry key="app/src/main/res/drawable/welcome_bg.xml" value="0.38958333333333334" /> | 17 | <entry key="app/src/main/res/drawable/welcome_bg.xml" value="0.38958333333333334" /> |
19 | <entry key="app/src/main/res/layout/activity_add_stu.xml" value="0.3734375" /> | 18 | <entry key="app/src/main/res/layout/activity_add_stu.xml" value="0.3734375" /> |
20 | <entry key="app/src/main/res/layout/activity_changem.xml" value="0.3734375" /> | 19 | <entry key="app/src/main/res/layout/activity_changem.xml" value="0.3734375" /> |
21 | <entry key="app/src/main/res/layout/activity_login.xml" value="0.20064724919093851" /> | 20 | <entry key="app/src/main/res/layout/activity_login.xml" value="0.20064724919093851" /> |
22 | <entry key="app/src/main/res/layout/activity_main.xml" value="0.359375" /> | 21 | <entry key="app/src/main/res/layout/activity_main.xml" value="0.359375" /> |
23 | <entry key="app/src/main/res/layout/activity_me.xml" value="0.3734375" /> | 22 | <entry key="app/src/main/res/layout/activity_me.xml" value="0.3734375" /> |
24 | <entry key="app/src/main/res/layout/activity_qr.xml" value="0.1" /> | 23 | <entry key="app/src/main/res/layout/activity_qr.xml" value="0.1" /> |
25 | <entry key="app/src/main/res/layout/activity_register.xml" value="0.3734375" /> | 24 | <entry key="app/src/main/res/layout/activity_register.xml" value="0.3734375" /> |
26 | <entry key="app/src/main/res/layout/activity_sao.xml" value="0.3734375" /> | 25 | <entry key="app/src/main/res/layout/activity_sao.xml" value="0.3734375" /> |
27 | <entry key="app/src/main/res/layout/activity_select_stu.xml" value="0.3734375" /> | 26 | <entry key="app/src/main/res/layout/activity_select_stu.xml" value="0.3734375" /> |
28 | <entry key="app/src/main/res/layout/activity_set_jia.xml" value="0.3734375" /> | 27 | <entry key="app/src/main/res/layout/activity_set_jia.xml" value="0.3734375" /> |
29 | <entry key="app/src/main/res/layout/activity_set_nian.xml" value="0.31952662721893493" /> | 28 | <entry key="app/src/main/res/layout/activity_set_nian.xml" value="0.31952662721893493" /> |
30 | <entry key="app/src/main/res/layout/activity_set_nick.xml" value="0.3734375" /> | 29 | <entry key="app/src/main/res/layout/activity_set_nick.xml" value="0.3734375" /> |
31 | <entry key="app/src/main/res/layout/activity_set_sex.xml" value="0.2781065088757396" /> | 30 | <entry key="app/src/main/res/layout/activity_set_sex.xml" value="0.2781065088757396" /> |
32 | <entry key="app/src/main/res/layout/activity_setac.xml" value="0.3734375" /> | 31 | <entry key="app/src/main/res/layout/activity_setac.xml" value="0.3734375" /> |
33 | <entry key="app/src/main/res/layout/activity_yin.xml" value="0.3734375" /> | 32 | <entry key="app/src/main/res/layout/activity_yin.xml" value="0.3734375" /> |
34 | <entry key="app/src/main/res/layout/fragment_home.xml" value="0.1" /> | 33 | <entry key="app/src/main/res/layout/fragment_home.xml" value="0.1" /> |
35 | <entry key="app/src/main/res/layout/fragment_me.xml" value="0.13197430135483507" /> | 34 | <entry key="app/src/main/res/layout/fragment_me.xml" value="0.13197430135483507" /> |
36 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.3814814814814815" /> | 35 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.3814814814814815" /> |
37 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.3814814814814815" /> | 36 | <entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.3814814814814815" /> |
38 | <entry key="libs/common/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> | 37 | <entry key="libs/common/src/main/res/drawable/bg_solid_white.xml" value="0.21851851851851853" /> |
39 | <entry key="libs/common/src/main/res/drawable/default_label_bg.xml" value="0.21851851851851853" /> | 38 | <entry key="libs/common/src/main/res/drawable/default_label_bg.xml" value="0.21851851851851853" /> |
40 | <entry key="libs/common/src/main/res/drawable/select_map_position_type.xml" value="0.21851851851851853" /> | 39 | <entry key="libs/common/src/main/res/drawable/select_map_position_type.xml" value="0.21851851851851853" /> |
41 | <entry key="libs/common/src/main/res/drawable/shape_dialog_bg.xml" value="0.21851851851851853" /> | 40 | <entry key="libs/common/src/main/res/drawable/shape_dialog_bg.xml" value="0.21851851851851853" /> |
42 | <entry key="libs/common/src/main/res/layout/dialog_auxiliary_point.xml" value="0.2791666666666667" /> | 41 | <entry key="libs/common/src/main/res/layout/dialog_auxiliary_point.xml" value="0.2791666666666667" /> |
43 | </map> | 42 | </map> |
44 | </option> | 43 | </option> |
45 | </component> | 44 | </component> |
46 | <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> | 45 | <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> |
47 | <output url="file://$PROJECT_DIR$/build/classes" /> | 46 | <output url="file://$PROJECT_DIR$/build/classes" /> |
48 | </component> | 47 | </component> |
49 | <component name="ProjectType"> | 48 | <component name="ProjectType"> |
50 | <option name="id" value="Android" /> | 49 | <option name="id" value="Android" /> |
51 | </component> | 50 | </component> |
52 | </project> | 51 | </project> |
app/build.gradle
1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
2 | apply from: '../config.gradle' | 2 | apply from: '../config.gradle' |
3 | 3 | ||
4 | 4 | ||
5 | def androidId = rootProject.ext.androidId | 5 | def androidId = rootProject.ext.androidId |
6 | def support = rootProject.ext.dependencies | 6 | def support = rootProject.ext.dependencies |
7 | def url = rootProject.ext.url | 7 | def url = rootProject.ext.url |
8 | 8 | ||
9 | 9 | ||
10 | android { | 10 | android { |
11 | signingConfigs { | 11 | signingConfigs { |
12 | 12 | ||
13 | config { | 13 | config { |
14 | keyAlias 'alias' | 14 | keyAlias 'alias' |
15 | keyPassword '123456' | 15 | keyPassword '123456' |
16 | storeFile file('key.jks') | 16 | storeFile file('key.jks') |
17 | storePassword '123456' | 17 | storePassword '123456' |
18 | } | 18 | } |
19 | debug { | 19 | debug { |
20 | } | 20 | } |
21 | } | 21 | } |
22 | compileSdk 32 | 22 | compileSdk 32 |
23 | 23 | ||
24 | defaultConfig { | 24 | defaultConfig { |
25 | applicationId "com.hjx.parent" | 25 | applicationId "com.hjx.parent" |
26 | minSdk 24 | 26 | minSdk 24 |
27 | targetSdk 32 | 27 | targetSdk 32 |
28 | versionCode 1 | 28 | versionCode 1 |
29 | versionName "1.0" | 29 | versionName "1.0" |
30 | 30 | ||
31 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | 31 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
32 | } | 32 | } |
33 | 33 | ||
34 | android.applicationVariants.all { | 34 | android.applicationVariants.all { |
35 | variant -> | 35 | variant -> |
36 | variant.outputs.all { | 36 | variant.outputs.all { |
37 | //在这里修改apk文件名 | 37 | //在这里修改apk文件名 |
38 | outputFileName = "parent-${variant.name}-v${variant.versionName}.apk" | 38 | outputFileName = "parent-${variant.name}-v${variant.versionName}.apk" |
39 | } | 39 | } |
40 | } | 40 | } |
41 | buildTypes { | 41 | buildTypes { |
42 | debug { | 42 | debug { |
43 | debuggable true | ||
43 | minifyEnabled false | 44 | minifyEnabled false |
44 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 45 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
46 | signingConfig signingConfigs.config | ||
45 | } | 47 | } |
46 | release { | 48 | release { |
47 | debuggable true | 49 | debuggable true |
48 | minifyEnabled false | 50 | minifyEnabled false |
49 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 51 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
50 | signingConfig signingConfigs.config | 52 | signingConfig signingConfigs.config |
51 | } | 53 | } |
52 | } | 54 | } |
53 | lintOptions { | 55 | lintOptions { |
54 | checkReleaseBuilds false | 56 | checkReleaseBuilds false |
55 | abortOnError false | 57 | abortOnError false |
56 | } | 58 | } |
57 | compileOptions { | 59 | compileOptions { |
58 | sourceCompatibility JavaVersion.VERSION_1_8 | 60 | sourceCompatibility JavaVersion.VERSION_1_8 |
59 | targetCompatibility JavaVersion.VERSION_1_8 | 61 | targetCompatibility JavaVersion.VERSION_1_8 |
60 | } | 62 | } |
61 | } | 63 | } |
62 | 64 | ||
63 | dependencies { | 65 | dependencies { |
64 | support.each { k, v -> implementation v } | 66 | support.each { k, v -> implementation v } |
65 | api project(path: ':libs:common') | 67 | api project(path: ':libs:common') |
66 | implementation 'androidx.appcompat:appcompat:1.5.1' | 68 | implementation 'androidx.appcompat:appcompat:1.5.1' |
67 | implementation 'com.google.android.material:material:1.6.1' | 69 | implementation 'com.google.android.material:material:1.6.1' |
68 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | 70 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' |
69 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' | 71 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' |
70 | } | 72 | } |
app/src/main/AndroidManifest.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:tools="http://schemas.android.com/tools" | 3 | xmlns:tools="http://schemas.android.com/tools" |
4 | package="com.hjx.parent"> | 4 | package="com.hjx.parent"> |
5 | 5 | ||
6 | 6 | ||
7 | <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" /> | 7 | <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" /> |
8 | <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <!-- 允许程序改变网络链接状态 --> | 8 | <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <!-- 允许程序改变网络链接状态 --> |
9 | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 允许程序访问访问WIFI网络状态信息 --> | 9 | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 允许程序访问访问WIFI网络状态信息 --> |
10 | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 允许程序改变WIFI链接状态 --> | 10 | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 允许程序改变WIFI链接状态 --> |
11 | <!-- 6.0系统需要添加权限才能获得wifi列表 --> | 11 | <!-- 6.0系统需要添加权限才能获得wifi列表 --> |
12 | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | 12 | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> |
13 | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | 13 | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
14 | <uses-permission android:name="android.permission.INTERNET" /> | 14 | <uses-permission android:name="android.permission.INTERNET" /> |
15 | <uses-permission android:name="android.permission.RECORD_AUDIO" /> | 15 | <uses-permission android:name="android.permission.RECORD_AUDIO" /> |
16 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | 16 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
17 | 17 | ||
18 | <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | 18 | <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> |
19 | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | 19 | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
20 | <uses-permission android:name="android.permission.WAKE_LOCK" /> | 20 | <uses-permission android:name="android.permission.WAKE_LOCK" /> |
21 | <uses-permission android:name="android.permission.CAMERA" /> | 21 | <uses-permission android:name="android.permission.CAMERA" /> |
22 | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | 22 | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> |
23 | <uses-permission android:name="android.permission.VIBRATE" /> | 23 | <uses-permission android:name="android.permission.VIBRATE" /> |
24 | 24 | ||
25 | <application | 25 | <application |
26 | android:name=".MyApplication" | 26 | android:name=".MyApplication" |
27 | android:allowBackup="true" | 27 | android:allowBackup="true" |
28 | android:icon="@mipmap/icon" | 28 | android:icon="@mipmap/icon" |
29 | android:label="@string/app_name" | 29 | android:label="@string/app_name" |
30 | android:networkSecurityConfig="@xml/network_security_config" | 30 | android:networkSecurityConfig="@xml/network_security_config" |
31 | android:supportsRtl="true" | 31 | android:supportsRtl="true" |
32 | android:theme="@style/Theme.Parent"> | 32 | android:theme="@style/Theme.Parent"> |
33 | <activity | 33 | <activity |
34 | android:name=".LoginActivity" | 34 | android:name=".LoginActivity" |
35 | android:exported="true" | 35 | android:exported="true" |
36 | android:theme="@style/ThemeSplash"> | 36 | android:theme="@style/ThemeSplash"> |
37 | <intent-filter> | 37 | <intent-filter> |
38 | <action android:name="android.intent.action.MAIN" /> | 38 | <action android:name="android.intent.action.MAIN" /> |
39 | <category android:name="android.intent.category.LAUNCHER" /> | 39 | <category android:name="android.intent.category.LAUNCHER" /> |
40 | </intent-filter> | 40 | </intent-filter> |
41 | </activity> | 41 | </activity> |
42 | <activity | 42 | <activity |
43 | android:name=".MainActivity" | 43 | android:name=".MainActivity" |
44 | android:launchMode="singleTask" | 44 | android:launchMode="singleTask" |
45 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 45 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
46 | <activity | 46 | <activity |
47 | android:name=".RegisterActivity" | 47 | android:name=".RegisterActivity" |
48 | android:theme="@style/ThemeSplash" /> | 48 | android:theme="@style/ThemeSplash" /> |
49 | <activity | 49 | <activity |
50 | android:name=".UserActivity" | 50 | android:name=".UserActivity" |
51 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 51 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
52 | <activity | 52 | <activity |
53 | android:name=".YinsiActivity" | 53 | android:name=".YinsiActivity" |
54 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 54 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
55 | <activity | 55 | <activity |
56 | android:name=".QRActivity" | 56 | android:name=".QRActivity" |
57 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 57 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
58 | <activity | 58 | <activity |
59 | android:name=".AddStudentActivity" | 59 | android:name=".AddStudentActivity" |
60 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 60 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
61 | <activity | 61 | <activity |
62 | android:name=".NickActivity" | 62 | android:name=".NickActivity" |
63 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 63 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
64 | <activity | 64 | <activity |
65 | android:name=".SexActivity" | 65 | android:name=".SexActivity" |
66 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 66 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
67 | <activity | 67 | <activity |
68 | android:name=".NianActivity" | 68 | android:name=".NianActivity" |
69 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 69 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
70 | <activity | 70 | <activity |
71 | android:name=".ShenActivity" | 71 | android:name=".ShenActivity" |
72 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 72 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
73 | <activity | 73 | <activity |
74 | android:name=".UserAgreementActivity" | ||
75 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | ||
76 | <activity | ||
74 | android:name=".AccountActivity" | 77 | android:name=".AccountActivity" |
75 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 78 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
76 | 79 | ||
77 | <activity | 80 | <activity |
78 | android:name=".ChangePwdActivity" | 81 | android:name=".ChangePwdActivity" |
79 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 82 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
80 | <activity | 83 | <activity |
81 | android:name=".EditStudentActivity" | 84 | android:name=".EditStudentActivity" |
82 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 85 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
83 | <activity | 86 | <activity |
84 | android:name=".ChooseActivity" | 87 | android:name=".ChooseActivity" |
85 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 88 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
86 | <activity | 89 | <activity |
87 | android:name=".AddTeacherActivity" | 90 | android:name=".AddTeacherActivity" |
88 | android:theme="@style/Theme.AppCompat.NoActionBar" /> | 91 | android:theme="@style/Theme.AppCompat.NoActionBar" /> |
89 | 92 | ||
90 | <provider | 93 | <provider |
91 | android:name="androidx.core.content.FileProvider" | 94 | android:name="androidx.core.content.FileProvider" |
92 | android:authorities="com.hjx.parent.fileprovider" | 95 | android:authorities="com.hjx.parent.fileprovider" |
93 | android:exported="false" | 96 | android:exported="false" |
94 | android:grantUriPermissions="true"> | 97 | android:grantUriPermissions="true"> |
95 | <meta-data | 98 | <meta-data |
96 | android:name="android.support.FILE_PROVIDER_PATHS" | 99 | android:name="android.support.FILE_PROVIDER_PATHS" |
97 | android:resource="@xml/file_provider_paths" | 100 | android:resource="@xml/file_provider_paths" |
98 | tools:replace="android:resource" /> | 101 | tools:replace="android:resource" /> |
99 | </provider> | 102 | </provider> |
100 | </application> | 103 | </application> |
101 | 104 | ||
102 | </manifest> | 105 | </manifest> |
app/src/main/assets/yinsi.html
File was created | 1 | <!DOCTYPE html> | |
2 | <html lang="en"> | ||
3 | |||
4 | <head> | ||
5 | <meta charset="UTF-8" /> | ||
6 | <link rel="icon" href="/logo.png" /> | ||
7 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
8 | <title>隐私政策</title> | ||
9 | <!-- [if lt IE 11]><script>window.location.href='./public/ie.html';</script>![endif] --> | ||
10 | <style> | ||
11 | </style> | ||
12 | </head> | ||
13 | |||
14 | <body> | ||
15 | <h1>隐私政策</h1> | ||
16 | <div>更新日期:<strong>2024/3/4</strong></div> | ||
17 | <div>生效日期:<strong>2024/3/4</strong></div> | ||
18 | <h2>导言</h2> | ||
19 | <p> | ||
20 | <i>家长管控</i> 是一款由 <i>好记星</i> (以下简称“我们”)提供的产品。 | ||
21 | 您在使用我们的服务时,我们可能会收集和使用您的相关信息。我们希望通过本《隐私政策》向您说明,在使用我们的服务时,我们如何收集、使用、储存和分享这些信息,以及我们为您提供的访问、更新、控制和保护这些信息的方式。 | ||
22 | 本《隐私政策》与您所使用的 <i>家长管控</i> 服务息息相关,希望您仔细阅读,在需要时,按照本《隐私政策》的指引,作出您认为适当的选择。本《隐私政策》中涉及的相关技术词汇,我们尽量以简明扼要的表述,并提供进一步说明的链接,以便您的理解。 | ||
23 | </p> | ||
24 | <p><strong>您使用或继续使用我们的服务,即意味着同意我们按照本《隐私政策》收集、使用、储存和分享您的相关信息。</strong></p> | ||
25 | <p>如对本《隐私政策》或相关事宜有任何问题,请通过 <strong>13665187964</strong> 与我们联系。</p> | ||
26 | |||
27 | <h2>1. 我们收集的信息</h2> | ||
28 | <p>我们或我们的第三方合作伙伴提供服务时,可能会收集、储存和使用下列与您有关的信息。如果您不提供相关信息,可能无法注册成为我们的用户或无法享受我们提供的某些服务,或者无法达到相关服务拟达到的效果。</p> | ||
29 | |||
30 | <ul> | ||
31 | <li><strong>个人信息</strong>,您在注册账户或使用我们的服务时,向我们提供的相关个人信息,例如电话号码、电子邮件等。</li> | ||
32 | <li><strong>日志信息</strong>,指您使用我们的服务时,系统可能通过cookies、标识符及相关技术收集的信息,包括您的<strong>设备信息</strong>、<strong>浏览信息</strong>、<strong>点击信息</strong>,并将该等信息储存为日志信息,为您提供个性化的用户体验、保障服务安全。您可以通过浏览器设置拒绝或管理cookie、标识符或相关技术的使用。</li> | ||
33 | </ul> | ||
34 | |||
35 | |||
36 | |||
37 | |||
38 | </ul> | ||
39 | |||
40 | <h2>2. 信息的存储</h2> | ||
41 | <strong>2.1 信息存储的方式和期限</strong> | ||
42 | <ul> | ||
43 | <li>我们会通过安全的方式存储您的信息,包括本地存储(例如利用APP进行数据缓存)、数据库和服务器日志。</li> | ||
44 | <li>一般情况下,我们只会在为实现服务目的所必需的时间内或法律法规规定的条件下存储您的个人信息。</li> | ||
45 | </ul> | ||
46 | |||
47 | <strong>2.2 信息存储的地域</strong> | ||
48 | <ul> | ||
49 | <li>我们会按照法律法规规定,将境内收集的用户个人信息存储于中国境内。</li> | ||
50 | <li>目前我们不会跨境传输或存储您的个人信息。将来如需跨境传输或存储的,我们会向您告知信息出境的目的、接收方、安全保证措施和安全风险,并征得您的同意。</li> | ||
51 | </ul> | ||
52 | |||
53 | <strong>2.3 产品或服务停止运营时的通知</strong> | ||
54 | <ul> | ||
55 | <li>当我们的产品或服务发生停止运营的情况时,我们将以推送通知、公告等形式通知您,并在合理期限内删除您的个人信息或进行匿名化处理,法律法规另有规定的除外。</li> | ||
56 | </ul> | ||
57 | |||
58 | <h2>3. 信息安全</h2> | ||
59 | <p> | ||
60 | 我们使用各种安全技术和程序,以防信息的丢失、不当使用、未经授权阅览或披露。例如,在某些服务中,我们将利用加密技术(例如SSL)来保护您提供的个人信息。但请您理解,由于技术的限制以及可能存在的各种恶意手段,在互联网行业,即便竭尽所能加强安全措施,也不可能始终保证信息百分之百的安全。您需要了解,您接入我们的服务所用的系统和通讯网络,有可能因我们可控范围外的因素而出现问题。 | ||
61 | </p> | ||
62 | |||
63 | <h2>4. 我们如何使用信息</h2> | ||
64 | <p>我们可能将在向您提供服务的过程之中所收集的信息用作下列用途:</p> | ||
65 | <ul> | ||
66 | <li>向您提供服务;</li> | ||
67 | <li>在我们提供服务时,用于身份验证、客户服务、安全防范、诈骗监测、存档和备份用途,确保我们向您提供的产品和服务的安全性;</li> | ||
68 | <li>帮助我们设计新服务,改善我们现有服务;</li> | ||
69 | <li>使我们更加了解您如何接入和使用我们的服务,从而针对性地回应您的个性化需求,例如语言设定、位置设定、个性化的帮助服务和指示,或对您和其他用户作出其他方面的回应;</li> | ||
70 | <li>向您提供与您更加相关的广告以替代普遍投放的广告;</li> | ||
71 | <li>评估我们服务中的广告和其他促销及推广活动的效果,并加以改善;</li> | ||
72 | <li>软件认证或管理软件升级;</li> | ||
73 | <li>让您参与有关我们产品和服务的调查。</li> | ||
74 | </ul> | ||
75 | |||
76 | <h2>5. 信息共享</h2> | ||
77 | <p> | ||
78 | 目前,我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。 | ||
79 | </p> | ||
80 | <p> | ||
81 | 为了投放广告,评估、优化广告投放效果等目的,我们需要向广告主及其代理商等第三方合作伙伴共享您的部分数据,要求其严格遵守我们关于数据隐私保护的措施与要求,包括但不限于根据数据保护协议、承诺书及相关数据处理政策进行处理,避免识别出个人身份,保障隐私安全。 | ||
82 | </p> | ||
83 | <p> | ||
84 | 我们不会向合作伙伴分享可用于识别您个人身份的信息(例如您的姓名或电子邮件地址),除非您明确授权。 | ||
85 | </p> | ||
86 | <p> | ||
87 | 我们不会对外公开披露所收集的个人信息,如必须公开披露时,我们会向您告知此次公开披露的目的、披露信息的类型及可能涉及的敏感信息,并征得您的明示同意。 | ||
88 | </p> | ||
89 | <p> | ||
90 | 随着我们业务的持续发展,我们有可能进行合并、收购、资产转让等交易,我们将告知您相关情形,按照法律法规及不低于本《隐私政策》所要求的标准继续保护或要求新的控制者继续保护您的个人信息。 | ||
91 | </p> | ||
92 | <p> | ||
93 | 另外,根据相关法律法规及国家标准,以下情形中,我们可能会共享、转让、公开披露个人信息无需事先征得您的授权同意: | ||
94 | </p> | ||
95 | <ul> | ||
96 | <li>与国家安全、国防安全直接相关的;</li> | ||
97 | <li>与公共安全、公共卫生、重大公共利益直接相关的;</li> | ||
98 | <li>犯罪侦查、起诉、审判和判决执行等直接相关的;</li> | ||
99 | <li>出于维护个人信息主体或其他个人的生命、财产等重大合法权益但又很难得到本人同意的;</li> | ||
100 | <li>个人信息主体自行向社会公众公开个人信息的;</li> | ||
101 | <li>从合法公开披露的信息中收集个人信息的,如合法的新闻报道、政府信息公开等渠道。</li> | ||
102 | </ul> | ||
103 | |||
104 | <h2>6. 您的权利</h2> | ||
105 | <p> | ||
106 | 在您使用我们的服务期间,我们可能会视产品具体情况为您提供相应的操作设置,以便您可以查询、删除、更正或撤回您的相关个人信息,您可参考相应的具体指引进行操作。此外,我们还设置了投诉举报渠道,您的意见将会得到及时的处理。如果您无法通过上述途径和方式行使您的个人信息主体权利,您可以通过本《隐私政策》中提供的联系方式提出您的请求,我们会按照法律法规的规定予以反馈。 | ||
107 | </p> | ||
108 | <p>当您决定不再使用我们的产品或服务时,可以申请注销账户。注销账户后,除法律法规另有规定外,我们将删除或匿名化处理您的个人信息。</p> | ||
109 | |||
110 | <h2>7. 变更</h2> | ||
111 | <p> | ||
112 | 我们可能适时修订本《隐私政策》的条款。当变更发生时,我们会在版本更新时向您提示新的《隐私政策》,并向您说明生效日期。请您仔细阅读变更后的《隐私政策》内容,<strong>若您继续使用我们的服务,即表示您同意我们按照更新后的《隐私政策》处理您的个人信息。</strong> | ||
113 | </p> | ||
114 | |||
115 | <h2>8. 未成年人保护</h2> | ||
116 | <p> | ||
117 | 我们鼓励父母或监护人指导未满十八岁的未成年人使用我们的服务。我们建议未成年人鼓励他们的父母或监护人阅读本《隐私政策》,并建议未成年人在提交的个人信息之前寻求父母或监护人的同意和指导。 | ||
118 | </p> | ||
119 | </body> | ||
120 | |||
121 | </html> | ||
122 |
app/src/main/assets/yonghuxieyi.html
File was created | 1 | <!DOCTYPE html> | |
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <meta charset="UTF-8" /> | ||
5 | <link rel="icon" href="/logo.png" /> | ||
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
7 | <title>隐私政策</title> | ||
8 | <!-- [if lt IE 11]><script>window.location.href='./public/ie.html';</script>![endif] --> | ||
9 | <style> | ||
10 | body { | ||
11 | font-size: 1rem; | ||
12 | padding: 1rem; | ||
13 | } | ||
14 | h1 { | ||
15 | font-size: 1.4rem; | ||
16 | margin: 3rem 0; | ||
17 | } | ||
18 | .date { | ||
19 | font-size: 0.8rem; | ||
20 | margin-bottom: 1.4rem; | ||
21 | color: gray; | ||
22 | } | ||
23 | p { | ||
24 | font-size: 0.9rem; | ||
25 | line-height: 2rem; | ||
26 | } | ||
27 | .title { | ||
28 | font-size: 1rem; | ||
29 | font-weight: bold; | ||
30 | } | ||
31 | </style> | ||
32 | </head> | ||
33 | |||
34 | <body> | ||
35 | <h1>好记星家长端用户协议</h1> | ||
36 | |||
37 | <div class="date">生效日期:2024年1月22日</div> | ||
38 | |||
39 | <div class="date" style="margin-bottom: 3rem;">更新日期:2024年1月22日</div> | ||
40 | |||
41 | <p> | ||
42 | 《好记星家长端用户协议》(以下简称“本协议”)由上海好记星教育科技有限公司(以下简称“好记星”)与您(以下或称“用户”)签订。本协议一经订立,将在您与好记星之间具有合同效力。好记星郑重提示您,请您审慎阅读并充分理解本协议全部条款,特别是以粗体字样标识的内容。当您勾选或点击“同意”本协议,即视为您已阅读并同意接受本协议的约束。如您不同意本协议,请立即停止注册或使用好记星的服务。 | ||
43 | </p> | ||
44 | |||
45 | <p class="title">一、总则</p> | ||
46 | |||
47 | <p> | ||
48 | 1. | ||
49 | 好记星家长端为好记星所运营的为您提供扫描、处理、管理等服务的工具,具体服务类型包括但不限于好记星家长端APP、供调用的应用程序编程接口(API)或应用软件开发工具包(SDK)。 | ||
50 | </p> | ||
51 | |||
52 | <p> | ||
53 | 2. | ||
54 | 好记星有权根据法律法规、国家标准及业务运营之需要适时修改本协议。如果本协议发生变更的,我们将在好记星家长端中公布更新后的协议。该等变更行为不视为好记星违反本协议之约定。如您在本协议修改后继续使用好记星家长端,即表示您已充分阅读、理解并同意修改后的协议,愿意受修改后协议的约束;如您不同意修改后的协议,请立即停止使用好记星家长端。 | ||
55 | </p> | ||
56 | |||
57 | <p> | ||
58 | 3. | ||
59 | 除本协议以外,我们已经发布的或将来可能发布的有关好记星向您提供产品或服务的协议、服务规则、政策、须知等内容,均视为本协议的补充协议,作为本协议不可分割的组成部分,与本协议具有同等法律效力。请您及时关注并阅读前述相关补充协议。相关补充协议的部分或全部条款被认定无效的,不影响其它协议或协议条款的效力。 | ||
60 | </p> | ||
61 | |||
62 | <p> | ||
63 | 4. | ||
64 | 如本协议与您和好记星签订的线下协议或购买具体服务生成的电子订单(以下简称“电子订单”)的约定不一致,则以线下协议或电子订单的约定为准。 | ||
65 | </p> | ||
66 | |||
67 | <p class="title">二、账户注册</p> | ||
68 | |||
69 | <p> | ||
70 | 1. | ||
71 | 您在使用好记星家长端时可能需要注册一个账户,或者使用我们认可的第三方账户登录,否则我们有权拒绝向您提供服务。 | ||
72 | </p> | ||
73 | |||
74 | <p>2. 账户注册条件:</p> | ||
75 | |||
76 | <p> | ||
77 | (1) | ||
78 | 如您为成年人(即18周岁以上)、法人或其他组织,您应具有完全民事行为能力; | ||
79 | </p> | ||
80 | |||
81 | <p> | ||
82 | (2) | ||
83 | 如果您不具备完全民事行为能力,您在注册、使用好记星家长端前,应事先取得监护人的同意。特别的,如您为未成年人(即未满18周岁,下同),还应遵守本协议有关未成年人使用条款的规定。 | ||
84 | </p> | ||
85 | |||
86 | <p> | ||
87 | (3) | ||
88 | 如您不符合上述任一条件,请您立即停止注册或使用好记星家长端的服务,否则好记星有权随时暂停或终止您的用户资格。 | ||
89 | </p> | ||
90 | |||
91 | <p>3. 完成注册:</p> | ||
92 | |||
93 | <p> | ||
94 | (1) | ||
95 | 您应当按照注册页面的提示,提供真实、完整、准确的信息,您不得使用他人的信息注册账户或向好记星提供其他的虚假信息。 | ||
96 | </p> | ||
97 | |||
98 | <p> | ||
99 | (2) | ||
100 | 好记星家长端账户的所有权归好记星所有,您完成申请注册后,仅获得账户的使用权。 | ||
101 | </p> | ||
102 | |||
103 | <p>4. 信息真实性保证:</p> | ||
104 | |||
105 | <p> | ||
106 | (1) | ||
107 | 如发现您以虚假或不实信息骗取注册,好记星有权不经通知单方采取限期改正、删除资料、限制或暂停使用、冻结或注销账户并终止对您提供部分或全部服务等措施。 | ||
108 | </p> | ||
109 | |||
110 | <p>(2) 您应及时更正不实信息,更新、完善您的相关信息。</p> | ||
111 | |||
112 | <p> | ||
113 | (3) | ||
114 | 如您未及时更正、更新信息导致好记星无法按协议约定向您提供服务,或导致您在使用好记星产品或服务过程中产生任何损失,应由您自行承担。 | ||
115 | </p> | ||
116 | |||
117 | <p> | ||
118 | (4) | ||
119 | 好记星对以上原因造成的服务暂停、终止不承担任何责任,您应当承担一切不利后果。如因此给好记星造成损失的,您应当承担相应的责任。 | ||
120 | </p> | ||
121 | |||
122 | <p class="title">三、账户安全及使用规范</p> | ||
123 | |||
124 | <p> | ||
125 | 1. | ||
126 | 您应当妥善保管自己的账号、密码及其他有效识别信息。因您个人原因导致的账号、密码或其他有效识别信息泄露、丢失或账号和密码被窃取、篡改等导致的一切损失,由您自行承担。您须对使用账号、密码所采取的一切行为负责,好记星不承担任何责任。 | ||
127 | </p> | ||
128 | |||
129 | <p> | ||
130 | 2. | ||
131 | 如您发现账号、密码被他人冒用或盗用,请立即以有效方式通知好记星,要求好记星暂停服务。好记星在采取行动的合理期限内,不对您的损失承担任何责任。 | ||
132 | </p> | ||
133 | |||
134 | <p> | ||
135 | 3. | ||
136 | 您不得将账号、密码以及部分或全部的账户权益转让、出售、出租、出借或分享给他人。如因您将账号、密码以及部分或全部的账户权益转让、出售、出租、出借或分享给他人,导致侵犯或可能侵犯好记星的合法权益或者第三方的个人信息、隐私权等其他合法权益,好记星有权不经通知而限制、冻结、注销您的账户,暂停或终止向您提供本协议项下的部分或全部服务,且无需对为此承担任何责任。 | ||
137 | </p> | ||
138 | |||
139 | <p> | ||
140 | 4. | ||
141 | 通过您的账户扫描、上传、制作、分享的任何信息或作出的任何行为都将视为您本人的行为,您应对该账户下发生所有行为负全部责任。 | ||
142 | </p> | ||
143 | |||
144 | <p> | ||
145 | 5. | ||
146 | 请您在申请注销手机号,或者手机号因其他原因被注销的时候,及时更新好记星家长端账号绑定的手机号。如因您不及时更新好记星家长端账号绑定的手机号信息而导致用户数据泄露或其他个人权益受损,好记星不承担任何责任。 | ||
147 | </p> | ||
148 | |||
149 | <p class="title">四、软件及服务使用规范</p> | ||
150 | |||
151 | <p> | ||
152 | 1. | ||
153 | 好记星给予您一项不可转让、可撤销及非排他性的许可,以使用我们的软件及服务。除另有书面约定,您仅可以为非商业目的在相应的终端设备上安装、使用、运行我们的软件及服务。 | ||
154 | </p> | ||
155 | |||
156 | <p> | ||
157 | 2. | ||
158 | 您可以直接从好记星的网站上获取我们的软件,也可以从得到好记星授权的第三方处获取。如果您从未经好记星授权的第三方获取我们的软件或与该等软件名称相同的安装程序,我们无法保证该软件能够正常使用,并对因此给您造成的损失不予负责。 | ||
159 | </p> | ||
160 | |||
161 | <p> | ||
162 | 3. | ||
163 | 请您正确使用好记星家长端,如您使用好记星家长端APP时产生疑问,您可以直接联系我们,以获取必要的帮助:400-800-3813。因您设置或操作不当造成的损失由您自行承担。 | ||
164 | </p> | ||
165 | |||
166 | <p> | ||
167 | 4. | ||
168 | 您理解并同意,您不得利用好记星家长端扫描、上传、制作、分享、传播含有如下内容的信息: | ||
169 | </p> | ||
170 | |||
171 | <p>(1) 反对中华人民共和国宪法所确定的基本原则的;</p> | ||
172 | |||
173 | <p>(2) 危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;</p> | ||
174 | |||
175 | <p>(3) 损害国家荣誉和利益的;</p> | ||
176 | |||
177 | <p> | ||
178 | (4) | ||
179 | 歪曲、丑化、亵渎、否定英雄烈士事迹和精神,以侮辱、诽谤或者其他方式侵害英雄烈士的姓名、肖像、名誉、荣誉的; | ||
180 | </p> | ||
181 | |||
182 | <p>(5) 宣扬恐怖主义、极端主义或者煽动实施恐怖活动、极端主义活动的;</p> | ||
183 | |||
184 | <p>(6) 煽动民族仇恨、民族歧视,破坏民族团结的;</p> | ||
185 | |||
186 | <p>(7) 破坏国家宗教政策,宣扬邪教和封建迷信的;</p> | ||
187 | |||
188 | <p>(8) 散布谣言,扰乱经济秩序和社会秩序的;</p> | ||
189 | |||
190 | <p>(9) 散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;</p> | ||
191 | |||
192 | <p>(10) 侮辱或者诽谤他人,侵害他人名誉、隐私和其他合法权益的;</p> | ||
193 | |||
194 | <p>(11) 法律、行政法规禁止的其他内容。</p> | ||
195 | |||
196 | <p> | ||
197 | 5. | ||
198 | 好记星有权基于单方独立判断,在认为可能发生危害国家安全、公共安全、社会公共利益、好记星或第三方合法权益等情形时,不经通知而限制、冻结、注销您的账户,暂停或终止向您提供本协议项下的部分或全部服务,并将您的相关数据删除,且无需对您承担任何责任。该等情形包括但不限于: | ||
199 | </p> | ||
200 | |||
201 | <p> | ||
202 | (1) | ||
203 | 您为注册账户而提供的信息不具有真实性、完整性或准确性,包括但不限于盗用他人证件信息注册等; | ||
204 | </p> | ||
205 | |||
206 | <p>(2) 将账户转让、出售、出租、出借或分享给他人使用;</p> | ||
207 | |||
208 | <p>(3) 盗取或非法访问、滥用其他用户账户或账户内的信息;</p> | ||
209 | |||
210 | <p> | ||
211 | (4) | ||
212 | 删除我们的产品所有关于著作权的信息,对我们的产品或服务进行反向工程、反向汇编、反向编译,或者以其他方式尝试发现软件源代码; | ||
213 | </p> | ||
214 | |||
215 | <p> | ||
216 | (5) | ||
217 | 对我们的产品进行商业性复制、更改、修改、挂接运行,或制作任何衍生作品或产品,使用插件、外挂或非经授权的工具接入、干扰、影响我们的产品或服务; | ||
218 | </p> | ||
219 | |||
220 | <p> | ||
221 | (6) | ||
222 | 限制、禁止或通过其它方法干扰、影响他人使用好记星家长端,或干扰网络的正常运行,如发布或传输以下性质的任何信息或软件:包含蠕虫、病毒或其它有害功能,或生成的流量级别可能妨碍其他人使用、发送或检索信息; | ||
223 | </p> | ||
224 | |||
225 | <p>(7) 通过网络爬虫或其他自动方式访问或尝试访问我们的产品或服务;</p> | ||
226 | |||
227 | <p> | ||
228 | (8) | ||
229 | 对我们的产品或服务相关信息内容等数据进行商业性使用、出租、出借、复制、修改、链接、转载、汇编、发表、出版、建立镜像站点等; | ||
230 | </p> | ||
231 | |||
232 | <p> | ||
233 | (9) | ||
234 | 出于恶意进行的任何操作,或可能损害针对我们的产品或服务的任何评级或评论,以及任何可能影响我们的产品或服务完整性或准确性的任何行为; | ||
235 | </p> | ||
236 | |||
237 | <p> | ||
238 | (10) | ||
239 | 侵犯或可能侵犯好记星或任何第三方的知识产权、个人信息、隐私权或其他合法权益; | ||
240 | </p> | ||
241 | |||
242 | <p>(11) 从事违反法律或本协议的其他行为。</p> | ||
243 | |||
244 | <p> | ||
245 | 6. | ||
246 | 您使用好记星家长端发送、上传的任何内容(包括但不限于文档图片、文档信息或其他信息等,以下简称“内容”),无论是公开还是私下传送,均由您承担责任,您保证已拥有必要授权上传内容,不得侵犯他人的知识产权、个人信息、隐私权等合法权益。若因您的行为导致好记星受到损失(包括但不限于损害赔偿、律师费),您同意对该损失承担全部赔偿责任。好记星保留依法对内容进行审核、屏蔽、删除的权利或终止服务的权利。 | ||
247 | </p> | ||
248 | |||
249 | <p> | ||
250 | 7. | ||
251 | 如您在使用好记星家长端的过程中,违反法律的规定或本协议的任何约定,导致好记星、其他用户或任何第三方损失,您应当承担全部的责任,好记星不为此承担任何责任。 | ||
252 | </p> | ||
253 | |||
254 | <p class="title">五、 信息存储及同步</p> | ||
255 | |||
256 | <p> | ||
257 | 1. | ||
258 | 您了解并同意,使用好记星家长端时相关信息将存储于您的终端设备中,占用您终端设备的存储空间。 | ||
259 | </p> | ||
260 | |||
261 | <p>2. 您应根据需要选择在使用本服务时是否设定密码以保护信息安全。</p> | ||
262 | |||
263 | <p> | ||
264 | 3. | ||
265 | 如果您登录您的账户并使用好记星家长端,则您同意导入的信息将会存储于好记星的服务器中。 | ||
266 | </p> | ||
267 | |||
268 | <p> | ||
269 | 4. | ||
270 | 您在登录状态下使用好记星家长端时,如果直接修改终端设备中的信息,该信息可能将会按照最后修改的结果在终端设备和服务器之间同步。在您临时用非本人所有的终端设备使用本服务时,请及时退出登录,并注意对您的设置进行必要调整以免泄漏您或他人的个人信息和隐私。 | ||
271 | </p> | ||
272 | |||
273 | <p> | ||
274 | 5. | ||
275 | 尽管好记星将采取必要措施依法存储您的数据并对其加以保护,我们提醒您仍应通过其他方式自行备份您的数据,我们无法对您未成功存储或自行删除的数据负责。 | ||
276 | </p> | ||
277 | |||
278 | <p class="title"> | ||
279 | 六、数据保护 | ||
280 | 好记星重视对用户信息的保护。《好记星家长端隐私政策》呈现了好记星将如何收集、使用、保存、共享及保护您的信息,详情请参阅《好记星家长端隐私政策》。 | ||
281 | </p> | ||
282 | |||
283 | <p class="title">七、风险自担</p> | ||
284 | |||
285 | <p> | ||
286 | 1. | ||
287 | 好记星将按现有技术水平,尽力保障服务的正确、持续、及时和安全,但我们对无法合理预知和不可控制的意外风险(如计算机病毒、木马或其他恶意程序、黑客攻击,设备、系统、硬件软件和通信线路故障、自然灾害等)、产品技术瑕疵、服务的稳定性以及由此产生的任何损失或损害不作任何形式的保证,亦不负任何赔偿责任,但法律另有规定的除外。 | ||
288 | </p> | ||
289 | |||
290 | <p> | ||
291 | 2. | ||
292 | 我们的产品或服务可能会不时提供更新,您可以自主选择是否接受更新;如果您选择不更新,我们不保证向您提供最新的服务,由此可能带来的任何损失由您自行承担。 | ||
293 | </p> | ||
294 | |||
295 | <p> | ||
296 | 3. | ||
297 | 在适用法律允许的范围内,好记星有权随时自行决定暂停、终止、修改服务,或对部分用户暂停、终止、修改服务,且毋须另行通知。 | ||
298 | </p> | ||
299 | |||
300 | <p> | ||
301 | 4. | ||
302 | 好记星家长端可能会包含至第三方平台或应用的链接、应用程序编程接口或软件开发工具包,好记星提供该等链接的目的仅在于向您提供方便,好记星对此不作任何保证,亦不代表好记星对该等第三方、其产品及服务的任何推荐、支持或授权,您应当自行甄别并自担风险。您在使用上述第三方的任何产品和服务时,应当了解并接受该等第三方的条款和规则。 | ||
303 | </p> | ||
304 | |||
305 | <p> | ||
306 | 5. | ||
307 | 因您自身的原因导致的任何损失或责任,由您自行负责,好记星不承担责任。好记星不承担责任的情形包括但不限于: | ||
308 | </p> | ||
309 | |||
310 | <p> | ||
311 | (1) | ||
312 | 您未按照本协议或好记星不时公布的任何规则进行操作导致的任何损失或责任; | ||
313 | </p> | ||
314 | |||
315 | <p> | ||
316 | (2) | ||
317 | 您未向好记星提供正确的联络方式,未能及时收到好记星相关通知导致的任何损失或责任; | ||
318 | </p> | ||
319 | |||
320 | <p>(3) 其他因您自身原因导致的任何损失或责任。</p> | ||
321 | |||
322 | <p class="title">八、知识产权的保护</p> | ||
323 | |||
324 | <p> | ||
325 | 1. | ||
326 | 好记星向您提供服务过程中使用的所有内容,包括但不限于任何文字、图像、视频、图表、软件、算法及其他材料均为好记星或其他特别注明的权利人所有。好记星及相应权利人并未通过本协议授予您对上述信息和内容的任何其他权利。除非经相应权利人事先书面同意,您不得以任何形式向任何第三方公开发表、传输、复制或以其他方式使用好记星提供的部分或全部信息,不得更改、虚化或删除任何署名、商标、版权标识和/或其他权利声明。 | ||
327 | </p> | ||
328 | |||
329 | <p> | ||
330 | 2. | ||
331 | 尊重知识产权是您应尽的义务,如您有违反,造成好记星或相应权利人损失的,您需要承担损害赔偿责任。 | ||
332 | </p> | ||
333 | |||
334 | <p class="title">九、关于未成年人的使用</p> | ||
335 | |||
336 | <p> | ||
337 | 如果您是未成年人用户,并希望使用好记星家长端,请征得您的监护人的同意,并在您的监护人的指导、监督下使用。此外,您的监护人有责任帮助您正确理解本协议、《好记星家长端隐私政策》以及其它相关法律文件的内容,从而引导您正确使用好记星家长端。 | ||
338 | </p> | ||
339 | |||
340 | <p class="title">十、侵权内容的通知及未侵权通知程序</p> | ||
341 | |||
342 | <p> | ||
343 | 1. | ||
344 | 除了本协议的条款之外,为了保护知识产权及其他合法利益,如果任何个人或机构发现有用户通过使用好记星的服务侵犯了其合法权利或利益,上述任何个人或机构(以下称“投诉方”)需以书面形式向好记星提交侵权通知,且权利人需亲笔签名,若为机构,则需加盖机构公章。侵权通知应包括下列内容: | ||
345 | </p> | ||
346 | |||
347 | <p> | ||
348 | (1) | ||
349 | 投诉方的真实身份信息与详细联系信息,包括姓名、地址、电话号码和电子邮件地址,并附有效身份证明文件的复印件,如身份证、护照(个人),或机构设立证明文件的复印件,如营业执照(机构); | ||
350 | </p> | ||
351 | |||
352 | <p>(2) 涉嫌侵权的信息具体名称和网络地址;</p> | ||
353 | |||
354 | <p> | ||
355 | (3) | ||
356 | 能够初步证明侵权行为的材料,包括但不限于权利人对涉嫌侵权内容拥有商标权、著作权或其他依法可以行使权利的权属证明等; | ||
357 | </p> | ||
358 | |||
359 | <p> | ||
360 | (4) | ||
361 | 在侵权通知中还包括以下声明:“(i)我是涉嫌侵权内容的真实权利人;(ii)我声明侵权通知中的内容真实、准确;并且(iii)我确认如果本侵权通知中的声明不真实、准确,我将承担相应的法律责任”。 | ||
362 | </p> | ||
363 | |||
364 | <p> | ||
365 | 2. | ||
366 | 如果好记星根据侵权通知移除了与您相关内容或链接,您可以以书面形式向好记星提交未侵权通知,并附您本人亲笔签名,若您为机构,则需加盖机构公章。未侵权通知应包括下列内容: | ||
367 | </p> | ||
368 | |||
369 | <p> | ||
370 | (1) | ||
371 | 您的真实身份信息与详细联系信息,包括姓名、地址、电话号码,以及电子邮件地址,并附有效身份证明文件的复印件,如身份证、护照(个人),或机构设立证明文件的复印件,如营业执照(机构); | ||
372 | </p> | ||
373 | |||
374 | <p>(2) 被好记星移除的信息具体名称和网络地址;</p> | ||
375 | |||
376 | <p> | ||
377 | (3) | ||
378 | 能够初步证明未侵权的材料,包括但不限于对涉嫌侵权内容拥有商标权、著作权或其他依法可以行使权利的权属证明等; | ||
379 | </p> | ||
380 | |||
381 | <p> | ||
382 | (4) | ||
383 | 在未侵权通知中还包括以下声明:“(i)我是被投诉涉嫌侵权内容的真实权利人;(ii)我有权提供或传播被投诉涉嫌侵权的内容,我声明本通知中的内容真实、准确;并且(iii)我确认如果本通知中的声明不真实、准确,我将承担相应的法律责任”。 | ||
384 | </p> | ||
385 | |||
386 | <p> | ||
387 | 3. | ||
388 | 对于侵权通知和未侵权通知程序中收集的相关信息,我们将严格遵守个人信息保护的规定,仅用于处理侵权的目的,且除法律另有规定,为将其用于可能的诉讼纠纷,我们将在诉讼时效届满后将上述信息及时删除。 | ||
389 | </p> | ||
390 | |||
391 | <p class="title">十一、商业活动</p> | ||
392 | |||
393 | <p> | ||
394 | 您理解并同意,我们可以在好记星提供的产品或服务中进行下述商业活动:通过好记星家长端APP或手机短信、邮件等合法方式向您发送关于好记星或第三方的商业性广告或其他相关商业信息。 | ||
395 | </p> | ||
396 | |||
397 | <p> | ||
398 | 我们特别提醒您,如果您收到的推送信息是关于第三方而非好记星的,对于此类信息,您应当自行判断其内容的真实性并为自己的判断行为负责。除法律明确规定外,您因此类信息提供的内容而遭受的任何损失或损害,我们均不承担任何责任。 | ||
399 | </p> | ||
400 | |||
401 | <p class="title">十二、其他</p> | ||
402 | |||
403 | <p> | ||
404 | 1. | ||
405 | 如本协议中的任何条款无论因何种原因部分或全部无效或不具有执行力,本协议的其余条款仍应有效且具有约束力,您和好记星均应尽力使该条款设定的本意得到实现。 | ||
406 | </p> | ||
407 | |||
408 | <p>2. 本协议之效力、解释、变更、执行与争议解决均适用中华人民共和国法律。</p> | ||
409 | |||
410 | <p> | ||
411 | 3. | ||
412 | 因本协议所引起的用户与好记星的任何纠纷或争议,双方应尽量友好协商解决;协商不成的,任何一方均可向好记星所在地即上海市徐汇区有管辖权的人民法院提起诉讼。 | ||
413 | </p> | ||
414 | </body> | ||
415 | </html> | ||
416 |
app/src/main/java/com/hjx/parent/AccountActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK; | ||
4 | import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; | ||
5 | |||
3 | import android.app.AlertDialog; | 6 | import android.app.AlertDialog; |
4 | import android.content.DialogInterface; | 7 | import android.content.DialogInterface; |
5 | import android.content.Intent; | 8 | import android.content.Intent; |
6 | import android.graphics.Bitmap; | 9 | import android.graphics.Bitmap; |
7 | import android.net.NetworkRequest; | 10 | import android.net.NetworkRequest; |
8 | import android.net.Uri; | 11 | import android.net.Uri; |
9 | import android.os.Build; | 12 | import android.os.Build; |
10 | import android.os.Bundle; | 13 | import android.os.Bundle; |
11 | import android.os.Environment; | 14 | import android.os.Environment; |
12 | import android.provider.MediaStore; | 15 | import android.provider.MediaStore; |
13 | import android.text.TextUtils; | 16 | import android.text.TextUtils; |
14 | import android.util.Log; | 17 | import android.util.Log; |
15 | import android.view.LayoutInflater; | 18 | import android.view.LayoutInflater; |
16 | import android.view.View; | 19 | import android.view.View; |
17 | import android.widget.ImageView; | 20 | import android.widget.ImageView; |
18 | import android.widget.TextView; | 21 | import android.widget.TextView; |
19 | import android.widget.Toast; | 22 | import android.widget.Toast; |
20 | 23 | ||
21 | import androidx.core.content.FileProvider; | 24 | import androidx.core.content.FileProvider; |
22 | 25 | ||
23 | import com.bumptech.glide.Glide; | 26 | import com.bumptech.glide.Glide; |
24 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | 27 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
25 | import com.bumptech.glide.request.RequestOptions; | 28 | import com.bumptech.glide.request.RequestOptions; |
26 | import com.google.android.material.bottomsheet.BottomSheetDialog; | 29 | import com.google.android.material.bottomsheet.BottomSheetDialog; |
27 | import com.hjq.permissions.OnPermissionCallback; | 30 | import com.hjq.permissions.OnPermissionCallback; |
28 | import com.hjq.permissions.Permission; | 31 | import com.hjq.permissions.Permission; |
29 | import com.hjq.permissions.XXPermissions; | 32 | import com.hjq.permissions.XXPermissions; |
30 | import com.prws.common.base.BaseActivity; | 33 | import com.prws.common.base.BaseActivity; |
31 | import com.prws.common.base.BasePresenter; | 34 | import com.prws.common.base.BasePresenter; |
32 | import com.prws.common.bean.ResponseResult; | 35 | import com.prws.common.bean.ResponseResult; |
33 | import com.prws.common.net.NetWorks; | 36 | import com.prws.common.net.NetWorks; |
34 | import com.prws.common.utils.LogUtil; | 37 | import com.prws.common.utils.LogUtil; |
35 | import com.prws.common.utils.ScreenUtils; | 38 | import com.prws.common.utils.ScreenUtils; |
36 | import com.prws.common.utils.SharedPreferencesUtil; | 39 | import com.prws.common.utils.SharedPreferencesUtil; |
37 | 40 | ||
38 | import org.json.JSONObject; | 41 | import org.json.JSONObject; |
39 | 42 | ||
40 | import java.io.File; | 43 | import java.io.File; |
41 | import java.io.FileOutputStream; | 44 | import java.io.FileOutputStream; |
42 | import java.io.IOException; | 45 | import java.io.IOException; |
43 | import java.util.HashMap; | 46 | import java.util.HashMap; |
44 | import java.util.List; | 47 | import java.util.List; |
45 | import java.util.Map; | 48 | import java.util.Map; |
46 | 49 | ||
47 | import butterknife.BindView; | 50 | import butterknife.BindView; |
48 | import butterknife.OnClick; | 51 | import butterknife.OnClick; |
49 | import io.reactivex.Observer; | 52 | import io.reactivex.Observer; |
50 | import io.reactivex.disposables.Disposable; | 53 | import io.reactivex.disposables.Disposable; |
51 | import okhttp3.ResponseBody; | 54 | import okhttp3.ResponseBody; |
52 | 55 | ||
53 | public class AccountActivity extends BaseActivity { | 56 | public class AccountActivity extends BaseActivity { |
54 | 57 | ||
55 | 58 | ||
56 | @Override | 59 | @Override |
57 | protected int layoutResId() { | 60 | protected int layoutResId() { |
58 | return R.layout.activity_setac; | 61 | return R.layout.activity_setac; |
59 | } | 62 | } |
60 | 63 | ||
61 | @Override | 64 | @Override |
62 | public Object getContract() { | 65 | public Object getContract() { |
63 | return null; | 66 | return null; |
64 | } | 67 | } |
65 | 68 | ||
66 | @Override | 69 | @Override |
67 | public BasePresenter getPresenter() { | 70 | public BasePresenter getPresenter() { |
68 | return null; | 71 | return null; |
69 | } | 72 | } |
70 | 73 | ||
71 | private static int CAMERA_REQUEST_CODE = 343; | 74 | private static int CAMERA_REQUEST_CODE = 343; |
72 | private static int ALBUM_REQUEST_CODE = 456; | 75 | private static int ALBUM_REQUEST_CODE = 456; |
73 | private static int CROP_REQUEST_CODE = 234; | 76 | private static int CROP_REQUEST_CODE = 234; |
74 | private File tempFile; | 77 | private File tempFile; |
75 | private String path; | 78 | private String path; |
76 | TextView tv_6; | 79 | TextView tv_6; |
77 | @BindView(R.id.iv_3) | 80 | @BindView(R.id.iv_3) |
78 | ImageView iv_3; | 81 | ImageView iv_3; |
79 | 82 | ||
80 | @Override | 83 | @Override |
81 | protected void initView() { | 84 | protected void initView() { |
82 | tv_6 = findViewById(R.id.tv_6); | 85 | tv_6 = findViewById(R.id.tv_6); |
83 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); | 86 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); |
84 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); | 87 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); |
85 | if (!TextUtils.isEmpty(photo)) { | 88 | if (!TextUtils.isEmpty(photo)) { |
86 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AccountActivity.this, 45)); | 89 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AccountActivity.this, 45)); |
87 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 90 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
88 | Glide.with(AccountActivity.this).load(photo).apply(options).into(iv_3); | 91 | Glide.with(AccountActivity.this).load(photo).apply(options).into(iv_3); |
89 | } | 92 | } |
90 | if (phone != null && phone.length() > 0) | 93 | if (phone != null && phone.length() > 0) |
91 | tv_6.setText(phone); | 94 | tv_6.setText(phone); |
92 | } | 95 | } |
93 | 96 | ||
94 | @Override | 97 | @Override |
95 | protected void initListener() { | 98 | protected void initListener() { |
96 | findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); | 99 | findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); |
97 | findViewById(R.id.tv_7).setOnClickListener(view -> startActivity(ChangePwdActivity.class)); | 100 | findViewById(R.id.tv_7).setOnClickListener(view -> startActivity(ChangePwdActivity.class)); |
98 | } | 101 | } |
99 | 102 | ||
100 | @Override | 103 | @Override |
101 | protected void initData() { | 104 | protected void initData() { |
102 | 105 | ||
103 | } | 106 | } |
104 | 107 | ||
105 | @Override | 108 | @Override |
106 | public void onNetChanged(int netWorkState) { | 109 | public void onNetChanged(int netWorkState) { |
107 | 110 | ||
108 | } | 111 | } |
109 | 112 | ||
110 | private void uploadAvatar(File file) { | 113 | private void uploadAvatar(File file) { |
111 | 114 | ||
112 | NetWorks.uploadAvatar(file, new Observer<ResponseResult<Map<String, String>>>() { | 115 | NetWorks.uploadAvatar(file, new Observer<ResponseResult<Map<String, String>>>() { |
113 | @Override | 116 | @Override |
114 | public void onSubscribe(Disposable d) { | 117 | public void onSubscribe(Disposable d) { |
115 | 118 | ||
116 | } | 119 | } |
117 | 120 | ||
118 | @Override | 121 | @Override |
119 | public void onNext(ResponseResult<Map<String, String>> responseBody) { | 122 | public void onNext(ResponseResult<Map<String, String>> responseBody) { |
120 | if (responseBody.getData() != null && responseBody.getCode() == 200) { | 123 | if (responseBody.getData() != null && responseBody.getCode() == 200) { |
121 | path = responseBody.getData().get("imageUrl"); | 124 | path = responseBody.getData().get("imageUrl"); |
122 | editUser(path); | 125 | editUser(path); |
123 | } | 126 | } |
124 | } | 127 | } |
125 | 128 | ||
126 | @Override | 129 | @Override |
127 | public void onError(Throwable e) { | 130 | public void onError(Throwable e) { |
128 | e.toString(); | 131 | e.toString(); |
129 | } | 132 | } |
130 | 133 | ||
131 | @Override | 134 | @Override |
132 | public void onComplete() { | 135 | public void onComplete() { |
133 | 136 | ||
134 | } | 137 | } |
135 | }); | 138 | }); |
136 | } | 139 | } |
137 | 140 | ||
138 | public void editUser(String path) { | 141 | public void editUser(String path) { |
139 | Map map = new HashMap(); | 142 | Map map = new HashMap(); |
140 | map.put("userId", SharedPreferencesUtil.getData("userId", "")); | 143 | map.put("userId", SharedPreferencesUtil.getData("userId", "")); |
141 | map.put("photo", path); | 144 | map.put("photo", path); |
142 | 145 | ||
143 | NetWorks.editUser(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { | 146 | NetWorks.editUser(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { |
144 | @Override | 147 | @Override |
145 | public void onSubscribe(Disposable d) { | 148 | public void onSubscribe(Disposable d) { |
146 | 149 | ||
147 | } | 150 | } |
148 | 151 | ||
149 | @Override | 152 | @Override |
150 | public void onNext(ResponseBody responseBody) { | 153 | public void onNext(ResponseBody responseBody) { |
151 | try { | 154 | try { |
152 | String str = responseBody.string().toString(); | 155 | String str = responseBody.string().toString(); |
153 | LogUtil.e(TAG, "----" + str); | 156 | LogUtil.e(TAG, "----" + str); |
154 | JSONObject jo = new JSONObject(str); | 157 | JSONObject jo = new JSONObject(str); |
155 | boolean isSucceed = jo.getBoolean("success"); | 158 | boolean isSucceed = jo.getBoolean("success"); |
156 | if (isSucceed) { | 159 | if (isSucceed) { |
157 | SharedPreferencesUtil.putData("photo", path); | 160 | SharedPreferencesUtil.putData("photo", path); |
158 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AccountActivity.this, 45)); | 161 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AccountActivity.this, 45)); |
159 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 162 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
160 | Glide.with(AccountActivity.this).load(path).apply(options).into(iv_3); | 163 | Glide.with(AccountActivity.this).load(path).apply(options).into(iv_3); |
161 | Toast.makeText(AccountActivity.this, "修改成功", Toast.LENGTH_SHORT).show(); | 164 | Toast.makeText(AccountActivity.this, "修改成功", Toast.LENGTH_SHORT).show(); |
162 | } else { | 165 | } else { |
163 | Toast.makeText(AccountActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); | 166 | Toast.makeText(AccountActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); |
164 | } | 167 | } |
165 | } catch (Exception e) { | 168 | } catch (Exception e) { |
166 | e.printStackTrace(); | 169 | e.printStackTrace(); |
167 | Toast.makeText(AccountActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | 170 | Toast.makeText(AccountActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); |
168 | } | 171 | } |
169 | } | 172 | } |
170 | 173 | ||
171 | @Override | 174 | @Override |
172 | public void onError(Throwable e) { | 175 | public void onError(Throwable e) { |
173 | 176 | ||
174 | } | 177 | } |
175 | 178 | ||
176 | @Override | 179 | @Override |
177 | public void onComplete() { | 180 | public void onComplete() { |
178 | 181 | ||
179 | } | 182 | } |
180 | }); | 183 | }); |
181 | } | 184 | } |
182 | 185 | ||
183 | public File saveImage(String name, Bitmap bmp) { | 186 | public File saveImage(String name, Bitmap bmp) { |
184 | File appDir = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()); | 187 | File appDir = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()); |
185 | if (!appDir.exists()) { | 188 | if (!appDir.exists()) { |
186 | appDir.mkdir(); | 189 | appDir.mkdir(); |
187 | } | 190 | } |
188 | String fileName = name + ".jpg"; | 191 | String fileName = name + ".jpg"; |
189 | File file = new File(appDir, fileName); | 192 | File file = new File(appDir, fileName); |
190 | try { | 193 | try { |
191 | FileOutputStream fos = new FileOutputStream(file); | 194 | FileOutputStream fos = new FileOutputStream(file); |
192 | bmp.compress(Bitmap.CompressFormat.PNG, 100, fos); | 195 | bmp.compress(Bitmap.CompressFormat.PNG, 100, fos); |
193 | fos.flush(); | 196 | fos.flush(); |
194 | fos.close(); | 197 | fos.close(); |
195 | return file; | 198 | return file; |
196 | } catch (IOException e) { | 199 | } catch (IOException e) { |
197 | Log.d("dsadsadsa", e.getLocalizedMessage()); | 200 | Log.d("dsadsadsa", e.getLocalizedMessage()); |
198 | e.printStackTrace(); | 201 | e.printStackTrace(); |
199 | } | 202 | } |
200 | return null; | 203 | return null; |
201 | } | 204 | } |
202 | 205 | ||
203 | @Override | 206 | @Override |
204 | protected void onActivityResult(int requestCode, int resultCode, Intent intent) { | 207 | protected void onActivityResult(int requestCode, int resultCode, Intent intent) { |
205 | super.onActivityResult(requestCode, resultCode, intent); | 208 | super.onActivityResult(requestCode, resultCode, intent); |
206 | if (requestCode == CAMERA_REQUEST_CODE) { | 209 | if (requestCode == CAMERA_REQUEST_CODE) { |
207 | if (resultCode == RESULT_OK) { | 210 | if (resultCode == RESULT_OK) { |
208 | //用相机返回的照片去调用剪裁也需要对Uri进行处理 | 211 | //用相机返回的照片去调用剪裁也需要对Uri进行处理 |
209 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | 212 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
210 | Uri contentUri = FileProvider.getUriForFile(this, | 213 | Uri contentUri = FileProvider.getUriForFile(this, |
211 | this.getPackageName() + ".fileprovider", tempFile); | 214 | this.getPackageName() + ".fileprovider", tempFile); |
212 | cropPhoto(contentUri); | 215 | cropPhoto(contentUri); |
213 | } else { | 216 | } else { |
214 | cropPhoto(Uri.fromFile(tempFile)); | 217 | cropPhoto(Uri.fromFile(tempFile)); |
215 | } | 218 | } |
216 | } | 219 | } |
217 | } else if (requestCode == ALBUM_REQUEST_CODE) { | 220 | } else if (requestCode == ALBUM_REQUEST_CODE) { |
218 | if (resultCode == RESULT_OK) { | 221 | if (resultCode == RESULT_OK) { |
219 | Uri uri = intent.getData(); | 222 | Uri uri = intent.getData(); |
220 | cropPhoto(uri); | 223 | cropPhoto(uri); |
221 | } | 224 | } |
222 | } else if (requestCode == CROP_REQUEST_CODE) { | 225 | } else if (requestCode == CROP_REQUEST_CODE) { |
223 | if (intent == null) { | 226 | if (intent == null) { |
224 | return; | 227 | return; |
225 | } | 228 | } |
226 | Bundle bundle = intent.getExtras(); | 229 | Bundle bundle = intent.getExtras(); |
227 | if (bundle != null) { | 230 | if (bundle != null) { |
228 | //在这里获得了剪裁后的Bitmap对象,可以用于上传 | 231 | //在这里获得了剪裁后的Bitmap对象,可以用于上传 |
229 | Bitmap image = bundle.getParcelable("data"); | 232 | Bitmap image = bundle.getParcelable("data"); |
230 | //设置到ImageView上 | 233 | //设置到ImageView上 |
231 | //也可以进行一些保存、压缩等操作后上传 | 234 | //也可以进行一些保存、压缩等操作后上传 |
232 | File file = saveImage("head_output", image); | 235 | File file = saveImage("head_output", image); |
233 | uploadAvatar(file); | 236 | uploadAvatar(file); |
234 | // Log.d("dsadsadsa",path); | 237 | // Log.d("dsadsadsa",path); |
235 | } | 238 | } |
236 | } | 239 | } |
237 | } | 240 | } |
238 | 241 | ||
239 | private void getPicFromCamera() { | 242 | private void getPicFromCamera() { |
240 | //用于保存调用相机拍照后所生成的文件 | 243 | //用于保存调用相机拍照后所生成的文件 |
241 | tempFile = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg"); | 244 | tempFile = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg"); |
242 | //跳转到调用系统相机 | 245 | //跳转到调用系统相机 |
243 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | 246 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
244 | //判断版本 | 247 | //判断版本 |
245 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //如果在Android7.0以上,使用FileProvider获取Uri | 248 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //如果在Android7.0以上,使用FileProvider获取Uri |
246 | intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); | 249 | intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); |
247 | Uri contentUri = FileProvider.getUriForFile(this, | 250 | Uri contentUri = FileProvider.getUriForFile(this, |
248 | this.getPackageName() + ".fileprovider", tempFile); | 251 | this.getPackageName() + ".fileprovider", tempFile); |
249 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri); | 252 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri); |
250 | } else { //否则使用Uri.fromFile(file)方法获取Uri | 253 | } else { //否则使用Uri.fromFile(file)方法获取Uri |
251 | intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile)); | 254 | intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile)); |
252 | } | 255 | } |
253 | startActivityForResult(intent, CAMERA_REQUEST_CODE); | 256 | startActivityForResult(intent, CAMERA_REQUEST_CODE); |
254 | } | 257 | } |
255 | 258 | ||
256 | private void cropPhoto(Uri uri) { | 259 | private void cropPhoto(Uri uri) { |
257 | Uri contentUri = Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg")); | 260 | Uri contentUri = Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg")); |
258 | Intent intent = new Intent("com.android.camera.action.CROP"); | 261 | Intent intent = new Intent("com.android.camera.action.CROP"); |
259 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | 262 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
260 | //Android 7.0需要临时添加读取Url的权限, 添加此属性是为了解决:调用裁剪框时候提示:图片无法加载或者加载图片失败或者无法加载此图片 | 263 | //Android 7.0需要临时添加读取Url的权限, 添加此属性是为了解决:调用裁剪框时候提示:图片无法加载或者加载图片失败或者无法加载此图片 |
261 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | 264 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
262 | } | 265 | } |
263 | intent.setDataAndType(uri, "image/*"); | 266 | intent.setDataAndType(uri, "image/*"); |
264 | intent.putExtra("crop", "true");//发送裁剪信号,去掉也能进行裁剪 | 267 | intent.putExtra("crop", "true");//发送裁剪信号,去掉也能进行裁剪 |
265 | intent.putExtra("scale", true);// 设置缩放 | 268 | intent.putExtra("scale", true);// 设置缩放 |
266 | intent.putExtra("scaleUpIfNeeded", true);// 去黑边 | 269 | intent.putExtra("scaleUpIfNeeded", true);// 去黑边 |
267 | intent.putExtra("aspectX", 1); | 270 | intent.putExtra("aspectX", 1); |
268 | intent.putExtra("aspectY", 1); | 271 | intent.putExtra("aspectY", 1); |
269 | //上述两个属性控制裁剪框的缩放比例。 | 272 | //上述两个属性控制裁剪框的缩放比例。 |
270 | //当用户用手拉伸裁剪框时候,裁剪框会按照上述比例缩放。 | 273 | //当用户用手拉伸裁剪框时候,裁剪框会按照上述比例缩放。 |
271 | intent.putExtra("outputX", 300);//属性控制裁剪完毕,保存的图片的大小格式。 | 274 | intent.putExtra("outputX", 300);//属性控制裁剪完毕,保存的图片的大小格式。 |
272 | intent.putExtra("outputY", 300);//你按照1:1的比例来裁剪的,如果最后成像是800*400,那么按照2:1的样式保存, | 275 | intent.putExtra("outputY", 300);//你按照1:1的比例来裁剪的,如果最后成像是800*400,那么按照2:1的样式保存, |
273 | intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出裁剪文件的格式 | 276 | intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出裁剪文件的格式 |
274 | intent.putExtra("return-data", true);//是否返回裁剪后图片的Bitmap | 277 | intent.putExtra("return-data", true);//是否返回裁剪后图片的Bitmap |
275 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri);//设置输出路径 | 278 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri);//设置输出路径 |
276 | startActivityForResult(intent, CROP_REQUEST_CODE); | 279 | startActivityForResult(intent, CROP_REQUEST_CODE); |
277 | } | 280 | } |
278 | 281 | ||
279 | /** | 282 | /** |
280 | * 从相册获取图片 | 283 | * 从相册获取图片 |
281 | */ | 284 | */ |
282 | private void getPicFromAlbm() { | 285 | private void getPicFromAlbm() { |
283 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); | 286 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); |
284 | photoPickerIntent.setType("image/*"); | 287 | photoPickerIntent.setType("image/*"); |
285 | startActivityForResult(photoPickerIntent, ALBUM_REQUEST_CODE); | 288 | startActivityForResult(photoPickerIntent, ALBUM_REQUEST_CODE); |
286 | } | 289 | } |
287 | 290 | ||
288 | @OnClick(R.id.iv_3) | 291 | @OnClick(R.id.iv_3) |
289 | public void showButtonDialog(View view) { | 292 | public void showButtonDialog(View view) { |
290 | BottomSheetDialog dialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | 293 | BottomSheetDialog dialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); |
291 | View bottomView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_layout, null); | 294 | View bottomView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_layout, null); |
292 | dialog.setContentView(bottomView); | 295 | dialog.setContentView(bottomView); |
293 | bottomView.findViewById(R.id.take_photo).setOnClickListener(new View.OnClickListener() { | 296 | bottomView.findViewById(R.id.take_photo).setOnClickListener(new View.OnClickListener() { |
294 | @Override | 297 | @Override |
295 | public void onClick(View view) { | 298 | public void onClick(View view) { |
296 | dialog.dismiss(); | 299 | dialog.dismiss(); |
297 | if (!XXPermissions.isGranted(AccountActivity.this, Permission.CAMERA)) { | 300 | if (!XXPermissions.isGranted(AccountActivity.this, Permission.CAMERA)) { |
298 | XXPermissions.with(AccountActivity.this) | 301 | XXPermissions.with(AccountActivity.this) |
299 | // 申请多个权限 | 302 | // 申请多个权限 |
300 | .permission(Permission.CAMERA) | 303 | .permission(Permission.CAMERA) |
301 | .request(new OnPermissionCallback() { | 304 | .request(new OnPermissionCallback() { |
302 | @Override | 305 | @Override |
303 | public void onGranted(List<String> permissions, boolean all) { | 306 | public void onGranted(List<String> permissions, boolean all) { |
304 | if (all) { | 307 | if (all) { |
305 | //开启扫码界面 | 308 | //开启扫码界面 |
306 | getPicFromCamera(); | 309 | getPicFromCamera(); |
307 | } else { | 310 | } else { |
308 | Toast.makeText(AccountActivity.this, "需要相机权限", Toast.LENGTH_SHORT).show(); | 311 | Toast.makeText(AccountActivity.this, "需要相机权限", Toast.LENGTH_SHORT).show(); |
309 | } | 312 | } |
310 | } | 313 | } |
311 | 314 | ||
312 | @Override | 315 | @Override |
313 | public void onDenied(List<String> permissions, boolean never) { | 316 | public void onDenied(List<String> permissions, boolean never) { |
314 | XXPermissions.startPermissionActivity(AccountActivity.this, permissions); | 317 | XXPermissions.startPermissionActivity(AccountActivity.this, permissions); |
315 | } | 318 | } |
316 | }); | 319 | }); |
317 | } else { | 320 | } else { |
318 | getPicFromCamera(); | 321 | getPicFromCamera(); |
319 | } | 322 | } |
320 | } | 323 | } |
321 | }); | 324 | }); |
322 | bottomView.findViewById(R.id.choose_photo).setOnClickListener(new View.OnClickListener() { | 325 | bottomView.findViewById(R.id.choose_photo).setOnClickListener(new View.OnClickListener() { |
323 | @Override | 326 | @Override |
324 | public void onClick(View view) { | 327 | public void onClick(View view) { |
325 | dialog.dismiss(); | 328 | dialog.dismiss(); |
326 | getPicFromAlbm(); | 329 | getPicFromAlbm(); |
327 | } | 330 | } |
328 | }); | 331 | }); |
329 | bottomView.findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() { | 332 | bottomView.findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() { |
330 | @Override | 333 | @Override |
331 | public void onClick(View view) { | 334 | public void onClick(View view) { |
332 | dialog.dismiss(); | 335 | dialog.dismiss(); |
333 | } | 336 | } |
334 | }); | 337 | }); |
335 | dialog.show(); | 338 | dialog.show(); |
336 | } | 339 | } |
337 | 340 | ||
338 | @OnClick(R.id.logout) | 341 | @OnClick(R.id.logout) |
339 | public void logout(View view) { | 342 | public void logout(View view) { |
340 | AlertDialog.Builder builder = new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_Light_Dialog_Alert); | 343 | AlertDialog.Builder builder = new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_Light_Dialog_Alert); |
341 | builder.setTitle("温馨提示"); | 344 | builder.setTitle("温馨提示"); |
342 | builder.setMessage("是否退出登录?"); | 345 | builder.setMessage("是否退出登录?"); |
343 | builder.setCancelable(false); | 346 | builder.setCancelable(false); |
344 | builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { | 347 | builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { |
345 | @Override | 348 | @Override |
346 | public void onClick(DialogInterface dialogInterface, int i) { | 349 | public void onClick(DialogInterface dialogInterface, int i) { |
347 | dialogInterface.dismiss(); | 350 | dialogInterface.dismiss(); |
348 | } | 351 | } |
349 | }); | 352 | }); |
350 | builder.setPositiveButton("确认", new DialogInterface.OnClickListener() { | 353 | builder.setPositiveButton("确认", new DialogInterface.OnClickListener() { |
351 | @Override | 354 | @Override |
352 | public void onClick(DialogInterface dialogInterface, int i) { | 355 | public void onClick(DialogInterface dialogInterface, int i) { |
353 | SharedPreferencesUtil.clear(AccountActivity.this); | 356 | SharedPreferencesUtil.clear(AccountActivity.this); |
354 | dialogInterface.dismiss(); | 357 | restartApp(); |
355 | setResult(1001); | ||
356 | finish(); | ||
357 | } | 358 | } |
358 | }); | 359 | }); |
359 | builder.show(); | 360 | builder.show(); |
360 | } | 361 | } |
361 | 362 | ||
363 | private void restartApp() { | ||
364 | //重启app,这一步一定要加上,如果不重启app,可能打开新的页面显示的语言会不正确 | ||
365 | Intent intent = new Intent(this, LoginActivity.class); | ||
366 | intent.addFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); | ||
367 | startActivity(intent); | ||
368 | android.os.Process.killProcess(android.os.Process.myPid()); | ||
369 | System.exit(0); | ||
370 | } |
app/src/main/java/com/hjx/parent/AddTeacherActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.content.Intent; | 3 | import android.content.Intent; |
4 | import android.graphics.Color; | 4 | import android.graphics.Color; |
5 | import android.text.Editable; | 5 | import android.text.Editable; |
6 | import android.text.TextUtils; | 6 | import android.text.TextUtils; |
7 | import android.text.TextWatcher; | 7 | import android.text.TextWatcher; |
8 | import android.view.View; | 8 | import android.view.View; |
9 | import android.widget.Button; | 9 | import android.widget.Button; |
10 | import android.widget.EditText; | 10 | import android.widget.EditText; |
11 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
12 | import android.widget.RelativeLayout; | 12 | import android.widget.RelativeLayout; |
13 | import android.widget.TextView; | 13 | import android.widget.TextView; |
14 | 14 | ||
15 | import com.bumptech.glide.Glide; | 15 | import com.bumptech.glide.Glide; |
16 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | 16 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
17 | import com.bumptech.glide.request.RequestOptions; | 17 | import com.bumptech.glide.request.RequestOptions; |
18 | import com.google.gson.Gson; | 18 | import com.google.gson.Gson; |
19 | import com.prws.common.base.BaseActivity; | 19 | import com.prws.common.base.BaseActivity; |
20 | import com.prws.common.base.BasePresenter; | 20 | import com.prws.common.base.BasePresenter; |
21 | import com.prws.common.bean.ResponseResult; | 21 | import com.prws.common.bean.ResponseResult; |
22 | import com.prws.common.bean.Teacher; | 22 | import com.prws.common.bean.Teacher; |
23 | import com.prws.common.net.NetWorks; | 23 | import com.prws.common.net.NetWorks; |
24 | import com.prws.common.utils.Common; | 24 | import com.prws.common.utils.Common; |
25 | import com.prws.common.utils.ScreenUtils; | 25 | import com.prws.common.utils.ScreenUtils; |
26 | 26 | ||
27 | import butterknife.BindView; | 27 | import butterknife.BindView; |
28 | import butterknife.OnClick; | 28 | import butterknife.OnClick; |
29 | import io.reactivex.Observer; | 29 | import io.reactivex.Observer; |
30 | import io.reactivex.disposables.Disposable; | 30 | import io.reactivex.disposables.Disposable; |
31 | 31 | ||
32 | public class AddTeacherActivity extends BaseActivity { | 32 | public class AddTeacherActivity extends BaseActivity { |
33 | @BindView(R.id.et_1) | 33 | @BindView(R.id.et_1) |
34 | EditText et_1; | 34 | EditText et_1; |
35 | @BindView(R.id.btn_next) | 35 | @BindView(R.id.btn_next) |
36 | Button btn_next; | 36 | Button btn_next; |
37 | @BindView(R.id.rl_teacher) | 37 | @BindView(R.id.rl_teacher) |
38 | RelativeLayout rl_teacher; | 38 | RelativeLayout rl_teacher; |
39 | @BindView(R.id.iv_teacher) | 39 | @BindView(R.id.iv_teacher) |
40 | ImageView iv_teacher; | 40 | ImageView iv_teacher; |
41 | @BindView(R.id.tv_teacher) | 41 | @BindView(R.id.tv_teacher) |
42 | TextView tv_teacher; | 42 | TextView tv_teacher; |
43 | Teacher teacher; | 43 | Teacher teacher; |
44 | 44 | ||
45 | @Override | 45 | @Override |
46 | protected int layoutResId() { | 46 | protected int layoutResId() { |
47 | return R.layout.activity_add_teacher; | 47 | return R.layout.activity_add_teacher; |
48 | } | 48 | } |
49 | 49 | ||
50 | @Override | 50 | @Override |
51 | public Object getContract() { | 51 | public Object getContract() { |
52 | return null; | 52 | return null; |
53 | } | 53 | } |
54 | 54 | ||
55 | @Override | 55 | @Override |
56 | public BasePresenter getPresenter() { | 56 | public BasePresenter getPresenter() { |
57 | return null; | 57 | return null; |
58 | } | 58 | } |
59 | 59 | ||
60 | @Override | 60 | @Override |
61 | protected void initView() { | 61 | protected void initView() { |
62 | btn_next.setEnabled(false); | 62 | btn_next.setEnabled(false); |
63 | et_1.addTextChangedListener(new TextWatcher() { | 63 | et_1.addTextChangedListener(new TextWatcher() { |
64 | @Override | 64 | @Override |
65 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | 65 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
66 | 66 | ||
67 | } | 67 | } |
68 | 68 | ||
69 | @Override | 69 | @Override |
70 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { | 70 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
71 | 71 | ||
72 | } | 72 | } |
73 | 73 | ||
74 | @Override | 74 | @Override |
75 | public void afterTextChanged(Editable editable) { | 75 | public void afterTextChanged(Editable editable) { |
76 | if (editable.length() == 11) { | 76 | if (editable.length() == 11) { |
77 | if (Common.isValidPhoneNumber(editable.toString())) { | 77 | if (Common.isValidPhoneNumber(editable.toString())) { |
78 | searchTeacher(editable.toString()); | 78 | searchTeacher(editable.toString()); |
79 | } else { | 79 | } else { |
80 | btn_next.setEnabled(false); | 80 | btn_next.setEnabled(false); |
81 | rl_teacher.setVisibility(View.GONE); | 81 | rl_teacher.setVisibility(View.GONE); |
82 | showToast("请输入正确的手机号码"); | 82 | showToast("请输入正确的手机号码"); |
83 | btn_next.setTextColor(Color.parseColor("#999999")); | 83 | btn_next.setTextColor(Color.parseColor("#999999")); |
84 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); | 84 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); |
85 | btn_next.setEnabled(false); | 85 | btn_next.setEnabled(false); |
86 | } | 86 | } |
87 | } else { | 87 | } else { |
88 | btn_next.setEnabled(false); | 88 | btn_next.setEnabled(false); |
89 | rl_teacher.setVisibility(View.GONE); | 89 | rl_teacher.setVisibility(View.GONE); |
90 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); | 90 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn_grad); |
91 | btn_next.setTextColor(Color.parseColor("#999999")); | 91 | btn_next.setTextColor(Color.parseColor("#999999")); |
92 | btn_next.setEnabled(false); | 92 | btn_next.setEnabled(false); |
93 | } | 93 | } |
94 | } | 94 | } |
95 | }); | 95 | }); |
96 | } | 96 | } |
97 | 97 | ||
98 | 98 | ||
99 | public void searchTeacher(String phone) { | 99 | public void searchTeacher(String phone) { |
100 | NetWorks.searchTeacher(phone, new Observer<ResponseResult<Teacher>>() { | 100 | NetWorks.searchTeacher(phone, new Observer<ResponseResult<Teacher>>() { |
101 | @Override | 101 | @Override |
102 | public void onSubscribe(Disposable d) { | 102 | public void onSubscribe(Disposable d) { |
103 | 103 | ||
104 | } | 104 | } |
105 | 105 | ||
106 | @Override | 106 | @Override |
107 | public void onNext(ResponseResult<Teacher> result) { | 107 | public void onNext(ResponseResult<Teacher> result) { |
108 | if (result != null && result.getCode() == 200) { | 108 | if (result != null && result.getCode() == 200) { |
109 | teacher = result.getData(); | 109 | teacher = result.getData(); |
110 | rl_teacher.setVisibility(View.VISIBLE); | 110 | rl_teacher.setVisibility(View.VISIBLE); |
111 | if (!TextUtils.isEmpty(teacher.getPhoto())) { | 111 | if (!TextUtils.isEmpty(teacher.getPhoto())) { |
112 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AddTeacherActivity.this, 20)); | 112 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AddTeacherActivity.this, 20)); |
113 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 113 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
114 | Glide.with(AddTeacherActivity.this).load(teacher.getPhoto()).apply(options).into(iv_teacher); | 114 | Glide.with(AddTeacherActivity.this).load(teacher.getPhoto()).apply(options).into(iv_teacher); |
115 | } else { | 115 | } else { |
116 | iv_teacher.setImageResource(R.mipmap.ic_teacher_male); | 116 | iv_teacher.setImageResource(R.mipmap.ic_teacher_male); |
117 | } | 117 | } |
118 | tv_teacher.setText(teacher.getUserName()); | 118 | tv_teacher.setText(teacher.getUserName()); |
119 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn); | 119 | btn_next.setBackgroundResource(R.drawable.bg_solid_btn); |
120 | btn_next.setTextColor(Color.WHITE); | 120 | btn_next.setTextColor(Color.WHITE); |
121 | btn_next.setEnabled(true); | 121 | btn_next.setEnabled(true); |
122 | } else { | ||
123 | showToast(result.getMsg()); | ||
122 | } | 124 | } |
123 | } | 125 | } |
124 | 126 | ||
125 | @Override | 127 | @Override |
126 | public void onError(Throwable e) { | 128 | public void onError(Throwable e) { |
127 | 129 | ||
128 | } | 130 | } |
129 | 131 | ||
130 | @Override | 132 | @Override |
131 | public void onComplete() { | 133 | public void onComplete() { |
132 | 134 | ||
133 | } | 135 | } |
134 | }); | 136 | }); |
135 | } | 137 | } |
136 | 138 | ||
137 | @OnClick(R.id.btn_next) | 139 | @OnClick(R.id.btn_next) |
138 | public void confirm(View view) { | 140 | public void confirm(View view) { |
139 | Intent intent = new Intent(); | 141 | Intent intent = new Intent(); |
140 | intent.putExtra("teacher", new Gson().toJson(teacher)); | 142 | intent.putExtra("teacher", new Gson().toJson(teacher)); |
141 | setResult(1000, intent); | 143 | setResult(1000, intent); |
142 | finish(); | 144 | finish(); |
143 | } | 145 | } |
144 | 146 | ||
145 | @OnClick(R.id.tv_cancel) | 147 | @OnClick(R.id.tv_cancel) |
146 | public void back(View view) { | 148 | public void back(View view) { |
147 | finish(); | 149 | finish(); |
148 | } | 150 | } |
149 | 151 | ||
150 | @Override | 152 | @Override |
151 | protected void initListener() { | 153 | protected void initListener() { |
152 | 154 | ||
153 | } | 155 | } |
154 | 156 | ||
155 | @Override | 157 | @Override |
156 | protected void initData() { | 158 | protected void initData() { |
157 | 159 | ||
158 | } | 160 | } |
159 | 161 | ||
160 | @Override | 162 | @Override |
161 | public void onNetChanged(int netWorkState) { | 163 | public void onNetChanged(int netWorkState) { |
162 | 164 | ||
163 | } | 165 | } |
164 | 166 | ||
165 | } | 167 | } |
166 | 168 |
app/src/main/java/com/hjx/parent/EditStudentActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.content.DialogInterface; | 3 | import android.content.DialogInterface; |
4 | import android.content.Intent; | 4 | import android.content.Intent; |
5 | import android.graphics.Bitmap; | 5 | import android.graphics.Bitmap; |
6 | import android.graphics.Color; | 6 | import android.graphics.Color; |
7 | import android.net.Uri; | 7 | import android.net.Uri; |
8 | import android.os.Build; | 8 | import android.os.Build; |
9 | import android.os.Bundle; | 9 | import android.os.Bundle; |
10 | import android.os.Environment; | 10 | import android.os.Environment; |
11 | import android.provider.MediaStore; | 11 | import android.provider.MediaStore; |
12 | import android.text.TextUtils; | 12 | import android.text.TextUtils; |
13 | import android.util.Log; | 13 | import android.util.Log; |
14 | import android.view.LayoutInflater; | 14 | import android.view.LayoutInflater; |
15 | import android.view.View; | 15 | import android.view.View; |
16 | import android.widget.Button; | 16 | import android.widget.Button; |
17 | import android.widget.ImageView; | 17 | import android.widget.ImageView; |
18 | import android.widget.LinearLayout; | 18 | import android.widget.LinearLayout; |
19 | import android.widget.RelativeLayout; | 19 | import android.widget.RelativeLayout; |
20 | import android.widget.TextView; | 20 | import android.widget.TextView; |
21 | import android.widget.Toast; | 21 | import android.widget.Toast; |
22 | 22 | ||
23 | import androidx.core.content.FileProvider; | 23 | import androidx.core.content.FileProvider; |
24 | 24 | ||
25 | import com.bumptech.glide.Glide; | 25 | import com.bumptech.glide.Glide; |
26 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | 26 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
27 | import com.bumptech.glide.request.RequestOptions; | 27 | import com.bumptech.glide.request.RequestOptions; |
28 | import com.google.android.material.bottomsheet.BottomSheetDialog; | 28 | import com.google.android.material.bottomsheet.BottomSheetDialog; |
29 | import com.google.gson.Gson; | 29 | import com.google.gson.Gson; |
30 | import com.hjq.permissions.OnPermissionCallback; | 30 | import com.hjq.permissions.OnPermissionCallback; |
31 | import com.hjq.permissions.Permission; | 31 | import com.hjq.permissions.Permission; |
32 | import com.hjq.permissions.XXPermissions; | 32 | import com.hjq.permissions.XXPermissions; |
33 | import com.hjx.parent.bean.StudentBean; | 33 | import com.hjx.parent.bean.StudentBean; |
34 | import com.prws.common.base.BaseActivity; | 34 | import com.prws.common.base.BaseActivity; |
35 | import com.prws.common.base.BasePresenter; | 35 | import com.prws.common.base.BasePresenter; |
36 | import com.prws.common.bean.ResponseResult; | 36 | import com.prws.common.bean.ResponseResult; |
37 | import com.prws.common.bean.Teacher; | 37 | import com.prws.common.bean.Teacher; |
38 | import com.prws.common.net.NetWorks; | 38 | import com.prws.common.net.NetWorks; |
39 | import com.prws.common.utils.LogUtil; | 39 | import com.prws.common.utils.LogUtil; |
40 | import com.prws.common.utils.ScreenUtils; | 40 | import com.prws.common.utils.ScreenUtils; |
41 | import com.prws.common.utils.SharedPreferencesUtil; | 41 | import com.prws.common.utils.SharedPreferencesUtil; |
42 | 42 | ||
43 | import org.json.JSONObject; | 43 | import org.json.JSONObject; |
44 | 44 | ||
45 | import java.io.File; | 45 | import java.io.File; |
46 | import java.io.FileOutputStream; | 46 | import java.io.FileOutputStream; |
47 | import java.io.IOException; | 47 | import java.io.IOException; |
48 | import java.util.HashMap; | 48 | import java.util.HashMap; |
49 | import java.util.List; | 49 | import java.util.List; |
50 | import java.util.Map; | 50 | import java.util.Map; |
51 | 51 | ||
52 | import butterknife.BindView; | 52 | import butterknife.BindView; |
53 | import butterknife.OnClick; | 53 | import butterknife.OnClick; |
54 | import io.reactivex.Observer; | 54 | import io.reactivex.Observer; |
55 | import io.reactivex.disposables.Disposable; | 55 | import io.reactivex.disposables.Disposable; |
56 | 56 | ||
57 | public class EditStudentActivity extends BaseActivity { | 57 | public class EditStudentActivity extends BaseActivity { |
58 | View view_2; | 58 | View view_2; |
59 | View view_3; | 59 | View view_3; |
60 | View view_4; | 60 | View view_4; |
61 | View view_5; | 61 | View view_5; |
62 | Button btn_next; | 62 | Button btn_next; |
63 | TextView tv_name, tv_sex, tv_nian, tv_shen; | 63 | TextView tv_name, tv_sex, tv_nian, tv_shen; |
64 | @BindView(R.id.iv_avatar) | 64 | @BindView(R.id.iv_avatar) |
65 | ImageView iv_avatar; | 65 | ImageView iv_avatar; |
66 | @BindView(R.id.tv_teacher) | 66 | @BindView(R.id.tv_teacher) |
67 | TextView tv_teacher; | 67 | TextView tv_teacher; |
68 | @BindView(R.id.iv_teacher) | 68 | @BindView(R.id.iv_teacher) |
69 | ImageView iv_teacher; | 69 | ImageView iv_teacher; |
70 | @BindView(R.id.rl_teacher) | 70 | @BindView(R.id.rl_teacher) |
71 | RelativeLayout rl_teacher; | 71 | RelativeLayout rl_teacher; |
72 | @BindView(R.id.tv_bind) | 72 | @BindView(R.id.tv_bind) |
73 | TextView tv_bind; | 73 | TextView tv_bind; |
74 | @BindView(R.id.view_6) | 74 | @BindView(R.id.view_6) |
75 | LinearLayout view_6; | 75 | LinearLayout view_6; |
76 | private static int CAMERA_REQUEST_CODE = 343; | 76 | private static int CAMERA_REQUEST_CODE = 343; |
77 | private static int ALBUM_REQUEST_CODE = 456; | 77 | private static int ALBUM_REQUEST_CODE = 456; |
78 | private static int CROP_REQUEST_CODE = 234; | 78 | private static int CROP_REQUEST_CODE = 234; |
79 | 79 | ||
80 | private static int BIND_TEACHER_CODE = 345; | 80 | private static int BIND_TEACHER_CODE = 345; |
81 | private File tempFile; | 81 | private File tempFile; |
82 | private String path; | 82 | private String path; |
83 | StudentBean studentBean; | 83 | StudentBean studentBean; |
84 | private Teacher teacher; | 84 | private Teacher teacher; |
85 | 85 | ||
86 | @Override | 86 | @Override |
87 | protected int layoutResId() { | 87 | protected int layoutResId() { |
88 | return R.layout.activity_edit_stu; | 88 | return R.layout.activity_edit_stu; |
89 | } | 89 | } |
90 | 90 | ||
91 | @Override | 91 | @Override |
92 | public Object getContract() { | 92 | public Object getContract() { |
93 | return null; | 93 | return null; |
94 | } | 94 | } |
95 | 95 | ||
96 | @Override | 96 | @Override |
97 | public BasePresenter getPresenter() { | 97 | public BasePresenter getPresenter() { |
98 | return null; | 98 | return null; |
99 | } | 99 | } |
100 | 100 | ||
101 | @Override | 101 | @Override |
102 | protected void initView() { | 102 | protected void initView() { |
103 | view_2 = findViewById(R.id.view_2); | 103 | view_2 = findViewById(R.id.view_2); |
104 | view_3 = findViewById(R.id.view_3); | 104 | view_3 = findViewById(R.id.view_3); |
105 | view_4 = findViewById(R.id.view_4); | 105 | view_4 = findViewById(R.id.view_4); |
106 | view_5 = findViewById(R.id.view_5); | 106 | view_5 = findViewById(R.id.view_5); |
107 | tv_name = findViewById(R.id.tv_name); | 107 | tv_name = findViewById(R.id.tv_name); |
108 | tv_sex = findViewById(R.id.tv_sex); | 108 | tv_sex = findViewById(R.id.tv_sex); |
109 | tv_nian = findViewById(R.id.tv_nian); | 109 | tv_nian = findViewById(R.id.tv_nian); |
110 | tv_shen = findViewById(R.id.tv_shen); | 110 | tv_shen = findViewById(R.id.tv_shen); |
111 | btn_next = findViewById(R.id.btn_next); | 111 | btn_next = findViewById(R.id.btn_next); |
112 | } | 112 | } |
113 | 113 | ||
114 | @Override | 114 | @Override |
115 | protected void onStart() { | 115 | protected void onStart() { |
116 | super.onStart(); | 116 | super.onStart(); |
117 | String name = (String) SharedPreferencesUtil.getData("setName", ""); | 117 | String name = (String) SharedPreferencesUtil.getData("setName", ""); |
118 | String sex = (String) SharedPreferencesUtil.getData("setSex", ""); | 118 | String sex = (String) SharedPreferencesUtil.getData("setSex", ""); |
119 | String nian = (String) SharedPreferencesUtil.getData("setNian", ""); | 119 | String nian = (String) SharedPreferencesUtil.getData("setNian", ""); |
120 | String shen = (String) SharedPreferencesUtil.getData("setShen", ""); | 120 | String shen = (String) SharedPreferencesUtil.getData("setShen", ""); |
121 | String xueq = (String) SharedPreferencesUtil.getData("setXueq", ""); | 121 | String xueq = (String) SharedPreferencesUtil.getData("setXueq", ""); |
122 | btn_next.setTextColor(Color.WHITE); | 122 | btn_next.setTextColor(Color.WHITE); |
123 | btn_next.setBackground(getResources().getDrawable(R.drawable.bg_solid_btn)); | 123 | btn_next.setBackground(getResources().getDrawable(R.drawable.bg_solid_btn)); |
124 | studentBean = new Gson().fromJson(getIntent().getStringExtra("student"), StudentBean.class); | 124 | studentBean = new Gson().fromJson(getIntent().getStringExtra("student"), StudentBean.class); |
125 | if (name != null && name.length() > 0) { | 125 | if (name != null && name.length() > 0) { |
126 | studentBean.setNickName(name); | 126 | studentBean.setNickName(name); |
127 | } | 127 | } |
128 | if (sex != null && sex.length() > 0) { | 128 | if (sex != null && sex.length() > 0) { |
129 | studentBean.setGender("男".equals(sex) ? 0 : 1); | 129 | studentBean.setGender("男".equals(sex) ? 0 : 1); |
130 | } | 130 | } |
131 | if (nian != null && nian.length() > 0) { | 131 | if (nian != null && nian.length() > 0) { |
132 | studentBean.setGrade(nian); | 132 | studentBean.setGrade(nian); |
133 | studentBean.setGradeId((Integer) SharedPreferencesUtil.getData("grade", 1)); | 133 | studentBean.setGradeId((Integer) SharedPreferencesUtil.getData("grade", 1)); |
134 | } | 134 | } |
135 | if (xueq != null && xueq.length() > 0) { | 135 | if (xueq != null && xueq.length() > 0) { |
136 | studentBean.setTerm(xueq); | 136 | studentBean.setTerm(xueq); |
137 | } | 137 | } |
138 | if (shen != null && shen.length() > 0) { | 138 | if (shen != null && shen.length() > 0) { |
139 | studentBean.setParentIdentity(shen); | 139 | studentBean.setParentIdentity(shen); |
140 | } | 140 | } |
141 | tv_name.setText(studentBean.getNickName()); | 141 | tv_name.setText(studentBean.getNickName()); |
142 | tv_nian.setText(studentBean.getGrade() + studentBean.getTerm()); | 142 | tv_nian.setText(studentBean.getGrade() + studentBean.getTerm()); |
143 | tv_sex.setText(studentBean.getGender() == 0 ? "男" : "女"); | 143 | tv_sex.setText(studentBean.getGender() == 0 ? "男" : "女"); |
144 | tv_shen.setText(studentBean.getParentIdentity()); | 144 | tv_shen.setText(studentBean.getParentIdentity()); |
145 | if (!TextUtils.isEmpty(studentBean.getPhoto())) { | 145 | if (!TextUtils.isEmpty(studentBean.getPhoto())) { |
146 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 45)); | 146 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 45)); |
147 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 147 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
148 | Glide.with(this).load(studentBean.getPhoto()).apply(options).into(iv_avatar); | 148 | Glide.with(this).load(studentBean.getPhoto()).apply(options).into(iv_avatar); |
149 | } else { | 149 | } else { |
150 | iv_avatar.setImageResource(studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | 150 | iv_avatar.setImageResource(studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); |
151 | } | 151 | } |
152 | if (!"虚拟".equals(studentBean.getTeacherIdentity())) { | 152 | if (!"虚拟".equals(studentBean.getTeacherIdentity())) { |
153 | rl_teacher.setVisibility(View.VISIBLE); | 153 | rl_teacher.setVisibility(View.VISIBLE); |
154 | tv_bind.setText("重新绑定"); | 154 | tv_bind.setText("重新绑定"); |
155 | tv_teacher.setText(studentBean.getTeacherName()); | 155 | tv_teacher.setText(studentBean.getTeacherName()); |
156 | if (!TextUtils.isEmpty(studentBean.getTeacherAvatar())) { | 156 | if (!TextUtils.isEmpty(studentBean.getTeacherAvatar())) { |
157 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 25)); | 157 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 25)); |
158 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 158 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
159 | Glide.with(this).load(studentBean.getTeacherAvatar()).apply(options).into(iv_teacher); | 159 | Glide.with(this).load(studentBean.getTeacherAvatar()).apply(options).into(iv_teacher); |
160 | } else { | 160 | } else { |
161 | iv_teacher.setImageResource(studentBean.getSex() == 0 ? R.mipmap.ic_teacher_male : R.mipmap.ic_teacher_female); | 161 | iv_teacher.setImageResource(studentBean.getSex() == 0 ? R.mipmap.ic_teacher_male : R.mipmap.ic_teacher_female); |
162 | } | 162 | } |
163 | } else { | 163 | } else { |
164 | rl_teacher.setVisibility(View.GONE); | 164 | rl_teacher.setVisibility(View.GONE); |
165 | if ((studentBean.getState() != null && studentBean.getState() == 0)) { | 165 | if ((studentBean.getState() != null && studentBean.getState() == 0)) { |
166 | tv_bind.setText("待通过"); | 166 | tv_bind.setText("待通过"); |
167 | tv_bind.setTextColor(Color.parseColor("#FF3737")); | 167 | tv_bind.setTextColor(Color.parseColor("#FF3737")); |
168 | view_6.setEnabled(false); | 168 | view_6.setEnabled(false); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | } | 172 | } |
173 | 173 | ||
174 | @Override | 174 | @Override |
175 | protected void initListener() { | 175 | protected void initListener() { |
176 | view_2.setOnClickListener(view -> startActivity(NickActivity.class)); | 176 | view_2.setOnClickListener(view -> startActivity(NickActivity.class)); |
177 | view_3.setOnClickListener(view -> startActivity(SexActivity.class)); | 177 | view_3.setOnClickListener(view -> startActivity(SexActivity.class)); |
178 | view_4.setOnClickListener(view -> startActivity(NianActivity.class)); | 178 | view_4.setOnClickListener(view -> startActivity(NianActivity.class)); |
179 | view_5.setOnClickListener(view -> startActivity(ShenActivity.class)); | 179 | view_5.setOnClickListener(view -> startActivity(ShenActivity.class)); |
180 | findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); | 180 | findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); |
181 | btn_next.setOnClickListener(view -> { | 181 | btn_next.setOnClickListener(view -> { |
182 | if (teacher != null || !"虚拟".equals(studentBean.getTeacherIdentity()) || (studentBean.getState() != null && studentBean.getState() == 0)) { | 182 | if (teacher != null || !"虚拟".equals(studentBean.getTeacherIdentity()) || (studentBean.getState() != null && studentBean.getState() == 0)) { |
183 | editStudent(); | 183 | editStudent(); |
184 | } else { | 184 | } else { |
185 | showDialog("温馨提示", "您还未绑定老师,是否绑定?", "去绑定", "暂不绑定", new DialogInterface.OnClickListener() { | 185 | showDialog("温馨提示", "您还未绑定老师,是否绑定?", "去绑定", "暂不绑定", new DialogInterface.OnClickListener() { |
186 | @Override | 186 | @Override |
187 | public void onClick(DialogInterface dialogInterface, int i) { | 187 | public void onClick(DialogInterface dialogInterface, int i) { |
188 | dialogInterface.dismiss(); | 188 | dialogInterface.dismiss(); |
189 | showDialog("温馨提示", "您暂未绑定老师,如需绑定老师\n" + "请联系400-800-3813", "确定", "", null, new DialogInterface.OnClickListener() { | 189 | showDialog("温馨提示", "您暂未绑定老师,如需绑定老师\n" + "请联系400-800-3813", "确定", "", null, new DialogInterface.OnClickListener() { |
190 | @Override | 190 | @Override |
191 | public void onClick(DialogInterface dialogInterface, int i) { | 191 | public void onClick(DialogInterface dialogInterface, int i) { |
192 | editStudent(); | 192 | editStudent(); |
193 | } | 193 | } |
194 | }); | 194 | }); |
195 | } | 195 | } |
196 | }, new DialogInterface.OnClickListener() { | 196 | }, new DialogInterface.OnClickListener() { |
197 | @Override | 197 | @Override |
198 | public void onClick(DialogInterface dialogInterface, int i) { | 198 | public void onClick(DialogInterface dialogInterface, int i) { |
199 | Intent intent = new Intent(EditStudentActivity.this, AddTeacherActivity.class); | 199 | Intent intent = new Intent(EditStudentActivity.this, AddTeacherActivity.class); |
200 | startActivityForResult(intent, BIND_TEACHER_CODE); | 200 | startActivityForResult(intent, BIND_TEACHER_CODE); |
201 | } | 201 | } |
202 | }); | 202 | }); |
203 | } | 203 | } |
204 | }); | 204 | }); |
205 | } | 205 | } |
206 | 206 | ||
207 | @OnClick(R.id.view_6) | 207 | @OnClick(R.id.view_6) |
208 | public void toAddTeacher(View view) { | 208 | public void toAddTeacher(View view) { |
209 | Intent intent = new Intent(EditStudentActivity.this, AddTeacherActivity.class); | 209 | Intent intent = new Intent(EditStudentActivity.this, AddTeacherActivity.class); |
210 | startActivityForResult(intent, BIND_TEACHER_CODE); | 210 | startActivityForResult(intent, BIND_TEACHER_CODE); |
211 | } | 211 | } |
212 | 212 | ||
213 | public void editStudent() { | 213 | public void editStudent() { |
214 | Map map = new HashMap(); | 214 | Map map = new HashMap(); |
215 | map.put("nickName", studentBean.getNickName()); | 215 | map.put("nickName", studentBean.getNickName()); |
216 | map.put("gender", studentBean.getGender()); | 216 | map.put("gender", studentBean.getGender()); |
217 | map.put("gradeId", studentBean.getGradeId()); | 217 | map.put("gradeId", studentBean.getGradeId()); |
218 | map.put("parentIdentity", studentBean.getParentIdentity()); | 218 | map.put("parentIdentity", studentBean.getParentIdentity()); |
219 | map.put("term", studentBean.getTerm()); | 219 | map.put("term", studentBean.getTerm()); |
220 | if (teacher != null) { | 220 | if (teacher != null) { |
221 | map.put("teacherId", teacher.getId()); | 221 | map.put("teacherId", teacher.getId()); |
222 | } | 222 | } |
223 | map.put("stuId", studentBean.getStuId()); | 223 | map.put("stuId", studentBean.getStuId()); |
224 | NetWorks.editStudent(NetWorks.getMapRequestBody(map), new Observer<ResponseResult>() { | 224 | NetWorks.editStudent(NetWorks.getMapRequestBody(map), new Observer<ResponseResult>() { |
225 | @Override | 225 | @Override |
226 | public void onSubscribe(Disposable d) { | 226 | public void onSubscribe(Disposable d) { |
227 | 227 | ||
228 | } | 228 | } |
229 | 229 | ||
230 | @Override | 230 | @Override |
231 | public void onNext(ResponseResult responseResult) { | 231 | public void onNext(ResponseResult responseResult) { |
232 | try { | 232 | try { |
233 | boolean isSucceed = responseResult.getSuccess(); | 233 | boolean isSucceed = responseResult.getSuccess(); |
234 | if (isSucceed) { | 234 | if (isSucceed) { |
235 | finish(); | 235 | finish(); |
236 | } else { | 236 | } else { |
237 | Toast.makeText(EditStudentActivity.this, responseResult.getMsg(), Toast.LENGTH_SHORT).show(); | 237 | Toast.makeText(EditStudentActivity.this, responseResult.getMsg(), Toast.LENGTH_SHORT).show(); |
238 | } | 238 | } |
239 | } catch (Exception e) { | 239 | } catch (Exception e) { |
240 | 240 | ||
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | @Override | 244 | @Override |
245 | public void onError(Throwable e) { | 245 | public void onError(Throwable e) { |
246 | 246 | ||
247 | } | 247 | } |
248 | 248 | ||
249 | @Override | 249 | @Override |
250 | public void onComplete() { | 250 | public void onComplete() { |
251 | 251 | ||
252 | } | 252 | } |
253 | }); | 253 | }); |
254 | } | 254 | } |
255 | 255 | ||
256 | @Override | 256 | @Override |
257 | protected void initData() { | 257 | protected void initData() { |
258 | 258 | ||
259 | } | 259 | } |
260 | 260 | ||
261 | @Override | 261 | @Override |
262 | public void onNetChanged(int netWorkState) { | 262 | public void onNetChanged(int netWorkState) { |
263 | 263 | ||
264 | } | 264 | } |
265 | 265 | ||
266 | private void cropPhoto(Uri uri) { | 266 | private void cropPhoto(Uri uri) { |
267 | Uri contentUri = Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg")); | 267 | Uri contentUri = Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg")); |
268 | Intent intent = new Intent("com.android.camera.action.CROP"); | 268 | Intent intent = new Intent("com.android.camera.action.CROP"); |
269 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | 269 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
270 | //Android 7.0需要临时添加读取Url的权限, 添加此属性是为了解决:调用裁剪框时候提示:图片无法加载或者加载图片失败或者无法加载此图片 | 270 | //Android 7.0需要临时添加读取Url的权限, 添加此属性是为了解决:调用裁剪框时候提示:图片无法加载或者加载图片失败或者无法加载此图片 |
271 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | 271 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
272 | } | 272 | } |
273 | intent.setDataAndType(uri, "image/*"); | 273 | intent.setDataAndType(uri, "image/*"); |
274 | intent.putExtra("crop", "true");//发送裁剪信号,去掉也能进行裁剪 | 274 | intent.putExtra("crop", "true");//发送裁剪信号,去掉也能进行裁剪 |
275 | intent.putExtra("scale", true);// 设置缩放 | 275 | intent.putExtra("scale", true);// 设置缩放 |
276 | intent.putExtra("scaleUpIfNeeded", true);// 去黑边 | 276 | intent.putExtra("scaleUpIfNeeded", true);// 去黑边 |
277 | intent.putExtra("aspectX", 1); | 277 | intent.putExtra("aspectX", 1); |
278 | intent.putExtra("aspectY", 1); | 278 | intent.putExtra("aspectY", 1); |
279 | //上述两个属性控制裁剪框的缩放比例。 | 279 | //上述两个属性控制裁剪框的缩放比例。 |
280 | //当用户用手拉伸裁剪框时候,裁剪框会按照上述比例缩放。 | 280 | //当用户用手拉伸裁剪框时候,裁剪框会按照上述比例缩放。 |
281 | intent.putExtra("outputX", 300);//属性控制裁剪完毕,保存的图片的大小格式。 | 281 | intent.putExtra("outputX", 300);//属性控制裁剪完毕,保存的图片的大小格式。 |
282 | intent.putExtra("outputY", 300);//你按照1:1的比例来裁剪的,如果最后成像是800*400,那么按照2:1的样式保存, | 282 | intent.putExtra("outputY", 300);//你按照1:1的比例来裁剪的,如果最后成像是800*400,那么按照2:1的样式保存, |
283 | intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出裁剪文件的格式 | 283 | intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出裁剪文件的格式 |
284 | intent.putExtra("return-data", true);//是否返回裁剪后图片的Bitmap | 284 | intent.putExtra("return-data", true);//是否返回裁剪后图片的Bitmap |
285 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri);//设置输出路径 | 285 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri);//设置输出路径 |
286 | startActivityForResult(intent, CROP_REQUEST_CODE); | 286 | startActivityForResult(intent, CROP_REQUEST_CODE); |
287 | } | 287 | } |
288 | 288 | ||
289 | @Override | 289 | @Override |
290 | protected void onActivityResult(int requestCode, int resultCode, Intent intent) { | 290 | protected void onActivityResult(int requestCode, int resultCode, Intent intent) { |
291 | super.onActivityResult(requestCode, resultCode, intent); | 291 | super.onActivityResult(requestCode, resultCode, intent); |
292 | if (requestCode == CAMERA_REQUEST_CODE) { | 292 | if (requestCode == CAMERA_REQUEST_CODE) { |
293 | if (resultCode == RESULT_OK) { | 293 | if (resultCode == RESULT_OK) { |
294 | //用相机返回的照片去调用剪裁也需要对Uri进行处理 | 294 | //用相机返回的照片去调用剪裁也需要对Uri进行处理 |
295 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | 295 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
296 | Uri contentUri = FileProvider.getUriForFile(this, | 296 | Uri contentUri = FileProvider.getUriForFile(this, |
297 | this.getPackageName() + ".fileprovider", tempFile); | 297 | this.getPackageName() + ".fileprovider", tempFile); |
298 | cropPhoto(contentUri); | 298 | cropPhoto(contentUri); |
299 | } else { | 299 | } else { |
300 | cropPhoto(Uri.fromFile(tempFile)); | 300 | cropPhoto(Uri.fromFile(tempFile)); |
301 | } | 301 | } |
302 | } | 302 | } |
303 | } else if (requestCode == ALBUM_REQUEST_CODE) { | 303 | } else if (requestCode == ALBUM_REQUEST_CODE) { |
304 | if (resultCode == RESULT_OK) { | 304 | if (resultCode == RESULT_OK) { |
305 | Uri uri = intent.getData(); | 305 | Uri uri = intent.getData(); |
306 | cropPhoto(uri); | 306 | cropPhoto(uri); |
307 | } | 307 | } |
308 | } else if (requestCode == CROP_REQUEST_CODE) { | 308 | } else if (requestCode == CROP_REQUEST_CODE) { |
309 | if (intent == null) { | 309 | if (intent == null) { |
310 | return; | 310 | return; |
311 | } | 311 | } |
312 | Bundle bundle = intent.getExtras(); | 312 | Bundle bundle = intent.getExtras(); |
313 | if (bundle != null) { | 313 | if (bundle != null) { |
314 | //在这里获得了剪裁后的Bitmap对象,可以用于上传 | 314 | //在这里获得了剪裁后的Bitmap对象,可以用于上传 |
315 | Bitmap image = bundle.getParcelable("data"); | 315 | Bitmap image = bundle.getParcelable("data"); |
316 | //设置到ImageView上 | 316 | //设置到ImageView上 |
317 | //也可以进行一些保存、压缩等操作后上传 | 317 | //也可以进行一些保存、压缩等操作后上传 |
318 | File file = saveImage("head_output", image); | 318 | File file = saveImage("head_output", image); |
319 | uploadAvatar(file); | 319 | uploadAvatar(file); |
320 | // Log.d("dsadsadsa",path); | 320 | // Log.d("dsadsadsa",path); |
321 | } | 321 | } |
322 | } else if (requestCode == BIND_TEACHER_CODE && resultCode == 1000) { | 322 | } else if (requestCode == BIND_TEACHER_CODE && resultCode == 1000) { |
323 | String t = intent.getStringExtra("teacher"); | 323 | String t = intent.getStringExtra("teacher"); |
324 | teacher = new Gson().fromJson(t, Teacher.class); | 324 | teacher = new Gson().fromJson(t, Teacher.class); |
325 | rl_teacher.setVisibility(View.VISIBLE); | 325 | rl_teacher.setVisibility(View.VISIBLE); |
326 | tv_bind.setText("重新绑定"); | 326 | tv_bind.setText("重新绑定"); |
327 | tv_teacher.setText(teacher.getUserName()); | 327 | tv_teacher.setText(teacher.getUserName()); |
328 | if (!TextUtils.isEmpty(teacher.getPhoto())) { | 328 | if (!TextUtils.isEmpty(teacher.getPhoto())) { |
329 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(EditStudentActivity.this, 20)); | 329 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(EditStudentActivity.this, 20)); |
330 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 330 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
331 | Glide.with(EditStudentActivity.this).load(teacher.getPhoto()).apply(options).into(iv_teacher); | 331 | Glide.with(EditStudentActivity.this).load(teacher.getPhoto()).apply(options).into(iv_teacher); |
332 | } | 332 | } |
333 | } | 333 | } |
334 | } | 334 | } |
335 | 335 | ||
336 | private void uploadAvatar(File file) { | 336 | private void uploadAvatar(File file) { |
337 | NetWorks.uploadStudentAvatar(file, studentBean.getStuId(), new Observer<ResponseResult<Map<String, String>>>() { | 337 | NetWorks.uploadStudentAvatar(file, studentBean.getStuId(), new Observer<ResponseResult<Map<String, String>>>() { |
338 | @Override | 338 | @Override |
339 | public void onSubscribe(Disposable d) { | 339 | public void onSubscribe(Disposable d) { |
340 | 340 | ||
341 | } | 341 | } |
342 | 342 | ||
343 | @Override | 343 | @Override |
344 | public void onNext(ResponseResult<Map<String, String>> responseBody) { | 344 | public void onNext(ResponseResult<Map<String, String>> responseBody) { |
345 | if (responseBody.getData() != null && responseBody.getCode() == 200) { | 345 | if (responseBody.getData() != null && responseBody.getCode() == 200) { |
346 | String filePath = responseBody.getData().get("imageUrl"); | 346 | String filePath = responseBody.getData().get("imageUrl"); |
347 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(EditStudentActivity.this, 45)); | 347 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(EditStudentActivity.this, 45)); |
348 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 348 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
349 | Glide.with(EditStudentActivity.this).load(filePath).apply(options).into(iv_avatar); | 349 | Glide.with(EditStudentActivity.this).load(filePath).apply(options).into(iv_avatar); |
350 | } | 350 | } |
351 | } | 351 | } |
352 | 352 | ||
353 | @Override | 353 | @Override |
354 | public void onError(Throwable e) { | 354 | public void onError(Throwable e) { |
355 | e.toString(); | 355 | e.toString(); |
356 | } | 356 | } |
357 | 357 | ||
358 | @Override | 358 | @Override |
359 | public void onComplete() { | 359 | public void onComplete() { |
360 | 360 | ||
361 | } | 361 | } |
362 | }); | 362 | }); |
363 | } | 363 | } |
364 | 364 | ||
365 | public File saveImage(String name, Bitmap bmp) { | 365 | public File saveImage(String name, Bitmap bmp) { |
366 | File appDir = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()); | 366 | File appDir = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()); |
367 | if (!appDir.exists()) { | 367 | if (!appDir.exists()) { |
368 | appDir.mkdir(); | 368 | appDir.mkdir(); |
369 | } | 369 | } |
370 | String fileName = name + ".jpg"; | 370 | String fileName = name + ".jpg"; |
371 | File file = new File(appDir, fileName); | 371 | File file = new File(appDir, fileName); |
372 | try { | 372 | try { |
373 | FileOutputStream fos = new FileOutputStream(file); | 373 | FileOutputStream fos = new FileOutputStream(file); |
374 | bmp.compress(Bitmap.CompressFormat.PNG, 100, fos); | 374 | bmp.compress(Bitmap.CompressFormat.PNG, 100, fos); |
375 | fos.flush(); | 375 | fos.flush(); |
376 | fos.close(); | 376 | fos.close(); |
377 | return file; | 377 | return file; |
378 | } catch (IOException e) { | 378 | } catch (IOException e) { |
379 | Log.d("dsadsadsa", e.getLocalizedMessage()); | 379 | Log.d("dsadsadsa", e.getLocalizedMessage()); |
380 | e.printStackTrace(); | 380 | e.printStackTrace(); |
381 | } | 381 | } |
382 | return null; | 382 | return null; |
383 | } | 383 | } |
384 | 384 | ||
385 | private void getPicFromCamera() { | 385 | private void getPicFromCamera() { |
386 | //用于保存调用相机拍照后所生成的文件 | 386 | //用于保存调用相机拍照后所生成的文件 |
387 | tempFile = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg"); | 387 | tempFile = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg"); |
388 | //跳转到调用系统相机 | 388 | //跳转到调用系统相机 |
389 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | 389 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
390 | //判断版本 | 390 | //判断版本 |
391 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //如果在Android7.0以上,使用FileProvider获取Uri | 391 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //如果在Android7.0以上,使用FileProvider获取Uri |
392 | intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); | 392 | intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); |
393 | Uri contentUri = FileProvider.getUriForFile(this, | 393 | Uri contentUri = FileProvider.getUriForFile(this, |
394 | this.getPackageName() + ".fileprovider", tempFile); | 394 | this.getPackageName() + ".fileprovider", tempFile); |
395 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri); | 395 | intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri); |
396 | } else { //否则使用Uri.fromFile(file)方法获取Uri | 396 | } else { //否则使用Uri.fromFile(file)方法获取Uri |
397 | intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile)); | 397 | intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile)); |
398 | } | 398 | } |
399 | startActivityForResult(intent, CAMERA_REQUEST_CODE); | 399 | startActivityForResult(intent, CAMERA_REQUEST_CODE); |
400 | } | 400 | } |
401 | 401 | ||
402 | /** | 402 | /** |
403 | * 从相册获取图片 | 403 | * 从相册获取图片 |
404 | */ | 404 | */ |
405 | private void getPicFromAlbm() { | 405 | private void getPicFromAlbm() { |
406 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); | 406 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); |
407 | photoPickerIntent.setType("image/*"); | 407 | photoPickerIntent.setType("image/*"); |
408 | startActivityForResult(photoPickerIntent, ALBUM_REQUEST_CODE); | 408 | startActivityForResult(photoPickerIntent, ALBUM_REQUEST_CODE); |
409 | } | 409 | } |
410 | 410 | ||
411 | @Override | 411 | @Override |
412 | protected void onDestroy() { | 412 | protected void onDestroy() { |
413 | super.onDestroy(); | 413 | super.onDestroy(); |
414 | SharedPreferencesUtil.putData("setName", ""); | 414 | SharedPreferencesUtil.putData("setName", ""); |
415 | SharedPreferencesUtil.putData("setSex", ""); | 415 | SharedPreferencesUtil.putData("setSex", ""); |
416 | SharedPreferencesUtil.putData("setNian", ""); | 416 | SharedPreferencesUtil.putData("setNian", ""); |
417 | SharedPreferencesUtil.putData("setShen", ""); | 417 | SharedPreferencesUtil.putData("setShen", ""); |
418 | SharedPreferencesUtil.putData("setXueq", ""); | 418 | SharedPreferencesUtil.putData("setXueq", ""); |
419 | SharedPreferencesUtil.putData("grade", 0); | 419 | SharedPreferencesUtil.putData("grade", 0); |
420 | } | 420 | } |
421 | 421 | ||
422 | @OnClick(R.id.iv_avatar) | 422 | @OnClick(R.id.iv_avatar) |
423 | public void showButtonDialog(View view) { | 423 | public void showButtonDialog(View view) { |
424 | BottomSheetDialog dialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | 424 | BottomSheetDialog dialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); |
425 | View bottomView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_layout, null); | 425 | View bottomView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_layout, null); |
426 | dialog.setContentView(bottomView); | 426 | dialog.setContentView(bottomView); |
427 | bottomView.findViewById(R.id.take_photo).setOnClickListener(new View.OnClickListener() { | 427 | bottomView.findViewById(R.id.take_photo).setOnClickListener(new View.OnClickListener() { |
428 | @Override | 428 | @Override |
429 | public void onClick(View view) { | 429 | public void onClick(View view) { |
430 | dialog.dismiss(); | 430 | dialog.dismiss(); |
431 | if (!XXPermissions.isGranted(EditStudentActivity.this, Permission.CAMERA)) { | 431 | if (!XXPermissions.isGranted(EditStudentActivity.this, Permission.CAMERA)) { |
432 | XXPermissions.with(EditStudentActivity.this) | 432 | XXPermissions.with(EditStudentActivity.this) |
433 | // 申请多个权限 | 433 | // 申请多个权限 |
434 | .permission(Permission.CAMERA) | 434 | .permission(Permission.CAMERA) |
435 | .request(new OnPermissionCallback() { | 435 | .request(new OnPermissionCallback() { |
436 | @Override | 436 | @Override |
437 | public void onGranted(List<String> permissions, boolean all) { | 437 | public void onGranted(List<String> permissions, boolean all) { |
438 | if (all) { | 438 | if (all) { |
439 | //开启扫码界面 | 439 | //开启扫码界面 |
440 | getPicFromCamera(); | 440 | getPicFromCamera(); |
441 | } else { | 441 | } else { |
442 | Toast.makeText(EditStudentActivity.this, "需要相机权限", Toast.LENGTH_SHORT).show(); | 442 | Toast.makeText(EditStudentActivity.this, "需要相机权限", Toast.LENGTH_SHORT).show(); |
443 | } | 443 | } |
444 | } | 444 | } |
445 | 445 | ||
446 | @Override | 446 | @Override |
447 | public void onDenied(List<String> permissions, boolean never) { | 447 | public void onDenied(List<String> permissions, boolean never) { |
448 | XXPermissions.startPermissionActivity(EditStudentActivity.this, permissions); | 448 | XXPermissions.startPermissionActivity(EditStudentActivity.this, permissions); |
449 | } | 449 | } |
450 | }); | 450 | }); |
451 | } else { | 451 | } else { |
452 | getPicFromCamera(); | 452 | getPicFromCamera(); |
453 | } | 453 | } |
454 | 454 | ||
455 | } | 455 | } |
456 | }); | 456 | }); |
457 | bottomView.findViewById(R.id.choose_photo).setOnClickListener(new View.OnClickListener() { | 457 | bottomView.findViewById(R.id.choose_photo).setOnClickListener(new View.OnClickListener() { |
458 | @Override | 458 | @Override |
459 | public void onClick(View view) { | 459 | public void onClick(View view) { |
460 | dialog.dismiss(); | 460 | dialog.dismiss(); |
461 | getPicFromAlbm(); | 461 | getPicFromAlbm(); |
462 | } | 462 | } |
463 | }); | 463 | }); |
464 | bottomView.findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() { | 464 | bottomView.findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() { |
465 | @Override | 465 | @Override |
466 | public void onClick(View view) { | 466 | public void onClick(View view) { |
467 | dialog.dismiss(); | 467 | dialog.dismiss(); |
468 | } | 468 | } |
469 | }); | 469 | }); |
470 | dialog.show(); | 470 | dialog.show(); |
471 | } | 471 | } |
472 | |||
473 | |||
472 | } | 474 | } |
473 | 475 |
app/src/main/java/com/hjx/parent/LoginActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.content.Intent; | 3 | import android.content.Intent; |
4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
5 | import android.telephony.PhoneNumberUtils; | 5 | import android.telephony.PhoneNumberUtils; |
6 | import android.text.InputType; | 6 | import android.text.InputType; |
7 | import android.text.TextUtils; | 7 | import android.text.TextUtils; |
8 | import android.text.method.HideReturnsTransformationMethod; | ||
9 | import android.text.method.PasswordTransformationMethod; | ||
8 | import android.widget.Button; | 10 | import android.widget.Button; |
9 | import android.widget.CheckBox; | 11 | import android.widget.CheckBox; |
10 | import android.widget.EditText; | 12 | import android.widget.EditText; |
11 | import android.widget.ImageView; | 13 | import android.widget.ImageView; |
12 | import android.widget.TextView; | 14 | import android.widget.TextView; |
13 | import android.widget.Toast; | 15 | import android.widget.Toast; |
14 | 16 | ||
15 | import androidx.appcompat.app.AppCompatActivity; | 17 | import androidx.appcompat.app.AppCompatActivity; |
16 | 18 | ||
17 | import com.prws.common.base.BaseActivity; | 19 | import com.prws.common.base.BaseActivity; |
18 | import com.prws.common.base.BasePresenter; | 20 | import com.prws.common.base.BasePresenter; |
19 | import com.prws.common.bean.BaseEntity; | 21 | import com.prws.common.bean.BaseEntity; |
20 | import com.prws.common.net.NetWorks; | 22 | import com.prws.common.net.NetWorks; |
21 | import com.prws.common.utils.LogUtil; | 23 | import com.prws.common.utils.LogUtil; |
22 | import com.prws.common.utils.SharedPreferencesUtil; | 24 | import com.prws.common.utils.SharedPreferencesUtil; |
23 | import com.prws.common.utils.acmanager.ActivityManager; | 25 | import com.prws.common.utils.acmanager.ActivityManager; |
24 | 26 | ||
25 | import org.json.JSONObject; | 27 | import org.json.JSONObject; |
26 | 28 | ||
27 | import java.io.IOException; | 29 | import java.io.IOException; |
28 | import java.util.HashMap; | 30 | import java.util.HashMap; |
29 | import java.util.Map; | 31 | import java.util.Map; |
30 | 32 | ||
31 | import io.reactivex.Observer; | 33 | import io.reactivex.Observer; |
32 | import io.reactivex.disposables.Disposable; | 34 | import io.reactivex.disposables.Disposable; |
33 | import okhttp3.ResponseBody; | 35 | import okhttp3.ResponseBody; |
34 | 36 | ||
35 | 37 | ||
36 | public class LoginActivity extends BaseActivity { | 38 | public class LoginActivity extends BaseActivity { |
37 | 39 | ||
38 | 40 | ||
39 | EditText et_phone; | 41 | EditText et_phone; |
40 | EditText et_pwd; | 42 | EditText et_pwd; |
41 | ImageView iv_show; | 43 | ImageView iv_show; |
42 | ImageView iv_delete; | 44 | ImageView iv_delete; |
43 | Button btn_login; | 45 | Button btn_login; |
44 | TextView tv_reg; | 46 | TextView tv_reg; |
45 | CheckBox cb_1; | 47 | CheckBox cb_1; |
46 | TextView tv_user; | 48 | TextView tv_user; |
47 | TextView tv_ys; | 49 | TextView tv_ys; |
48 | 50 | ||
49 | 51 | ||
50 | @Override | 52 | @Override |
51 | protected int layoutResId() { | 53 | protected int layoutResId() { |
52 | return R.layout.activity_login; | 54 | return R.layout.activity_login; |
53 | } | 55 | } |
54 | 56 | ||
55 | @Override | 57 | @Override |
56 | public Object getContract() { | 58 | public Object getContract() { |
57 | return null; | 59 | return null; |
58 | } | 60 | } |
59 | 61 | ||
60 | @Override | 62 | @Override |
61 | public BasePresenter getPresenter() { | 63 | public BasePresenter getPresenter() { |
62 | return null; | 64 | return null; |
63 | } | 65 | } |
64 | 66 | ||
65 | 67 | ||
66 | @Override | 68 | @Override |
67 | protected void initView() { | 69 | protected void initView() { |
68 | et_phone = findViewById(R.id.et_phone); | 70 | et_phone = findViewById(R.id.et_phone); |
69 | et_pwd = findViewById(R.id.et_pwd); | 71 | et_pwd = findViewById(R.id.et_pwd); |
70 | iv_show = findViewById(R.id.iv_4); | 72 | iv_show = findViewById(R.id.iv_4); |
71 | iv_delete = findViewById(R.id.iv_2); | 73 | iv_delete = findViewById(R.id.iv_2); |
72 | btn_login = findViewById(R.id.btn_1); | 74 | btn_login = findViewById(R.id.btn_1); |
73 | tv_reg = findViewById(R.id.tv_2); | 75 | tv_reg = findViewById(R.id.tv_2); |
74 | cb_1 = findViewById(R.id.cb_1); | 76 | cb_1 = findViewById(R.id.cb_1); |
75 | tv_user = findViewById(R.id.tv_4); | 77 | tv_user = findViewById(R.id.tv_4); |
76 | tv_ys = findViewById(R.id.tv_6); | 78 | tv_ys = findViewById(R.id.tv_6); |
77 | 79 | ||
78 | 80 | ||
79 | String student = (String) SharedPreferencesUtil.getData("student", ""); | 81 | String student = (String) SharedPreferencesUtil.getData("student", ""); |
80 | 82 | ||
81 | if (!TextUtils.isEmpty(student)) { | 83 | if (!TextUtils.isEmpty(student)) { |
82 | LogUtil.e(TAG, "role 不是空----"); | 84 | LogUtil.e(TAG, "role 不是空----"); |
83 | Intent intent = new Intent(this, MainActivity.class); | 85 | Intent intent = new Intent(this, MainActivity.class); |
84 | startActivity(intent); | 86 | startActivity(intent); |
85 | finish(); | 87 | finish(); |
86 | return; | 88 | return; |
87 | } else { | 89 | } else { |
88 | LogUtil.e(TAG, "role 是空----"); | 90 | LogUtil.e(TAG, "role 是空----"); |
89 | } | 91 | } |
90 | 92 | ||
91 | 93 | ||
92 | } | 94 | } |
93 | 95 | ||
94 | @Override | 96 | @Override |
95 | protected void initListener() { | 97 | protected void initListener() { |
96 | iv_delete.setOnClickListener(view -> { | 98 | iv_delete.setOnClickListener(view -> { |
97 | et_phone.setText(""); | 99 | et_phone.setText(""); |
98 | }); | 100 | }); |
99 | iv_show.setOnClickListener(view -> { | 101 | iv_show.setOnClickListener(view -> { |
100 | if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { | 102 | if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { |
101 | iv_show.setBackgroundResource(R.mipmap.yc); | 103 | iv_show.setBackgroundResource(R.mipmap.yc); |
102 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); | 104 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); |
105 | et_pwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); | ||
103 | } else { | 106 | } else { |
104 | iv_show.setBackgroundResource(R.mipmap.xs); | 107 | iv_show.setBackgroundResource(R.mipmap.xs); |
105 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); | 108 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); |
109 | et_pwd.setTransformationMethod(PasswordTransformationMethod.getInstance()); | ||
106 | } | 110 | } |
107 | }); | 111 | }); |
108 | 112 | ||
109 | 113 | ||
110 | btn_login.setOnClickListener(view -> { | 114 | btn_login.setOnClickListener(view -> { |
111 | 115 | ||
112 | String phone = et_phone.getText().toString().trim(); | 116 | String phone = et_phone.getText().toString().trim(); |
113 | String pwd = et_pwd.getText().toString().trim(); | 117 | String pwd = et_pwd.getText().toString().trim(); |
114 | if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0) { | 118 | if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0) { |
115 | Toast.makeText(this, "手机号以及密码不能为空", Toast.LENGTH_SHORT).show(); | 119 | Toast.makeText(this, "手机号以及密码不能为空", Toast.LENGTH_SHORT).show(); |
116 | return; | 120 | return; |
117 | } | 121 | } |
118 | 122 | ||
119 | if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())) { | 123 | if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())) { |
120 | Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_SHORT).show(); | 124 | Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_SHORT).show(); |
121 | return; | 125 | return; |
122 | } | 126 | } |
123 | 127 | ||
124 | if (!cb_1.isChecked()) { | 128 | if (!cb_1.isChecked()) { |
125 | Toast.makeText(this, "请勾选协议", Toast.LENGTH_SHORT).show(); | 129 | Toast.makeText(this, "请勾选协议", Toast.LENGTH_SHORT).show(); |
126 | return; | 130 | return; |
127 | } | 131 | } |
128 | 132 | ||
129 | login(phone, pwd); | 133 | login(phone, pwd); |
130 | 134 | ||
131 | }); | 135 | }); |
132 | 136 | ||
133 | tv_reg.setOnClickListener(view -> { | 137 | tv_reg.setOnClickListener(view -> { |
134 | startActivity(RegisterActivity.class); | 138 | startActivity(RegisterActivity.class); |
135 | finish(); | 139 | finish(); |
136 | }); | 140 | }); |
137 | 141 | ||
138 | tv_ys.setOnClickListener(view -> { | 142 | tv_ys.setOnClickListener(view -> { |
139 | startActivity(YinsiActivity.class); | 143 | startActivity(YinsiActivity.class); |
140 | }); | 144 | }); |
141 | tv_user.setOnClickListener(view -> { | 145 | tv_user.setOnClickListener(view -> { |
142 | startActivity(UserActivity.class); | 146 | startActivity(UserAgreementActivity.class); |
143 | }); | 147 | }); |
144 | } | 148 | } |
145 | 149 | ||
146 | public void login(final String phone, String pwd) { | 150 | public void login(final String phone, String pwd) { |
147 | 151 | ||
148 | Map map = new HashMap(); | 152 | Map map = new HashMap(); |
149 | map.put("username", phone); | 153 | map.put("username", phone); |
150 | map.put("password", pwd); | 154 | map.put("password", pwd); |
151 | 155 | ||
152 | 156 | ||
153 | NetWorks.login(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { | 157 | NetWorks.login(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { |
154 | @Override | 158 | @Override |
155 | public void onSubscribe(Disposable d) { | 159 | public void onSubscribe(Disposable d) { |
156 | 160 | ||
157 | } | 161 | } |
158 | 162 | ||
159 | @Override | 163 | @Override |
160 | public void onNext(ResponseBody responseBody) { | 164 | public void onNext(ResponseBody responseBody) { |
161 | try { | 165 | try { |
162 | String str = responseBody.string().toString(); | 166 | String str = responseBody.string().toString(); |
163 | LogUtil.e(TAG, "----" + str); | 167 | LogUtil.e(TAG, "----" + str); |
164 | JSONObject jo = new JSONObject(str); | 168 | JSONObject jo = new JSONObject(str); |
165 | boolean isSucceed = jo.getBoolean("success"); | 169 | boolean isSucceed = jo.getBoolean("success"); |
166 | if (isSucceed) { | 170 | if (isSucceed) { |
167 | JSONObject jo2 = jo.getJSONObject("data"); | 171 | JSONObject jo2 = jo.getJSONObject("data"); |
168 | SharedPreferencesUtil.putData("phone", phone); | 172 | SharedPreferencesUtil.putData("phone", phone); |
169 | SharedPreferencesUtil.putData("role", jo2.getString("role")); | 173 | SharedPreferencesUtil.putData("role", jo2.getString("role")); |
170 | SharedPreferencesUtil.putData("userId", jo2.getString("userId")); | 174 | SharedPreferencesUtil.putData("userId", jo2.getString("userId")); |
171 | SharedPreferencesUtil.putData("token", jo2.getString("token")); | 175 | SharedPreferencesUtil.putData("token", jo2.getString("token")); |
172 | JSONObject user = new JSONObject(jo2.getString("user")); | 176 | JSONObject user = new JSONObject(jo2.getString("user")); |
173 | SharedPreferencesUtil.putData("photo", user.getString("photo")); | 177 | SharedPreferencesUtil.putData("photo", user.getString("photo")); |
174 | startActivity(ChooseActivity.class); | 178 | startActivity(ChooseActivity.class); |
175 | finish(); | 179 | finish(); |
176 | } else { | 180 | } else { |
177 | Toast.makeText(LoginActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); | 181 | Toast.makeText(LoginActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); |
178 | } | 182 | } |
179 | } catch (Exception e) { | 183 | } catch (Exception e) { |
180 | e.printStackTrace(); | 184 | e.printStackTrace(); |
181 | Toast.makeText(LoginActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | 185 | Toast.makeText(LoginActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); |
182 | } | 186 | } |
183 | } | 187 | } |
184 | 188 | ||
185 | @Override | 189 | @Override |
186 | public void onError(Throwable e) { | 190 | public void onError(Throwable e) { |
187 | 191 | ||
188 | } | 192 | } |
189 | 193 | ||
190 | @Override | 194 | @Override |
191 | public void onComplete() { | 195 | public void onComplete() { |
192 | 196 | ||
193 | } | 197 | } |
194 | }); | 198 | }); |
195 | } | 199 | } |
196 | 200 | ||
197 | 201 | ||
198 | @Override | 202 | @Override |
199 | protected void initData() { | 203 | protected void initData() { |
200 | 204 | ||
201 | } | 205 | } |
202 | 206 | ||
203 | @Override | 207 | @Override |
204 | public void onNetChanged(int netWorkState) { | 208 | public void onNetChanged(int netWorkState) { |
205 | 209 | ||
206 | } | 210 | } |
207 | } | 211 | } |
app/src/main/java/com/hjx/parent/NickActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.widget.EditText; | 3 | import android.widget.EditText; |
4 | import android.widget.TextView; | 4 | import android.widget.TextView; |
5 | import android.widget.Toast; | 5 | import android.widget.Toast; |
6 | 6 | ||
7 | import com.prws.common.base.BaseActivity; | 7 | import com.prws.common.base.BaseActivity; |
8 | import com.prws.common.base.BasePresenter; | 8 | import com.prws.common.base.BasePresenter; |
9 | import com.prws.common.utils.SharedPreferencesUtil; | 9 | import com.prws.common.utils.SharedPreferencesUtil; |
10 | 10 | ||
11 | public class NickActivity extends BaseActivity { | 11 | public class NickActivity extends BaseActivity { |
12 | @Override | 12 | @Override |
13 | protected int layoutResId() { | 13 | protected int layoutResId() { |
14 | return R.layout.activity_set_nick; | 14 | return R.layout.activity_set_nick; |
15 | } | 15 | } |
16 | 16 | ||
17 | @Override | 17 | @Override |
18 | public Object getContract() { | 18 | public Object getContract() { |
19 | return null; | 19 | return null; |
20 | } | 20 | } |
21 | 21 | ||
22 | @Override | 22 | @Override |
23 | public BasePresenter getPresenter() { | 23 | public BasePresenter getPresenter() { |
24 | return null; | 24 | return null; |
25 | } | 25 | } |
26 | 26 | ||
27 | EditText et_1; | 27 | EditText et_1; |
28 | 28 | ||
29 | @Override | 29 | @Override |
30 | protected void initView() { | 30 | protected void initView() { |
31 | et_1 = findViewById(R.id.et_1); | 31 | et_1 = findViewById(R.id.et_1); |
32 | findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); | 32 | findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); |
33 | findViewById(R.id.tv_ok).setOnClickListener(view -> { | 33 | findViewById(R.id.tv_ok).setOnClickListener(view -> { |
34 | String name = et_1.getText().toString().trim(); | 34 | String name = et_1.getText().toString().trim(); |
35 | if (name != null && name.length() > 0){ | 35 | if (name != null && name.length() > 0){ |
36 | SharedPreferencesUtil.putData("setName",name); | 36 | if(name.length()>1&&name.length()<11) { |
37 | finish(); | 37 | SharedPreferencesUtil.putData("setName", name); |
38 | finish(); | ||
39 | }else{ | ||
40 | showToast("请设置2-10个字符"); | ||
41 | } | ||
38 | }else { | 42 | }else { |
39 | Toast.makeText(this,"请设置昵称",Toast.LENGTH_SHORT).show(); | 43 | Toast.makeText(this,"请设置昵称",Toast.LENGTH_SHORT).show(); |
40 | } | 44 | } |
41 | }); | 45 | }); |
42 | } | 46 | } |
43 | 47 | ||
44 | @Override | 48 | @Override |
45 | protected void initListener() { | 49 | protected void initListener() { |
46 | 50 | ||
47 | } | 51 | } |
48 | 52 | ||
49 | @Override | 53 | @Override |
50 | protected void initData() { | 54 | protected void initData() { |
51 | 55 | ||
52 | } | 56 | } |
53 | 57 | ||
54 | @Override | 58 | @Override |
55 | public void onNetChanged(int netWorkState) { | 59 | public void onNetChanged(int netWorkState) { |
56 | 60 | ||
57 | } | 61 | } |
58 | } | 62 | } |
59 | 63 |
app/src/main/java/com/hjx/parent/RegisterActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.content.Intent; | 3 | import android.content.Intent; |
4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
5 | import android.telephony.PhoneNumberUtils; | 5 | import android.telephony.PhoneNumberUtils; |
6 | import android.text.InputType; | 6 | import android.text.InputType; |
7 | import android.text.method.HideReturnsTransformationMethod; | ||
8 | import android.text.method.PasswordTransformationMethod; | ||
7 | import android.widget.Button; | 9 | import android.widget.Button; |
8 | import android.widget.CheckBox; | 10 | import android.widget.CheckBox; |
9 | import android.widget.EditText; | 11 | import android.widget.EditText; |
10 | import android.widget.ImageView; | 12 | import android.widget.ImageView; |
11 | import android.widget.TextView; | 13 | import android.widget.TextView; |
12 | import android.widget.Toast; | 14 | import android.widget.Toast; |
13 | 15 | ||
14 | import androidx.annotation.Nullable; | 16 | import androidx.annotation.Nullable; |
15 | 17 | ||
16 | import com.google.gson.Gson; | 18 | import com.google.gson.Gson; |
17 | import com.hjq.permissions.OnPermissionCallback; | 19 | import com.hjq.permissions.OnPermissionCallback; |
18 | import com.hjq.permissions.Permission; | 20 | import com.hjq.permissions.Permission; |
19 | import com.hjq.permissions.XXPermissions; | 21 | import com.hjq.permissions.XXPermissions; |
20 | import com.hjx.parent.bean.RegisterBean; | 22 | import com.hjx.parent.bean.RegisterBean; |
21 | import com.prws.common.base.BaseActivity; | 23 | import com.prws.common.base.BaseActivity; |
22 | import com.prws.common.base.BasePresenter; | 24 | import com.prws.common.base.BasePresenter; |
23 | import com.prws.common.bean.BaseEntity; | 25 | import com.prws.common.bean.BaseEntity; |
24 | import com.prws.common.net.NetWorks; | 26 | import com.prws.common.net.NetWorks; |
25 | import com.prws.common.utils.Common; | 27 | import com.prws.common.utils.Common; |
26 | import com.prws.common.utils.GsonUtil; | 28 | import com.prws.common.utils.GsonUtil; |
27 | import com.prws.common.utils.LogUtil; | 29 | import com.prws.common.utils.LogUtil; |
28 | import com.prws.common.utils.SharedPreferencesUtil; | 30 | import com.prws.common.utils.SharedPreferencesUtil; |
29 | import com.uuzuche.lib_zxing.activity.CaptureActivity; | 31 | import com.uuzuche.lib_zxing.activity.CaptureActivity; |
30 | import com.uuzuche.lib_zxing.activity.CodeUtils; | 32 | import com.uuzuche.lib_zxing.activity.CodeUtils; |
31 | 33 | ||
32 | import org.json.JSONObject; | 34 | import org.json.JSONObject; |
33 | 35 | ||
34 | import java.io.IOException; | 36 | import java.io.IOException; |
35 | import java.util.HashMap; | 37 | import java.util.HashMap; |
36 | import java.util.List; | 38 | import java.util.List; |
37 | import java.util.Map; | 39 | import java.util.Map; |
38 | 40 | ||
39 | import io.reactivex.Observer; | 41 | import io.reactivex.Observer; |
40 | import io.reactivex.disposables.Disposable; | 42 | import io.reactivex.disposables.Disposable; |
41 | import okhttp3.ResponseBody; | 43 | import okhttp3.ResponseBody; |
42 | 44 | ||
43 | public class RegisterActivity extends BaseActivity { | 45 | public class RegisterActivity extends BaseActivity { |
44 | 46 | ||
45 | EditText et_phone; | 47 | EditText et_phone; |
46 | EditText et_pwd; | 48 | EditText et_pwd; |
47 | EditText et_pwd_2; | 49 | EditText et_pwd_2; |
48 | ImageView iv_show; | 50 | ImageView iv_show; |
49 | ImageView iv_show_2; | 51 | ImageView iv_show_2; |
50 | ImageView iv_delete; | 52 | ImageView iv_delete; |
51 | Button btn_reg; | 53 | Button btn_reg; |
52 | TextView tv_log; | 54 | TextView tv_log; |
53 | CheckBox cb_1; | 55 | CheckBox cb_1; |
54 | TextView tv_user; | 56 | TextView tv_user; |
55 | TextView tv_ys; | 57 | TextView tv_ys; |
56 | 58 | ||
57 | 59 | ||
58 | @Override | 60 | @Override |
59 | protected int layoutResId() { | 61 | protected int layoutResId() { |
60 | return R.layout.activity_register; | 62 | return R.layout.activity_register; |
61 | } | 63 | } |
62 | 64 | ||
63 | @Override | 65 | @Override |
64 | public Object getContract() { | 66 | public Object getContract() { |
65 | return null; | 67 | return null; |
66 | } | 68 | } |
67 | 69 | ||
68 | @Override | 70 | @Override |
69 | public BasePresenter getPresenter() { | 71 | public BasePresenter getPresenter() { |
70 | return null; | 72 | return null; |
71 | } | 73 | } |
72 | 74 | ||
73 | @Override | 75 | @Override |
74 | protected void initView() { | 76 | protected void initView() { |
75 | et_phone = findViewById(R.id.et_phone); | 77 | et_phone = findViewById(R.id.et_phone); |
76 | et_pwd = findViewById(R.id.et_pwd); | 78 | et_pwd = findViewById(R.id.et_pwd); |
77 | iv_show = findViewById(R.id.iv_4); | 79 | iv_show = findViewById(R.id.iv_4); |
78 | iv_show_2 = findViewById(R.id.iv_6); | 80 | iv_show_2 = findViewById(R.id.iv_6); |
79 | et_pwd_2 = findViewById(R.id.et_pwd_2); | 81 | et_pwd_2 = findViewById(R.id.et_pwd_2); |
80 | iv_delete = findViewById(R.id.iv_2); | 82 | iv_delete = findViewById(R.id.iv_2); |
81 | btn_reg = findViewById(R.id.btn_1); | 83 | btn_reg = findViewById(R.id.btn_1); |
82 | tv_log = findViewById(R.id.tv_2); | 84 | tv_log = findViewById(R.id.tv_2); |
83 | cb_1 = findViewById(R.id.cb_1); | 85 | cb_1 = findViewById(R.id.cb_1); |
84 | tv_user = findViewById(R.id.tv_4); | 86 | tv_user = findViewById(R.id.tv_4); |
85 | tv_ys = findViewById(R.id.tv_6); | 87 | tv_ys = findViewById(R.id.tv_6); |
86 | 88 | ||
87 | 89 | ||
88 | } | 90 | } |
89 | 91 | ||
90 | @Override | 92 | @Override |
91 | protected void initListener() { | 93 | protected void initListener() { |
92 | iv_delete.setOnClickListener(view -> { | 94 | iv_delete.setOnClickListener(view -> { |
93 | et_phone.setText(""); | 95 | et_phone.setText(""); |
94 | }); | 96 | }); |
95 | iv_show.setOnClickListener(view -> { | 97 | iv_show.setOnClickListener(view -> { |
96 | 98 | ||
97 | if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { | 99 | if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { |
98 | iv_show.setBackgroundResource(R.mipmap.yc); | 100 | iv_show.setBackgroundResource(R.mipmap.yc); |
99 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); | 101 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); |
102 | et_pwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); | ||
100 | } else { | 103 | } else { |
101 | iv_show.setBackgroundResource(R.mipmap.xs); | 104 | iv_show.setBackgroundResource(R.mipmap.xs); |
102 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); | 105 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); |
106 | et_pwd.setTransformationMethod(PasswordTransformationMethod.getInstance()); | ||
103 | } | 107 | } |
104 | 108 | ||
105 | 109 | ||
106 | }); | 110 | }); |
107 | 111 | ||
108 | iv_show_2.setOnClickListener(view -> { | 112 | iv_show_2.setOnClickListener(view -> { |
109 | 113 | ||
110 | if (iv_show_2.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { | 114 | if (iv_show_2.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { |
111 | iv_show_2.setBackgroundResource(R.mipmap.yc); | 115 | iv_show_2.setBackgroundResource(R.mipmap.yc); |
112 | et_pwd_2.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); | 116 | et_pwd_2.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); |
117 | et_pwd_2.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); | ||
113 | } else { | 118 | } else { |
114 | iv_show_2.setBackgroundResource(R.mipmap.xs); | 119 | iv_show_2.setBackgroundResource(R.mipmap.xs); |
115 | et_pwd_2.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); | 120 | et_pwd_2.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); |
121 | et_pwd_2.setTransformationMethod(PasswordTransformationMethod.getInstance()); | ||
116 | } | 122 | } |
117 | 123 | ||
118 | 124 | ||
119 | }); | 125 | }); |
120 | 126 | ||
121 | 127 | ||
122 | btn_reg.setOnClickListener(view -> { | 128 | btn_reg.setOnClickListener(view -> { |
123 | 129 | ||
124 | String phone = et_phone.getText().toString().trim(); | 130 | String phone = et_phone.getText().toString().trim(); |
125 | String pwd = et_pwd.getText().toString().trim(); | 131 | String pwd = et_pwd.getText().toString().trim(); |
126 | String pwd2 = et_pwd_2.getText().toString().trim(); | 132 | String pwd2 = et_pwd_2.getText().toString().trim(); |
127 | if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0) { | 133 | if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0) { |
128 | Toast.makeText(this, "手机号以及密码不能为空", Toast.LENGTH_SHORT).show(); | 134 | Toast.makeText(this, "手机号以及密码不能为空", Toast.LENGTH_SHORT).show(); |
129 | return; | 135 | return; |
130 | } | 136 | } |
131 | if (pwd.length() < 6 || pwd.length() > 16 || pwd2.length() < 6 || pwd2.length() > 16) { | 137 | if (pwd.length() < 6 || pwd.length() > 16 || pwd2.length() < 6 || pwd2.length() > 16) { |
132 | Toast.makeText(this, "密码必须为6-16位,数字或字母", Toast.LENGTH_SHORT).show(); | 138 | Toast.makeText(this, "密码必须为6-16位,数字或字母", Toast.LENGTH_SHORT).show(); |
133 | } | 139 | } |
134 | if (!Common.isValidPhoneNumber(phone)) { | 140 | if (!Common.isValidPhoneNumber(phone)) { |
135 | Toast.makeText(this, "请输入有效手机号", Toast.LENGTH_SHORT).show(); | 141 | Toast.makeText(this, "请输入有效手机号", Toast.LENGTH_SHORT).show(); |
136 | return; | 142 | return; |
137 | } | 143 | } |
138 | 144 | ||
139 | if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())) { | 145 | if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())) { |
140 | Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_SHORT).show(); | 146 | Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_SHORT).show(); |
141 | return; | 147 | return; |
142 | } | 148 | } |
143 | 149 | ||
144 | if (!cb_1.isChecked()) { | 150 | if (!cb_1.isChecked()) { |
145 | Toast.makeText(this, "请勾选协议", Toast.LENGTH_SHORT).show(); | 151 | Toast.makeText(this, "请勾选协议", Toast.LENGTH_SHORT).show(); |
146 | return; | 152 | return; |
147 | } | 153 | } |
148 | if (!pwd.equals(pwd2)) { | 154 | if (!pwd.equals(pwd2)) { |
149 | Toast.makeText(this, "两次密码需要一致", Toast.LENGTH_SHORT).show(); | 155 | Toast.makeText(this, "两次密码需要一致", Toast.LENGTH_SHORT).show(); |
150 | return; | 156 | return; |
151 | } | 157 | } |
152 | 158 | ||
153 | reg(phone, pwd); | 159 | reg(phone, pwd); |
154 | 160 | ||
155 | }); | 161 | }); |
156 | 162 | ||
157 | tv_log.setOnClickListener(view -> { | 163 | tv_log.setOnClickListener(view -> { |
158 | startActivity(LoginActivity.class); | 164 | startActivity(LoginActivity.class); |
159 | finish(); | 165 | finish(); |
160 | }); | 166 | }); |
161 | 167 | ||
162 | tv_ys.setOnClickListener(view -> { | 168 | tv_ys.setOnClickListener(view -> { |
163 | startActivity(YinsiActivity.class); | 169 | startActivity(YinsiActivity.class); |
164 | }); | 170 | }); |
165 | tv_user.setOnClickListener(view -> { | 171 | tv_user.setOnClickListener(view -> { |
166 | startActivity(UserActivity.class); | 172 | startActivity(UserActivity.class); |
167 | }); | 173 | }); |
168 | } | 174 | } |
169 | 175 | ||
170 | public void reg(final String phone, String pwd) { | 176 | public void reg(final String phone, String pwd) { |
171 | 177 | ||
172 | Map map = new HashMap(); | 178 | Map map = new HashMap(); |
173 | map.put("username", phone); | 179 | map.put("username", phone); |
174 | map.put("password", pwd); | 180 | map.put("password", pwd); |
175 | 181 | ||
176 | 182 | ||
177 | NetWorks.registerParent(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { | 183 | NetWorks.registerParent(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { |
178 | @Override | 184 | @Override |
179 | public void onSubscribe(Disposable d) { | 185 | public void onSubscribe(Disposable d) { |
180 | 186 | ||
181 | } | 187 | } |
182 | 188 | ||
183 | @Override | 189 | @Override |
184 | public void onNext(ResponseBody responseBody) { | 190 | public void onNext(ResponseBody responseBody) { |
185 | String str = null; | 191 | String str = null; |
186 | try { | 192 | try { |
187 | str = responseBody.string(); | 193 | str = responseBody.string(); |
188 | } catch (IOException e) { | 194 | } catch (IOException e) { |
189 | e.printStackTrace(); | 195 | e.printStackTrace(); |
190 | } | 196 | } |
191 | 197 | ||
192 | if (str == null || str.length() == 0) { | 198 | if (str == null || str.length() == 0) { |
193 | Toast.makeText(RegisterActivity.this, "服务器繁忙", Toast.LENGTH_SHORT).show(); | 199 | Toast.makeText(RegisterActivity.this, "服务器繁忙", Toast.LENGTH_SHORT).show(); |
194 | return; | 200 | return; |
195 | } | 201 | } |
196 | 202 | ||
197 | RegisterBean registerBean = new Gson().fromJson(str, RegisterBean.class); | 203 | RegisterBean registerBean = new Gson().fromJson(str, RegisterBean.class); |
198 | 204 | ||
199 | if (!registerBean.isSuccess()) { | 205 | if (!registerBean.isSuccess()) { |
200 | Toast.makeText(RegisterActivity.this, registerBean.getMsg(), Toast.LENGTH_SHORT).show(); | 206 | Toast.makeText(RegisterActivity.this, registerBean.getMsg(), Toast.LENGTH_SHORT).show(); |
201 | return; | 207 | return; |
202 | } | 208 | } |
203 | 209 | ||
204 | if (registerBean.getData().getUserName() != null && registerBean.getData().getUserName().length() > 0) { | 210 | if (registerBean.getData().getUserName() != null && registerBean.getData().getUserName().length() > 0) { |
205 | SharedPreferencesUtil.putData("phone", phone); | 211 | SharedPreferencesUtil.putData("phone", phone); |
206 | SharedPreferencesUtil.putData("role", registerBean.getData().getUserName()); | 212 | SharedPreferencesUtil.putData("role", registerBean.getData().getUserName()); |
207 | SharedPreferencesUtil.putData("userId", registerBean.getData().getUserName()); | 213 | SharedPreferencesUtil.putData("userId", registerBean.getData().getUserName()); |
208 | login(phone, pwd); | 214 | login(phone, pwd); |
209 | 215 | ||
210 | } | 216 | } |
211 | 217 | ||
212 | 218 | ||
213 | } | 219 | } |
214 | 220 | ||
215 | @Override | 221 | @Override |
216 | public void onError(Throwable e) { | 222 | public void onError(Throwable e) { |
217 | 223 | ||
218 | } | 224 | } |
219 | 225 | ||
220 | @Override | 226 | @Override |
221 | public void onComplete() { | 227 | public void onComplete() { |
222 | 228 | ||
223 | } | 229 | } |
224 | }); | 230 | }); |
225 | } | 231 | } |
226 | 232 | ||
227 | public void login(final String phone, String pwd) { | 233 | public void login(final String phone, String pwd) { |
228 | Map map = new HashMap(); | 234 | Map map = new HashMap(); |
229 | map.put("username", phone); | 235 | map.put("username", phone); |
230 | map.put("password", pwd); | 236 | map.put("password", pwd); |
231 | 237 | ||
232 | NetWorks.login(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { | 238 | NetWorks.login(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { |
233 | @Override | 239 | @Override |
234 | public void onSubscribe(Disposable d) { | 240 | public void onSubscribe(Disposable d) { |
235 | 241 | ||
236 | } | 242 | } |
237 | 243 | ||
238 | @Override | 244 | @Override |
239 | public void onNext(ResponseBody responseBody) { | 245 | public void onNext(ResponseBody responseBody) { |
240 | try { | 246 | try { |
241 | String str = responseBody.string().toString(); | 247 | String str = responseBody.string().toString(); |
242 | LogUtil.e(TAG, "----" + str); | 248 | LogUtil.e(TAG, "----" + str); |
243 | JSONObject jo = new JSONObject(str); | 249 | JSONObject jo = new JSONObject(str); |
244 | boolean isSucceed = jo.getBoolean("success"); | 250 | boolean isSucceed = jo.getBoolean("success"); |
245 | if (isSucceed) { | 251 | if (isSucceed) { |
246 | JSONObject jo2 = jo.getJSONObject("data"); | 252 | JSONObject jo2 = jo.getJSONObject("data"); |
247 | SharedPreferencesUtil.putData("phone", phone); | 253 | SharedPreferencesUtil.putData("phone", phone); |
248 | SharedPreferencesUtil.putData("role", jo2.getString("role")); | 254 | SharedPreferencesUtil.putData("role", jo2.getString("role")); |
249 | SharedPreferencesUtil.putData("userId", jo2.getString("userId")); | 255 | SharedPreferencesUtil.putData("userId", jo2.getString("userId")); |
250 | SharedPreferencesUtil.putData("token", jo2.getString("token")); | 256 | SharedPreferencesUtil.putData("token", jo2.getString("token")); |
251 | startActivity(ChooseActivity.class); | 257 | startActivity(ChooseActivity.class); |
258 | finish(); | ||
252 | } else { | 259 | } else { |
253 | Toast.makeText(RegisterActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); | 260 | Toast.makeText(RegisterActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); |
254 | } | 261 | } |
255 | } catch (Exception e) { | 262 | } catch (Exception e) { |
256 | e.printStackTrace(); | 263 | e.printStackTrace(); |
257 | Toast.makeText(RegisterActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | 264 | Toast.makeText(RegisterActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); |
258 | } | 265 | } |
259 | 266 | ||
260 | } | 267 | } |
261 | 268 | ||
262 | @Override | 269 | @Override |
263 | public void onError(Throwable e) { | 270 | public void onError(Throwable e) { |
264 | 271 | ||
265 | } | 272 | } |
266 | 273 | ||
267 | @Override | 274 | @Override |
268 | public void onComplete() { | 275 | public void onComplete() { |
269 | 276 | ||
270 | } | 277 | } |
271 | }); | 278 | }); |
272 | } | 279 | } |
273 | 280 | ||
274 | public void goQRView() { | 281 | public void goQRView() { |
275 | 282 | ||
276 | if (!XXPermissions.isGranted(this, Permission.CAMERA)) { | 283 | if (!XXPermissions.isGranted(this, Permission.CAMERA)) { |
277 | XXPermissions.with(this) | 284 | XXPermissions.with(this) |
278 | // 申请多个权限 | 285 | // 申请多个权限 |
279 | .permission(Permission.CAMERA) | 286 | .permission(Permission.CAMERA) |
280 | .request(new OnPermissionCallback() { | 287 | .request(new OnPermissionCallback() { |
281 | @Override | 288 | @Override |
282 | public void onGranted(List<String> permissions, boolean all) { | 289 | public void onGranted(List<String> permissions, boolean all) { |
283 | if (all) { | 290 | if (all) { |
284 | //开启扫码界面 | 291 | //开启扫码界面 |
285 | startQRView(); | 292 | startQRView(); |
286 | 293 | ||
287 | } else { | 294 | } else { |
288 | Toast.makeText(RegisterActivity.this, "需要相机权限", Toast.LENGTH_SHORT).show(); | 295 | Toast.makeText(RegisterActivity.this, "需要相机权限", Toast.LENGTH_SHORT).show(); |
289 | } | 296 | } |
290 | } | 297 | } |
291 | 298 | ||
292 | @Override | 299 | @Override |
293 | public void onDenied(List<String> permissions, boolean never) { | 300 | public void onDenied(List<String> permissions, boolean never) { |
294 | XXPermissions.startPermissionActivity(RegisterActivity.this, permissions); | 301 | XXPermissions.startPermissionActivity(RegisterActivity.this, permissions); |
295 | } | 302 | } |
296 | }); | 303 | }); |
297 | 304 | ||
298 | 305 | ||
299 | } else { | 306 | } else { |
300 | startQRView(); | 307 | startQRView(); |
301 | } | 308 | } |
302 | 309 | ||
303 | 310 | ||
304 | } | 311 | } |
305 | 312 | ||
306 | public void startQRView() { | 313 | public void startQRView() { |
307 | 314 | ||
308 | startActivity(QRActivity.class); | 315 | startActivity(QRActivity.class); |
309 | finish(); | 316 | finish(); |
310 | 317 | ||
311 | } | 318 | } |
312 | 319 | ||
313 | 320 | ||
314 | @Override | 321 | @Override |
315 | protected void initData() { | 322 | protected void initData() { |
316 | 323 | ||
317 | } | 324 | } |
318 | 325 | ||
319 | @Override | 326 | @Override |
320 | public void onNetChanged(int netWorkState) { | 327 | public void onNetChanged(int netWorkState) { |
321 | 328 | ||
322 | } | 329 | } |
323 | } | 330 | } |
app/src/main/java/com/hjx/parent/UserAgreementActivity.java
File was created | 1 | package com.hjx.parent; | |
2 | |||
3 | import android.view.View; | ||
4 | import android.webkit.WebView; | ||
5 | |||
6 | import com.prws.common.base.BaseActivity; | ||
7 | import com.prws.common.base.BasePresenter; | ||
8 | |||
9 | import butterknife.BindView; | ||
10 | import butterknife.OnClick; | ||
11 | |||
12 | public class UserAgreementActivity extends BaseActivity { | ||
13 | @BindView(R.id.web) | ||
14 | WebView webView; | ||
15 | @Override | ||
16 | protected int layoutResId() { | ||
17 | return R.layout.activity_yin; | ||
18 | } | ||
19 | |||
20 | @Override | ||
21 | public Object getContract() { | ||
22 | return null; | ||
23 | } | ||
24 | |||
25 | @Override | ||
26 | public BasePresenter getPresenter() { | ||
27 | return null; | ||
28 | } | ||
29 | |||
30 | |||
31 | @Override | ||
32 | protected void initView() { | ||
33 | webView.loadUrl("file:///android_asset/yonghuxieyi.html"); | ||
34 | } | ||
35 | |||
36 | @Override | ||
37 | protected void initListener() { | ||
38 | } | ||
39 | |||
40 | @OnClick(R.id.iv_back) | ||
41 | public void back(View view) { | ||
42 | finish(); | ||
43 | } | ||
44 | |||
45 | @Override | ||
46 | protected void initData() { | ||
47 | |||
48 | } | ||
49 | |||
50 | @Override | ||
51 | public void onNetChanged(int netWorkState) { | ||
52 | |||
53 | } | ||
54 | } |
app/src/main/java/com/hjx/parent/YinsiActivity.java
1 | package com.hjx.parent; | 1 | package com.hjx.parent; |
2 | 2 | ||
3 | import android.view.View; | 3 | import android.view.View; |
4 | import android.webkit.WebView; | ||
4 | 5 | ||
5 | import com.prws.common.base.BaseActivity; | 6 | import com.prws.common.base.BaseActivity; |
6 | import com.prws.common.base.BasePresenter; | 7 | import com.prws.common.base.BasePresenter; |
7 | 8 | ||
9 | import butterknife.BindView; | ||
8 | import butterknife.OnClick; | 10 | import butterknife.OnClick; |
9 | 11 | ||
10 | public class YinsiActivity extends BaseActivity { | 12 | public class YinsiActivity extends BaseActivity { |
11 | 13 | @BindView(R.id.web) | |
14 | WebView webView; | ||
12 | @Override | 15 | @Override |
13 | protected int layoutResId() { | 16 | protected int layoutResId() { |
14 | return R.layout.activity_yin; | 17 | return R.layout.activity_yin; |
15 | } | 18 | } |
16 | 19 | ||
17 | @Override | 20 | @Override |
18 | public Object getContract() { | 21 | public Object getContract() { |
19 | return null; | 22 | return null; |
20 | } | 23 | } |
21 | 24 | ||
22 | @Override | 25 | @Override |
23 | public BasePresenter getPresenter() { | 26 | public BasePresenter getPresenter() { |
24 | return null; | 27 | return null; |
25 | } | 28 | } |
26 | 29 | ||
27 | 30 | ||
28 | @Override | 31 | @Override |
29 | protected void initView() { | 32 | protected void initView() { |
30 | 33 | webView.loadUrl("file:///android_asset/yinsi.html"); | |
31 | } | 34 | } |
32 | 35 | ||
33 | @Override | 36 | @Override |
34 | protected void initListener() { | 37 | protected void initListener() { |
35 | } | 38 | } |
36 | 39 | ||
37 | @OnClick(R.id.iv_back) | 40 | @OnClick(R.id.iv_back) |
38 | public void back(View view) { | 41 | public void back(View view) { |
39 | finish(); | 42 | finish(); |
40 | } | 43 | } |
41 | 44 | ||
42 | @Override | 45 | @Override |
43 | protected void initData() { | 46 | protected void initData() { |
44 | 47 | ||
45 | } | 48 | } |
46 | 49 | ||
47 | @Override | 50 | @Override |
48 | public void onNetChanged(int netWorkState) { | 51 | public void onNetChanged(int netWorkState) { |
49 | 52 | ||
50 | } | 53 | } |
51 | } | 54 | } |
app/src/main/res/layout/activity_user_agreement.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="match_parent" | ||
6 | android:background="#F4F6F8"> | ||
7 | |||
8 | <View | ||
9 | android:id="@+id/view_1" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="44dp" | ||
12 | android:background="@android:color/white" | ||
13 | app:layout_constraintTop_toTopOf="parent" /> | ||
14 | |||
15 | <TextView | ||
16 | android:layout_width="wrap_content" | ||
17 | android:layout_height="wrap_content" | ||
18 | android:text="用户协议" | ||
19 | android:textColor="#333333" | ||
20 | android:textSize="18dp" | ||
21 | app:layout_constraintBottom_toBottomOf="@id/view_1" | ||
22 | app:layout_constraintLeft_toLeftOf="@id/view_1" | ||
23 | app:layout_constraintRight_toRightOf="@id/view_1" | ||
24 | app:layout_constraintTop_toTopOf="@id/view_1" /> | ||
25 | |||
26 | <ImageView | ||
27 | android:id="@+id/iv_back" | ||
28 | android:layout_width="10dp" | ||
29 | android:layout_height="16dp" | ||
30 | android:layout_marginLeft="15dp" | ||
31 | android:background="@mipmap/icon_back" | ||
32 | app:layout_constraintBottom_toBottomOf="@id/view_1" | ||
33 | app:layout_constraintLeft_toLeftOf="parent" | ||
34 | app:layout_constraintTop_toTopOf="@id/view_1" /> | ||
35 | |||
36 | <View | ||
37 | android:layout_width="match_parent" | ||
38 | android:layout_height="1dp" | ||
39 | android:background="#EEEEEE" | ||
40 | app:layout_constraintTop_toBottomOf="@id/view_1" /> | ||
41 | |||
42 | <WebView | ||
43 | android:id="@+id/web" | ||
44 | android:layout_width="match_parent" | ||
45 | android:layout_height="match_parent" | ||
46 | android:layout_marginTop="45dp" /> | ||
47 | |||
48 | |||
49 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/activity_yin.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
3 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
4 | android:layout_height="match_parent" | 5 | android:layout_height="match_parent" |
5 | xmlns:app="http://schemas.android.com/apk/res-auto" | 6 | android:background="#F4F6F8"> |
6 | android:background="#F4F6F8" | ||
7 | > | ||
8 | 7 | ||
9 | <View | 8 | <View |
10 | android:id="@+id/view_1" | 9 | android:id="@+id/view_1" |
11 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
12 | android:layout_height="44dp" | 11 | android:layout_height="44dp" |
13 | app:layout_constraintTop_toTopOf="parent" | ||
14 | android:background="@android:color/white" | 12 | android:background="@android:color/white" |
15 | /> | 13 | app:layout_constraintTop_toTopOf="parent" /> |
14 | |||
16 | <TextView | 15 | <TextView |
17 | android:layout_width="wrap_content" | 16 | android:layout_width="wrap_content" |
18 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
19 | android:text="隐私政策" | 18 | android:text="隐私政策" |
20 | android:textColor="#333333" | 19 | android:textColor="#333333" |
21 | android:textSize="18dp" | 20 | android:textSize="18dp" |
21 | app:layout_constraintBottom_toBottomOf="@id/view_1" | ||
22 | app:layout_constraintLeft_toLeftOf="@id/view_1" | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
23 | app:layout_constraintRight_toRightOf="@id/view_1" | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
24 | app:layout_constraintTop_toTopOf="@id/view_1" | 24 | app:layout_constraintTop_toTopOf="@id/view_1" /> |
25 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 25 | |
26 | /> | ||
27 | <ImageView | 26 | <ImageView |
28 | android:id="@+id/iv_back" | 27 | android:id="@+id/iv_back" |
29 | android:layout_width="10dp" | 28 | android:layout_width="10dp" |
30 | android:layout_height="16dp" | 29 | android:layout_height="16dp" |
31 | app:layout_constraintLeft_toLeftOf="parent" | ||
32 | app:layout_constraintTop_toTopOf="@id/view_1" | ||
33 | app:layout_constraintBottom_toBottomOf="@id/view_1" | ||
34 | android:layout_marginLeft="15dp" | 30 | android:layout_marginLeft="15dp" |
35 | android:background="@mipmap/icon_back" | 31 | android:background="@mipmap/icon_back" |
36 | /> | 32 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
33 | app:layout_constraintLeft_toLeftOf="parent" | ||
34 | app:layout_constraintTop_toTopOf="@id/view_1" /> | ||
35 | |||
37 | <View | 36 | <View |
38 | android:layout_width="match_parent" | 37 | android:layout_width="match_parent" |
39 | android:layout_height="1dp" | 38 | android:layout_height="1dp" |
40 | android:background="#EEEEEE" | 39 | android:background="#EEEEEE" |
41 | app:layout_constraintTop_toBottomOf="@id/view_1" | 40 | app:layout_constraintTop_toBottomOf="@id/view_1" /> |
42 | /> | 41 | |
42 | <WebView |
app/src/main/res/layout/fragment_me.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="match_parent" | 5 | android:layout_height="match_parent" |
6 | android:background="#F4F6F8"> | 6 | android:background="#F4F6F8"> |
7 | 7 | ||
8 | <androidx.constraintlayout.widget.Group | 8 | <androidx.constraintlayout.widget.Group |
9 | android:id="@+id/group_1" | 9 | android:id="@+id/group_1" |
10 | android:layout_width="wrap_content" | 10 | android:layout_width="wrap_content" |
11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
12 | android:visibility="visible" /> | 12 | android:visibility="visible" /> |
13 | 13 | ||
14 | <View | 14 | <View |
15 | android:id="@+id/view_1" | 15 | android:id="@+id/view_1" |
16 | android:layout_width="match_parent" | 16 | android:layout_width="match_parent" |
17 | android:layout_height="44dp" | 17 | android:layout_height="44dp" |
18 | android:background="@android:color/white" | 18 | android:background="@android:color/white" |
19 | app:layout_constraintTop_toTopOf="parent" /> | 19 | app:layout_constraintTop_toTopOf="parent" /> |
20 | 20 | ||
21 | <TextView | 21 | <TextView |
22 | android:layout_width="wrap_content" | 22 | android:layout_width="wrap_content" |
23 | android:layout_height="wrap_content" | 23 | android:layout_height="wrap_content" |
24 | android:text="个人中心" | 24 | android:text="个人中心" |
25 | android:textColor="#333333" | 25 | android:textColor="#333333" |
26 | android:textSize="18dp" | 26 | android:textSize="18dp" |
27 | app:layout_constraintBottom_toBottomOf="@id/view_1" | 27 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
28 | app:layout_constraintLeft_toLeftOf="@id/view_1" | 28 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
29 | app:layout_constraintRight_toRightOf="@id/view_1" | 29 | app:layout_constraintRight_toRightOf="@id/view_1" |
30 | app:layout_constraintTop_toTopOf="@id/view_1" /> | 30 | app:layout_constraintTop_toTopOf="@id/view_1" /> |
31 | 31 | ||
32 | 32 | ||
33 | <ImageView | 33 | <ImageView |
34 | android:id="@+id/iv_toux" | 34 | android:id="@+id/iv_toux" |
35 | android:layout_width="57dp" | 35 | android:layout_width="57dp" |
36 | android:layout_height="57dp" | 36 | android:layout_height="57dp" |
37 | android:layout_marginLeft="15dp" | 37 | android:layout_marginLeft="15dp" |
38 | android:layout_marginTop="63dp" | 38 | android:layout_marginTop="63dp" |
39 | android:background="@mipmap/ic_parent_avatar" | 39 | android:background="@mipmap/ic_parent_avatar" |
40 | app:layout_constraintLeft_toLeftOf="parent" | 40 | app:layout_constraintLeft_toLeftOf="parent" |
41 | app:layout_constraintTop_toTopOf="parent" /> | 41 | app:layout_constraintTop_toTopOf="parent" /> |
42 | 42 | ||
43 | <TextView | 43 | <TextView |
44 | android:id="@+id/tv_name" | 44 | android:id="@+id/tv_name" |
45 | android:layout_width="wrap_content" | 45 | android:layout_width="wrap_content" |
46 | android:layout_height="wrap_content" | 46 | android:layout_height="wrap_content" |
47 | android:layout_marginLeft="88dp" | 47 | android:layout_marginLeft="88dp" |
48 | android:layout_marginTop="72dp" | 48 | android:layout_marginTop="72dp" |
49 | android:text="名字" | 49 | android:text="名字" |
50 | android:textColor="#333333" | 50 | android:textColor="#333333" |
51 | android:textSize="20dp" | 51 | android:textSize="20dp" |
52 | app:layout_constraintLeft_toLeftOf="parent" | 52 | app:layout_constraintLeft_toLeftOf="parent" |
53 | app:layout_constraintTop_toTopOf="parent" /> | 53 | app:layout_constraintTop_toTopOf="parent" /> |
54 | 54 | ||
55 | <TextView | 55 | <TextView |
56 | android:id="@+id/tv_phone" | 56 | android:id="@+id/tv_phone" |
57 | android:layout_width="wrap_content" | 57 | android:layout_width="wrap_content" |
58 | android:layout_height="wrap_content" | 58 | android:layout_height="wrap_content" |
59 | android:layout_marginLeft="88dp" | 59 | android:layout_marginLeft="88dp" |
60 | android:layout_marginTop="98dp" | 60 | android:layout_marginTop="98dp" |
61 | android:text="1231223123" | 61 | android:text="1231223123" |
62 | android:textColor="#999999" | 62 | android:textColor="#999999" |
63 | android:textSize="17dp" | 63 | android:textSize="17dp" |
64 | android:visibility="gone" | 64 | android:visibility="gone" |
65 | app:layout_constraintLeft_toLeftOf="parent" | 65 | app:layout_constraintLeft_toLeftOf="parent" |
66 | app:layout_constraintTop_toTopOf="parent" /> | 66 | app:layout_constraintTop_toTopOf="parent" /> |
67 | 67 | ||
68 | 68 | ||
69 | <LinearLayout | 69 | <LinearLayout |
70 | android:id="@+id/view_2" | 70 | android:id="@+id/view_2" |
71 | android:layout_width="match_parent" | 71 | android:layout_width="match_parent" |
72 | android:layout_height="140dp" | 72 | android:layout_height="140dp" |
73 | android:layout_marginLeft="15dp" | 73 | android:layout_marginLeft="15dp" |
74 | android:layout_marginTop="140dp" | 74 | android:layout_marginTop="140dp" |
75 | android:layout_marginRight="15dp" | 75 | android:layout_marginRight="15dp" |
76 | android:background="@drawable/bg_solid_white_10" | 76 | android:background="@drawable/bg_solid_white_10" |
77 | android:orientation="vertical" | 77 | android:orientation="vertical" |
78 | app:layout_constraintLeft_toLeftOf="parent" | 78 | app:layout_constraintLeft_toLeftOf="parent" |
79 | app:layout_constraintRight_toRightOf="parent" | 79 | app:layout_constraintRight_toRightOf="parent" |
80 | app:layout_constraintTop_toTopOf="parent"> | 80 | app:layout_constraintTop_toTopOf="parent"> |
81 | 81 | ||
82 | <TextView | 82 | <TextView |
83 | android:id="@+id/tv_title" | 83 | android:id="@+id/tv_title" |
84 | android:layout_width="wrap_content" | 84 | android:layout_width="wrap_content" |
85 | android:layout_height="wrap_content" | 85 | android:layout_height="wrap_content" |
86 | android:layout_marginLeft="15dp" | 86 | android:layout_marginLeft="15dp" |
87 | android:layout_marginTop="15dp" | 87 | android:layout_marginTop="15dp" |
88 | android:text="学生" | 88 | android:text="学生" |
89 | android:textColor="#333333" | 89 | android:textColor="#333333" |
90 | android:textSize="16dp" /> | 90 | android:textSize="16dp" /> |
91 | 91 | ||
92 | <androidx.recyclerview.widget.RecyclerView | 92 | <androidx.recyclerview.widget.RecyclerView |
93 | android:id="@+id/recycle" | 93 | android:id="@+id/recycle" |
94 | android:layout_width="match_parent" | 94 | android:layout_width="match_parent" |
95 | android:layout_height="match_parent" | 95 | android:layout_height="match_parent" |
96 | android:layout_marginLeft="15dp" | 96 | android:layout_marginLeft="15dp" |
97 | android:layout_marginRight="15dp" /> | 97 | android:layout_marginRight="15dp" /> |
98 | </LinearLayout> | 98 | </LinearLayout> |
99 | 99 | ||
100 | <View | 100 | <View |
101 | android:id="@+id/view_3" | 101 | android:id="@+id/view_3" |
102 | android:layout_width="match_parent" | 102 | android:layout_width="match_parent" |
103 | android:layout_height="45dp" | 103 | android:layout_height="45dp" |
104 | android:layout_marginLeft="15dp" | 104 | android:layout_marginLeft="15dp" |
105 | android:layout_marginTop="15dp" | 105 | android:layout_marginTop="15dp" |
106 | android:layout_marginRight="15dp" | 106 | android:layout_marginRight="15dp" |
107 | android:background="@drawable/bg_solid_white_10_top" | 107 | android:background="@drawable/bg_solid_white_10_top" |
108 | app:layout_constraintLeft_toLeftOf="parent" | 108 | app:layout_constraintLeft_toLeftOf="parent" |
109 | app:layout_constraintRight_toRightOf="parent" | 109 | app:layout_constraintRight_toRightOf="parent" |
110 | app:layout_constraintTop_toBottomOf="@id/view_2" | 110 | app:layout_constraintTop_toBottomOf="@id/view_2" |
111 | app:layout_goneMarginTop="241dp" /> | 111 | app:layout_goneMarginTop="241dp" /> |
112 | 112 | ||
113 | <ImageView | 113 | <ImageView |
114 | android:layout_width="6.8dp" | 114 | android:layout_width="6.8dp" |
115 | android:layout_height="12dp" | 115 | android:layout_height="12dp" |
116 | android:layout_marginRight="15dp" | 116 | android:layout_marginRight="15dp" |
117 | android:background="@mipmap/ycaj" | 117 | android:background="@mipmap/ycaj" |
118 | app:layout_constraintBottom_toBottomOf="@id/view_3" | 118 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
119 | app:layout_constraintRight_toRightOf="@id/view_3" | 119 | app:layout_constraintRight_toRightOf="@id/view_3" |
120 | app:layout_constraintTop_toTopOf="@id/view_3" /> | 120 | app:layout_constraintTop_toTopOf="@id/view_3" /> |
121 | 121 | ||
122 | <ImageView | 122 | <ImageView |
123 | android:layout_width="14dp" | 123 | android:layout_width="14dp" |
124 | android:layout_height="14dp" | 124 | android:layout_height="14dp" |
125 | android:layout_marginLeft="15dp" | 125 | android:layout_marginLeft="15dp" |
126 | android:background="@mipmap/szz" | 126 | android:background="@mipmap/szz" |
127 | app:layout_constraintBottom_toBottomOf="@id/view_3" | 127 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
128 | app:layout_constraintLeft_toLeftOf="@id/view_3" | 128 | app:layout_constraintLeft_toLeftOf="@id/view_3" |
129 | app:layout_constraintTop_toTopOf="@id/view_3" /> | 129 | app:layout_constraintTop_toTopOf="@id/view_3" /> |
130 | 130 | ||
131 | <TextView | 131 | <TextView |
132 | android:layout_width="wrap_content" | 132 | android:layout_width="wrap_content" |
133 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
134 | android:layout_marginLeft="40dp" | 134 | android:layout_marginLeft="40dp" |
135 | android:text="账户设置" | 135 | android:text="账户设置" |
136 | android:textColor="#333333" | 136 | android:textColor="#333333" |
137 | android:textSize="15dp" | 137 | android:textSize="15dp" |
138 | app:layout_constraintBottom_toBottomOf="@id/view_3" | 138 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
139 | app:layout_constraintLeft_toLeftOf="@id/view_3" | 139 | app:layout_constraintLeft_toLeftOf="@id/view_3" |
140 | app:layout_constraintTop_toTopOf="@id/view_3" /> | 140 | app:layout_constraintTop_toTopOf="@id/view_3" /> |
141 | 141 | ||
142 | <View | 142 | <View |
143 | android:id="@+id/view_4" | 143 | android:id="@+id/view_4" |
144 | android:layout_width="match_parent" | 144 | android:layout_width="match_parent" |
145 | android:layout_height="45dp" | 145 | android:layout_height="45dp" |
146 | android:layout_marginLeft="15dp" | 146 | android:layout_marginLeft="15dp" |
147 | android:layout_marginRight="15dp" | 147 | android:layout_marginRight="15dp" |
148 | android:background="@android:color/white" | 148 | android:background="@android:color/white" |
149 | app:layout_constraintLeft_toLeftOf="parent" | 149 | app:layout_constraintLeft_toLeftOf="parent" |
150 | app:layout_constraintRight_toRightOf="parent" | 150 | app:layout_constraintRight_toRightOf="parent" |
151 | app:layout_constraintTop_toBottomOf="@id/view_3" /> | 151 | app:layout_constraintTop_toBottomOf="@id/view_3" /> |
152 | 152 | ||
153 | <ImageView | 153 | <ImageView |
154 | android:layout_width="6.8dp" | 154 | android:layout_width="6.8dp" |
155 | android:layout_height="12dp" | 155 | android:layout_height="12dp" |
156 | android:layout_marginRight="15dp" | 156 | android:layout_marginRight="15dp" |
157 | android:background="@mipmap/ycaj" | 157 | android:background="@mipmap/ycaj" |
158 | app:layout_constraintBottom_toBottomOf="@id/view_4" | 158 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
159 | app:layout_constraintRight_toRightOf="@id/view_4" | 159 | app:layout_constraintRight_toRightOf="@id/view_4" |
160 | app:layout_constraintTop_toTopOf="@id/view_4" /> | 160 | app:layout_constraintTop_toTopOf="@id/view_4" /> |
161 | 161 | ||
162 | <ImageView | 162 | <ImageView |
163 | android:layout_width="14dp" | 163 | android:layout_width="14dp" |
164 | android:layout_height="14dp" | 164 | android:layout_height="14dp" |
165 | android:layout_marginLeft="15dp" | 165 | android:layout_marginLeft="15dp" |
166 | android:background="@mipmap/yincs" | 166 | android:background="@mipmap/yincs" |
167 | app:layout_constraintBottom_toBottomOf="@id/view_4" | 167 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
168 | app:layout_constraintLeft_toLeftOf="@id/view_4" | 168 | app:layout_constraintLeft_toLeftOf="@id/view_4" |
169 | app:layout_constraintTop_toTopOf="@id/view_4" /> | 169 | app:layout_constraintTop_toTopOf="@id/view_4" /> |
170 | 170 | ||
171 | <TextView | 171 | <TextView |
172 | android:layout_width="wrap_content" | 172 | android:layout_width="wrap_content" |
173 | android:layout_height="wrap_content" | 173 | android:layout_height="wrap_content" |
174 | android:layout_marginLeft="40dp" | 174 | android:layout_marginLeft="40dp" |
175 | android:text="隐私设置" | 175 | android:text="隐私政策" |
176 | android:textColor="#333333" | 176 | android:textColor="#333333" |
177 | android:textSize="15dp" | 177 | android:textSize="15dp" |
178 | app:layout_constraintBottom_toBottomOf="@id/view_4" | 178 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
179 | app:layout_constraintLeft_toLeftOf="@id/view_4" | 179 | app:layout_constraintLeft_toLeftOf="@id/view_4" |
180 | app:layout_constraintTop_toTopOf="@id/view_4" /> | 180 | app:layout_constraintTop_toTopOf="@id/view_4" /> |
181 | 181 | ||
182 | <View | 182 | <View |
183 | android:id="@+id/view_5" | 183 | android:id="@+id/view_5" |
184 | android:layout_width="match_parent" | 184 | android:layout_width="match_parent" |
185 | android:layout_height="45dp" | 185 | android:layout_height="45dp" |
186 | android:layout_marginLeft="15dp" | 186 | android:layout_marginLeft="15dp" |
187 | android:layout_marginRight="15dp" | 187 | android:layout_marginRight="15dp" |
188 | android:background="@android:color/white" | 188 | android:background="@android:color/white" |
189 | app:layout_constraintLeft_toLeftOf="parent" | 189 | app:layout_constraintLeft_toLeftOf="parent" |
190 | app:layout_constraintRight_toRightOf="parent" | 190 | app:layout_constraintRight_toRightOf="parent" |
191 | app:layout_constraintTop_toBottomOf="@id/view_4" /> | 191 | app:layout_constraintTop_toBottomOf="@id/view_4" /> |
192 | 192 | ||
193 | <ImageView | 193 | <ImageView |
194 | android:layout_width="6.8dp" | 194 | android:layout_width="6.8dp" |
195 | android:layout_height="12dp" | 195 | android:layout_height="12dp" |
196 | android:layout_marginRight="15dp" | 196 | android:layout_marginRight="15dp" |
197 | android:background="@mipmap/ycaj" | 197 | android:background="@mipmap/ycaj" |
198 | app:layout_constraintBottom_toBottomOf="@id/view_5" | 198 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
199 | app:layout_constraintRight_toRightOf="@id/view_5" | 199 | app:layout_constraintRight_toRightOf="@id/view_5" |
200 | app:layout_constraintTop_toTopOf="@id/view_5" /> | 200 | app:layout_constraintTop_toTopOf="@id/view_5" /> |
201 | 201 | ||
202 | <ImageView | 202 | <ImageView |
203 | android:layout_width="14dp" | 203 | android:layout_width="14dp" |
204 | android:layout_height="14dp" | 204 | android:layout_height="14dp" |
205 | android:layout_marginLeft="15dp" | 205 | android:layout_marginLeft="15dp" |
206 | android:background="@mipmap/gywmm" | 206 | android:background="@mipmap/gywmm" |
207 | app:layout_constraintBottom_toBottomOf="@id/view_5" | 207 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
208 | app:layout_constraintLeft_toLeftOf="@id/view_5" | 208 | app:layout_constraintLeft_toLeftOf="@id/view_5" |
209 | app:layout_constraintTop_toTopOf="@id/view_5" /> | 209 | app:layout_constraintTop_toTopOf="@id/view_5" /> |
210 | 210 | ||
211 | <TextView | 211 | <TextView |
212 | android:layout_width="wrap_content" | 212 | android:layout_width="wrap_content" |
213 | android:layout_height="wrap_content" | 213 | android:layout_height="wrap_content" |
214 | android:layout_marginLeft="40dp" | 214 | android:layout_marginLeft="40dp" |
215 | android:text="关于我们" | 215 | android:text="关于我们" |
216 | android:textColor="#333333" | 216 | android:textColor="#333333" |
217 | android:textSize="15dp" | 217 | android:textSize="15dp" |
218 | app:layout_constraintBottom_toBottomOf="@id/view_5" | 218 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
219 | app:layout_constraintLeft_toLeftOf="@id/view_5" | 219 | app:layout_constraintLeft_toLeftOf="@id/view_5" |
220 | app:layout_constraintTop_toTopOf="@id/view_5" /> | 220 | app:layout_constraintTop_toTopOf="@id/view_5" /> |
221 | 221 | ||
222 | <View | 222 | <View |
223 | android:id="@+id/view_6" | 223 | android:id="@+id/view_6" |
224 | android:layout_width="match_parent" | 224 | android:layout_width="match_parent" |
225 | android:layout_height="45dp" | 225 | android:layout_height="45dp" |
226 | android:layout_marginLeft="15dp" | 226 | android:layout_marginLeft="15dp" |
227 | android:layout_marginRight="15dp" | 227 | android:layout_marginRight="15dp" |
228 | android:background="@drawable/bg_solid_white_10_bottom" | 228 | android:background="@drawable/bg_solid_white_10_bottom" |
229 | app:layout_constraintLeft_toLeftOf="parent" | 229 | app:layout_constraintLeft_toLeftOf="parent" |
230 | app:layout_constraintRight_toRightOf="parent" | 230 | app:layout_constraintRight_toRightOf="parent" |
231 | app:layout_constraintTop_toBottomOf="@id/view_5" /> | 231 | app:layout_constraintTop_toBottomOf="@id/view_5" /> |
232 | 232 | ||
233 | <ImageView | 233 | <ImageView |
234 | android:layout_width="14dp" | 234 | android:layout_width="14dp" |
235 | android:layout_height="14dp" | 235 | android:layout_height="14dp" |
236 | android:layout_marginLeft="15dp" | 236 | android:layout_marginLeft="15dp" |
237 | android:background="@mipmap/banb" | 237 | android:background="@mipmap/banb" |
238 | app:layout_constraintBottom_toBottomOf="@id/view_6" | 238 | app:layout_constraintBottom_toBottomOf="@id/view_6" |
239 | app:layout_constraintLeft_toLeftOf="@id/view_6" | 239 | app:layout_constraintLeft_toLeftOf="@id/view_6" |
240 | app:layout_constraintTop_toTopOf="@id/view_6" /> | 240 | app:layout_constraintTop_toTopOf="@id/view_6" /> |
241 | 241 | ||
242 | <TextView | 242 | <TextView |
243 | android:layout_width="wrap_content" | 243 | android:layout_width="wrap_content" |
244 | android:layout_height="wrap_content" | 244 | android:layout_height="wrap_content" |
245 | android:layout_marginLeft="40dp" | 245 | android:layout_marginLeft="40dp" |
246 | android:text="当前版本" | 246 | android:text="当前版本" |
247 | android:textColor="#333333" | 247 | android:textColor="#333333" |
248 | android:textSize="15dp" | 248 | android:textSize="15dp" |
249 | app:layout_constraintBottom_toBottomOf="@id/view_6" | 249 | app:layout_constraintBottom_toBottomOf="@id/view_6" |
250 | app:layout_constraintLeft_toLeftOf="@id/view_6" | 250 | app:layout_constraintLeft_toLeftOf="@id/view_6" |
251 | app:layout_constraintTop_toTopOf="@id/view_6" /> | 251 | app:layout_constraintTop_toTopOf="@id/view_6" /> |
252 | 252 | ||
253 | <TextView | 253 | <TextView |
254 | android:layout_width="wrap_content" | 254 | android:layout_width="wrap_content" |
255 | android:layout_height="wrap_content" | 255 | android:layout_height="wrap_content" |
256 | android:layout_marginRight="15dp" | 256 | android:layout_marginRight="15dp" |
257 | android:text="V1.0" | 257 | android:text="V1.0" |
258 | android:textColor="#333333" | 258 | android:textColor="#333333" |
259 | android:textSize="15dp" | 259 | android:textSize="15dp" |
260 | app:layout_constraintBottom_toBottomOf="@id/view_6" | 260 | app:layout_constraintBottom_toBottomOf="@id/view_6" |
261 | app:layout_constraintRight_toRightOf="@id/view_6" | 261 | app:layout_constraintRight_toRightOf="@id/view_6" |
262 | app:layout_constraintTop_toTopOf="@id/view_6" /> | 262 | app:layout_constraintTop_toTopOf="@id/view_6" /> |
263 | 263 | ||
264 | </androidx.constraintlayout.widget.ConstraintLayout> | 264 | </androidx.constraintlayout.widget.ConstraintLayout> |