Przeglądaj źródła

添加信息隐私协议

huyuguo 4 lat temu
rodzic
commit
5a5605fcb2

+ 12 - 9
app/src/main/AndroidManifest.xml

@ -2,8 +2,8 @@
2 2
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 3
    xmlns:tools="http://schemas.android.com/tools"
4 4
    package="com.electric.chargingpile"
5
    android:versionCode="93"
6
    android:versionName="3.5.5">
5
    android:versionCode="94"
6
    android:versionName="3.5.6">
7 7
8 8
    <uses-permission android:name="android.permission.BLUETOOTH" />
9 9
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
@ -71,6 +71,15 @@
71 71
        android:resizeableActivity="true"
72 72
        android:theme="@style/AppTheme"
73 73
        tools:ignore="LockedOrientationActivity">
74
        <activity
75
            android:name=".activity.PrivacyAgreementActivity"
76
            android:screenOrientation="portrait">
77
            <intent-filter>
78
                <action android:name="android.intent.action.MAIN" />
79
                <category android:name="android.intent.category.LAUNCHER" />
80
            </intent-filter>
81
        </activity>
82
74 83
        <activity android:name=".activity.SearchAllActivity"></activity>
75 84
        <activity android:name=".activity.ShareTwoPictureActivity" />
76 85
        <activity
@ -87,13 +96,7 @@
87 96
            android:label="@string/app_name"
88 97
            android:launchMode="singleTop"
89 98
            android:screenOrientation="portrait"
90
            android:windowSoftInputMode="stateHidden|adjustUnspecified">
91
            <intent-filter>
92
                <action android:name="android.intent.action.MAIN" />
93
94
                <category android:name="android.intent.category.LAUNCHER" />
95
            </intent-filter>
96
        </activity>
99
            android:windowSoftInputMode="stateHidden|adjustUnspecified"></activity>
97 100
        <activity
98 101
            android:name=".activity.MainActicity"
99 102
            android:configChanges="keyboardHidden|orientation"

+ 1 - 0
app/src/main/assets/ShareSDK.xml

@ -54,4 +54,5 @@
54 54
<Kuaishou Enable="false" />
55 55
<Littleredbook Enable="false" />
56 56
<Watermelonvideo Enable="false" />
57
<Tiktok Enable="false" />
57 58
</DevInfor>

+ 96 - 0
app/src/main/java/com/electric/chargingpile/activity/PrivacyAgreementActivity.java

@ -0,0 +1,96 @@
1
package com.electric.chargingpile.activity;
2
3
4
import android.app.Activity;
5
import android.content.Intent;
6
import android.graphics.Color;
7
import android.graphics.Typeface;
8
import android.os.Bundle;
9
import android.text.SpannableString;
10
import android.text.Spanned;
11
import android.text.TextPaint;
12
import android.text.method.LinkMovementMethod;
13
import android.text.style.ClickableSpan;
14
import android.text.style.ForegroundColorSpan;
15
import android.text.style.StyleSpan;
16
import android.view.View;
17
import android.view.Window;
18
import android.view.WindowManager;
19
import android.widget.Button;
20
import android.widget.TextView;
21
import android.widget.Toast;
22
23
import com.electric.chargingpile.R;
24
import com.electric.chargingpile.manager.ProfileManager;
25
import com.electric.chargingpile.util.BarColorUtil;
26
27
public class PrivacyAgreementActivity extends Activity {
28
29
    private TextView agree_enter_text_view;
30
31
    @Override
32
    protected void onCreate(Bundle savedInstanceState) {
33
        super.onCreate(savedInstanceState);
34
        setContentView(R.layout.activity_privacy_agreement);
35
        BarColorUtil.initStatusBarColor(PrivacyAgreementActivity.this);
36
        if (ProfileManager.getInstance().getPrivacyAgreement(this)) {
37
            startActivity(new Intent(PrivacyAgreementActivity.this, WelcomeActivity.class));
38
            finish();
39
        } else {
40
            initView();
41
        }
42
    }
43
44
    private void initView() {
45
        agree_enter_text_view = findViewById(R.id.agree_enter_text_view);
46
47
        String str = "你选择「同意并进入」即表示充分阅读、理解并接受《充电桩APP用户协议和隐私政策》的全部内容"; //23-40 前包括后不包括
48
        //超链接的块对象
49
        ClickableSpan clickableSpan = new ClickableSpan() {
50
            @Override
51
            public void onClick(View widget) {
52
                Intent intent = new Intent(getApplication(), MyWebViewActivity.class);
53
                intent.putExtra("url", "http://evcharge.cc/pc/agreement.html");
54
                startActivity(intent);
55
            }
56
57
            //更新局部效果,使用画笔来设置
58
            @Override
59
            public void updateDrawState(TextPaint ds) {
60
                ds.setColor(Color.parseColor("#39C663"));
61
                ds.setUnderlineText(false);
62
                ds.setFakeBoldText(true);
63
                ds.setTextSize(40);
64
            }
65
        };
66
        //创建Spannable对象
67
        SpannableString span = new SpannableString(str);
68
        //设置局部效果
69
        //(局部的效果对象,局部的起始位置,结束位置,包括方式) INCLUSIVE表示包裹, EXCLUSIVE不包括
70
        span.setSpan(clickableSpan, 23, 40, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);//此处为前包括后不包括
71
        span.setSpan(new StyleSpan(Typeface.BOLD), 3, 10, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
72
        //将文本特效设置到文本框中
73
        agree_enter_text_view.setText(span, TextView.BufferType.SPANNABLE);
74
        //设置触摸监听的解析对象
75
        agree_enter_text_view.setMovementMethod(LinkMovementMethod.getInstance());
76
77
78
        Button agreement_btn = findViewById(R.id.agreement_btn);
79
        agreement_btn.setOnClickListener(new View.OnClickListener() {
80
            @Override
81
            public void onClick(View v) {
82
                startActivity(new Intent(PrivacyAgreementActivity.this, WelcomeActivity.class));
83
                finish();
84
            }
85
        });
86
87
        Button exit_btn = findViewById(R.id.exit_btn);
88
        exit_btn.setOnClickListener(new View.OnClickListener() {
89
            @Override
90
            public void onClick(View v) {
91
                android.os.Process.killProcess(android.os.Process.myPid());
92
            }
93
        });
94
    }
95
96
}

+ 8 - 0
app/src/main/java/com/electric/chargingpile/activity/SimpleNaviActivity.java

@ -8,8 +8,11 @@ import android.util.Log;
8 8
import android.view.Window;
9 9
import android.view.WindowManager;
10 10
11
import com.amap.api.maps.model.BitmapDescriptor;
12
import com.amap.api.maps.model.BitmapDescriptorFactory;
11 13
import com.amap.api.navi.AMapNaviViewOptions;
12 14
import com.amap.api.navi.model.NaviLatLng;
15
import com.amap.api.navi.model.RouteOverlayOptions;
13 16
import com.amap.api.navi.view.RouteOverLay;
14 17
import com.amap.api.navi.AMapNavi;
15 18
import com.amap.api.navi.AMapNaviListener;
@ -283,6 +286,11 @@ public class SimpleNaviActivity extends Activity implements AMapNaviListener, AM
283 286
        routeOverLay.setEndPointBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.icon_newstopr));
284 287
        routeOverLay.setWayPointBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.icon_sgreen));
285 288
        routeOverLay.addToMap();
289
290
        BitmapDescriptor afterGrayTraffic = BitmapDescriptorFactory.fromResource(R.drawable.after_route_gray);
291
        RouteOverlayOptions routeOverlayOptions = new RouteOverlayOptions();
292
        routeOverlayOptions.setPassRoute(afterGrayTraffic.getBitmap());
293
        routeOverLay.setRouteOverlayOptions(routeOverlayOptions);
286 294
    }
287 295
288 296
    @Override

+ 1 - 0
app/src/main/java/com/electric/chargingpile/activity/WelcomeActivity.java

@ -277,6 +277,7 @@ public class WelcomeActivity extends Activity implements OnClickListener, EasyPe
277 277
        super.onCreate(savedInstanceState);
278 278
        setContentView(R.layout.activity_welcome);
279 279
        BarColorUtil.initStatusBarColor(WelcomeActivity.this);
280
        ProfileManager.getInstance().setKeyPrivacyAgreement(WelcomeActivity.this, true);
280 281
        androidd = (TextView) findViewById(R.id.android);
281 282
        ll_1 = (LinearLayout) findViewById(R.id.ll_1);
282 283
        getVersion();

+ 11 - 0
app/src/main/java/com/electric/chargingpile/manager/ProfileManager.java

@ -13,6 +13,7 @@ public class ProfileManager {
13 13
    private static final String KEY_YUYUE = "key_yuyue";
14 14
    private static final String KEY_ID = "key_id";
15 15
    private static final String KEY_GUIDE = "key_guide";
16
    private static final String KEY_PRIVACY_AGREEMENT = "key_privacy_agreement";
16 17
    private static final String KEY_TYPE = "key_type";
17 18
    private static final String KEY_USERID = "key_userid";
18 19
    private static final String KEY_USERICON = "key_usericon";
@ -571,6 +572,16 @@ public class ProfileManager {
571 572
        PreferenceManager.getInstance(context).putBoolean(KEY_GUIDE, guide);
572 573
    }
573 574

575
    public void setKeyPrivacyAgreement(Context context, boolean guide) {
576
        PreferenceManager.getInstance(context).putBoolean(KEY_PRIVACY_AGREEMENT, guide);
577
    }
578

579
    public boolean getPrivacyAgreement(Context context) {
580
        return PreferenceManager.getInstance(context).getBoolean(KEY_PRIVACY_AGREEMENT,
581
                false);
582
    }
583

584

574 585
    public void setFirstssyd(Context context, boolean firstssyd) {
575 586
        PreferenceManager.getInstance(context).putBoolean(KEY_FIRSTSSYD, firstssyd);
576 587
    }

BIN
app/src/main/res/drawable-hdpi/after_route_gray.png


BIN
app/src/main/res/drawable-hdpi/private_location.png


BIN
app/src/main/res/drawable-hdpi/private_phone.png


BIN
app/src/main/res/drawable-hdpi/private_storage.png


BIN
app/src/main/res/drawable-mdpi/after_route_gray.png


BIN
app/src/main/res/drawable-xhdpi/after_route_gray.png


BIN
app/src/main/res/drawable-xxhdpi/after_route_gray.png


BIN
app/src/main/res/drawable-xxxhdpi/after_route_gray.png


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

@ -0,0 +1,8 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:shape="rectangle">
4
5
    <corners android:radius="5dp" /> <!-- 圆角大小 -->
6
    <solid android:color="@color/ui_green" /> <!-- 填充颜色 -->
7
8
</shape>

+ 220 - 0
app/src/main/res/layout/activity_privacy_agreement.xml

@ -0,0 +1,220 @@
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
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    android:background="@color/white"
8
    tools:context=".activity.PrivacyAgreementActivity">
9
10
    <TextView
11
        android:id="@+id/top_title"
12
        android:layout_width="match_parent"
13
        android:layout_height="wrap_content"
14
        android:layout_marginTop="40dp"
15
        android:paddingLeft="30dp"
16
        android:paddingTop="16dp"
17
        android:paddingBottom="16dp"
18
        android:text="充电桩向您申请如下权限:"
19
        android:textSize="20sp"
20
        app:layout_constraintTop_toTopOf="parent" />
21
22
    <ScrollView
23
        android:layout_width="match_parent"
24
        android:layout_height="0dp"
25
        android:paddingLeft="40dp"
26
        android:paddingRight="40dp"
27
        app:layout_constraintBottom_toTopOf="@id/bottom_btn"
28
        app:layout_constraintTop_toBottomOf="@id/top_title">
29
30
        <LinearLayout
31
            android:layout_width="match_parent"
32
            android:layout_height="match_parent"
33
            android:orientation="vertical">
34
35
            <LinearLayout
36
                android:layout_width="match_parent"
37
                android:layout_height="wrap_content"
38
                android:background="#f7f7f7"
39
                android:orientation="vertical"
40
                android:paddingLeft="15dp"
41
                android:paddingTop="20dp"
42
                android:paddingRight="15dp">
43
44
                <LinearLayout
45
                    android:layout_width="match_parent"
46
                    android:layout_height="wrap_content">
47
48
                    <ImageView
49
                        android:layout_width="20dp"
50
                        android:layout_height="match_parent"
51
                        android:layout_marginRight="10dp"
52
                        android:src="@drawable/private_phone" />
53
54
                    <TextView
55
                        android:layout_width="wrap_content"
56
                        android:layout_height="wrap_content"
57
                        android:text="电话权限"
58
                        android:textColor="#444444"
59
                        android:textSize="16sp"
60
                        android:textStyle="bold" />
61
                </LinearLayout>
62
63
                <TextView
64
                    android:layout_width="match_parent"
65
                    android:layout_height="wrap_content"
66
                    android:layout_marginLeft="30dp"
67
                    android:text="为了正常识别手机设备、运营商网络和本机手机号,进行手机认证、保证账号安全"
68
                    android:textColor="#797979"
69
                    android:textSize="14sp" />
70
71
                <View
72
                    android:layout_width="match_parent"
73
                    android:layout_height="1dp"
74
                    android:layout_marginLeft="30dp"
75
                    android:layout_marginTop="20dp"
76
                    android:layout_marginBottom="20dp"
77
                    android:background="#dddddd" />
78
            </LinearLayout>
79
80
            <LinearLayout
81
                android:layout_width="match_parent"
82
                android:layout_height="wrap_content"
83
                android:background="#f7f7f7"
84
                android:orientation="vertical"
85
                android:paddingLeft="15dp"
86
                android:paddingRight="15dp">
87
88
                <LinearLayout
89
                    android:layout_width="match_parent"
90
                    android:layout_height="wrap_content">
91
92
                    <ImageView
93
                        android:layout_width="20dp"
94
                        android:layout_height="match_parent"
95
                        android:layout_marginRight="10dp"
96
                        android:src="@drawable/private_location" />
97
98
                    <TextView
99
                        android:layout_width="wrap_content"
100
                        android:layout_height="wrap_content"
101
                        android:text="位置信息权限"
102
                        android:textColor="#444444"
103
                        android:textSize="16sp"
104
                        android:textStyle="bold" />
105
                </LinearLayout>
106
107
                <TextView
108
                    android:layout_width="match_parent"
109
                    android:layout_height="wrap_content"
110
                    android:layout_marginLeft="30dp"
111
                    android:text="为了定位您的位置,推荐充电桩,充电桩位置路线导航"
112
                    android:textColor="#797979"
113
                    android:textSize="14sp" />
114
115
                <View
116
                    android:layout_width="match_parent"
117
                    android:layout_height="1dp"
118
                    android:layout_marginLeft="30dp"
119
                    android:layout_marginTop="20dp"
120
                    android:layout_marginBottom="20dp"
121
                    android:background="#dddddd" />
122
            </LinearLayout>
123
124
            <LinearLayout
125
                android:layout_width="match_parent"
126
                android:layout_height="wrap_content"
127
                android:background="#f7f7f7"
128
                android:orientation="vertical"
129
                android:paddingLeft="15dp"
130
                android:paddingRight="15dp"
131
                android:paddingBottom="15dp">
132
133
                <LinearLayout
134
                    android:layout_width="match_parent"
135
                    android:layout_height="wrap_content">
136
137
                    <ImageView
138
                        android:layout_width="20dp"
139
                        android:layout_height="match_parent"
140
                        android:layout_marginRight="10dp"
141
                        android:src="@drawable/private_storage" />
142
143
                    <TextView
144
                        android:layout_width="wrap_content"
145
                        android:layout_height="wrap_content"
146
                        android:text="存储权限"
147
                        android:textColor="#444444"
148
                        android:textSize="16sp"
149
                        android:textStyle="bold" />
150
                </LinearLayout>
151
152
                <TextView
153
                    android:layout_width="match_parent"
154
                    android:layout_height="wrap_content"
155
                    android:layout_marginLeft="30dp"
156
                    android:text="实现图片或视频的缓存和使用,降低流量消耗"
157
                    android:textColor="#797979"
158
                    android:textSize="14sp" />
159
160
            </LinearLayout>
161
162
            <TextView
163
                android:layout_width="match_parent"
164
                android:layout_height="wrap_content"
165
                android:layout_marginTop="20dp"
166
                android:text="同时,充电桩采用严格的数据安全措施保护你的个人信息安全。"
167
                android:textColor="#444444"
168
                android:textSize="14sp" />
169
170
            <TextView
171
                android:id="@+id/agree_enter_text_view"
172
                android:layout_width="match_parent"
173
                android:layout_height="wrap_content"
174
                android:layout_marginTop="5dp"
175
                android:textColor="#444444"
176
                android:textSize="14sp" />
177
178
            <TextView
179
                android:layout_width="match_parent"
180
                android:layout_height="wrap_content"
181
                android:layout_marginTop="5dp"
182
                android:text="你也可以选择「退出并关闭」,充电桩将无法为你提供产品或服务。"
183
                android:textColor="#444444"
184
                android:textSize="14sp" />
185
        </LinearLayout>
186
    </ScrollView>
187
188
    <LinearLayout
189
        android:id="@+id/bottom_btn"
190
        android:layout_width="match_parent"
191
        android:layout_height="wrap_content"
192
        android:orientation="vertical"
193
        android:paddingLeft="40dp"
194
        android:paddingTop="20dp"
195
        android:paddingRight="40dp"
196
        android:paddingBottom="20dp"
197
        app:layout_constraintBottom_toBottomOf="parent">
198
199
        <Button
200
            android:id="@+id/agreement_btn"
201
            android:layout_width="match_parent"
202
            android:layout_height="wrap_content"
203
            android:layout_marginTop="15dp"
204
            android:background="@drawable/privacy_agreement_btn_shape"
205
            android:text="同意并进入"
206
            android:textColor="@color/white"
207
            android:textSize="14sp" />
208
209
        <Button
210
            android:id="@+id/exit_btn"
211
            android:layout_width="match_parent"
212
            android:layout_height="wrap_content"
213
            android:layout_marginTop="15dp"
214
            android:background="@color/transparent"
215
            android:text="退出并关闭 App"
216
            android:textColor="#9c9c9c"
217
            android:textSize="14sp" />
218
    </LinearLayout>
219
220
</androidx.constraintlayout.widget.ConstraintLayout>