Quellcode durchsuchen

注册隐私政策添加

huyuguo vor 4 Jahren
Ursprung
Commit
461f765c97

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

@ -445,10 +445,6 @@
445 445
            android:label="@string/title_activity_my_message"
446 446
            android:screenOrientation="portrait" />
447 447
        <activity
448
            android:name=".activity.XieYiActivity"
449
            android:label="@string/title_activity_xie_yi"
450
            android:screenOrientation="portrait" />
451
        <activity
452 448
            android:name=".activity.BuildInfoActivity"
453 449
            android:screenOrientation="portrait" />
454 450
        <activity

+ 12 - 5
app/src/main/java/com/electric/chargingpile/activity/RegisterActivity.java

@ -63,7 +63,7 @@ public class RegisterActivity extends Activity implements OnClickListener {
63 63
    private static final String TAG = "RegisterActivity";
64 64
    private ImageView ivBack, ivRight;
65 65
    private EditText etCode, etPhone;
66
    private TextView tvGetCode, tvSure, tv_xieyi;
66
    private TextView tvGetCode, tvSure, tv_xieyi, tv_yinsi;
67 67
    LinearLayout ll_tongyi;
68 68
    ImageView iv_tongyi;
69 69
    private int time = 90;
@ -107,6 +107,9 @@ public class RegisterActivity extends Activity implements OnClickListener {
107 107
        tv_xieyi = (TextView) findViewById(R.id.tv_xieyi);
108 108
        tv_xieyi.setOnClickListener(this);
109 109

110
        tv_yinsi = (TextView) findViewById(R.id.tv_yinsi);
111
        tv_yinsi.setOnClickListener(this);
112

110 113
        animation = AnimationUtils.loadAnimation(RegisterActivity.this, R.anim.nn);
111 114
        point = (ImageView) findViewById(R.id.tv_one);
112 115

@ -380,11 +383,15 @@ public class RegisterActivity extends Activity implements OnClickListener {
380 383
                break;
381 384

382 385
            case R.id.tv_xieyi:
383
                Intent intent = new Intent(this, XieYiActivity.class);
384
                startActivity(intent);
385
//                this.startActivity(intent); //启动浏览器
386
                Intent xieyiintent = new Intent(getApplication(), MyWebViewActivity.class);
387
                xieyiintent.putExtra("url", "http://evcharge.cc/activity/user-proto.html");
388
                startActivity(xieyiintent);
389
                break;
390
            case R.id.tv_yinsi:
391
                Intent yinsintent = new Intent(getApplication(), MyWebViewActivity.class);
392
                yinsintent.putExtra("url", "http://evcharge.cc/pc/privacy.html");
393
                startActivity(yinsintent);
386 394
                break;
387

388 395
            case R.id.ll_tongyi:
389 396
                if (flag) {
390 397
                    iv_tongyi.setImageResource(R.drawable.icon_login_select);

+ 0 - 174
app/src/main/java/com/electric/chargingpile/activity/XieYiActivity.java

@ -1,174 +0,0 @@
1
package com.electric.chargingpile.activity;
2
3
import android.app.Activity;
4
import android.content.Intent;
5
import android.net.Uri;
6
import android.os.Bundle;
7
import android.util.Log;
8
import android.view.KeyEvent;
9
import android.view.View;
10
import android.webkit.WebBackForwardList;
11
import android.webkit.WebChromeClient;
12
import android.webkit.WebView;
13
import android.webkit.WebViewClient;
14
import android.widget.ImageView;
15
import android.widget.TextView;
16
17
import com.electric.chargingpile.R;
18
import com.electric.chargingpile.util.BarColorUtil;
19
import com.electric.chargingpile.util.DES3;
20
import com.umeng.analytics.MobclickAgent;
21
22
import java.net.URLEncoder;
23
24
public class XieYiActivity extends Activity implements View.OnClickListener {
25
    private WebView webView;
26
    private ImageView iv_back, iv_close;
27
    private TextView txtTitle;
28
    int screenHeight;
29
    int screenWidth;
30
31
    @Override
32
    protected void onCreate(Bundle savedInstanceState) {
33
        super.onCreate(savedInstanceState);
34
        setContentView(R.layout.activity_xie_yi);
35
        BarColorUtil.initStatusBarColor(XieYiActivity.this);
36
        try {
37
            initView();
38
        } catch (Exception e) {
39
            e.printStackTrace();
40
        }
41
    }
42
43
    private void initView() throws Exception {
44
45
        txtTitle = (TextView) findViewById(R.id.textview);
46
        webView = (WebView) findViewById(R.id.webView);
47
48
        iv_back = (ImageView) findViewById(R.id.iv_back);
49
        iv_back.setOnClickListener(this);
50
51
        iv_close = (ImageView) findViewById(R.id.iv_close);
52
        iv_close.setOnClickListener(this);
53
54
        WebChromeClient wvcc = new WebChromeClient() {
55
            @Override
56
            public void onReceivedTitle(WebView view, String title) {
57
                super.onReceivedTitle(view, title);
58
                Log.d("ANDROID_LAB", "TITLE=" + title);
59
                txtTitle.setText(title);
60
            }
61
62
        };
63
64
65
        // 设置setWebChromeClient对象
66
        webView.setWebChromeClient(wvcc);
67
68
//         创建WebViewClient对象
69
//        WebViewClient wvc = new WebViewClient() {
70
//            @Override
71
//            public boolean shouldOverrideUrlLoading(WebView view, String url) {
72
//                // 使用自己的WebView组件来响应Url加载事件,而不是使用默认浏览器器加载页面
73
//                webView.loadUrl(url);
74
//                // 消耗掉这个事件。Android中返回True的即到此为止吧,事件就会不会冒泡传递了,我们称之为消耗掉
75
//                return true;
76
//            }
77
//        };
78
//        webView.setWebViewClient(wvc);
79
        long appTime1 = System.currentTimeMillis() / 1000;
80
        Log.i("appTime(long)---", appTime1 + "");
81
        long updatetime = appTime1 - MainMapActivity.cha - 5;
82
        Log.i("updatetime(long)---", updatetime + "");
83
        Log.i("cha---", MainMapActivity.cha + "");
84
        String token = String.valueOf(updatetime);
85
        String encode_token = DES3.encode(token);
86
        String replace = URLEncoder.encode(encode_token);
87
        String urlweb = "http://evcharge.cc/activity/user-proto.html";
88
        Log.e("url", urlweb);
89
        webView.loadUrl(urlweb);
90
//        webView.loadUrl("http://www.d1ev.com/app/chondian/and38.html");
91
//        webView.loadUrl("www.baidu.com");
92
//        WebSettings settings = webView.getSettings();
93
//        Display display = this.getWindowManager().getDefaultDisplay();
94
//        if (display.getHeight() < display.getWidth()) {
95
//            screenHeight = display.getWidth();
96
//            screenWidth = display.getHeight();
97
//        } else {
98
//            screenWidth = display.getWidth();
99
//            screenHeight = display.getHeight();
100
//        }
101
//
102
//        webView.setMinimumHeight(screenHeight);
103
//        webView.setMinimumWidth(screenWidth);
104
        webView.getSettings().setSupportZoom(true);
105
        webView.getSettings().setBuiltInZoomControls(true);
106
        webView.getSettings().setJavaScriptEnabled(true);
107
108
        webView.setWebViewClient(new WebViewClient() {
109
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
110
                //  重写此方法表明点击网页里面的链接还是在当前的webview里跳转,不跳到浏览器那边
111
//                view.loadUrl(url);
112
                if (url.startsWith("tel:")) {
113
                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
114
                    startActivity(intent);
115
                    return true;
116
                }
117
                return false;
118
            }
119
        });
120
121
122
    }
123
124
    @Override
125
    public void onClick(View v) {
126
        switch (v.getId()) {
127
            case R.id.iv_back:
128
                WebBackForwardList mWebBackForwardList = webView.copyBackForwardList();
129
130
                Log.e("tag", "mWebBackForwardList.getSize() " + mWebBackForwardList.getSize());
131
                if (webView.canGoBack()) {
132
                    webView.goBack();
133
                } else {
134
                    finish();
135
                }
136
137
138
                break;
139
            case R.id.iv_close:
140
                finish();
141
                break;
142
        }
143
    }
144
145
    @Override
146
    public boolean onKeyDown(int keyCode, KeyEvent event) {
147
        WebBackForwardList mWebBackForwardList = webView.copyBackForwardList();
148
149
        Log.e("tag", "mWebBackForwardList.getSize() " + mWebBackForwardList.getSize());
150
//        WebView browser=(WebView)findViewById(R.id.webView);
151
        // Check if the key event was the Back button and if there's history
152
        if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()) {
153
154
            webView.goBack();
155
            return true;
156
        }
157
        //  return true;
158
        // If it wasn't the Back key or there's no web page history, bubble up to the default
159
        // system behavior (probably exit the activity)
160
        return super.onKeyDown(keyCode, event);
161
    }
162
163
    @Override
164
    protected void onResume() {
165
        super.onResume();
166
        MobclickAgent.onResume(this);
167
    }
168
169
    @Override
170
    protected void onPause() {
171
        super.onPause();
172
        MobclickAgent.onPause(this);
173
    }
174
}

+ 19 - 7
app/src/main/res/layout/activity_register.xml

@ -220,16 +220,17 @@
220 220

221 221
            <com.zhy.autolayout.AutoLinearLayout
222 222
                android:layout_width="match_parent"
223
                android:layout_height="130px"
223
                android:layout_height="wrap_content"
224 224
                android:background="@color/white"
225
                android:orientation="horizontal">
225
                android:orientation="vertical">
226 226

227 227
                <com.zhy.autolayout.AutoLinearLayout
228 228
                    android:id="@+id/ll_tongyi"
229 229
                    android:layout_width="wrap_content"
230
                    android:layout_height="match_parent"
230
                    android:layout_height="wrap_content"
231 231
                    android:orientation="horizontal"
232
                    android:layout_gravity="center">
232
                    android:layout_marginTop="20dp"
233
                    android:layout_gravity="left">
233 234

234 235
                    <ImageView
235 236
                        android:id="@+id/iv_tongyi"
@ -251,17 +252,28 @@
251 252
                        android:layout_gravity="center" />
252 253
                </com.zhy.autolayout.AutoLinearLayout>
253 254

254

255

256 255
                <TextView
257 256
                    android:id="@+id/tv_xieyi"
258
                    android:layout_width="wrap_content"
257
                    android:layout_marginTop="5dp"
258
                    android:layout_marginLeft="64px"
259
                    android:layout_width="match_parent"
259 260
                    android:layout_height="wrap_content"
260 261
                    android:text="《充电桩APP用户使用协议》"
261 262
                    android:textColor="#3190e8"
262 263
                    android:textSize="13sp"
263 264
                    android:layout_gravity="center"
264 265
                    android:layout_marginBottom="1dp"/>
266
                <TextView
267
                    android:id="@+id/tv_yinsi"
268
                    android:layout_marginTop="5dp"
269
                    android:layout_marginLeft="64px"
270
                    android:layout_width="match_parent"
271
                    android:layout_height="wrap_content"
272
                    android:text="《充电桩隐私政策》"
273
                    android:textColor="#3190e8"
274
                    android:textSize="13sp"
275
                    android:layout_gravity="center"
276
                    android:layout_marginBottom="1dp"/>
265 277
            </com.zhy.autolayout.AutoLinearLayout>
266 278

267 279
            <RelativeLayout

+ 0 - 79
app/src/main/res/layout/activity_xie_yi.xml

@ -1,79 +0,0 @@
1
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
    xmlns:tools="http://schemas.android.com/tools"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    android:orientation="vertical"
6
    tools:context="com.electric.chargingpile.activity.ShopActivity">
7
8
    <RelativeLayout
9
        android:layout_width="fill_parent"
10
        android:layout_height="46dp"
11
        android:background="#f9f9f9">
12
13
        <TextView
14
            android:id="@+id/textview"
15
            android:layout_width="wrap_content"
16
            android:layout_height="wrap_content"
17
            android:layout_centerInParent="true"
18
            android:text="用户使用协议"
19
            android:singleLine="true"
20
            android:maxEms="8"
21
            android:ellipsize="end"
22
            android:textColor="#222222"
23
            android:textSize="20sp" />
24
25
        <TextView
26
            android:id="@+id/tv_next"
27
            android:layout_width="wrap_content"
28
            android:layout_height="match_parent"
29
            android:layout_alignParentEnd="true"
30
            android:layout_alignParentRight="true"
31
            android:layout_alignParentTop="true"
32
            android:contentDescription="@null"
33
            android:gravity="center"
34
            android:paddingRight="12dp"
35
            android:text="添加记录"
36
            android:textColor="@color/white"
37
            android:textSize="16sp"
38
            android:visibility="gone" />
39
40
41
        <ImageView
42
            android:id="@+id/iv_back"
43
            android:layout_width="wrap_content"
44
            android:layout_height="match_parent"
45
            android:layout_alignParentLeft="true"
46
            android:layout_centerVertical="true"
47
            android:contentDescription="@null"
48
            android:paddingBottom="4dp"
49
            android:paddingLeft="16dp"
50
            android:paddingRight="16dp"
51
            android:paddingTop="4dp"
52
            android:src="@drawable/icon_lvback1119" />
53
54
        <ImageView
55
            android:id="@+id/iv_close"
56
            android:layout_width="wrap_content"
57
            android:layout_height="match_parent"
58
            android:layout_toRightOf="@+id/iv_back"
59
            android:contentDescription="@null"
60
            android:paddingBottom="4dp"
61
            android:paddingLeft="8dp"
62
            android:paddingRight="16dp"
63
            android:paddingTop="4dp"
64
            android:visibility="gone"
65
            android:src="@drawable/icon_close1210" />
66
    </RelativeLayout>
67
68
    <View
69
        android:layout_width="match_parent"
70
        android:layout_height="0.5dp"
71
        android:background="@color/ui_line"/>
72
73
    <WebView
74
        android:layout_width="match_parent"
75
        android:layout_height="match_parent"
76
        android:id="@+id/webView" />
77
78
</LinearLayout>
79

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

@ -152,7 +152,6 @@
152 152
    <string name="title_activity_zhan_details">ZhanDetails</string>
153 153
    <string name="title_activity_details">DetailsActivity</string>
154 154
    <string name="title_activity_my_message">MyMessageActivity</string>
155
    <string name="title_activity_xie_yi">XieYiActivity</string>
156 155
157 156
    <string name="pay_result_tip">这个界面用于显示第三方app通过微信支付的结果</string>
158 157
    <string name="pay_result_callback_msg" formatted="false">微信支付结果:%s</string>