public void onClick(View view) { 485
                        popupWindow1.dismiss();
486
                    }
487
                });
488
                Button btn_one = (Button) popupWindowView.findViewById(R.id.tvTwo);
489
                btn_one.setOnClickListener(new View.OnClickListener() {
490
                    @Override
491
                    public void onClick(View view) {
492
                        tv_buy.setText("已购买");
493
                        rl_select_car.setVisibility(View.VISIBLE);
494
495
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
496
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
497
//                                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
498
//                        ((Activity) mContext).startActivityForResult(intent, 2);
499
                        popupWindow1.dismiss();
500
                    }
501
                });
502
                Button btn_two = (Button) popupWindowView.findViewById(R.id.tvThree);
503
                btn_two.setOnClickListener(new View.OnClickListener() {
504
                    @Override
505
                    public void onClick(View view) {
506
                        tv_buy.setText("未购买");
507
                        rl_select_car.setVisibility(View.GONE);
508
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
509
//                        intent.setDataAndType(
510
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
511
//                                "image/*");
512
//                        startActivityForResult(intent, 1);
513
                        popupWindow1.dismiss();
514
                    }
515
                });
516
517
                popupWindow1.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
518
                break;
519 369
520 370
            case R.id.onclick:
521 371
@ -542,29 +392,25 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
542 392
                    dialog.show();
543 393
                }
544 394
                break;
395
396
            case R.id.go_certificate:
397
                // 1 去认证  2审核中  3认证车主
398
                if (certificateStatus == 0) {
399
                    getCarOwnerCertificateList(true);
400
                } else if (certificateStatus == 1) {
401
                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
402
                }
403
                break;
545 404
        }
546 405
    }
547 406
548 407
    private boolean checkText() {
549 408
        String nickName = et_nickName.getText().toString().trim();
550
        String isBuy = tv_buy.getText().toString().trim();
551
        String carType = et_che.getText().toString().trim();
552 409
553 410
        if (TextUtils.isEmpty(nickName)) {
554 411
            Toast.makeText(this, "请输入您的昵称", Toast.LENGTH_SHORT).show();
555 412
            return false;
556 413
        }
557
        if (TextUtils.isEmpty(isBuy)) {
558
            Toast.makeText(this, "请选择您是否购买了新能源汽车", Toast.LENGTH_SHORT).show();
559
            return false;
560
        }
561
        if (isBuy.equals("已购买")) {
562
            if (TextUtils.isEmpty(carType)) {
563
                Toast.makeText(this, "请选择您购买的车型", Toast.LENGTH_SHORT).show();
564
                return false;
565
            }
566
        }
567
568 414
        return true;
569 415
    }
570 416
@ -659,15 +505,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
659 505
        String token = String.valueOf(updatetime);
660 506
        Log.i("token---", token);
661 507
662
        if (tv_buy.getText().toString().equals("未购买")) {
663
            havecar = "待购";
664
        } else {
665
            if (car_brand != null && null != car_type) {
666
                havecar = car_brand + "$$" + car_type;
667
            }
668
        }
669
670
        nocar = "";
671 508
        try {
672 509
            if (null != photo) {
673 510
                Bitmap bm = imageZoom(photo);
@ -683,10 +520,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
683 520
        par.put("username", et_realName.getText().toString());
684 521
        par.put("nickname", et_nickName.getText().toString());
685 522
        par.put("sex", sex);
686
        par.put("chexing", havecar);
687
        par.put("yichexing", nocar);
688
        Log.e("chexing", havecar);
689
        Log.e("yichexing", nocar);
690 523
691 524
        try {
692 525
            par.put("token", DES3.encode(token));
@ -842,14 +675,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
842 675
843 676
        switch (requestCode) {
844 677
            // 如果是直接从相册获取
845
            case REQUSET:
846
                select_pinpai = data.getStringExtra("pinpai");
847
                select_chexing = data.getStringExtra("chexing");
848
849
                et_che.setText(select_pinpai + " " + select_chexing);
850
                car_brand = select_pinpai;
851
                car_type = select_chexing;
852
                break;
853 678
            case 1:
854 679
                if (SDCardUtil.hasSdcard()) {
855 680
                    cropImageUri = Uri.fromFile(fileCropUri);
@ -916,8 +741,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
916 741
        matrix.postScale(scaleWidth, scaleHeight);
917 742
        Bitmap bitmap = Bitmap.createBitmap(bgimage, 0, 0, (int) width,
918 743
                (int) height, matrix, true);
919
//        iv_2.setImageBitmap(bitmap);
920
//        tv_2.setText(bitmap.getRowBytes() * bitmap.getHeight() + "");
921 744
        return bitmap;
922 745
    }
923 746
@ -1040,66 +863,13 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1040 863
    }
1041 864
1042 865
1043
    /*
1044
     *bitmap转base64
1045
     */
1046
//    public static Bitmap base64ToBitmap(String base64String){
1047
//        byte[] bytes = Base64.decode(base64String);
1048
//        Bitmap bitmap= BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
1049
//        return bitmap;
1050
//    }
1051
1052 866
    Handler handle = new Handler() {
1053 867
        public void handleMessage(Message msg) {
1054 868
            switch (msg.what) {
1055 869
                case StatusConstants.REQUEST_WHAT_SUCCESS:
1056 870
                    LogUtils.getLogger().e(msg.obj.toString());
1057
//                    Toast.makeText(UserInfoActivity.this, msg.obj.toString(), 1).show();
1058 871
                    break;
1059 872
                case 1:
1060
//
1061
//				Gson g = new Gson();
1062
//				pr.clear();
1063
//				pr = g.fromJson(msg.obj.toString(), new TypeToken<List<Province>>() {
1064
//				}.getType());
1065
//				String s=msg.obj.toString();
1066
//				JSONObject
1067
//				Province p= new Province(s.get, code, cities)
1068
//				pr.add(arg0)
1069
//				spinner();
1070
//                    if (!chexing.equals("") && yichexing.equals("")){
1071
//                        String[] strarray=chexing.split("\\$\\$");
1072
//
1073
//                        if(strarray.length>1){
1074
//                            name0=strarray[0];//江淮
1075
//                            name1=strarray[1];//iEV3
1076
//                        }
1077
//                        Log.e("name0+name1",name0+name1);
1078
//                        et_che.setText(name0 + " - " + name1);
1079
//                        Log.e(TAG, "handleMessage: "+ et_che.getText().toString());
1080
//                        if (et_che.getText().toString().equals(" - ")){
1081
//                            tv_buy.setText("未购买");
1082
//                            rl_select_car.setVisibility(View.GONE);
1083
//                        }else {
1084
//                            tv_buy.setText("已购买");
1085
//                            rl_select_car.setVisibility(View.VISIBLE);
1086
//                        }
1087
//                        car_brand = name0;
1088
//                        car_type = name1;
1089
//                    }else if(chexing.equals("") && !yichexing.equals("")){
1090
//                        String[] strarray=yichexing.split("\\$\\$");
1091
//
1092
//                        if(strarray.length>1){
1093
//                            name0=strarray[0];//江淮
1094
//                            name1=strarray[1];//iEV3
1095
//                        }
1096
//                        Log.e("name0+name1",name0+name1);
1097
//                        et_che.setText(name0 + " - " + name1);
1098
//                        car_brand = name0;
1099
//                        car_type = name1;
1100
//                }
1101
1102
1103 873
                    try {
1104 874
                        JSONArray jsonary = new JSONArray(msg.obj.toString());
1105 875
                        for (int i = 0; i < jsonary.length(); i++) {
@ -1124,24 +894,12 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1124 894
                            pr.remove(prov);
1125 895
                            pr.add(prov);
1126 896
1127
//                            spinnerProvince.setSelection(de);
1128
//                                    spinnerCity
1129 897
                        }
1130 898
1131 899
                    } catch (JSONException e) {
1132 900
                        e.printStackTrace();
1133 901
                    }
1134
//				pr =(List<Province>) JsonUtils.parseToObjectBean(msg.obj.toString(), Province.class);
1135
//                    Log.e("pe", pr.size()+"");
1136
//                    Log.e("pe", pr.get(0).getCities().size()+"");
1137
//                    Log.e("pe", pr.get(1).getCities().size()+"");
1138
//                    Log.e("pe", pr.get(2).getCities().size()+"");
1139
//                    Log.e("pe", pr.get(3).getCities().size()+"");
1140
//				Log.e("pe", pr.size()+"");
1141
//				Log.e("pe", pr.size()+"");
1142 902
1143
1144
//
1145 903
                    ArrayAdapter<Province> provinceAdapter = new ArrayAdapter<Province>(UserInfoActivity.this, R.layout.simple_spinner_item, pr);
1146 904
                    spinnerProvince.setAdapter(provinceAdapter);
1147 905
                    provinceAdapter.notifyDataSetChanged();
@ -1166,38 +924,15 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1166 924
1167 925
                        if (rtnCode.equals("01")) {
1168 926
                            dialog.cancel();
1169
//                            SharedPreferences mySharedPreferences= getSharedPreferences("userInfo",
1170
//                                    Activity.MODE_PRIVATE);
1171
//                            SharedPreferences.Editor editor = mySharedPreferences.edit();
1172
//                            editor.putString("nickname", et_nickName.getText().toString());
1173
//                            editor.putString("username", et_realName.getText().toString());
1174
//                            editor.putString("sex", sex);
1175
//                            editor.putString("chexing", havecar);
1176
//                            editor.putString("yichexing", nocar);
1177
//
1178
////                            String data = JsonUtils.getKeyResult(msg.obj.toString(),"data");
1179
////                            String userid = JsonUtils.getKeyResult(data,"userid");
1180
////                            String username = JsonUtils.getKeyResult(data,"username");
1181
////                            String userpic = JsonUtils.getKeyResult(data,"userpic");
1182
////                            String nickname = JsonUtils.getKeyResult(data,"nickname");
1183
////                            LogUtils.getLogger().e(userid+"---"+username+"---"+userpic+"---"+nickname);
1184
////                            Log.e(TAG, "handleMessage: "+userid+"---"+username+"---"+userpic+"---"+nickname );
1185
//
1186
//                            editor.commit();
1187 927
                            String picurl = JsonUtils.getKeyResult(msg.obj.toString(), "picurl");
1188 928
                            MainApplication.userIcon = MainApplication.url + picurl;
1189 929
                            ProfileManager.getInstance().setUsericon(getApplicationContext(), MainApplication.userIcon);
1190
                            MainApplication.userCar = havecar;
1191
                            ProfileManager.getInstance().setUsercar(getApplicationContext(), havecar);
1192 930
                            MainApplication.userNickname = et_nickName.getText().toString();
1193 931
                            ProfileManager.getInstance().setNickname(getApplicationContext(), et_nickName.getText().toString());
1194 932
                            Intent intent = new Intent();
1195 933
                            intent.putExtra("nickname", et_nickName.getText().toString().trim());
1196 934
                            intent.putExtra("userphoto", ss);
1197 935
                            setResult(RESULT_SUCCESS, intent);
1198
//                            MainApplication.userIcon="V";
1199
//                            ProfileManager.getInstance().setUsericon(UserInfoActivity.this, "V");
1200
//                            ImageTools.saveImageToGallery(getApplicationContext(),photo,"user_icon");
1201 936
1202 937
                            String plusScore = jsonObject.getString("plusScore");
1203 938
                            if (!plusScore.equals("")) {
@ -1209,12 +944,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1209 944
                                        rl_point.setVisibility(View.GONE);
1210 945
                                    }
1211 946
                                }, 1000);
1212
//                                if (photo != null) {
1213
//                                    photo.recycle();
1214
//                                    photo = null;
1215
////                                            bitmap.recycle();
1216
//
1217
//                                }
1218 947
                                new Handler().postDelayed(new Runnable() {
1219 948
                                    public void run() {
1220 949
@ -1223,11 +952,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1223 952
                                }, 1500);
1224 953
                            } else {
1225 954
                                ToastUtil.showToast(UserInfoActivity.this, "保存成功", Toast.LENGTH_SHORT);
1226
//                                if (photo != null) {
1227
//                                    photo.recycle();
1228
//                                    photo = null;
1229
//
1230
//                                }
1231 955
                                UserInfoActivity.this.finish();
1232 956
                            }
1233 957
@ -1241,10 +965,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1241 965
                    } catch (JSONException e) {
1242 966
                        e.printStackTrace();
1243 967
                    }
1244
1245
//                    Toast.makeText(UserInfoActivity.this, msg.obj.toString(), Toast.LENGTH_SHORT).show();
1246 968
                    break;
1247
1248 969
                case 5:
1249 970
                    Toast.makeText(UserInfoActivity.this, msg.obj.toString(), Toast.LENGTH_SHORT).show();
1250 971
                    break;
@ -1314,6 +1035,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1314 1035
    protected void onResume() {
1315 1036
        super.onResume();
1316 1037
        MobclickAgent.onResume(this);
1038
        getCarOwnerCertificateList(false);
1317 1039
    }
1318 1040
1319 1041
    @Override
@ -1326,4 +1048,75 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1326 1048
    protected void onDestroy() {
1327 1049
        super.onDestroy();
1328 1050
    }
1051
1052
    private void getCarOwnerCertificateList(Boolean showLoading) {
1053
        if (showLoading) {
1054
            loadDialog.show();
1055
        }
1056
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId;
1057
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1058
            @Override
1059
            public void onError(Call call, Exception e) {
1060
                e.printStackTrace();
1061
                loadDialog.dismiss();
1062
                Toast.makeText(getApplicationContext(), e.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
1063
                go_title.setText("去认证车主(获得充电优惠)");
1064
                go_desc.setText("");
1065
                go_cursor.setVisibility(View.VISIBLE);
1066
            }
1067
1068
            @Override
1069
            public void onResponse(String response) {
1070
                loadDialog.dismiss();
1071
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1072
                if ("01".equals(rtnCode)) {
1073
                    String data = JsonUtils.getKeyResult(response, "data");
1074
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1075
                    CarSeriesEntity carSeriesEntity = null;
1076
                    // 1 去认证  2审核中  3认证车主
1077
                    if (list.size() == 0) {
1078
                        certificateStatus = 1;
1079
                    } else {
1080
                        certificateStatus = 2;
1081
                        for (CarOwnerCertificateBean bean : list) {
1082
                            if (bean.getStatus() == 1 && bean.getMain() == 1) {
1083
                                certificateStatus = 3;
1084
                                Gson gson = new Gson();
1085
                                carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1086
                                break;
1087
                            }
1088
                        }
1089
                    }
1090
1091
                    if (certificateStatus == 2) {
1092
                        go_title.setText("认证车主");
1093
                        go_desc.setText("审核中");
1094
                        go_cursor.setVisibility(View.GONE);
1095
                    } else if (certificateStatus == 3) {
1096
                        go_title.setText("认证车主");
1097
                        if (carSeriesEntity != null) {
1098
                            go_desc.setText(carSeriesEntity.getSeriesName());
1099
                        }
1100
                        go_cursor.setVisibility(View.GONE);
1101
                    } else {
1102
                        go_title.setText("去认证车主(获得充电优惠)");
1103
                        go_desc.setText("");
1104
                        go_cursor.setVisibility(View.VISIBLE);
1105
                    }
1106
1107
                    if (certificateStatus == 1) {
1108
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1109
                    }
1110
1111
                } else {
1112
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
1113
                    Toast.makeText(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT).show();
1114
1115
                    go_title.setText("去认证车主(获得充电优惠)");
1116
                    go_desc.setText("");
1117
                    go_cursor.setVisibility(View.VISIBLE);
1118
                }
1119
            }
1120
        });
1121
    }
1329 1122
}

+ 1 - 2
app/src/main/java/com/electric/chargingpile/adapter/CarOwnerCertificateListAdapter.java

@ -49,8 +49,7 @@ public class CarOwnerCertificateListAdapter extends RecyclerView.Adapter<CarOwne
49 49
        CarOwnerCertificateBean bean = mList.get(position);
50 50
        Gson gson = new Gson();
51 51
        CarSeriesEntity carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
52
//        Glide.with(mContext).load(carSeriesEntity.getIcon()).into(holder.master_pic);
53
//        Picasso.with(mContext).load(carSeriesEntity.getMasterPic()).into(holder.master_pic);
52
        Glide.with(mContext).load(carSeriesEntity.getIcon()).into(holder.master_pic);
54 53
        holder.name.setText(carSeriesEntity.getCompanyName());
55 54
        holder.detail_name.setText(carSeriesEntity.getSeriesName());
56 55

+ 6 - 2
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

@ -75,10 +75,14 @@ public class MainApplication extends MultiDexApplication {
75 75
    public static Boolean firstSsyd;
76 76
    public static String password = "";
77 77
    public static String url = "http://59.110.68.162";// 充电桩测试环境
78
//        public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
78
    public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
79
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
80
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
81

79 82
//    public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
80 83
    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
81
    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
84

85

82 86
    //	public static String url = "https://cdz.d1ev.com";
83 87
    public static String build_flag = "0";
84 88
    public static String support = "0"; // true:本APP支付  false:其他方式支付

+ 0 - 11
app/src/main/java/com/electric/chargingpile/entity/CarSeriesEntity.java

@ -13,17 +13,6 @@ public class CarSeriesEntity {
13 13
    private String maxSalePrice;
14 14
    private String minSalePrice;
15 15
16
//    public CarSeriesEntity(String brandId, String brandName, String companyId, String companyName, String seriesId, String seriesName, String salePrice, String icon) {
17
//        this.brandId = brandId;
18
//        this.brandName = brandName;
19
//        this.companyId = companyId;
20
//        this.companyName = companyName;
21
//        this.seriesId = seriesId;
22
//        this.seriesName = seriesName;
23
//        this.salePrice = salePrice;
24
//        this.icon = icon;
25
//    }
26
27 16
    public String getBrandId() {
28 17
        return brandId;
29 18
    }

+ 211 - 253
app/src/main/res/layout/activity_user_info.xml

@ -1,10 +1,11 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:tools="http://schemas.android.com/tools"
3 4
    android:layout_width="match_parent"
4 5
    android:layout_height="match_parent"
5
    android:orientation="vertical"
6 6
    android:focusable="true"
7
    android:focusableInTouchMode="true">
7
    android:focusableInTouchMode="true"
8
    android:orientation="vertical">
8 9
9 10
    <RelativeLayout
10 11
        android:layout_width="fill_parent"
@ -17,10 +18,10 @@
17 18
            android:layout_height="match_parent"
18 19
            android:layout_centerVertical="true"
19 20
            android:contentDescription="@null"
20
            android:paddingBottom="4dp"
21 21
            android:paddingLeft="16dp"
22
            android:paddingRight="16dp"
23 22
            android:paddingTop="4dp"
23
            android:paddingRight="16dp"
24
            android:paddingBottom="4dp"
24 25
            android:src="@drawable/icon_lvback1119" />
25 26
26 27
        <TextView
@ -36,18 +37,18 @@
36 37
            android:id="@+id/iv_right"
37 38
            android:layout_width="wrap_content"
38 39
            android:layout_height="match_parent"
39
            android:paddingBottom="4dp"
40
            android:layout_alignParentTop="true"
41
            android:layout_alignParentEnd="true"
42
            android:layout_alignParentRight="true"
43
            android:gravity="center"
40 44
            android:paddingLeft="16dp"
41
            android:paddingRight="16dp"
42 45
            android:paddingTop="4dp"
43
            android:textSize="15sp"
44
            android:visibility="gone"
46
            android:paddingRight="16dp"
47
            android:paddingBottom="4dp"
45 48
            android:text="跳过"
46
            android:gravity="center"
47 49
            android:textColor="@color/white"
48
            android:layout_alignParentTop="true"
49
            android:layout_alignParentRight="true"
50
            android:layout_alignParentEnd="true" />
50
            android:textSize="15sp"
51
            android:visibility="gone" />
51 52
    </RelativeLayout>
52 53
53 54
@ -70,38 +71,40 @@
70 71
                android:layout_width="fill_parent"
71 72
                android:layout_height="62dp"
72 73
                android:background="@color/white">
74
73 75
                <TextView
74 76
                    android:layout_width="wrap_content"
75 77
                    android:layout_height="match_parent"
78
                    android:gravity="center"
79
                    android:paddingLeft="15dp"
76 80
                    android:text="头像"
77 81
                    android:textColor="@color/title_row"
78
                    android:textSize="15sp"
79
                    android:paddingLeft="15dp"
80
                    android:gravity="center"/>
82
                    android:textSize="15sp" />
81 83
82 84
                <com.electric.chargingpile.view.RoundImageView
83 85
                    android:id="@+id/iv_user_icon"
84 86
                    android:layout_width="45dp"
85 87
                    android:layout_height="45dp"
86
                    android:src="@drawable/icon_face2_0"
87
                    android:layout_centerVertical="true"
88
                    android:layout_alignParentRight="true"
89 88
                    android:layout_alignParentEnd="true"
89
                    android:layout_alignParentRight="true"
90
                    android:layout_centerVertical="true"
91
                    android:layout_marginEnd="32dp"
90 92
                    android:layout_marginRight="32dp"
91
                    android:layout_marginEnd="32dp" />
93
                    android:src="@drawable/icon_face2_0" />
94
92 95
                <ImageView
93 96
                    android:layout_width="wrap_content"
94 97
                    android:layout_height="match_parent"
95
                    android:src="@drawable/icon_more2_0"
96
                    android:layout_centerVertical="true"
97
                    android:layout_alignParentRight="true"
98 98
                    android:layout_alignParentEnd="true"
99
                    android:layout_alignParentRight="true"
100
                    android:layout_centerVertical="true"
101
                    android:layout_marginEnd="15dp"
99 102
                    android:layout_marginRight="15dp"
100
                    android:layout_marginEnd="15dp" />
101
103
                    android:src="@drawable/icon_more2_0" />
102 104
103 105
104 106
            </RelativeLayout>
107
105 108
            <View
106 109
                android:layout_width="match_parent"
107 110
                android:layout_height="0.5dp"
@ -112,208 +115,166 @@
112 115
                android:layout_width="fill_parent"
113 116
                android:layout_height="45dp"
114 117
                android:background="@color/white">
118
115 119
                <TextView
116 120
                    android:layout_width="wrap_content"
117 121
                    android:layout_height="match_parent"
122
                    android:gravity="center"
123
                    android:paddingLeft="15dp"
118 124
                    android:text="昵称"
119 125
                    android:textColor="@color/title_row"
120
                    android:textSize="15sp"
121
                    android:paddingLeft="15dp"
122
                    android:gravity="center"/>
126
                    android:textSize="15sp" />
123 127
124 128
                <EditText
125 129
                    android:id="@+id/et_nickName"
126 130
                    android:layout_width="wrap_content"
127 131
                    android:layout_height="130px"
128
                    android:background="@color/white"
129
                    android:hint="请输入昵称"
132
                    android:layout_alignParentTop="true"
133
                    android:layout_alignParentEnd="true"
130 134
135
                    android:layout_alignParentRight="true"
136
                    android:layout_marginEnd="15dp"
137
                    android:layout_marginRight="15dp"
138
                    android:background="@color/white"
131 139
                    android:gravity="center|right"
140
                    android:hint="请输入昵称"
141
                    android:maxLength="16"
132 142
                    android:singleLine="true"
133
                    android:textColorHint="@color/ui_68"
134 143
                    android:textColor="@color/ui_62"
135
                    android:textSize="15sp"
136
                    android:maxLength="16"
137
                    android:layout_alignParentTop="true"
138
                    android:layout_alignParentRight="true"
139
                    android:layout_alignParentEnd="true"
140
                    android:layout_marginRight="15dp"
141
                    android:layout_marginEnd="15dp" />
144
                    android:textColorHint="@color/ui_68"
145
                    android:textSize="15sp" />
142 146
143 147
            </RelativeLayout>
144 148
145 149
            <View
146 150
                android:layout_width="match_parent"
147 151
                android:layout_height="0.5dp"
148
                android:background="@color/ui_line"
149 152
                android:layout_marginLeft="15dp"
150
                android:visibility="visible"/>
151
153
                android:background="@color/ui_line"
154
                android:visibility="visible" />
152 155
153 156
154 157
            <RelativeLayout
155
                android:id="@+id/rl_isBuy"
158
                android:id="@+id/go_certificate"
156 159
                android:layout_width="fill_parent"
157
                android:background="@color/white"
158 160
                android:layout_height="45dp"
161
                android:background="@color/white"
159 162
                android:visibility="visible">
163
160 164
                <TextView
165
                    android:id="@+id/go_title"
161 166
                    android:layout_width="wrap_content"
162 167
                    android:layout_height="match_parent"
163
                    android:text="是否购买新能源汽车"
168
                    android:gravity="center"
169
                    android:paddingLeft="15dp"
164 170
                    android:textColor="@color/title_row"
165 171
                    android:textSize="15sp"
166
                    android:paddingLeft="15dp"
167
                    android:gravity="center"/>
172
                    android:text="去认证车主(获得充电优惠)" />
168 173
169 174
                <TextView
170
                    android:id="@+id/tv_buy"
175
                    android:id="@+id/go_desc"
171 176
                    android:layout_width="wrap_content"
172 177
                    android:layout_height="45dp"
178
                    android:layout_alignParentTop="true"
179
                    android:layout_alignParentEnd="true"
180
                    android:layout_alignParentRight="true"
181
                    android:layout_marginEnd="15dp"
182
                    android:layout_marginRight="15dp"
173 183
                    android:background="@color/white"
174
                    android:text="未购买"
175
                    android:hint="请选择"
176 184
                    android:gravity="center|right"
177 185
                    android:singleLine="true"
178
                    android:textColorHint="@color/ui_68"
186
                    tools:text="审核中"
179 187
                    android:textColor="@color/ui_62"
180
                    android:textSize="15sp"
181
                    android:layout_alignParentTop="true"
182
                    android:layout_marginRight="8dp"
183
                    android:layout_toLeftOf="@+id/imageView14"
184
                    android:layout_toStartOf="@+id/imageView14" />
188
                    android:textColorHint="@color/ui_68"
189
                    android:textSize="15sp" />
185 190
186 191
                <ImageView
192
                    android:id="@+id/go_cursor"
187 193
                    android:layout_width="wrap_content"
188 194
                    android:layout_height="match_parent"
189
                    android:src="@drawable/icon_more2_0"
190
                    android:layout_centerVertical="true"
191
                    android:layout_alignParentRight="true"
192 195
                    android:layout_alignParentEnd="true"
196
                    android:layout_alignParentRight="true"
197
                    android:layout_centerVertical="true"
193 198
                    android:layout_marginRight="15dp"
194
                    android:id="@+id/imageView14" />
199
                    android:src="@drawable/icon_more2_0" />
195 200
196 201
            </RelativeLayout>
197 202
198 203
            <View
199 204
                android:layout_width="match_parent"
200 205
                android:layout_height="0.5dp"
201
                android:background="@color/ui_line"
202 206
                android:layout_marginLeft="15dp"
203
                android:visibility="visible"/>
204
205
206
207
            <RelativeLayout
208
                android:id="@+id/rl_select_car"
209
                android:layout_width="fill_parent"
210
                android:background="@color/white"
211
                android:layout_height="45dp"
212
                android:visibility="visible">
213
                <TextView
214
                    android:layout_width="wrap_content"
215
                    android:layout_height="match_parent"
216
                    android:text="品牌型号"
217
                    android:textColor="@color/title_row"
218
                    android:textSize="15sp"
219
                    android:paddingLeft="15dp"
220
                    android:gravity="center"/>
221
222
                <TextView
223
                    android:id="@+id/et_che"
224
                    android:layout_width="wrap_content"
225
                    android:layout_height="45dp"
226
                    android:background="@color/white"
227
                    android:hint="请选择品牌车型"
228
                    android:gravity="center|right"
229
                    android:singleLine="true"
230
                    android:textColorHint="@color/ui_68"
231
                    android:textColor="@color/ui_62"
232
                    android:textSize="15sp"
233
                    android:layout_alignParentTop="true"
234
                    android:layout_marginRight="8dp"
235
                    android:layout_toLeftOf="@+id/imageView13"
236
                    android:layout_toStartOf="@+id/imageView13" />
237
238
                <ImageView
239
                    android:layout_width="wrap_content"
240
                    android:layout_height="match_parent"
241
                    android:src="@drawable/icon_more2_0"
242
                    android:layout_centerVertical="true"
243
                    android:layout_alignParentRight="true"
244
                    android:layout_alignParentEnd="true"
245
                    android:layout_marginRight="15dp"
246
                    android:id="@+id/imageView13" />
247
248
            </RelativeLayout>
249
207
                android:background="@color/ui_line"
208
                android:visibility="visible" />
250 209
251 210
            <com.zhy.autolayout.AutoRelativeLayout
252 211
                android:layout_width="fill_parent"
253 212
                android:layout_height="139px"
254 213
                android:visibility="gone">
214
255 215
                <TextView
256 216
                    android:layout_width="wrap_content"
257 217
                    android:layout_height="match_parent"
218
                    android:gravity="center"
219
                    android:paddingLeft="44px"
258 220
                    android:text="性别"
259 221
                    android:textColor="@color/title_row"
260
                    android:textSize="15sp"
261
                    android:paddingLeft="44px"
262
                    android:gravity="center"/>
222
                    android:textSize="15sp" />
263 223
264 224
                <ToggleButton
265 225
                    android:id="@+id/sex_button"
266 226
                    android:layout_width="wrap_content"
267 227
                    android:layout_height="wrap_content"
228
                    android:layout_alignParentEnd="true"
229
                    android:layout_alignParentRight="true"
230
                    android:layout_centerVertical="true"
268 231
                    android:layout_gravity="center_horizontal"
232
                    android:layout_marginRight="5dp"
269 233
                    android:background="@android:color/transparent"
270 234
                    android:button="@drawable/sex_btn"
271 235
                    android:gravity="center"
272 236
                    android:textOff=""
273
                    android:textOn=""
274
                    android:layout_marginRight="5dp"
275
                    android:layout_centerVertical="true"
276
                    android:layout_alignParentRight="true"
277
                    android:layout_alignParentEnd="true" />
237
                    android:textOn="" />
278 238
279 239
            </com.zhy.autolayout.AutoRelativeLayout>
280 240
281 241
            <View
282 242
                android:layout_width="match_parent"
283 243
                android:layout_height="0.5dp"
284
                android:background="@color/ui_line"
285 244
                android:layout_marginLeft="44px"
286
                android:visibility="gone"/>
245
                android:background="@color/ui_line"
246
                android:visibility="gone" />
287 247
288 248
            <com.zhy.autolayout.AutoRelativeLayout
289 249
                android:layout_width="fill_parent"
290 250
                android:layout_height="139px"
291 251
                android:visibility="gone">
252
292 253
                <TextView
293 254
                    android:layout_width="wrap_content"
294 255
                    android:layout_height="match_parent"
256
                    android:gravity="center"
257
                    android:paddingLeft="44px"
295 258
                    android:text="真实姓名"
296 259
                    android:textColor="@color/title_row"
297
                    android:textSize="15sp"
298
                    android:paddingLeft="44px"
299
                    android:gravity="center"/>
260
                    android:textSize="15sp" />
300 261
301 262
                <EditText
302 263
                    android:id="@+id/et_realName"
303 264
                    android:layout_width="wrap_content"
304 265
                    android:layout_height="139px"
266
                    android:layout_alignParentTop="true"
267
                    android:layout_alignParentEnd="true"
268
                    android:layout_alignParentRight="true"
269
                    android:layout_marginEnd="44px"
270
                    android:layout_marginRight="44px"
305 271
                    android:background="@color/white"
272
                    android:gravity="center|right"
306 273
                    android:hint="请输入真实姓名"
307 274
                    android:singleLine="true"
308
                    android:textColorHint="@color/ui_68"
309 275
                    android:textColor="@color/ui_62"
310
                    android:gravity="center|right"
311
                    android:textSize="15sp"
312
                    android:layout_alignParentTop="true"
313
                    android:layout_alignParentRight="true"
314
                    android:layout_alignParentEnd="true"
315
                    android:layout_marginRight="44px"
316
                    android:layout_marginEnd="44px" />
276
                    android:textColorHint="@color/ui_68"
277
                    android:textSize="15sp" />
317 278
318 279
            </com.zhy.autolayout.AutoRelativeLayout>
319 280
@ -324,113 +285,112 @@
324 285
                android:background="@color/ui_line" />
325 286
326 287
327
328 288
        </LinearLayout>
329 289
330 290
        <com.zhy.autolayout.AutoLinearLayout
331 291
            android:layout_width="match_parent"
332 292
            android:layout_height="wrap_content"
333
            android:orientation="vertical"
293
            android:layout_marginTop="15dp"
334 294
            android:background="@color/white"
335
            android:layout_marginTop="15dp">
295
            android:orientation="vertical">
336 296
337
        <View
338
            android:layout_width="match_parent"
339
            android:layout_height="0.5dp"
340
            android:background="@color/ui_line"
341
            android:visibility="gone"/>
297
            <View
298
                android:layout_width="match_parent"
299
                android:layout_height="0.5dp"
300
                android:background="@color/ui_line"
301
                android:visibility="gone" />
342 302
343
        <com.zhy.autolayout.AutoRelativeLayout
344
            android:layout_width="fill_parent"
345
            android:layout_height="139px"
346
            android:background="@color/white"
347
            android:visibility="gone">
303
            <com.zhy.autolayout.AutoRelativeLayout
304
                android:layout_width="fill_parent"
305
                android:layout_height="139px"
306
                android:background="@color/white"
307
                android:visibility="gone">
348 308
349 309
350
            <ToggleButton
351
                android:id="@+id/car_button"
352
                android:layout_width="wrap_content"
353
                android:layout_height="wrap_content"
354
                android:layout_gravity="center_horizontal"
355
                android:background="@android:color/transparent"
356
                android:button="@drawable/car_btn"
357
                android:layout_marginLeft="44px"
358
                android:gravity="center"
359
                android:textOff=""
360
                android:textOn=""
361
                android:layout_centerVertical="true"
362
                android:visibility="gone"/>
310
                <ToggleButton
311
                    android:id="@+id/car_button"
312
                    android:layout_width="wrap_content"
313
                    android:layout_height="wrap_content"
314
                    android:layout_centerVertical="true"
315
                    android:layout_gravity="center_horizontal"
316
                    android:layout_marginLeft="44px"
317
                    android:background="@android:color/transparent"
318
                    android:button="@drawable/car_btn"
319
                    android:gravity="center"
320
                    android:textOff=""
321
                    android:textOn=""
322
                    android:visibility="gone" />
363 323
364 324
365
        </com.zhy.autolayout.AutoRelativeLayout>
325
            </com.zhy.autolayout.AutoRelativeLayout>
366 326
367 327
328
            <com.zhy.autolayout.AutoLinearLayout
329
                android:layout_width="fill_parent"
330
                android:layout_height="45dp"
331
                android:background="@color/white"
332
                android:orientation="horizontal"
333
                android:visibility="gone">
368 334
369
        <com.zhy.autolayout.AutoLinearLayout
370
            android:layout_width="fill_parent"
371
            android:layout_height="45dp"
372
            android:background="@color/white"
373
            android:orientation="horizontal"
374
            android:visibility="gone">
375
           <com.zhy.autolayout.AutoLinearLayout
376
               android:id="@+id/rl_1"
377
               android:layout_width="0dp"
378
               android:layout_weight="1"
379
               android:layout_height="match_parent"
380
               android:orientation="horizontal">
381
                <TextView
382
                    android:id="@+id/onclick"
383
                    android:layout_width="wrap_content"
335
                <com.zhy.autolayout.AutoLinearLayout
336
                    android:id="@+id/rl_1"
337
                    android:layout_width="0dp"
384 338
                    android:layout_height="match_parent"
385
                    android:text="品牌"
386
                    android:paddingLeft="16dp"
387
                    android:textSize="16sp"
388
                    android:textColor="@color/hintColor"
389
                    android:gravity="center_vertical"/>
390
               <Spinner
391
                   android:id = "@+id/spinner_province_search_event"
392
                   android:layout_width = "match_parent"
393
                   android:layout_height ="match_parent"
394
                   android:gravity="center"
395
                   android:spinnerMode="dialog">
396
               </Spinner >
397
398
399
               <!--<ImageView-->
400
                   <!--android:layout_width="wrap_content"-->
401
                   <!--android:layout_height="wrap_content"-->
402
                   <!--android:src="@drawable/icon_xiala2_0"-->
403
                   <!--android:layout_centerVertical="true"-->
404
                   <!--android:layout_alignParentRight="true"-->
405
                   <!--android:layout_alignParentEnd="true"-->
406
                   <!--android:layout_marginRight="16dp" />-->
407
           </com.zhy.autolayout.AutoLinearLayout>
339
                    android:layout_weight="1"
340
                    android:orientation="horizontal">
408 341
342
                    <TextView
343
                        android:id="@+id/onclick"
344
                        android:layout_width="wrap_content"
345
                        android:layout_height="match_parent"
346
                        android:gravity="center_vertical"
347
                        android:paddingLeft="16dp"
348
                        android:text="品牌"
349
                        android:textColor="@color/hintColor"
350
                        android:textSize="16sp" />
351
352
                    <Spinner
353
                        android:id="@+id/spinner_province_search_event"
354
                        android:layout_width="match_parent"
355
                        android:layout_height="match_parent"
356
                        android:gravity="center"
357
                        android:spinnerMode="dialog"></Spinner>
358
359
360
                    <!--<ImageView-->
361
                    <!--android:layout_width="wrap_content"-->
362
                    <!--android:layout_height="wrap_content"-->
363
                    <!--android:src="@drawable/icon_xiala2_0"-->
364
                    <!--android:layout_centerVertical="true"-->
365
                    <!--android:layout_alignParentRight="true"-->
366
                    <!--android:layout_alignParentEnd="true"-->
367
                    <!--android:layout_marginRight="16dp" />-->
368
                </com.zhy.autolayout.AutoLinearLayout>
409 369
410
            <com.zhy.autolayout.AutoLinearLayout
411
                android:id="@+id/rl_2"
412
                android:layout_width="0dp"
413
                android:layout_weight="1"
414
                android:layout_height="match_parent"
415
                android:orientation="horizontal">
416 370
417
                <TextView
418
                    android:layout_width="wrap_content"
371
                <com.zhy.autolayout.AutoLinearLayout
372
                    android:id="@+id/rl_2"
373
                    android:layout_width="0dp"
419 374
                    android:layout_height="match_parent"
420
                    android:text="车型"
421
                    android:paddingLeft="44px"
422
                    android:textSize="16sp"
423
                    android:textColor="@color/hintColor"
424
                    android:gravity="center_vertical"/>
425
426
                <Spinner
427
                    android:id = "@+id/spinner_city_search_event"
428
                    android:layout_width = "match_parent"
429
                    android:layout_height ="match_parent"
430
                    android:gravity="center"
431
                    android:spinnerMode="dialog">
432
                </Spinner >
433
                <!--<ImageView-->
375
                    android:layout_weight="1"
376
                    android:orientation="horizontal">
377
378
                    <TextView
379
                        android:layout_width="wrap_content"
380
                        android:layout_height="match_parent"
381
                        android:gravity="center_vertical"
382
                        android:paddingLeft="44px"
383
                        android:text="车型"
384
                        android:textColor="@color/hintColor"
385
                        android:textSize="16sp" />
386
387
                       <Spinner
388
                        android:id="@+id/spinner_city_search_event"
389
                        android:layout_width="match_parent"
390
                        android:layout_height="match_parent"
391
                        android:gravity="center"
392
                        android:spinnerMode="dialog"></Spinner>
393
                    <!--<ImageView-->
434 394
                    <!--android:layout_width="wrap_content"-->
435 395
                    <!--android:layout_height="wrap_content"-->
436 396
                    <!--android:src="@drawable/icon_xiala2_0"-->
@ -439,24 +399,23 @@
439 399
                    <!--android:layout_alignParentEnd="true"-->
440 400
                    <!--android:layout_marginRight="16dp" />-->
441 401
442
            </com.zhy.autolayout.AutoLinearLayout>
402
                </com.zhy.autolayout.AutoLinearLayout>
443 403
444
        </com.zhy.autolayout.AutoLinearLayout>
445
446
        <View
447
            android:layout_width="match_parent"
448
            android:layout_height="0.5dp"
449
            android:background="@color/ui_line"
450
            android:layout_marginLeft="16dp"
451
            android:visibility="gone"/>
404
            </com.zhy.autolayout.AutoLinearLayout>
452 405
406
            <View
407
                android:layout_width="match_parent"
408
                android:layout_height="0.5dp"
409
                android:layout_marginLeft="16dp"
410
                android:background="@color/ui_line"
411
                android:visibility="gone" />
453 412
454 413
455
        <View
456
            android:layout_width="match_parent"
457
            android:layout_height="0.5dp"
458
            android:background="@color/ui_line"
459
            android:visibility="gone"/>
414
            <View
415
                android:layout_width="match_parent"
416
                android:layout_height="0.5dp"
417
                android:background="@color/ui_line"
418
                android:visibility="gone" />
460 419
461 420
        </com.zhy.autolayout.AutoLinearLayout>
462 421
@ -513,49 +472,49 @@
513 472
                android:layout_width="match_parent"
514 473
                android:layout_height="39dp"
515 474
                android:layout_alignParentBottom="true"
516
                android:layout_marginTop="15dp"
517 475
                android:layout_marginLeft="15dp"
476
                android:layout_marginTop="15dp"
518 477
                android:layout_marginRight="15dp"
519 478
                android:layout_marginBottom="8dp"
520 479
                android:background="@drawable/textview_greenstyle"
521
                android:textColor="@color/white"
522
                android:textSize="16sp"
480
                android:gravity="center"
523 481
                android:text="保存"
524
                android:gravity="center" />
482
                android:textColor="@color/white"
483
                android:textSize="16sp" />
525 484
526 485
            <ImageView
527 486
                android:id="@+id/tv_one"
528 487
                android:layout_width="wrap_content"
529 488
                android:layout_height="wrap_content"
530
                android:layout_gravity="center"
489
                android:layout_above="@+id/tv_make_sure"
531 490
532
                android:gravity="center"
491
                android:layout_centerHorizontal="true"
533 492
493
                android:layout_gravity="center"
494
                android:layout_marginBottom="20dp"
495
                android:background="@drawable/icon_5point"
496
                android:gravity="center"
534 497
                android:padding="5dp"
535 498
                android:scaleType="fitXY"
536
                android:background="@drawable/icon_5point"
537 499
                android:textColor="#000000"
538
                android:visibility="gone"
539
                android:layout_marginBottom="20dp"
540
                android:layout_above="@+id/tv_make_sure"
541
                android:layout_centerHorizontal="true" />
500
                android:visibility="gone" />
542 501
543 502
544 503
            <RelativeLayout
545 504
                android:id="@+id/rl_point"
546 505
                android:layout_width="80dp"
547 506
                android:layout_height="80dp"
548
                android:layout_marginBottom="50dp"
549
                android:layout_centerHorizontal="true"
550 507
                android:layout_alignParentBottom="true"
551
                android:visibility="gone"
552
                android:background="@drawable/icon_point_bg">
508
                android:layout_centerHorizontal="true"
509
                android:layout_marginBottom="50dp"
510
                android:background="@drawable/icon_point_bg"
511
                android:visibility="gone">
553 512
554 513
                <LinearLayout
555 514
                    android:layout_width="wrap_content"
556 515
                    android:layout_height="wrap_content"
557
                    android:orientation="vertical"
558
                    android:layout_centerInParent="true">
516
                    android:layout_centerInParent="true"
517
                    android:orientation="vertical">
559 518
560 519
                    <LinearLayout
561 520
                        android:layout_width="wrap_content"
@ -566,17 +525,17 @@
566 525
                            android:layout_width="wrap_content"
567 526
                            android:layout_height="wrap_content"
568 527
                            android:text="+"
569
                            android:textSize="16sp"
570
                            android:textColor="@color/white"/>
528
                            android:textColor="@color/white"
529
                            android:textSize="16sp" />
571 530
572 531
                        <TextView
573 532
                            android:id="@+id/tv_point"
574 533
                            android:layout_width="wrap_content"
575 534
                            android:layout_height="wrap_content"
576
                            android:text="20"
577
                            android:textSize="19sp"
578 535
                            android:layout_marginLeft="2dp"
579
                            android:textColor="@color/white"/>
536
                            android:text="20"
537
                            android:textColor="@color/white"
538
                            android:textSize="19sp" />
580 539
581 540
582 541
                    </LinearLayout>
@ -585,16 +544,15 @@
585 544
                        android:layout_width="wrap_content"
586 545
                        android:layout_height="wrap_content"
587 546
                        android:layout_gravity="center_horizontal"
547
                        android:layout_marginTop="2dp"
588 548
                        android:text="充电币"
589
                        android:textSize="13sp"
590 549
                        android:textColor="@color/white"
591
                        android:layout_marginTop="2dp"/>
550
                        android:textSize="13sp" />
592 551
593 552
594 553
                </LinearLayout>
595 554
596 555
597
598 556
            </RelativeLayout>
599 557
600 558
        </com.zhy.autolayout.AutoRelativeLayout>

隐私政策和权限设置调整 · 3158c4254a - Gogs: Go Git Service
浏览代码

隐私政策和权限设置调整

huyuguo 4 年之前
父节点
当前提交
3158c4254a

+ 25 - 20
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="95"
6
    android:versionName="3.5.7">
5
    android:versionCode="96"
6
    android:versionName="3.5.8">
7 7
8 8
    <uses-permission android:name="android.permission.BLUETOOTH" />
9 9
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
@ -81,11 +81,13 @@
81 81
            android:screenOrientation="portrait">
82 82
            <intent-filter>
83 83
                <action android:name="android.intent.action.MAIN" />
84
85 84
                <category android:name="android.intent.category.LAUNCHER" />
86 85
            </intent-filter>
87 86
        </activity>
88 87
        <activity
88
            android:name=".activity.PermissionAgreementActivity"
89
            android:screenOrientation="portrait"></activity>
90
        <activity
89 91
            android:name=".activity.CarModelActivity"
90 92
            android:launchMode="singleTop"
91 93
            android:screenOrientation="portrait" />
@ -809,18 +811,18 @@
809 811
        <!-- Rich push 核心功能 since 2.0.6-->
810 812
        <activity
811 813
            android:name="cn.jpush.android.ui.PopWinActivity"
812
            android:theme="@style/MyDialogStyle"
813
            android:exported="false">
814
        </activity>
814
            android:exported="false"
815
            android:theme="@style/MyDialogStyle"></activity>
815 816
816 817
        <!-- Required SDK核心功能-->
817 818
        <activity
818 819
            android:name="cn.jpush.android.ui.PushActivity"
819 820
            android:configChanges="orientation|keyboardHidden"
820
            android:theme="@android:style/Theme.NoTitleBar"
821
            android:exported="false">
821
            android:exported="false"
822
            android:theme="@android:style/Theme.NoTitleBar">
822 823
            <intent-filter>
823 824
                <action android:name="cn.jpush.android.ui.PushActivity" />
825
824 826
                <category android:name="android.intent.category.DEFAULT" />
825 827
                <category android:name="${applicationId}" />
826 828
            </intent-filter>
@ -841,11 +843,10 @@
841 843
842 844
        <!-- since 3.0.9 Required SDK 核心功能-->
843 845
        <provider
844
            android:authorities="${applicationId}.DataProvider"
845 846
            android:name="cn.jpush.android.service.DataProvider"
846
            android:process=":pushcore"
847
            android:authorities="${applicationId}.DataProvider"
847 848
            android:exported="false"
848
            />
849
            android:process=":pushcore" />
849 850
850 851
        <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
851 852
        <!-- 若不启用该功能可删除该组件,或把 enabled 设置成 false ;App 不会被其他 App 拉起,但会拉起其他的 App。 -->
@ -860,13 +861,14 @@
860 861
        </service>
861 862
862 863
        <!-- 可选,如果使用静态Activity方式拉起,该组件必须声明 -->
863
        <activity android:name="cn.jpush.android.service.DActivity"
864
        <activity
865
            android:name="cn.jpush.android.service.DActivity"
864 866
            android:enabled="true"
865 867
            android:exported="true"
866
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
867
            android:taskAffinity="jpush.custom">
868
            android:taskAffinity="jpush.custom"
869
            android:theme="@android:style/Theme.Translucent.NoTitleBar">
868 870
            <intent-filter>
869
                <action android:name="cn.jpush.android.intent.DActivity"/>
871
                <action android:name="cn.jpush.android.intent.DActivity" />
870 872
                <category android:name="${applicationId}" />
871 873
            </intent-filter>
872 874
        </activity>
@ -885,10 +887,9 @@
885 887
886 888
        <!-- since 3.1.0 Required SDK 核心功能-->
887 889
        <provider
888
            android:authorities="${applicationId}.DownloadProvider"
889 890
            android:name="cn.jpush.android.service.DownloadProvider"
890
            android:exported="true"
891
            />
891
            android:authorities="${applicationId}.DownloadProvider"
892
            android:exported="true" />
892 893
893 894
        <!-- Required SDK核心功能-->
894 895
        <receiver
@ -912,10 +913,14 @@
912 913
        </receiver>
913 914
914 915
        <!-- Required SDK核心功能-->
915
        <receiver android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false"/>
916
        <receiver
917
            android:name="cn.jpush.android.service.AlarmReceiver"
918
            android:exported="false" />
916 919
917 920
        <!-- 3.5.0新增,用于定时展示功能 -->
918
        <receiver android:name="cn.jpush.android.service.SchedulerReceiver" android:exported="false"/>
921
        <receiver
922
            android:name="cn.jpush.android.service.SchedulerReceiver"
923
            android:exported="false" />
919 924
920 925
921 926
        <meta-data

+ 126 - 0
app/src/main/java/com/electric/chargingpile/activity/PermissionAgreementActivity.java

@ -0,0 +1,126 @@
1
package com.electric.chargingpile.activity;
2
3
4
import android.Manifest;
5
import android.app.Activity;
6
import android.content.Intent;
7
import android.os.Bundle;
8
import android.view.View;
9
import android.widget.TextView;
10
import androidx.annotation.NonNull;
11
import com.electric.chargingpile.R;
12
import com.electric.chargingpile.manager.ProfileManager;
13
import com.electric.chargingpile.util.BarColorUtil;
14
import com.electric.chargingpile.util.SystemTypeUtil;
15
import com.electric.chargingpile.view.AlertDialogCommon;
16
import java.util.List;
17
import pub.devrel.easypermissions.AfterPermissionGranted;
18
import pub.devrel.easypermissions.EasyPermissions;
19
20
public class PermissionAgreementActivity extends Activity implements EasyPermissions.PermissionCallbacks {
21
22
    private static final int RC_PHONE_PERM = 100;
23
    private static final int RC_STORAGE_PERM = 101;
24
25
    @Override
26
    protected void onCreate(Bundle savedInstanceState) {
27
        super.onCreate(savedInstanceState);
28
        setContentView(R.layout.activity_permission_agreement);
29
        ProfileManager.getInstance().setKeyPermissionAgreement(PermissionAgreementActivity.this, true);
30
        BarColorUtil.initStatusBarColor(PermissionAgreementActivity.this);
31
        initView();
32
    }
33
34
    private void initView() {
35
        TextView agreement_btn = findViewById(R.id.agreement_btn);
36
        agreement_btn.setOnClickListener(new View.OnClickListener() {
37
            @Override
38
            public void onClick(View v) {
39
                requestPhonePermission();
40
            }
41
        });
42
    }
43
44
    @AfterPermissionGranted(RC_PHONE_PERM)
45
    private void requestPhonePermission() {
46
        if (isPhonePermissionOK()) {
47
            requestStoragePermission();
48
        } else {
49
            EasyPermissions.requestPermissions(
50
                    this, "为保证您正常、安全的使用充电桩,需要获取您的电话使用权限,请允许。",
51
                    RC_PHONE_PERM,
52
                    Manifest.permission.READ_PHONE_STATE);
53
        }
54
    }
55
56
    private boolean isPhonePermissionOK() {
57
        return EasyPermissions.hasPermissions(this,
58
                Manifest.permission.READ_PHONE_STATE
59
        );
60
    }
61
62
    @AfterPermissionGranted(RC_STORAGE_PERM)
63
    private void requestStoragePermission() {
64
        if (isStoragePermissionOK()) {
65
                startActivity(new Intent(PermissionAgreementActivity.this, WelcomeActivity.class));
66
                finish();
67
        } else {
68
            EasyPermissions.requestPermissions(
69
                    this, "为保证您正常、安全的使用充电桩,需要获取您的存储权限,请允许。",
70
                    RC_STORAGE_PERM,
71
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
72
                    Manifest.permission.READ_EXTERNAL_STORAGE);
73
        }
74
    }
75
76
    private boolean isStoragePermissionOK() {
77
        return EasyPermissions.hasPermissions(this,
78
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
79
                Manifest.permission.READ_EXTERNAL_STORAGE
80
        );
81
    }
82
83
    @Override
84
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
85
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
86
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
87
    }
88
89
    @Override
90
    public void onPermissionsGranted(int requestCode, List<String> perms) {
91
    }
92
93
    @Override
94
    public void onPermissionsDenied(int requestCode, List<String> perms) {
95
        if (requestCode == RC_PHONE_PERM) {
96
            new AlertDialogCommon(PermissionAgreementActivity.this).builder()
97
                    .setMsg("为保证您正常、安全的使用充电桩,需要获取您的电话使用权限,请允许。")
98
                    .setPositiveButton("去设置", new View.OnClickListener() {
99
                        @Override
100
                        public void onClick(View v) {
101
                            SystemTypeUtil.goToPermissionManager(PermissionAgreementActivity.this);
102
                        }
103
                    }).setNegativeButton("取消", new View.OnClickListener() {
104
                @Override
105
                public void onClick(View v) {
106
                    android.os.Process.killProcess(android.os.Process.myPid());
107
                }
108
            }).show();
109
        } else if (requestCode == RC_STORAGE_PERM) {
110
            new AlertDialogCommon(PermissionAgreementActivity.this).builder()
111
                    .setMsg("为保证您正常、安全的使用充电桩,需要获取您的存储权限,请允许。")
112
                    .setPositiveButton("去设置", new View.OnClickListener() {
113
                        @Override
114
                        public void onClick(View v) {
115
                            SystemTypeUtil.goToPermissionManager(PermissionAgreementActivity.this);
116
                        }
117
                    }).setNegativeButton("取消", new View.OnClickListener() {
118
                @Override
119
                public void onClick(View v) {
120
                    android.os.Process.killProcess(android.os.Process.myPid());
121
                }
122
            }).show();
123
        }
124
    }
125
126
}

+ 19 - 16
app/src/main/java/com/electric/chargingpile/activity/PrivacyAgreementActivity.java

@ -11,21 +11,15 @@ import android.text.Spanned;
11 11
import android.text.TextPaint;
12 12
import android.text.method.LinkMovementMethod;
13 13
import android.text.style.ClickableSpan;
14
import android.text.style.ForegroundColorSpan;
15 14
import android.text.style.StyleSpan;
16 15
import android.view.View;
17
import android.view.Window;
18
import android.view.WindowManager;
19 16
import android.widget.Button;
20 17
import android.widget.TextView;
21
import android.widget.Toast;
22 18
23 19
import com.electric.chargingpile.R;
24
import com.electric.chargingpile.application.MainApplication;
25 20
import com.electric.chargingpile.manager.ProfileManager;
26 21
import com.electric.chargingpile.util.BarColorUtil;
27
28
import cn.jpush.android.api.JPushInterface;
22
import com.electric.chargingpile.view.AlertDialogCommon;
29 23
30 24
public class PrivacyAgreementActivity extends Activity {
31 25
@ -39,6 +33,9 @@ public class PrivacyAgreementActivity extends Activity {
39 33
        if (ProfileManager.getInstance().getPrivacyAgreement(this)) {
40 34
            startActivity(new Intent(PrivacyAgreementActivity.this, WelcomeActivity.class));
41 35
            finish();
36
        } else if (ProfileManager.getInstance().getPermissionAgreement(PrivacyAgreementActivity.this)) {
37
            startActivity(new Intent(PrivacyAgreementActivity.this, PermissionAgreementActivity.class));
38
            finish();
42 39
        } else {
43 40
            initView();
44 41
        }
@ -47,13 +44,14 @@ public class PrivacyAgreementActivity extends Activity {
47 44
    private void initView() {
48 45
        agree_enter_text_view = findViewById(R.id.agree_enter_text_view);
49 46
50
        String str = "你选择「同意并进入」即表示充分阅读、理解并接受《充电桩APP用户协议和隐私政策》的全部内容"; //23-40 前包括后不包括
47
//        String str = "你选择「同意并进入」即表示充分阅读、理解并接受《充电桩APP用户协议和隐私政策》的全部内容"; //23-40 前包括后不包括
48
        String str = "如您同意《充电桩隐私政策》,请点击「同意」开始使用我们的产品和服务,我们尽全力保护您的个人信息安全"; // 4-13 前包括后不包括
51 49
        //超链接的块对象
52 50
        ClickableSpan clickableSpan = new ClickableSpan() {
53 51
            @Override
54 52
            public void onClick(View widget) {
55 53
                Intent intent = new Intent(getApplication(), MyWebViewActivity.class);
56
                intent.putExtra("url", "http://evcharge.cc/pc/agreement.html");
54
                intent.putExtra("url", "http://evcharge.cc/pc/privacy.html");
57 55
                startActivity(intent);
58 56
            }
59 57
@ -70,8 +68,8 @@ public class PrivacyAgreementActivity extends Activity {
70 68
        SpannableString span = new SpannableString(str);
71 69
        //设置局部效果
72 70
        //(局部的效果对象,局部的起始位置,结束位置,包括方式) INCLUSIVE表示包裹, EXCLUSIVE不包括
73
        span.setSpan(clickableSpan, 23, 40, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);//此处为前包括后不包括
74
        span.setSpan(new StyleSpan(Typeface.BOLD), 3, 10, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
71
        span.setSpan(clickableSpan, 4, 13, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);//此处为前包括后不包括
72
        span.setSpan(new StyleSpan(Typeface.BOLD), 18, 20, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
75 73
        //将文本特效设置到文本框中
76 74
        agree_enter_text_view.setText(span, TextView.BufferType.SPANNABLE);
77 75
        //设置触摸监听的解析对象
@ -82,18 +80,23 @@ public class PrivacyAgreementActivity extends Activity {
82 80
        agreement_btn.setOnClickListener(new View.OnClickListener() {
83 81
            @Override
84 82
            public void onClick(View v) {
85
                startActivity(new Intent(PrivacyAgreementActivity.this, WelcomeActivity.class));
83
                startActivity(new Intent(PrivacyAgreementActivity.this, PermissionAgreementActivity.class));
86 84
                finish();
87 85
            }
88 86
        });
89 87
90
        Button exit_btn = findViewById(R.id.exit_btn);
91
        exit_btn.setOnClickListener(new View.OnClickListener() {
88
        Button disagreement_btn = findViewById(R.id.disagreement_btn);
89
        disagreement_btn.setOnClickListener(new View.OnClickListener() {
92 90
            @Override
93 91
            public void onClick(View v) {
94
                android.os.Process.killProcess(android.os.Process.myPid());
92
                new AlertDialogCommon(PrivacyAgreementActivity.this).builder()
93
                        .setMsg("您需要同意《充电桩隐私协议》方可使用本软件")
94
                        .setPositiveButton("知道了", new View.OnClickListener() {
95
                            @Override
96
                            public void onClick(View v) {
97
                            }
98
                        }).show();
95 99
            }
96 100
        });
97 101
    }
98
99 102
}

+ 10 - 115
app/src/main/java/com/electric/chargingpile/activity/WelcomeActivity.java

@ -48,6 +48,7 @@ import com.electric.chargingpile.util.BarColorUtil;
48 48
import com.electric.chargingpile.util.DES3;
49 49
import com.electric.chargingpile.util.JsonUtils;
50 50
import com.electric.chargingpile.util.OkHttpUtil;
51
import com.electric.chargingpile.util.SystemTypeUtil;
51 52
import com.electric.chargingpile.view.AlertDialogTwo;
52 53
import com.electric.chargingpile.view.ViewPagerAdapter;
53 54
import com.google.gson.Gson;
@ -84,7 +85,7 @@ import okhttp3.Call;
84 85
import pub.devrel.easypermissions.AfterPermissionGranted;
85 86
import pub.devrel.easypermissions.EasyPermissions;
86 87

87
public class WelcomeActivity extends Activity implements OnClickListener, EasyPermissions.PermissionCallbacks {
88
public class WelcomeActivity extends Activity implements OnClickListener {
88 89
    private static final String TAG = "WelcomeActivity";
89 90
    private ViewPager viewPager;
90 91
    private List<View> views;
@ -287,10 +288,14 @@ public class WelcomeActivity extends Activity implements OnClickListener, EasyPe
287 288
        MapsInitializer.sdcardDir = MAP_FILE_PATH;
288 289
        mTimer = new Timer();
289 290
        if (ProfileManager.getInstance().getGuide(this)) {
290
            saveTask();
291
        } else {
291
            new Handler().postDelayed(new Runnable() {
292
                @Override
293
                public void run() {
294
                    eteinit("{\"fun\":\"timer\"}");
295
                }
296
            }, 1000);
292 297

293
            cameraTask();
298
        } else {
294 299
            androidd.setVisibility(View.GONE);
295 300
            ll_1.setVisibility(View.GONE);
296 301
            viewPager = (ViewPager) findViewById(R.id.viewpager);
@ -318,7 +323,6 @@ public class WelcomeActivity extends Activity implements OnClickListener, EasyPe
318 323
    }
319 324

320 325
    private void openNotification() {
321

322 326
        AlertDialog.Builder builder = new AlertDialog.Builder(WelcomeActivity.this);
323 327
        builder.setTitle("\"充电桩\"想给您发送通知");
324 328
        builder.setMessage("\"通知\"可能包括提醒、声音和图标标记。这些可以在\"设置\"中配置。");
@ -326,19 +330,7 @@ public class WelcomeActivity extends Activity implements OnClickListener, EasyPe
326 330
        builder.setPositiveButton("允许", new DialogInterface.OnClickListener() {
327 331
            @Override
328 332
            public void onClick(DialogInterface dialog, int which) {
329
                Intent localIntent = new Intent();
330
                localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
331
                if (Build.VERSION.SDK_INT >= 9) {
332
                    localIntent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
333
                    localIntent.setData(Uri.fromParts("package", WelcomeActivity.this.getPackageName(), null));
334
                } else if (Build.VERSION.SDK_INT <= 8) {
335
                    localIntent.setAction(Intent.ACTION_VIEW);
336

337
                    localIntent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails");
338

339
                    localIntent.putExtra("com.android.settings.ApplicationPkgName", WelcomeActivity.this.getPackageName());
340
                }
341
                startActivity(localIntent);
333
                SystemTypeUtil.goToPermissionManager(WelcomeActivity.this);
342 334
                dialog.dismiss();
343 335
            }
344 336
        });
@ -668,103 +660,6 @@ public class WelcomeActivity extends Activity implements OnClickListener, EasyPe
668 660
        });
669 661
    }
670 662

671
    @Override
672
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
673
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
674
        // EasyPermissions handles the request result.
675
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
676
    }
677

678
    @Override
679
    public void onPermissionsGranted(int requestCode, List<String> perms) {
680
        for (String s : perms) {
681
            if (s.equals(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
682
                new Handler().postDelayed(new Runnable() {
683
                    @Override
684
                    public void run() {
685
                        eteinit("{\"fun\":\"timer\"}");
686
                    }
687
                }, 1000);
688
            }
689
            break;
690
        }
691
    }
692

693
    @Override
694
    public void onPermissionsDenied(int requestCode, List<String> perms) {
695
        for (String s : perms) {
696
            if (s.equals(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
697
                AlertDialog.Builder builder = new AlertDialog.Builder(WelcomeActivity.this);
698
                builder.setMessage("充电桩想要获取您的相关权限,是否允许?");
699
                builder.setCancelable(false);
700
                builder.setPositiveButton("去设置", new DialogInterface.OnClickListener() {
701
                    @Override
702
                    public void onClick(DialogInterface dialog, int which) {
703
                        EasyPermissions.requestPermissions(
704
                                WelcomeActivity.this, "充电桩想要获取您的相关权限,是否允许?",
705
                                RC_SAVE_PERM,
706
                                Manifest.permission.WRITE_EXTERNAL_STORAGE,
707
                                Manifest.permission.READ_EXTERNAL_STORAGE);
708
                    }
709
                });
710
                builder.create().show();
711
            }
712
            break;
713
        }
714
    }
715

716
    @AfterPermissionGranted(RC_CAMERA_PERM)
717
    public void cameraTask() {
718
        if (isPermissionOK()) {
719
        } else {
720
            // Ask for one permission
721
            EasyPermissions.requestPermissions(
722
                    this, "充电桩想要获取您的相关权限,是否允许?",
723
                    RC_CAMERA_PERM,
724
                    Manifest.permission.ACCESS_FINE_LOCATION,
725
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
726
                    Manifest.permission.READ_EXTERNAL_STORAGE,
727
                    Manifest.permission.READ_PHONE_STATE);
728
        }
729
    }
730

731
    @AfterPermissionGranted(RC_SAVE_PERM)
732
    public void saveTask() {
733
        if (isSavePermissionOK()) {
734
            new Handler().postDelayed(new Runnable() {
735
                @Override
736
                public void run() {
737
                    eteinit("{\"fun\":\"timer\"}");
738
                }
739
            }, 1000);
740
            // Have permission, do the thing!
741
        } else {
742
            // Ask for one permission
743
            EasyPermissions.requestPermissions(
744
                    this, "充电桩想要获取您的相关权限,是否允许?",
745
                    RC_CAMERA_PERM,
746
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
747
                    Manifest.permission.READ_EXTERNAL_STORAGE);
748
        }
749
    }
750

751
    private boolean isPermissionOK() {
752
        return EasyPermissions.hasPermissions(this,
753
                Manifest.permission.ACCESS_FINE_LOCATION,
754
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
755
                Manifest.permission.READ_EXTERNAL_STORAGE,
756
                Manifest.permission.READ_PHONE_STATE
757
        );
758
    }
759

760
    private boolean isSavePermissionOK() {
761
        return EasyPermissions.hasPermissions(this,
762
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
763
                Manifest.permission.READ_EXTERNAL_STORAGE
764
        );
765
    }
766

767

768 663
    public static void DeleteFile(File file) {
769 664
        if (file.exists() == false) {
770 665
            return;

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

@ -14,6 +14,7 @@ public class ProfileManager {
14 14
    private static final String KEY_ID = "key_id";
15 15
    private static final String KEY_GUIDE = "key_guide";
16 16
    private static final String KEY_PRIVACY_AGREEMENT = "key_privacy_agreement";
17
    private static final String KEY_PRIVACY_PERMISSION = "key_privacy_permission";
17 18
    private static final String KEY_TYPE = "key_type";
18 19
    private static final String KEY_USERID = "key_userid";
19 20
    private static final String KEY_USERICON = "key_usericon";
@ -582,6 +583,15 @@ public class ProfileManager {
582 583
                false);
583 584
    }
584 585

586
    public void setKeyPermissionAgreement(Context context, boolean guide) {
587
        PreferenceManager.getInstance(context).putBoolean(KEY_PRIVACY_PERMISSION, guide);
588
    }
589

590
    public boolean getPermissionAgreement(Context context) {
591
        return PreferenceManager.getInstance(context).getBoolean(KEY_PRIVACY_PERMISSION,
592
                false);
593
    }
594

585 595

586 596
    public void setFirstssyd(Context context, boolean firstssyd) {
587 597
        PreferenceManager.getInstance(context).putBoolean(KEY_FIRSTSSYD, firstssyd);

+ 2 - 0
app/src/main/java/com/electric/chargingpile/util/SystemTypeUtil.java

@ -123,6 +123,8 @@ public class SystemTypeUtil {
123 123
                e.printStackTrace();
124 124
                context.startActivity(getAppDetailSettingIntent(context));
125 125
            }
126
        } else {
127
            context.startActivity(getAppDetailSettingIntent(context));
126 128
        }
127 129
    }
128 130

+ 189 - 0
app/src/main/java/com/electric/chargingpile/view/AlertDialogCommon.java

@ -0,0 +1,189 @@
1
package com.electric.chargingpile.view;
2
3
import android.app.Dialog;
4
import android.content.Context;
5
import android.text.TextUtils;
6
import android.view.Display;
7
import android.view.Gravity;
8
import android.view.LayoutInflater;
9
import android.view.View;
10
import android.view.View.OnClickListener;
11
import android.view.ViewTreeObserver;
12
import android.view.WindowManager;
13
import android.widget.FrameLayout;
14
import android.widget.LinearLayout;
15
import android.widget.LinearLayout.LayoutParams;
16
import android.widget.TextView;
17
18
import com.electric.chargingpile.R;
19
import com.electric.chargingpile.application.MainApplication;
20
import com.electric.chargingpile.util.ScreenUtils;
21
22
public class AlertDialogCommon {
23
    private Context context;
24
    private Dialog dialog;
25
    private LinearLayout lLayout_bg;
26
    private TextView txt_title;
27
    private TextView txt_msg;
28
    private TextView btn_neg;
29
    private TextView btn_pos;
30
    private View btn_line;
31
    private Display display;
32
    private boolean showTitle = false;
33
    private boolean showMsg = false;
34
    private boolean showPosBtn = false;
35
    private boolean showNegBtn = false;
36
37
    public AlertDialogCommon(Context context) {
38
        this.context = context;
39
        WindowManager windowManager = (WindowManager) context
40
                .getSystemService(Context.WINDOW_SERVICE);
41
        display = windowManager.getDefaultDisplay();
42
    }
43
44
    public AlertDialogCommon builder() {
45
        // 获取Dialog布局
46
        View view = LayoutInflater.from(context).inflate(R.layout.view_alterdialog_common, null);
47
48
        // 获取自定义Dialog布局中的控件
49
        lLayout_bg = (LinearLayout) view.findViewById(R.id.lLayout_bg);
50
        txt_title = (TextView) view.findViewById(R.id.txt_title);
51
        txt_msg = (TextView) view.findViewById(R.id.txt_msg);
52
        btn_neg = (TextView) view.findViewById(R.id.btn_neg);
53
        btn_neg.setVisibility(View.GONE);
54
        btn_pos = (TextView) view.findViewById(R.id.btn_pos);
55
        btn_pos.setVisibility(View.GONE);
56
        btn_line = (View) view.findViewById(R.id.btn_line);
57
58
        // 定义Dialog布局和参数
59
        dialog = new Dialog(context, R.style.AlertDialogStyle);
60
        dialog.setContentView(view);
61
62
        int width = (int) (ScreenUtils.getScreenWidth(MainApplication.context) * 0.75);
63
        // 调整dialog背景大小
64
        lLayout_bg.setLayoutParams(new FrameLayout.LayoutParams(width, LayoutParams.WRAP_CONTENT));
65
        return this;
66
    }
67
68
    public AlertDialogCommon setTitle(String title) {
69
        showTitle = true;
70
        if (TextUtils.isEmpty(title)) {
71
            txt_title.setVisibility(View.GONE);
72
        } else {
73
            txt_title.setText(title);
74
            txt_title.setVisibility(View.VISIBLE);
75
        }
76
        return this;
77
    }
78
79
    public AlertDialogCommon setMsg(String msg) {
80
        showMsg = true;
81
        if (TextUtils.isEmpty(msg)) {
82
            txt_msg.setVisibility(View.GONE);
83
        } else {
84
            txt_msg.setVisibility(View.VISIBLE);
85
            txt_msg.setText(msg);
86
        }
87
        ViewTreeObserver vto = txt_msg.getViewTreeObserver();
88
        vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
89
            @Override
90
            public boolean onPreDraw() {
91
                int lineCount = txt_msg.getLineCount();
92
                if (lineCount == 1) {
93
                    txt_msg.setGravity(Gravity.CENTER);
94
                } else {
95
                    txt_msg.setGravity(Gravity.CENTER | Gravity.LEFT);
96
                }
97
                return true;
98
            }
99
        });
100
        return this;
101
    }
102
103
    public AlertDialogCommon setCancelable(boolean cancel) {
104
        dialog.setCancelable(cancel);
105
        return this;
106
    }
107
108
    public AlertDialogCommon setPositiveButton(String text, final OnClickListener listener) {
109
        showPosBtn = true;
110
        if (TextUtils.isEmpty(text)) {
111
            btn_pos.setVisibility(View.GONE);
112
        } else {
113
            btn_pos.setText(text);
114
            btn_pos.setVisibility(View.VISIBLE);
115
        }
116
        btn_pos.setOnClickListener(new OnClickListener() {
117
            @Override
118
            public void onClick(View v) {
119
                try {
120
                    listener.onClick(v);
121
                    dialog.dismiss();
122
                } catch (Exception e) {
123
                    e.printStackTrace();
124
                }
125
126
            }
127
        });
128
        return this;
129
    }
130
131
    public AlertDialogCommon setNegativeButton(String text, final OnClickListener listener) {
132
        showNegBtn = true;
133
        if (TextUtils.isEmpty(text)) {
134
            btn_neg.setVisibility(View.GONE);
135
            btn_line.setVisibility(View.GONE);
136
        } else {
137
            btn_neg.setText(text);
138
            btn_neg.setVisibility(View.VISIBLE);
139
            btn_line.setVisibility(View.VISIBLE);
140
        }
141
        btn_neg.setOnClickListener(new OnClickListener() {
142
            @Override
143
            public void onClick(View v) {
144
                listener.onClick(v);
145
                dialog.dismiss();
146
            }
147
        });
148
        return this;
149
    }
150
151
    private void setLayout() {
152
        if (!showPosBtn && !showNegBtn) {
153
            btn_pos.setText("确定");
154
            btn_pos.setVisibility(View.VISIBLE);
155
            btn_pos.setOnClickListener(new OnClickListener() {
156
                @Override
157
                public void onClick(View v) {
158
                    dialog.dismiss();
159
                }
160
            });
161
        }
162
163
        if (showPosBtn && showNegBtn) {
164
            btn_pos.setVisibility(View.VISIBLE);
165
            btn_neg.setVisibility(View.VISIBLE);
166
        }
167
168
        if (showPosBtn && !showNegBtn) {
169
            btn_pos.setVisibility(View.VISIBLE);
170
        }
171
172
        if (!showPosBtn && showNegBtn) {
173
            btn_neg.setVisibility(View.VISIBLE);
174
        }
175
    }
176
177
    public void show() {
178
        setLayout();
179
        dialog.show();
180
    }
181
182
    public boolean isShowing() {
183
        if (dialog.isShowing()) {
184
            return true;
185
        } else {
186
            return false;
187
        }
188
    }
189
}

二进制
app/src/main/res/drawable-hdpi/private_camera.png


+ 9 - 0
app/src/main/res/drawable/common_alert_bottom_shape.xml

@ -0,0 +1,9 @@
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="8dp" />
6
    <!-- 边框颜色 -->
7
    <!-- 填充色 -->
8
    <solid android:color="#FFFFFF" />
9
</shape>

+ 8 - 0
app/src/main/res/drawable/privacy_disagreement_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/white" /> <!-- 填充颜色 -->
7
    <stroke android:color="@color/ui_green" android:width="1dp"/>
8
</shape>

+ 234 - 0
app/src/main/res/layout/activity_permission_agreement.xml

@ -0,0 +1,234 @@
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="20dp"
26
        android:paddingRight="20dp"
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="为了保证您正常、安全的使用App,获取唯一设备标识符、运营商网络等软硬件特征信息进行身份验证,防止账号信息被盗"
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
                android:paddingBottom="15dp">
88
89
                <LinearLayout
90
                    android:layout_width="match_parent"
91
                    android:layout_height="wrap_content">
92
93
                    <ImageView
94
                        android:layout_width="20dp"
95
                        android:layout_height="match_parent"
96
                        android:layout_marginRight="10dp"
97
                        android:src="@drawable/private_storage" />
98
99
                    <TextView
100
                        android:layout_width="wrap_content"
101
                        android:layout_height="wrap_content"
102
                        android:text="存储权限"
103
                        android:textColor="#444444"
104
                        android:textSize="16sp"
105
                        android:textStyle="bold" />
106
                </LinearLayout>
107
108
                <TextView
109
                    android:layout_width="match_parent"
110
                    android:layout_height="wrap_content"
111
                    android:layout_marginLeft="30dp"
112
                    android:text="实现图片或视频的缓存和使用,降低流量消耗"
113
                    android:textColor="#797979"
114
                    android:textSize="14sp" />
115
116
                <View
117
                    android:layout_width="match_parent"
118
                    android:layout_height="1dp"
119
                    android:layout_marginLeft="30dp"
120
                    android:layout_marginTop="20dp"
121
                    android:layout_marginBottom="20dp"
122
                    android:background="#dddddd" />
123
124
            </LinearLayout>
125
126
            <LinearLayout
127
                android:layout_width="match_parent"
128
                android:layout_height="wrap_content"
129
                android:background="#f7f7f7"
130
                android:orientation="vertical"
131
                android:paddingLeft="15dp"
132
                android:paddingRight="15dp">
133
134
                <LinearLayout
135
                    android:layout_width="match_parent"
136
                    android:layout_height="wrap_content">
137
138
                    <ImageView
139
                        android:layout_width="20dp"
140
                        android:layout_height="match_parent"
141
                        android:layout_marginRight="10dp"
142
                        android:src="@drawable/private_location" />
143
144
                    <TextView
145
                        android:layout_width="wrap_content"
146
                        android:layout_height="wrap_content"
147
                        android:text="位置权限"
148
                        android:textColor="#444444"
149
                        android:textSize="16sp"
150
                        android:textStyle="bold" />
151
                </LinearLayout>
152
153
                <TextView
154
                    android:layout_width="match_parent"
155
                    android:layout_height="wrap_content"
156
                    android:layout_marginLeft="30dp"
157
                    android:text="为了定位您的位置,推荐充电桩,充电桩位置路线导航"
158
                    android:textColor="#797979"
159
                    android:textSize="14sp" />
160
161
                <View
162
                    android:layout_width="match_parent"
163
                    android:layout_height="1dp"
164
                    android:layout_marginLeft="30dp"
165
                    android:layout_marginTop="20dp"
166
                    android:layout_marginBottom="20dp"
167
                    android:background="#dddddd" />
168
            </LinearLayout>
169
170
            <LinearLayout
171
                android:layout_width="match_parent"
172
                android:layout_height="wrap_content"
173
                android:background="#f7f7f7"
174
                android:orientation="vertical"
175
                android:paddingLeft="15dp"
176
                android:paddingRight="15dp">
177
178
                <LinearLayout
179
                    android:layout_width="match_parent"
180
                    android:layout_height="wrap_content">
181
182
                    <ImageView
183
                        android:layout_width="20dp"
184
                        android:layout_height="match_parent"
185
                        android:layout_marginRight="10dp"
186
                        android:src="@drawable/private_camera" />
187
188
                    <TextView
189
                        android:layout_width="wrap_content"
190
                        android:layout_height="wrap_content"
191
                        android:text="摄像头权限"
192
                        android:textColor="#444444"
193
                        android:textSize="16sp"
194
                        android:textStyle="bold" />
195
                </LinearLayout>
196
197
                <TextView
198
                    android:layout_width="match_parent"
199
                    android:layout_height="wrap_content"
200
                    android:layout_marginLeft="30dp"
201
                    android:paddingBottom="20dp"
202
                    android:text="用于扫码充电终端二维码启动充电"
203
                    android:textColor="#797979"
204
                    android:textSize="14sp" />
205
            </LinearLayout>
206
207
        </LinearLayout>
208
    </ScrollView>
209
210
    <LinearLayout
211
        android:id="@+id/bottom_btn"
212
        android:layout_width="match_parent"
213
        android:layout_height="wrap_content"
214
        android:orientation="vertical"
215
        android:paddingLeft="20dp"
216
        android:paddingTop="10dp"
217
        android:paddingRight="20dp"
218
        android:paddingBottom="40dp"
219
        app:layout_constraintBottom_toBottomOf="parent">
220
221
        <TextView
222
            android:id="@+id/agreement_btn"
223
            android:layout_width="match_parent"
224
            android:layout_height="40dp"
225
            android:layout_marginTop="15dp"
226
            android:background="@drawable/privacy_agreement_btn_shape"
227
            android:gravity="center"
228
            android:text="知道了"
229
            android:textColor="@color/white"
230
            android:textSize="14sp" />
231
232
    </LinearLayout>
233
234
</androidx.constraintlayout.widget.ConstraintLayout>

+ 56 - 168
app/src/main/res/layout/activity_privacy_agreement.xml

@ -7,180 +7,48 @@
7 7
    android:background="@color/white"
8 8
    tools:context=".activity.PrivacyAgreementActivity">
9 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 10
    <ScrollView
23 11
        android:layout_width="match_parent"
24 12
        android:layout_height="0dp"
25
        android:paddingLeft="40dp"
26
        android:paddingRight="40dp"
13
        android:paddingLeft="20dp"
14
        android:paddingRight="20dp"
27 15
        app:layout_constraintBottom_toTopOf="@id/bottom_btn"
28
        app:layout_constraintTop_toBottomOf="@id/top_title">
16
        app:layout_constraintTop_toTopOf="parent">
29 17
30 18
        <LinearLayout
31 19
            android:layout_width="match_parent"
32 20
            android:layout_height="match_parent"
33 21
            android:orientation="vertical">
34 22
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
23
            <ImageView
81 24
                android:layout_width="match_parent"
82 25
                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>
26
                android:layout_marginTop="40dp"
27
                android:src="@drawable/icon626" />
161 28
162 29
            <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" />
30
                android:layout_width="wrap_content"
31
                android:layout_height="match_parent"
32
                android:layout_gravity="center"
33
                android:layout_marginTop="5dp"
34
                android:text="充电桩隐私政策"
35
                android:textColor="@color/color_222222"
36
                android:textSize="24sp" />
169 37
170 38
            <TextView
171
                android:id="@+id/agree_enter_text_view"
172 39
                android:layout_width="match_parent"
173 40
                android:layout_height="wrap_content"
174
                android:layout_marginTop="5dp"
175
                android:textColor="#444444"
176
                android:textSize="14sp" />
41
                android:layout_marginTop="15dp"
42
                android:text="感谢您下载充电桩应用,当您开始使用本软件时,我们可能会对您的部分个人信息进行收集、使用和共享。请您仔细阅读《充电桩隐私政策》并确定了解我们对您个人信息的处理规则,包括:"
43
                android:textColor="@color/color_222222"
44
                android:textSize="16sp" />
177 45
178 46
            <TextView
179 47
                android:layout_width="match_parent"
180 48
                android:layout_height="wrap_content"
181
                android:layout_marginTop="5dp"
182
                android:text="你也可以选择「退出并关闭」,充电桩将无法为你提供产品或服务。"
183
                android:textColor="#444444"
49
                android:layout_marginTop="20dp"
50
                android:text="我们如何收集和使用您的个人信息\n我们如何使用Cookie和同类技术\n我们如何共享、转让、公开披露您的个人信息\n我们如何保护您的个人信息\n您如果管理您的个人信息\未成年人的个人信息保护\n通知和修订\n如何联系我们\n"
51
                android:textColor="@color/color_222222"
184 52
                android:textSize="14sp" />
185 53
        </LinearLayout>
186 54
    </ScrollView>
@ -190,31 +58,51 @@
190 58
        android:layout_width="match_parent"
191 59
        android:layout_height="wrap_content"
192 60
        android:orientation="vertical"
193
        android:paddingLeft="40dp"
61
        android:paddingLeft="20dp"
194 62
        android:paddingTop="20dp"
195
        android:paddingRight="40dp"
196
        android:paddingBottom="20dp"
63
        android:paddingRight="20dp"
64
        android:paddingBottom="40dp"
197 65
        app:layout_constraintBottom_toBottomOf="parent">
198 66
199
        <Button
200
            android:id="@+id/agreement_btn"
67
        <TextView
68
            android:id="@+id/agree_enter_text_view"
201 69
            android:layout_width="match_parent"
202 70
            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"
71
            android:text="如您同意《充电桩隐私政策》,请点击「同意」开始使用我们的产品和服务,我们尽全力保护您的个人信息安全"
72
            android:textColor="@color/color_222222"
207 73
            android:textSize="14sp" />
208 74
209
        <Button
210
            android:id="@+id/exit_btn"
75
        <LinearLayout
211 76
            android:layout_width="match_parent"
212 77
            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" />
78
            android:orientation="horizontal">
79
80
81
            <Button
82
                android:id="@+id/disagreement_btn"
83
                android:layout_width="match_parent"
84
                android:layout_height="40dp"
85
                android:layout_marginTop="15dp"
86
                android:layout_marginRight="5dp"
87
                android:layout_weight="1"
88
                android:background="@drawable/privacy_disagreement_btn_shape"
89
                android:text="不同意"
90
                android:textColor="@color/ui_green"
91
                android:textSize="14sp" />
92
93
            <Button
94
                android:id="@+id/agreement_btn"
95
                android:layout_width="match_parent"
96
                android:layout_height="40dp"
97
                android:layout_marginLeft="5dp"
98
                android:layout_marginTop="15dp"
99
                android:layout_weight="1"
100
                android:background="@drawable/privacy_agreement_btn_shape"
101
                android:text="同意"
102
                android:textColor="@color/white"
103
                android:textSize="14sp" />
104
        </LinearLayout>
105
218 106
    </LinearLayout>
219 107
220 108
</androidx.constraintlayout.widget.ConstraintLayout>

+ 92 - 0
app/src/main/res/layout/view_alterdialog_common.xml

@ -0,0 +1,92 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout 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:id="@+id/lLayout_bg"
6
    android:layout_width="272dp"
7
    android:layout_height="wrap_content"
8
    android:orientation="vertical">
9
10
    <LinearLayout
11
        android:layout_width="match_parent"
12
        android:layout_height="wrap_content"
13
        android:background="@drawable/common_alert_bottom_shape"
14
        android:orientation="vertical"
15
        android:paddingTop="20dp">
16
17
        <TextView
18
            android:id="@+id/txt_title"
19
            android:layout_width="match_parent"
20
            android:layout_height="wrap_content"
21
            android:paddingLeft="20dp"
22
            android:paddingRight="20dp"
23
            android:textAlignment="center"
24
            android:textColor="#444444"
25
            android:textSize="15sp"
26
            android:visibility="gone"
27
            tools:text="更新提示 3.5.2"
28
            tools:visibility="visible" />
29
30
        <TextView
31
            android:id="@+id/txt_msg"
32
            android:layout_width="match_parent"
33
            android:layout_height="wrap_content"
34
            android:layout_marginLeft="18dp"
35
            android:layout_marginTop="12dp"
36
            android:layout_marginRight="18dp"
37
            android:gravity="center|left"
38
            android:textColor="#444444"
39
            android:textSize="13sp"
40
            android:visibility="gone"
41
            tools:text="1-新增“聊聊”新能源车主社区版块。可以通过短图文和视频的方式,聊聊你的新能源汽车和生活\n\n2-修改已知BUG"
42
            tools:visibility="visible" />
43
44
        <View
45
            android:layout_width="match_parent"
46
            android:layout_height="1dp"
47
            android:layout_marginTop="20dp"
48
            android:background="@color/ui_line" />
49
50
        <LinearLayout
51
            android:layout_width="match_parent"
52
            android:layout_height="40dp"
53
            android:gravity="center_horizontal"
54
            android:orientation="horizontal">
55
56
            <TextView
57
                android:id="@+id/btn_neg"
58
                android:layout_width="match_parent"
59
                android:layout_height="match_parent"
60
                android:layout_weight="1"
61
                android:gravity="center"
62
                android:textColor="#999999"
63
                android:textSize="14sp"
64
                android:visibility="gone"
65
                tools:text="取消"
66
                tools:visibility="visible" />
67
68
            <View
69
                android:id="@+id/btn_line"
70
                android:layout_width="1dp"
71
                android:layout_height="match_parent"
72
                android:background="@color/ui_line"
73
                android:visibility="gone"
74
                tools:visibility="visible" />
75
76
            <TextView
77
                android:id="@+id/btn_pos"
78
                android:layout_width="match_parent"
79
                android:layout_height="match_parent"
80
                android:layout_weight="1"
81
                android:gravity="center"
82
                android:textColor="@color/ui_green"
83
                android:textSize="14sp"
84
                android:visibility="gone"
85
                tools:text="确定"
86
                tools:visibility="visible" />
87
88
        </LinearLayout>
89
    </LinearLayout>
90
91
92
</LinearLayout>