Commit e91fb2bcfd44539adb8b301f8db808b5b437a56c
1 parent
21a03311cb
Exists in
master
BUG修改
Showing
3 changed files
with
41 additions
and
23 deletions
Show diff stats
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 1001 |
29 | versionName "1.0" | 29 | versionName "1.0.0.1" |
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 | debuggable true |
44 | minifyEnabled false | 44 | minifyEnabled false |
45 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 45 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
46 | signingConfig signingConfigs.config | 46 | signingConfig signingConfigs.config |
47 | } | 47 | } |
48 | release { | 48 | release { |
49 | debuggable true | 49 | debuggable true |
50 | minifyEnabled false | 50 | minifyEnabled false |
51 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 51 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
52 | signingConfig signingConfigs.config | 52 | signingConfig signingConfigs.config |
53 | } | 53 | } |
54 | } | 54 | } |
55 | lintOptions { | 55 | lintOptions { |
56 | checkReleaseBuilds false | 56 | checkReleaseBuilds false |
57 | abortOnError false | 57 | abortOnError false |
58 | } | 58 | } |
59 | compileOptions { | 59 | compileOptions { |
60 | sourceCompatibility JavaVersion.VERSION_1_8 | 60 | sourceCompatibility JavaVersion.VERSION_1_8 |
61 | targetCompatibility JavaVersion.VERSION_1_8 | 61 | targetCompatibility JavaVersion.VERSION_1_8 |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | dependencies { | 65 | dependencies { |
66 | support.each { k, v -> implementation v } | 66 | support.each { k, v -> implementation v } |
67 | api project(path: ':libs:common') | 67 | api project(path: ':libs:common') |
68 | implementation 'androidx.appcompat:appcompat:1.5.1' | 68 | implementation 'androidx.appcompat:appcompat:1.5.1' |
69 | implementation 'com.google.android.material:material:1.6.1' | 69 | implementation 'com.google.android.material:material:1.6.1' |
70 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | 70 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' |
71 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' | 71 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' |
72 | } | 72 | } |
app/src/main/assets/yinsi.html
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="en"> | 2 | <html lang="en"> |
3 | 3 | ||
4 | <head> | 4 | <head> |
5 | <meta charset="UTF-8" /> | 5 | <meta charset="UTF-8" /> |
6 | <link rel="icon" href="/logo.png" /> | 6 | <link rel="icon" href="/logo.png" /> |
7 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
8 | <title>隐私政策</title> | 8 | <title>隐私政策</title> |
9 | <!-- [if lt IE 11]><script>window.location.href='./public/ie.html';</script>![endif] --> | 9 | <!-- [if lt IE 11]><script>window.location.href='./public/ie.html';</script>![endif] --> |
10 | <style> | 10 | <style> |
11 | </style> | 11 | body { |
12 | font-size: 1rem; | ||
13 | padding: 1rem; | ||
14 | color: #333; | ||
15 | } | ||
16 | h1 { | ||
17 | font-size: 1.4rem; | ||
18 | margin: 3rem 0; | ||
19 | } | ||
20 | .date { | ||
21 | font-size: 0.8rem; | ||
22 | margin-bottom: 1.4rem; | ||
23 | color: gray; | ||
24 | } | ||
25 | p, li { | ||
26 | font-size: 0.9rem; | ||
27 | line-height: 2rem; | ||
28 | } | ||
29 | .title { | ||
30 | font-size: 1rem; | ||
31 | font-weight: bold; | ||
32 | } | ||
33 | </style> | ||
12 | </head> | 34 | </head> |
13 | 35 | ||
14 | <body> | 36 | <body> |
15 | <h1>隐私政策</h1> | 37 | <h1>隐私政策</h1> |
16 | <div>更新日期:<strong>2024/3/4</strong></div> | 38 | <div class="date">更新日期:2024/3/4</div> |
17 | <div>生效日期:<strong>2024/3/4</strong></div> | 39 | <div class="date" style="margin-bottom: 3rem;">生效日期:2024/3/4</div> |
18 | <h2>导言</h2> | 40 | <p class="title">导言</p> |
19 | <p> | 41 | <p> |
20 | <i>家长管控</i> 是一款由 <i>好记星</i> (以下简称“我们”)提供的产品。 | 42 | 家长管控是一款由好记星(以下简称“我们”)提供的产品。 |
21 | 您在使用我们的服务时,我们可能会收集和使用您的相关信息。我们希望通过本《隐私政策》向您说明,在使用我们的服务时,我们如何收集、使用、储存和分享这些信息,以及我们为您提供的访问、更新、控制和保护这些信息的方式。 | 43 | 您在使用我们的服务时,我们可能会收集和使用您的相关信息。我们希望通过本《隐私政策》向您说明,在使用我们的服务时,我们如何收集、使用、储存和分享这些信息,以及我们为您提供的访问、更新、控制和保护这些信息的方式。 |
22 | 本《隐私政策》与您所使用的 <i>家长管控</i> 服务息息相关,希望您仔细阅读,在需要时,按照本《隐私政策》的指引,作出您认为适当的选择。本《隐私政策》中涉及的相关技术词汇,我们尽量以简明扼要的表述,并提供进一步说明的链接,以便您的理解。 | 44 | 本《隐私政策》与您所使用的家长管控服务息息相关,希望您仔细阅读,在需要时,按照本《隐私政策》的指引,作出您认为适当的选择。本《隐私政策》中涉及的相关技术词汇,我们尽量以简明扼要的表述,并提供进一步说明的链接,以便您的理解。 |
23 | </p> | 45 | </p> |
24 | <p><strong>您使用或继续使用我们的服务,即意味着同意我们按照本《隐私政策》收集、使用、储存和分享您的相关信息。</strong></p> | 46 | <p>您使用或继续使用我们的服务,即意味着同意我们按照本《隐私政策》收集、使用、储存和分享您的相关信息。</p> |
25 | <p>如对本《隐私政策》或相关事宜有任何问题,请通过 <strong>13665187964</strong> 与我们联系。</p> | 47 | <p>如对本《隐私政策》或相关事宜有任何问题,请通过 <strong>13665187964</strong> 与我们联系。</p> |
26 | 48 | ||
27 | <h2>1. 我们收集的信息</h2> | 49 | <p class="title">1. 我们收集的信息</p> |
28 | <p>我们或我们的第三方合作伙伴提供服务时,可能会收集、储存和使用下列与您有关的信息。如果您不提供相关信息,可能无法注册成为我们的用户或无法享受我们提供的某些服务,或者无法达到相关服务拟达到的效果。</p> | 50 | <p>我们或我们的第三方合作伙伴提供服务时,可能会收集、储存和使用下列与您有关的信息。如果您不提供相关信息,可能无法注册成为我们的用户或无法享受我们提供的某些服务,或者无法达到相关服务拟达到的效果。</p> |
29 | 51 | ||
30 | <ul> | 52 | <ul> |
31 | <li><strong>个人信息</strong>,您在注册账户或使用我们的服务时,向我们提供的相关个人信息,例如电话号码、电子邮件等。</li> | 53 | <li><strong>个人信息</strong>,您在注册账户或使用我们的服务时,向我们提供的相关个人信息,例如电话号码、电子邮件等。</li> |
32 | <li><strong>日志信息</strong>,指您使用我们的服务时,系统可能通过cookies、标识符及相关技术收集的信息,包括您的<strong>设备信息</strong>、<strong>浏览信息</strong>、<strong>点击信息</strong>,并将该等信息储存为日志信息,为您提供个性化的用户体验、保障服务安全。您可以通过浏览器设置拒绝或管理cookie、标识符或相关技术的使用。</li> | 54 | <li><strong>日志信息</strong>,指您使用我们的服务时,系统可能通过cookies、标识符及相关技术收集的信息,包括您的<strong>设备信息</strong>、<strong>浏览信息</strong>、<strong>点击信息</strong>,并将该等信息储存为日志信息,为您提供个性化的用户体验、保障服务安全。您可以通过浏览器设置拒绝或管理cookie、标识符或相关技术的使用。</li> |
33 | </ul> | 55 | </ul> |
34 | |||
35 | |||
36 | |||
37 | |||
38 | </ul> | 56 | </ul> |
39 | 57 | ||
40 | <h2>2. 信息的存储</h2> | 58 | <p class="title">2. 信息的存储</p> |
41 | <strong>2.1 信息存储的方式和期限</strong> | 59 | <strong>2.1 信息存储的方式和期限</strong> |
42 | <ul> | 60 | <ul> |
43 | <li>我们会通过安全的方式存储您的信息,包括本地存储(例如利用APP进行数据缓存)、数据库和服务器日志。</li> | 61 | <li>我们会通过安全的方式存储您的信息,包括本地存储(例如利用APP进行数据缓存)、数据库和服务器日志。</li> |
44 | <li>一般情况下,我们只会在为实现服务目的所必需的时间内或法律法规规定的条件下存储您的个人信息。</li> | 62 | <li>一般情况下,我们只会在为实现服务目的所必需的时间内或法律法规规定的条件下存储您的个人信息。</li> |
45 | </ul> | 63 | </ul> |
46 | 64 | ||
47 | <strong>2.2 信息存储的地域</strong> | 65 | <strong>2.2 信息存储的地域</strong> |
48 | <ul> | 66 | <ul> |
49 | <li>我们会按照法律法规规定,将境内收集的用户个人信息存储于中国境内。</li> | 67 | <li>我们会按照法律法规规定,将境内收集的用户个人信息存储于中国境内。</li> |
50 | <li>目前我们不会跨境传输或存储您的个人信息。将来如需跨境传输或存储的,我们会向您告知信息出境的目的、接收方、安全保证措施和安全风险,并征得您的同意。</li> | 68 | <li>目前我们不会跨境传输或存储您的个人信息。将来如需跨境传输或存储的,我们会向您告知信息出境的目的、接收方、安全保证措施和安全风险,并征得您的同意。</li> |
51 | </ul> | 69 | </ul> |
52 | 70 | ||
53 | <strong>2.3 产品或服务停止运营时的通知</strong> | 71 | <strong>2.3 产品或服务停止运营时的通知</strong> |
54 | <ul> | 72 | <ul> |
55 | <li>当我们的产品或服务发生停止运营的情况时,我们将以推送通知、公告等形式通知您,并在合理期限内删除您的个人信息或进行匿名化处理,法律法规另有规定的除外。</li> | 73 | <li>当我们的产品或服务发生停止运营的情况时,我们将以推送通知、公告等形式通知您,并在合理期限内删除您的个人信息或进行匿名化处理,法律法规另有规定的除外。</li> |
56 | </ul> | 74 | </ul> |
57 | 75 | ||
58 | <h2>3. 信息安全</h2> | 76 | <p class="title">3. 信息安全</p> |
59 | <p> | 77 | <p> |
60 | 我们使用各种安全技术和程序,以防信息的丢失、不当使用、未经授权阅览或披露。例如,在某些服务中,我们将利用加密技术(例如SSL)来保护您提供的个人信息。但请您理解,由于技术的限制以及可能存在的各种恶意手段,在互联网行业,即便竭尽所能加强安全措施,也不可能始终保证信息百分之百的安全。您需要了解,您接入我们的服务所用的系统和通讯网络,有可能因我们可控范围外的因素而出现问题。 | 78 | 我们使用各种安全技术和程序,以防信息的丢失、不当使用、未经授权阅览或披露。例如,在某些服务中,我们将利用加密技术(例如SSL)来保护您提供的个人信息。但请您理解,由于技术的限制以及可能存在的各种恶意手段,在互联网行业,即便竭尽所能加强安全措施,也不可能始终保证信息百分之百的安全。您需要了解,您接入我们的服务所用的系统和通讯网络,有可能因我们可控范围外的因素而出现问题。 |
61 | </p> | 79 | </p> |
62 | 80 | ||
63 | <h2>4. 我们如何使用信息</h2> | 81 | <p class="title">4. 我们如何使用信息</p> |
64 | <p>我们可能将在向您提供服务的过程之中所收集的信息用作下列用途:</p> | 82 | <p>我们可能将在向您提供服务的过程之中所收集的信息用作下列用途:</p> |
65 | <ul> | 83 | <ul> |
66 | <li>向您提供服务;</li> | 84 | <li>向您提供服务;</li> |
67 | <li>在我们提供服务时,用于身份验证、客户服务、安全防范、诈骗监测、存档和备份用途,确保我们向您提供的产品和服务的安全性;</li> | 85 | <li>在我们提供服务时,用于身份验证、客户服务、安全防范、诈骗监测、存档和备份用途,确保我们向您提供的产品和服务的安全性;</li> |
68 | <li>帮助我们设计新服务,改善我们现有服务;</li> | 86 | <li>帮助我们设计新服务,改善我们现有服务;</li> |
69 | <li>使我们更加了解您如何接入和使用我们的服务,从而针对性地回应您的个性化需求,例如语言设定、位置设定、个性化的帮助服务和指示,或对您和其他用户作出其他方面的回应;</li> | 87 | <li>使我们更加了解您如何接入和使用我们的服务,从而针对性地回应您的个性化需求,例如语言设定、位置设定、个性化的帮助服务和指示,或对您和其他用户作出其他方面的回应;</li> |
70 | <li>向您提供与您更加相关的广告以替代普遍投放的广告;</li> | 88 | <li>向您提供与您更加相关的广告以替代普遍投放的广告;</li> |
71 | <li>评估我们服务中的广告和其他促销及推广活动的效果,并加以改善;</li> | 89 | <li>评估我们服务中的广告和其他促销及推广活动的效果,并加以改善;</li> |
72 | <li>软件认证或管理软件升级;</li> | 90 | <li>软件认证或管理软件升级;</li> |
73 | <li>让您参与有关我们产品和服务的调查。</li> | 91 | <li>让您参与有关我们产品和服务的调查。</li> |
74 | </ul> | 92 | </ul> |
75 | 93 | ||
76 | <h2>5. 信息共享</h2> | 94 | <p class="title">5. 信息共享</p> |
77 | <p> | 95 | <p> |
78 | 目前,我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。 | 96 | 目前,我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。 |
79 | </p> | 97 | </p> |
80 | <p> | 98 | <p> |
81 | 为了投放广告,评估、优化广告投放效果等目的,我们需要向广告主及其代理商等第三方合作伙伴共享您的部分数据,要求其严格遵守我们关于数据隐私保护的措施与要求,包括但不限于根据数据保护协议、承诺书及相关数据处理政策进行处理,避免识别出个人身份,保障隐私安全。 | 99 | 为了投放广告,评估、优化广告投放效果等目的,我们需要向广告主及其代理商等第三方合作伙伴共享您的部分数据,要求其严格遵守我们关于数据隐私保护的措施与要求,包括但不限于根据数据保护协议、承诺书及相关数据处理政策进行处理,避免识别出个人身份,保障隐私安全。 |
82 | </p> | 100 | </p> |
83 | <p> | 101 | <p> |
84 | 我们不会向合作伙伴分享可用于识别您个人身份的信息(例如您的姓名或电子邮件地址),除非您明确授权。 | 102 | 我们不会向合作伙伴分享可用于识别您个人身份的信息(例如您的姓名或电子邮件地址),除非您明确授权。 |
85 | </p> | 103 | </p> |
86 | <p> | 104 | <p> |
87 | 我们不会对外公开披露所收集的个人信息,如必须公开披露时,我们会向您告知此次公开披露的目的、披露信息的类型及可能涉及的敏感信息,并征得您的明示同意。 | 105 | 我们不会对外公开披露所收集的个人信息,如必须公开披露时,我们会向您告知此次公开披露的目的、披露信息的类型及可能涉及的敏感信息,并征得您的明示同意。 |
88 | </p> | 106 | </p> |
89 | <p> | 107 | <p> |
90 | 随着我们业务的持续发展,我们有可能进行合并、收购、资产转让等交易,我们将告知您相关情形,按照法律法规及不低于本《隐私政策》所要求的标准继续保护或要求新的控制者继续保护您的个人信息。 | 108 | 随着我们业务的持续发展,我们有可能进行合并、收购、资产转让等交易,我们将告知您相关情形,按照法律法规及不低于本《隐私政策》所要求的标准继续保护或要求新的控制者继续保护您的个人信息。 |
91 | </p> | 109 | </p> |
92 | <p> | 110 | <p> |
93 | 另外,根据相关法律法规及国家标准,以下情形中,我们可能会共享、转让、公开披露个人信息无需事先征得您的授权同意: | 111 | 另外,根据相关法律法规及国家标准,以下情形中,我们可能会共享、转让、公开披露个人信息无需事先征得您的授权同意: |
94 | </p> | 112 | </p> |
95 | <ul> | 113 | <ul> |
96 | <li>与国家安全、国防安全直接相关的;</li> | 114 | <li>与国家安全、国防安全直接相关的;</li> |
97 | <li>与公共安全、公共卫生、重大公共利益直接相关的;</li> | 115 | <li>与公共安全、公共卫生、重大公共利益直接相关的;</li> |
98 | <li>犯罪侦查、起诉、审判和判决执行等直接相关的;</li> | 116 | <li>犯罪侦查、起诉、审判和判决执行等直接相关的;</li> |
99 | <li>出于维护个人信息主体或其他个人的生命、财产等重大合法权益但又很难得到本人同意的;</li> | 117 | <li>出于维护个人信息主体或其他个人的生命、财产等重大合法权益但又很难得到本人同意的;</li> |
100 | <li>个人信息主体自行向社会公众公开个人信息的;</li> | 118 | <li>个人信息主体自行向社会公众公开个人信息的;</li> |
101 | <li>从合法公开披露的信息中收集个人信息的,如合法的新闻报道、政府信息公开等渠道。</li> | 119 | <li>从合法公开披露的信息中收集个人信息的,如合法的新闻报道、政府信息公开等渠道。</li> |
102 | </ul> | 120 | </ul> |
103 | 121 | ||
104 | <h2>6. 您的权利</h2> | 122 | <p class="title">6. 您的权利</p> |
105 | <p> | 123 | <p> |
106 | 在您使用我们的服务期间,我们可能会视产品具体情况为您提供相应的操作设置,以便您可以查询、删除、更正或撤回您的相关个人信息,您可参考相应的具体指引进行操作。此外,我们还设置了投诉举报渠道,您的意见将会得到及时的处理。如果您无法通过上述途径和方式行使您的个人信息主体权利,您可以通过本《隐私政策》中提供的联系方式提出您的请求,我们会按照法律法规的规定予以反馈。 | 124 | 在您使用我们的服务期间,我们可能会视产品具体情况为您提供相应的操作设置,以便您可以查询、删除、更正或撤回您的相关个人信息,您可参考相应的具体指引进行操作。此外,我们还设置了投诉举报渠道,您的意见将会得到及时的处理。如果您无法通过上述途径和方式行使您的个人信息主体权利,您可以通过本《隐私政策》中提供的联系方式提出您的请求,我们会按照法律法规的规定予以反馈。 |
107 | </p> | 125 | </p> |
108 | <p>当您决定不再使用我们的产品或服务时,可以申请注销账户。注销账户后,除法律法规另有规定外,我们将删除或匿名化处理您的个人信息。</p> | 126 | <p>当您决定不再使用我们的产品或服务时,可以申请注销账户。注销账户后,除法律法规另有规定外,我们将删除或匿名化处理您的个人信息。</p> |
109 | 127 | ||
110 | <h2>7. 变更</h2> | 128 | <p class="title">7. 变更</p> |
111 | <p> | 129 | <p> |
112 | 我们可能适时修订本《隐私政策》的条款。当变更发生时,我们会在版本更新时向您提示新的《隐私政策》,并向您说明生效日期。请您仔细阅读变更后的《隐私政策》内容,<strong>若您继续使用我们的服务,即表示您同意我们按照更新后的《隐私政策》处理您的个人信息。</strong> | 130 | 我们可能适时修订本《隐私政策》的条款。当变更发生时,我们会在版本更新时向您提示新的《隐私政策》,并向您说明生效日期。请您仔细阅读变更后的《隐私政策》内容,<strong>若您继续使用我们的服务,即表示您同意我们按照更新后的《隐私政策》处理您的个人信息。</strong> |
113 | </p> | 131 | </p> |
114 | 132 | ||
115 | <h2>8. 未成年人保护</h2> | 133 | <p class="title">8. 未成年人保护</p> |
116 | <p> | 134 | <p> |
117 | 我们鼓励父母或监护人指导未满十八岁的未成年人使用我们的服务。我们建议未成年人鼓励他们的父母或监护人阅读本《隐私政策》,并建议未成年人在提交的个人信息之前寻求父母或监护人的同意和指导。 | 135 | 我们鼓励父母或监护人指导未满十八岁的未成年人使用我们的服务。我们建议未成年人鼓励他们的父母或监护人阅读本《隐私政策》,并建议未成年人在提交的个人信息之前寻求父母或监护人的同意和指导。 |
118 | </p> | 136 | </p> |
app/src/main/java/com/hjx/parent/fragment/MeFragment.java
1 | package com.hjx.parent.fragment; | 1 | package com.hjx.parent.fragment; |
2 | 2 | ||
3 | import android.app.AlertDialog; | 3 | import android.app.AlertDialog; |
4 | import android.content.DialogInterface; | 4 | import android.content.DialogInterface; |
5 | import android.content.Intent; | 5 | import android.content.Intent; |
6 | import android.text.TextUtils; | 6 | import android.text.TextUtils; |
7 | import android.view.View; | 7 | import android.view.View; |
8 | import android.widget.ImageView; | 8 | import android.widget.ImageView; |
9 | import android.widget.TextView; | 9 | import android.widget.TextView; |
10 | import android.widget.Toast; | 10 | import android.widget.Toast; |
11 | 11 | ||
12 | import androidx.annotation.NonNull; | 12 | import androidx.annotation.NonNull; |
13 | import androidx.annotation.Nullable; | 13 | import androidx.annotation.Nullable; |
14 | import androidx.constraintlayout.widget.Group; | 14 | import androidx.constraintlayout.widget.Group; |
15 | import androidx.recyclerview.widget.LinearLayoutManager; | 15 | import androidx.recyclerview.widget.LinearLayoutManager; |
16 | import androidx.recyclerview.widget.RecyclerView; | 16 | import androidx.recyclerview.widget.RecyclerView; |
17 | 17 | ||
18 | import com.bumptech.glide.Glide; | 18 | import com.bumptech.glide.Glide; |
19 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | 19 | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
20 | import com.bumptech.glide.request.RequestOptions; | 20 | import com.bumptech.glide.request.RequestOptions; |
21 | import com.chad.library.adapter.base.BaseQuickAdapter; | 21 | import com.chad.library.adapter.base.BaseQuickAdapter; |
22 | import com.chad.library.adapter.base.BaseViewHolder; | 22 | import com.chad.library.adapter.base.BaseViewHolder; |
23 | import com.developer.wang.utils.PermissionUtils; | 23 | import com.developer.wang.utils.PermissionUtils; |
24 | import com.google.gson.Gson; | 24 | import com.google.gson.Gson; |
25 | import com.google.gson.JsonArray; | 25 | import com.google.gson.JsonArray; |
26 | import com.hjq.permissions.OnPermissionCallback; | 26 | import com.hjq.permissions.OnPermissionCallback; |
27 | import com.hjq.permissions.Permission; | 27 | import com.hjq.permissions.Permission; |
28 | import com.hjq.permissions.XXPermissions; | 28 | import com.hjq.permissions.XXPermissions; |
29 | import com.hjx.parent.AccountActivity; | 29 | import com.hjx.parent.AccountActivity; |
30 | import com.hjx.parent.AddStudentActivity; | 30 | import com.hjx.parent.AddStudentActivity; |
31 | import com.hjx.parent.EditStudentActivity; | 31 | import com.hjx.parent.EditStudentActivity; |
32 | import com.hjx.parent.LoginActivity; | 32 | import com.hjx.parent.LoginActivity; |
33 | import com.hjx.parent.MainActivity; | 33 | import com.hjx.parent.MainActivity; |
34 | import com.hjx.parent.QRActivity; | 34 | import com.hjx.parent.QRActivity; |
35 | import com.hjx.parent.R; | 35 | import com.hjx.parent.R; |
36 | import com.hjx.parent.UserActivity; | 36 | import com.hjx.parent.UserActivity; |
37 | import com.hjx.parent.YinsiActivity; | 37 | import com.hjx.parent.YinsiActivity; |
38 | import com.hjx.parent.bean.StudentBean; | 38 | import com.hjx.parent.bean.StudentBean; |
39 | import com.prws.common.base.BaseFragment; | 39 | import com.prws.common.base.BaseFragment; |
40 | import com.prws.common.net.NetWorks; | 40 | import com.prws.common.net.NetWorks; |
41 | import com.prws.common.utils.LogUtil; | 41 | import com.prws.common.utils.LogUtil; |
42 | import com.prws.common.utils.ScreenUtils; | 42 | import com.prws.common.utils.ScreenUtils; |
43 | import com.prws.common.utils.SharedPreferencesUtil; | 43 | import com.prws.common.utils.SharedPreferencesUtil; |
44 | 44 | ||
45 | import org.json.JSONArray; | 45 | import org.json.JSONArray; |
46 | import org.json.JSONObject; | 46 | import org.json.JSONObject; |
47 | 47 | ||
48 | import java.util.ArrayList; | 48 | import java.util.ArrayList; |
49 | import java.util.HashMap; | 49 | import java.util.HashMap; |
50 | import java.util.List; | 50 | import java.util.List; |
51 | import java.util.Map; | 51 | import java.util.Map; |
52 | 52 | ||
53 | import butterknife.BindView; | 53 | import butterknife.BindView; |
54 | import butterknife.OnClick; | 54 | import butterknife.OnClick; |
55 | import io.reactivex.Observer; | 55 | import io.reactivex.Observer; |
56 | import io.reactivex.disposables.Disposable; | 56 | import io.reactivex.disposables.Disposable; |
57 | import okhttp3.ResponseBody; | 57 | import okhttp3.ResponseBody; |
58 | 58 | ||
59 | public class MeFragment extends BaseFragment { | 59 | public class MeFragment extends BaseFragment { |
60 | @Override | 60 | @Override |
61 | protected int getLayoutRes() { | 61 | protected int getLayoutRes() { |
62 | return R.layout.fragment_me; | 62 | return R.layout.fragment_me; |
63 | } | 63 | } |
64 | 64 | ||
65 | Group group_1; | 65 | Group group_1; |
66 | TextView tv_name; | 66 | TextView tv_name; |
67 | TextView tv_phone; | 67 | TextView tv_phone; |
68 | ImageView iv_toux; | 68 | ImageView iv_toux; |
69 | RecyclerView recycle; | 69 | RecyclerView recycle; |
70 | 70 | ||
71 | @Override | 71 | @Override |
72 | protected void initDatas() { | 72 | protected void initDatas() { |
73 | super.initDatas(); | 73 | super.initDatas(); |
74 | recycle = mRootView.findViewById(R.id.recycle); | 74 | recycle = mRootView.findViewById(R.id.recycle); |
75 | group_1 = mRootView.findViewById(R.id.group_1); | 75 | group_1 = mRootView.findViewById(R.id.group_1); |
76 | String role = (String) SharedPreferencesUtil.getData("role", ""); | 76 | String role = (String) SharedPreferencesUtil.getData("role", ""); |
77 | String userId = (String) SharedPreferencesUtil.getData("userId", ""); | 77 | String userId = (String) SharedPreferencesUtil.getData("userId", ""); |
78 | String token = (String) SharedPreferencesUtil.getData("token", ""); | 78 | String token = (String) SharedPreferencesUtil.getData("token", ""); |
79 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); | 79 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); |
80 | group_1.setVisibility(View.VISIBLE); | 80 | group_1.setVisibility(View.VISIBLE); |
81 | iv_toux = mRootView.findViewById(R.id.iv_toux); | 81 | iv_toux = mRootView.findViewById(R.id.iv_toux); |
82 | tv_name = mRootView.findViewById(R.id.tv_name); | 82 | tv_name = mRootView.findViewById(R.id.tv_name); |
83 | tv_phone = mRootView.findViewById(R.id.tv_phone); | 83 | tv_phone = mRootView.findViewById(R.id.tv_phone); |
84 | tv_phone.setVisibility(View.GONE); | 84 | tv_phone.setVisibility(View.GONE); |
85 | // tv_phone.setText(phone); | 85 | // tv_phone.setText(phone); |
86 | tv_name.setText(phone); | 86 | tv_name.setText(phone); |
87 | } | 87 | } |
88 | 88 | ||
89 | @Override | 89 | @Override |
90 | public void onResume() { | 90 | public void onResume() { |
91 | super.onResume(); | 91 | super.onResume(); |
92 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); | 92 | String photo = (String) SharedPreferencesUtil.getData("photo", ""); |
93 | if (!TextUtils.isEmpty(photo)) { | 93 | if (!TextUtils.isEmpty(photo)) { |
94 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | 94 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); |
95 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 95 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
96 | Glide.with(getContext()).load(photo).apply(options).into(iv_toux); | 96 | Glide.with(getContext()).load(photo).apply(options).into(iv_toux); |
97 | } | 97 | } |
98 | loadChildList(); | 98 | loadChildList(); |
99 | } | 99 | } |
100 | 100 | ||
101 | ArrayList<StudentBean> alist = new ArrayList<>(); | 101 | ArrayList<StudentBean> alist = new ArrayList<>(); |
102 | 102 | ||
103 | public void loadChildList() { | 103 | public void loadChildList() { |
104 | NetWorks.listChildren(new Observer<ResponseBody>() { | 104 | NetWorks.listChildren(new Observer<ResponseBody>() { |
105 | @Override | 105 | @Override |
106 | public void onSubscribe(Disposable d) { | 106 | public void onSubscribe(Disposable d) { |
107 | 107 | ||
108 | } | 108 | } |
109 | 109 | ||
110 | @Override | 110 | @Override |
111 | public void onNext(ResponseBody responseBody) { | 111 | public void onNext(ResponseBody responseBody) { |
112 | try { | 112 | try { |
113 | 113 | ||
114 | String str = responseBody.string().toString(); | 114 | String str = responseBody.string().toString(); |
115 | 115 | ||
116 | 116 | ||
117 | LogUtil.e("TAG", "----" + str); | 117 | LogUtil.e("TAG", "----" + str); |
118 | JSONObject jo = new JSONObject(str); | 118 | JSONObject jo = new JSONObject(str); |
119 | boolean isSucceed = jo.getBoolean("success"); | 119 | boolean isSucceed = jo.getBoolean("success"); |
120 | if (isSucceed) { | 120 | if (isSucceed) { |
121 | JSONArray jarr = jo.getJSONArray("data"); | 121 | JSONArray jarr = jo.getJSONArray("data"); |
122 | alist.clear(); | 122 | alist.clear(); |
123 | for (int i = 0; i < jarr.length(); i++) { | 123 | for (int i = 0; i < jarr.length(); i++) { |
124 | JSONObject jo2 = jarr.getJSONObject(i); | 124 | JSONObject jo2 = jarr.getJSONObject(i); |
125 | Gson gson = new Gson(); | 125 | Gson gson = new Gson(); |
126 | StudentBean sb = gson.fromJson(jo2.toString(), StudentBean.class); | 126 | StudentBean sb = gson.fromJson(jo2.toString(), StudentBean.class); |
127 | alist.add(sb); | 127 | alist.add(sb); |
128 | } | 128 | } |
129 | if (alist.size() > 0) { | 129 | if (alist.size() > 0) { |
130 | loadList(); | 130 | loadList(); |
131 | } | 131 | } |
132 | 132 | ||
133 | } else { | 133 | } else { |
134 | 134 | ||
135 | } | 135 | } |
136 | } catch (Exception e) { | 136 | } catch (Exception e) { |
137 | e.printStackTrace(); | 137 | e.printStackTrace(); |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | @Override | 141 | @Override |
142 | public void onError(Throwable e) { | 142 | public void onError(Throwable e) { |
143 | 143 | e.toString(); | |
144 | } | 144 | } |
145 | 145 | ||
146 | @Override | 146 | @Override |
147 | public void onComplete() { | 147 | public void onComplete() { |
148 | 148 | ||
149 | } | 149 | } |
150 | }); | 150 | }); |
151 | mRootView.findViewById(R.id.view_4).setOnClickListener(view -> startActivity(new Intent(getActivity(), YinsiActivity.class))); | 151 | mRootView.findViewById(R.id.view_4).setOnClickListener(view -> startActivity(new Intent(getActivity(), YinsiActivity.class))); |
152 | mRootView.findViewById(R.id.view_5).setOnClickListener(view -> startActivity(new Intent(getActivity(), UserActivity.class))); | 152 | mRootView.findViewById(R.id.view_5).setOnClickListener(view -> startActivity(new Intent(getActivity(), UserActivity.class))); |
153 | mRootView.findViewById(R.id.view_3).setOnClickListener(view -> startActivityForResult(new Intent(getActivity(), AccountActivity.class), 1003)); | 153 | mRootView.findViewById(R.id.view_3).setOnClickListener(view -> startActivityForResult(new Intent(getActivity(), AccountActivity.class), 1003)); |
154 | } | 154 | } |
155 | 155 | ||
156 | // @Override | 156 | // @Override |
157 | // public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | 157 | // public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
158 | // super.onActivityResult(requestCode, resultCode, data); | 158 | // super.onActivityResult(requestCode, resultCode, data); |
159 | // Intent intent = new Intent(getActivity(), LoginActivity.class); | 159 | // Intent intent = new Intent(getActivity(), LoginActivity.class); |
160 | // startActivity(intent); | 160 | // startActivity(intent); |
161 | // getActivity().finish(); | 161 | // getActivity().finish(); |
162 | // } | 162 | // } |
163 | 163 | ||
164 | public void loadList() { | 164 | public void loadList() { |
165 | StudentBean sb = new StudentBean(); | 165 | StudentBean sb = new StudentBean(); |
166 | sb.setNickName("添加学生"); | 166 | sb.setNickName("添加学生"); |
167 | alist.add(0, sb); | 167 | alist.add(0, sb); |
168 | BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_child, alist) { | 168 | BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_child, alist) { |
169 | @Override | 169 | @Override |
170 | protected void convert(@NonNull BaseViewHolder item, Object o) { | 170 | protected void convert(@NonNull BaseViewHolder item, Object o) { |
171 | StudentBean studentBean = alist.get(item.getAdapterPosition()); | 171 | StudentBean studentBean = alist.get(item.getAdapterPosition()); |
172 | item.setText(R.id.tv_name, studentBean.getNickName()); | 172 | item.setText(R.id.tv_name, studentBean.getNickName()); |
173 | if (TextUtils.isEmpty(studentBean.getStuId())) { | 173 | if (TextUtils.isEmpty(studentBean.getStuId())) { |
174 | item.setImageResource(R.id.iv_avatar, R.mipmap.tjxss); | 174 | item.setImageResource(R.id.iv_avatar, R.mipmap.tjxss); |
175 | item.setVisible(R.id.iv_vip, false); | 175 | item.setVisible(R.id.iv_vip, false); |
176 | item.getConvertView().setOnClickListener(new View.OnClickListener() { | 176 | item.getConvertView().setOnClickListener(new View.OnClickListener() { |
177 | @Override | 177 | @Override |
178 | public void onClick(View view) { | 178 | public void onClick(View view) { |
179 | startActivity(new Intent(getActivity(), AddStudentActivity.class)); | 179 | startActivity(new Intent(getActivity(), AddStudentActivity.class)); |
180 | } | 180 | } |
181 | }); | 181 | }); |
182 | } else { | 182 | } else { |
183 | if (TextUtils.isEmpty(studentBean.getPhoto())) { | 183 | if (TextUtils.isEmpty(studentBean.getPhoto())) { |
184 | item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | 184 | item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); |
185 | } else { | 185 | } else { |
186 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | 186 | RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); |
187 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | 187 | RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); |
188 | Glide.with(getActivity()).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); | 188 | Glide.with(getActivity()).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); |
189 | } | 189 | } |
190 | item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); | 190 | item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); |
191 | item.getConvertView().setOnClickListener(new View.OnClickListener() { | 191 | item.getConvertView().setOnClickListener(new View.OnClickListener() { |
192 | @Override | 192 | @Override |
193 | public void onClick(View view) { | 193 | public void onClick(View view) { |
194 | startActivity(new Intent(getActivity(), EditStudentActivity.class).putExtra("student", new Gson().toJson(studentBean))); | 194 | startActivity(new Intent(getActivity(), EditStudentActivity.class).putExtra("student", new Gson().toJson(studentBean))); |
195 | } | 195 | } |
196 | }); | 196 | }); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | }; | 199 | }; |
200 | recycle.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); | 200 | recycle.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); |
201 | recycle.setAdapter(adapter); | 201 | recycle.setAdapter(adapter); |
202 | } | 202 | } |
203 | 203 | ||
204 | } | 204 | } |
205 | 205 |