nguage-java">// } 956
//                        }).show();
957
//                break;
958

959
//            case R.id.iv_photo1:
960
//                LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
961
//                popupWindowView = inflater.inflate(R.layout.popupwindow_upload, null);
962
//                popupWindow = new PopupWindow(popupWindowView,
963
//                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
964
//                        true);
965
//                popupWindow.setBackgroundDrawable(new BitmapDrawable());
966
//                // 设置PopupWindow的弹出和消失效果
967
//                popupWindow.setAnimationStyle(R.style.popupAnimation);
968
////                confirmButton = (Button) popupWindowView
969
////                        .findViewById(R.id.confirmButton);
970
////                confirmButton.setOnClickListener(new OnClickListener() {
971
////                    @Override
972
////                    public void onClick(View view) {
973
////                        popupWindow.dismiss();
974
////                    }
975
////                });
976
//                cancleButton = (Button) popupWindowView
977
//                        .findViewById(R.id.cancleButton);
978
//                cancleButton.setOnClickListener(new View.OnClickListener() {
979
//                    @Override
980
//                    public void onClick(View view) {
981
//                        popupWindow.dismiss();
982
//                    }
983
//                });
984
//                btn_one = (Button) popupWindowView.findViewById(R.id.tvTwo);
985
//                btn_one.setOnClickListener(new View.OnClickListener() {
986
//                    @Override
987
//                    public void onClick(View view) {
988
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
989
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
990
//                                Environment.getExternalStorageDirectory(), "alterandroidapp.jpg")));
991
//                        ((Activity) mContext).startActivityForResult(intent, 2);
992
//                        popupWindow.dismiss();
993
//                    }
994
//                });
995
//                btn_two = (Button) popupWindowView.findViewById(R.id.tvThree);
996
//                btn_two.setOnClickListener(new View.OnClickListener() {
997
//                    @Override
998
//                    public void onClick(View view) {
999
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
1000
//                        intent.setDataAndType(
1001
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
1002
//                                "image/*");
1003
//                        startActivityForResult(intent, 1);
1004
//                        popupWindow.dismiss();
1005
//                    }
1006
//                });
1007
//                popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
1008
//
1009
//
1010
//                break;
1011

1012
//            case R.id.iv_photo2:
1013
//                LayoutInflater inflater2 = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
1014
//                popupWindowView = inflater2.inflate(R.layout.popupwindow_upload, null);
1015
//                popupWindow = new PopupWindow(popupWindowView,
1016
//                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
1017
//                        true);
1018
//                popupWindow.setBackgroundDrawable(new BitmapDrawable());
1019
//                // 设置PopupWindow的弹出和消失效果
1020
//                popupWindow.setAnimationStyle(R.style.popupAnimation);
1021
////                confirmButton = (Button) popupWindowView
1022
////                        .findViewById(R.id.confirmButton);
1023
////                confirmButton.setOnClickListener(new OnClickListener() {
1024
////                    @Override
1025
////                    public void onClick(View view) {
1026
////                        popupWindow.dismiss();
1027
////                    }
1028
////                });
1029
//                Button cancleButton2 = (Button) popupWindowView
1030
//                        .findViewById(R.id.cancleButton);
1031
//                cancleButton2.setOnClickListener(new View.OnClickListener() {
1032
//                    @Override
1033
//                    public void onClick(View view) {
1034
//                        popupWindow.dismiss();
1035
//                    }
1036
//                });
1037
//                Button btn_one2 = (Button) popupWindowView.findViewById(R.id.tvTwo);
1038
//                btn_one2.setOnClickListener(new View.OnClickListener() {
1039
//                    @Override
1040
//                    public void onClick(View view) {
1041
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
1042
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
1043
//                                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
1044
//                        ((Activity) mContext).startActivityForResult(intent, 5);
1045
//                        popupWindow.dismiss();
1046
//                    }
1047
//                });
1048
//                Button btn_two2 = (Button) popupWindowView.findViewById(R.id.tvThree);
1049
//                btn_two2.setOnClickListener(new View.OnClickListener() {
1050
//                    @Override
1051
//                    public void onClick(View view) {
1052
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
1053
//                        intent.setDataAndType(
1054
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
1055
//                                "image/*");
1056
//                        startActivityForResult(intent, 4);
1057
//                        popupWindow.dismiss();
1058
//                    }
1059
//                });
1060
//                popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
1061
//                break;
1062
//            case R.id.iv_photo3:
1063
//                LayoutInflater inflater3 = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
1064
//                popupWindowView = inflater3.inflate(R.layout.popupwindow_upload, null);
1065
//                popupWindow = new PopupWindow(popupWindowView,
1066
//                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
1067
//                        true);
1068
//                popupWindow.setBackgroundDrawable(new BitmapDrawable());
1069
//                // 设置PopupWindow的弹出和消失效果
1070
//                popupWindow.setAnimationStyle(R.style.popupAnimation);
1071
////                confirmButton = (Button) popupWindowView
1072
////                        .findViewById(R.id.confirmButton);
1073
////                confirmButton.setOnClickListener(new OnClickListener() {
1074
////                    @Override
1075
////                    public void onClick(View view) {
1076
////                        popupWindow.dismiss();
1077
////                    }
1078
////                });
1079
//                Button cancleButton3 = (Button) popupWindowView
1080
//                        .findViewById(R.id.cancleButton);
1081
//                cancleButton3.setOnClickListener(new View.OnClickListener() {
1082
//                    @Override
1083
//                    public void onClick(View view) {
1084
//                        popupWindow.dismiss();
1085
//                    }
1086
//                });
1087
//                Button btn_one3 = (Button) popupWindowView.findViewById(R.id.tvTwo);
1088
//                btn_one3.setOnClickListener(new View.OnClickListener() {
1089
//                    @Override
1090
//                    public void onClick(View view) {
1091
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
1092
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
1093
//                                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
1094
//                        ((Activity) mContext).startActivityForResult(intent, 8);
1095
//                        popupWindow.dismiss();
1096
//                    }
1097
//                });
1098
//                Button btn_two3 = (Button) popupWindowView.findViewById(R.id.tvThree);
1099
//                btn_two3.setOnClickListener(new View.OnClickListener() {
1100
//                    @Override
1101
//                    public void onClick(View view) {
1102
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
1103
//                        intent.setDataAndType(
1104
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
1105
//                                "image/*");
1106
//                        startActivityForResult(intent, 7);
1107
//                        popupWindow.dismiss();
1108
//                    }
1109
//                });
1110
//                popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
1111
//                break;
1112 718
        }
1113 719

1114 720


+ 0 - 6
app/src/main/java/com/electric/chargingpile/activity/AnswerDetailsActivity.java

@ -91,7 +91,6 @@ public class AnswerDetailsActivity extends AppCompatActivity implements View.OnC
91 91
    private void getIntentData() {
92 92
        id = getIntent().getStringExtra("id");
93 93
        tag = getIntent().getStringExtra("tag");
94
//        Log.e(TAG, "getIntentData: id=" + id);
95 94
    }
96 95
97 96
    private void initViews() {
@ -144,7 +143,6 @@ public class AnswerDetailsActivity extends AppCompatActivity implements View.OnC
144 143
        } else {
145 144
            url = MainApplication.url + "/zhannew/basic/web/index.php/question/answer-detail?id=" + id;
146 145
        }
147
//        Log.e(TAG, "getAnswerDetails: url="+url );
148 146
        OkHttpUtils.get().url(url).build().readTimeOut(10000).connTimeOut(10000).execute(new StringCallback() {
149 147
            @Override
150 148
            public void onError(Call call, Exception e) {
@ -154,7 +152,6 @@ public class AnswerDetailsActivity extends AppCompatActivity implements View.OnC
154 152
155 153
            @Override
156 154
            public void onResponse(String response) {
157
//                Log.e(TAG, "onResponse: " + response);
158 155
                loadingDialog.dismiss();
159 156
                try {
160 157
                    String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
@ -228,12 +225,10 @@ public class AnswerDetailsActivity extends AppCompatActivity implements View.OnC
228 225
            for (int i = 0; i < textList.size(); i++) {
229 226
                String text = textList.get(i);
230 227
                if (text.contains("<cdz img") && text.contains("src=") && text.contains("width=") && text.contains("height=")) {
231
                    Log.e(TAG, "showEditData——text: " + text);
232 228
                    String imagePath = StringUtils.getImgSrc(text);
233 229
                    String width = StringUtils.getImgSrcW(text);
234 230
                    String height = StringUtils.getImgSrcH(text);
235 231
                    String new_s = imagePath + "&" + width + "&" + height;
236
                    Log.e(TAG, "showEditData_new_s: " + new_s);
237 232
                    if (new_s.contains("http") && new_s.contains("//")) {
238 233
                        subscriber.onNext(new_s);
239 234
                    }
@ -271,7 +266,6 @@ public class AnswerDetailsActivity extends AppCompatActivity implements View.OnC
271 266
        tv_a_content.post(new Runnable() {
272 267
            @Override
273 268
            public void run() {
274
                //showEditData(myContent);
275 269
                tv_a_content.clearAllLayout();
276 270
                showDataSync(answer);
277 271
            }

+ 27 - 28
app/src/main/java/com/electric/chargingpile/activity/ChargingCommentActivity.java

@ -53,6 +53,7 @@ import com.electric.chargingpile.data.RObject;
53 53
import com.electric.chargingpile.util.BarColorUtil;
54 54
import com.electric.chargingpile.util.Bimp;
55 55
import com.electric.chargingpile.util.DES3;
56
import com.electric.chargingpile.util.FileUtils;
56 57
import com.electric.chargingpile.util.ImageItem;
57 58
import com.electric.chargingpile.util.ImageUtils;
58 59
import com.electric.chargingpile.util.JsonUtils;
@ -68,6 +69,10 @@ import com.electric.chargingpile.view.HongBaoResultDialog;
68 69
import com.electric.chargingpile.view.REditText;
69 70
import com.electric.chargingpile.view.RatingBarView;
70 71
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
72
import com.zhihu.matisse.Matisse;
73
import com.zhihu.matisse.MimeType;
74
import com.zhihu.matisse.engine.impl.GlideEngine;
75
import com.zhihu.matisse.internal.entity.CaptureStrategy;
71 76
import com.zhy.http.okhttp.OkHttpUtils;
72 77
import com.zhy.http.okhttp.callback.StringCallback;
73 78
import com.zhy.view.flowlayout.FlowLayout;
@ -155,6 +160,7 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
155 160
    private String isShow = "0";
156 161
    private HongBaoDialog hongBaoDialog;
157 162
    private static final int RC_ALBUM_PERM = 123;
163
    public static final int REQUEST_CODE_CHOOSE = 335;
158 164
    //输入表情前EditText中的文本
159 165
//    private String inputAfterText;
160 166
    Handler handler = new Handler() {
@ -553,14 +559,14 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
553 559
     * 调用图库选择
554 560
     */
555 561
    private void callGallery() {
556
        Log.e(TAG, "callGallery: " + (Bimp.max - Bimp.tempSelectBitmap.size()));
557
        //调用第三方图库选择
558
        PhotoPicker.builder()
559
                .setPhotoCount(PIC_NUM - Bimp.tempSelectBitmap.size())//可选择图片数量
560
                .setShowCamera(true)//是否显示拍照按钮
561
                .setShowGif(true)//是否显示动态图
562
                .setPreviewEnabled(true)//是否可以预览
563
                .start(this, PhotoPicker.REQUEST_CODE);
562
        Matisse.from(ChargingCommentActivity.this)
563
                .choose(MimeType.of(MimeType.JPEG, MimeType.PNG, MimeType.GIF))
564
                .countable(true)
565
                .maxSelectable(PIC_NUM - Bimp.tempSelectBitmap.size())
566
                .capture(true)
567
                .captureStrategy(new CaptureStrategy(true, "com.electric.chargingpile.provider"))
568
                .imageEngine(new GlideEngine())
569
                .forResult(REQUEST_CODE_CHOOSE);
564 570
    }
565 571
566 572
    @Override
@ -570,7 +576,7 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
570 576
            if (data != null) {
571 577
                if (requestCode == 1) {
572 578
                    //处理调用系统图库
573
                } else if (requestCode == PhotoPicker.REQUEST_CODE) {
579
                } else if (requestCode == REQUEST_CODE_CHOOSE) {
574 580
                    //异步方式插入图片
575 581
                    insertImagesSync(data);
576 582
                }
@ -590,22 +596,17 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
590 596
            public void subscribe(ObservableEmitter<String> subscriber) throws Exception {
591 597
592 598
                try {
593
                    ArrayList<String> photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
594
                    //可以同时插入多张图片
595
                    for (String imagePath : photos) {
596
597
                        Log.e(TAG, "call: imagePath " + imagePath);
598
                        Bitmap bitmap = BitmapFactory.decodeFile(imagePath);//压缩图片
599
                        if (ImageUtils.readPictureDegree(imagePath) != 0) {
600
                            bitmap = imageZoom(ImageUtils.toturn(bitmap));
601
                        } else {
602
                            bitmap = imageZoom(bitmap);
603
                        }
599
                    List<Uri> uriList = Matisse.obtainResult(data);
600
                    for (Uri uri : uriList) {
601
                        Bitmap bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(uri));
602
                        File file = FileUtils.from(ChargingCommentActivity.this, uri);
603
604
                        bitmap = FileUtils.rotateIfRequired(file, bitmap);
605
                        bitmap = imageZoom(bitmap);
604 606
                        ImageItem takePhoto = new ImageItem();
605 607
                        takePhoto.setBitmap(bitmap);
606
                        takePhoto.setImagePath(imagePath);
607 608
                        Bimp.tempSelectBitmap.add(takePhoto);
608
                        subscriber.onNext(imagePath);
609
                        subscriber.onNext("");
609 610
                    }
610 611
                    subscriber.onComplete();
611 612
                } catch (Exception e) {
@ -1044,23 +1045,21 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
1044 1045
    public void permissionTask() {
1045 1046
        if (isPermissionOK()) {
1046 1047
            callGallery();
1047
            // Have permission, do the thing!
1048
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
1049
//            ifTimeout();
1050 1048
        } else {
1051
            // Ask for one permission
1052 1049
            EasyPermissions.requestPermissions(
1053 1050
                    this, "充电桩想要获取您的图片读取权限,是否允许?",
1054 1051
                    RC_ALBUM_PERM,
1055 1052
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
1056
                    Manifest.permission.READ_EXTERNAL_STORAGE);
1053
                    Manifest.permission.READ_EXTERNAL_STORAGE,
1054
                    Manifest.permission.CAMERA);
1057 1055
        }
1058 1056
    }
1059 1057
1060 1058
    private boolean isPermissionOK() {
1061 1059
        return EasyPermissions.hasPermissions(this,
1062 1060
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
1063
                Manifest.permission.READ_EXTERNAL_STORAGE
1061
                Manifest.permission.READ_EXTERNAL_STORAGE,
1062
                Manifest.permission.CAMERA
1064 1063
        );
1065 1064
    }
1066 1065

+ 0 - 172
app/src/main/java/com/electric/chargingpile/activity/ClaimDataActivity.java

@ -581,178 +581,6 @@ public class ClaimDataActivity extends Activity {
581 581
        }
582 582
    }
583 583
584
//    @Override
585
//    public void onClick(View view) {
586
//        switch (view.getId()){
587
//            case R.id.ll_addPhoto:
588
////                CharSequence[] items = { "手机相册","拍照" };
589
////                // CharSequence[] items = { "手机相册", "手机拍照" };
590
////                imageChooseItem(items);
591
//                LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
592
//                popupWindowView = inflater.inflate(R.layout.popupwindow_upload, null);
593
//                popupWindow = new PopupWindow(popupWindowView,
594
//                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
595
//                        true);
596
//                popupWindow.setBackgroundDrawable(new BitmapDrawable());
597
//                // 设置PopupWindow的弹出和消失效果
598
//                popupWindow.setAnimationStyle(R.style.popupAnimation);
599
////                confirmButton = (Button) popupWindowView
600
////                        .findViewById(R.id.confirmButton);
601
////                confirmButton.setOnClickListener(new OnClickListener() {
602
////                    @Override
603
////                    public void onClick(View view) {
604
////                        popupWindow.dismiss();
605
////                    }
606
////                });
607
//                cancleButton = (Button) popupWindowView
608
//                        .findViewById(R.id.cancleButton);
609
//                cancleButton.setOnClickListener(new View.OnClickListener() {
610
//                    @Override
611
//                    public void onClick(View view) {
612
//                        popupWindow.dismiss();
613
//                    }
614
//                });
615
//                btn_one = (Button) popupWindowView.findViewById(R.id.tvTwo);
616
//                btn_one.setOnClickListener(new View.OnClickListener() {
617
//                    @Override
618
//                    public void onClick(View view) {
619
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
620
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
621
//                                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
622
//                        ((Activity) mContext).startActivityForResult(intent, 2);
623
//                        popupWindow.dismiss();
624
//                    }
625
//                });
626
//                btn_two = (Button) popupWindowView.findViewById(R.id.tvThree);
627
//                btn_two.setOnClickListener(new View.OnClickListener() {
628
//                    @Override
629
//                    public void onClick(View view) {
630
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
631
//                        intent.setDataAndType(
632
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
633
//                                "image/*");
634
//                        startActivityForResult(intent, 1);
635
//                        popupWindow.dismiss();
636
//                    }
637
//                });
638
//                popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
639
//                break;
640
//            case R.id.ll_uploadPhoto:
641
////                CharSequence[] itemss = { "手机相册","拍照" };
642
////                // CharSequence[] items = { "手机相册", "手机拍照" };
643
////                imageChooseItems(itemss);
644
//                LayoutInflater inflater1 = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
645
//                popupWindowView = inflater1.inflate(R.layout.popupwindow_upload, null);
646
//                popupWindow = new PopupWindow(popupWindowView,
647
//                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
648
//                        true);
649
//                popupWindow.setBackgroundDrawable(new BitmapDrawable());
650
//                // 设置PopupWindow的弹出和消失效果
651
//                popupWindow.setAnimationStyle(R.style.popupAnimation);
652
////                confirmButton = (Button) popupWindowView
653
////                        .findViewById(R.id.confirmButton);
654
////                confirmButton.setOnClickListener(new OnClickListener() {
655
////                    @Override
656
////                    public void onClick(View view) {
657
////                        popupWindow.dismiss();
658
////                    }
659
////                });
660
//                cancleButton = (Button) popupWindowView
661
//                        .findViewById(R.id.cancleButton);
662
//                cancleButton.setOnClickListener(new View.OnClickListener() {
663
//                    @Override
664
//                    public void onClick(View view) {
665
//                        popupWindow.dismiss();
666
//                    }
667
//                });
668
//                btn_one = (Button) popupWindowView.findViewById(R.id.tvTwo);
669
//                btn_one.setOnClickListener(new View.OnClickListener() {
670
//                    @Override
671
//                    public void onClick(View view) {
672
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
673
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
674
//                                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
675
//                        ((Activity) mContext).startActivityForResult(intent, 2);
676
//                        popupWindow.dismiss();
677
//                    }
678
//                });
679
//                btn_two = (Button) popupWindowView.findViewById(R.id.tvThree);
680
//                btn_two.setOnClickListener(new View.OnClickListener() {
681
//                    @Override
682
//                    public void onClick(View view) {
683
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
684
//                        intent.setDataAndType(
685
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
686
//                                "image/*");
687
//                        startActivityForResult(intent, 1);
688
//                        popupWindow.dismiss();
689
//                    }
690
//                });
691
//                popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
692
//                break;
693
//        }
694
//    }
695
696
    /**
697
     * 操作选择
698
     *
699
     * @param items
700
     */
701
//    protected void imageChooseItem(CharSequence[] items) {
702
//        AlertDialog imageDialog = new AlertDialog.Builder(mContext)
703
//                .setTitle("请选择")
704
//                .setItems(items, new DialogInterface.OnClickListener() {
705
//                    public void onClick(DialogInterface dialog, int item) {
706
//                        // 手机选图
707
//                        if (item == 0) {
708
//
709
//                            Intent intent = new Intent(Intent.ACTION_PICK, null);
710
//                            intent.setDataAndType(
711
//                                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
712
//                                    "image/*");
713
//                            startActivityForResult(intent, 1);
714
//                        }
715
//                        // 拍照
716
//                        else if (item == 1) {
717
//                            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
718
//                            intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
719
//                                    Environment.getExternalStorageDirectory(), "androidapp.jpg")));
720
//                            ((Activity) mContext).startActivityForResult(intent, 2);
721
//                        }
722
//                    }
723
//                }).create();
724
//
725
//        imageDialog.show();
726
//    }
727
//
728
//    protected void imageChooseItems(CharSequence[] itemss) {
729
//        AlertDialog imageDialog = new AlertDialog.Builder(mContext)
730
//                .setTitle("请选择")
731
//                .setItems(itemss, new DialogInterface.OnClickListener() {
732
//                    public void onClick(DialogInterface dialog, int item) {
733
//                        // 手机选图
734
//                        if (item == 0) {
735
//
736
//                            Intent intent = new Intent(Intent.ACTION_PICK, null);
737
//                            intent.setDataAndType(
738
//                                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
739
//                                    "image/*");
740
//                            startActivityForResult(intent, 1);
741
//                        }
742
//                        // 拍照
743
//                        else if (item == 1) {
744
//                            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
745
//                            intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
746
//                                    Environment.getExternalStorageDirectory(), "androidapp.jpg")));
747
//                            ((Activity) mContext).startActivityForResult(intent, 2);
748
//                        }
749
//                    }
750
//                }).create();
751
//
752
//        imageDialog.show();
753
//    }
754
//
755
756 584
    /**
757 585
     * 裁剪图片方法实现 @param uri
758 586
     */

+ 68 - 79
app/src/main/java/com/electric/chargingpile/activity/EditAnswerActivity.java

@ -7,9 +7,12 @@ import android.content.Intent;
7 7
import android.graphics.Bitmap;
8 8
import android.graphics.BitmapFactory;
9 9
import android.graphics.Matrix;
10
import android.net.Uri;
10 11
import android.os.Bundle;
11 12
import android.os.Handler;
13
12 14
import androidx.appcompat.app.AppCompatActivity;
15
13 16
import android.util.DisplayMetrics;
14 17
import android.util.Log;
15 18
import android.util.TypedValue;
@ -28,6 +31,8 @@ import com.electric.chargingpile.R;
28 31
import com.electric.chargingpile.application.MainApplication;
29 32
import com.electric.chargingpile.util.AndroidBug5497Workaround;
30 33
import com.electric.chargingpile.util.BarColorUtil;
34
import com.electric.chargingpile.util.FileUtils;
35
import com.electric.chargingpile.util.ImageItem;
31 36
import com.electric.chargingpile.util.ImageUitl;
32 37
import com.electric.chargingpile.util.ImageUtils;
33 38
import com.electric.chargingpile.util.JsonUtils;
@ -37,6 +42,10 @@ import com.electric.chargingpile.util.ToastUtil;
37 42
import com.electric.chargingpile.view.CarTypeDialog;
38 43
import com.electric.chargingpile.view.xrichtext.RichTextEditorForA;
39 44
import com.electric.chargingpile.view.xrichtext.SDCardUtil;
45
import com.zhihu.matisse.Matisse;
46
import com.zhihu.matisse.MimeType;
47
import com.zhihu.matisse.engine.impl.GlideEngine;
48
import com.zhihu.matisse.internal.entity.CaptureStrategy;
40 49
import com.zhy.http.okhttp.OkHttpUtils;
41 50
import com.zhy.http.okhttp.callback.StringCallback;
42 51
@ -78,8 +87,9 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
78 87
    private RelativeLayout rl_root, rl_point;
79 88
    public static android.view.animation.Animation animation;
80 89
    private LinearLayout ll;
90
    private Bitmap insertBitmap;
81 91
    private static final int RC_ALBUM_PERM = 123;
82
92
    public static final int REQUEST_CODE_CHOOSE = 338;
83 93
84 94
    @Override
85 95
    protected void onCreate(Bundle savedInstanceState) {
@ -177,7 +187,6 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
177 187
                    @Override
178 188
                    public void onError(Throwable e) {
179 189
                        loadingDialog.dismiss();
180
//                        ToastUtil.showToast(getApplicationContext(),"解析错误:图片不存在或已损坏",Toast.LENGTH_SHORT);
181 190
                    }
182 191
183 192
@ -206,10 +215,8 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
206 215
207 216
            for (int i = 0; i < textList.size(); i++) {
208 217
                String text = textList.get(i);
209
//                Log.e(TAG, "showEditData: "+text );
210 218
                if (text.contains("<cdz img")) {
211 219
                    String imagePath = StringUtils.getImgSrc(text);
212
//                    Log.e(TAG, "showEditData: imagePath= "+imagePath );
213 220
                    if (new File(imagePath).exists()) {
214 221
                        subscriber.onNext(imagePath);
215 222
                    } else {
@ -255,16 +262,10 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
255 262
     */
256 263
    private String getEditData() {
257 264
        List<RichTextEditorForA.EditData> editList = et_new_content.buildEditData();
258
//        for (int i=0;i<editList.size();i++){
259
////            Log.e(TAG, "getEditData"+i+": "+editList.get(i).imagePath );
260
//        }
261 265
        StringBuffer content = new StringBuffer();
262
//        StringBuffer contentt = new StringBuffer();
263 266
        for (RichTextEditorForA.EditData itemData : editList) {
264 267
            if (itemData.inputStr != null) {
265 268
                content.append(itemData.inputStr);
266
//                contentt.append(itemData.inputStr);
267
                //Log.d("RichEditor", "commit inputStr=" + itemData.inputStr);
268 269
            } else if (itemData.imagePath != null) {
269 270
                Bitmap bitmap = BitmapFactory.decodeFile(itemData.imagePath);
270 271
                int width = bitmap.getWidth();
@ -274,18 +275,11 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
274 275
                    String key = (String) keys.next();
275 276
                    if (itemData.imagePath.equals(key)) {
276 277
                        content.append("<cdz img src=\"").append(map.get(itemData.imagePath)).append("\" width=" + "\"" + width + "\"" + " height=" + "\"" + height + "\" /cdz>");
277
//                        contentt.append("<cdz img src=\"").append(itemData.imagePath).append("\" width="+"\""+width+"\""+" height="+"\""+height+"\" /cdz>");
278 278
                    }
279 279
                }
280 280
281
                //Log.d("RichEditor", "commit imgePath=" + itemData.imagePath);
282
                //imageList.add(itemData.imagePath);
283 281
            }
284 282
        }
285
//        MainApplication.q_content = contentt.toString();
286
//        MainApplication.q_map.putAll(map);
287
//        Log.e(TAG, "getEditData_content: "+content.toString() );
288
//        Log.e(TAG, "getEditData_contentt: "+contentt.toString() );
289 283
        return content.toString();
290 284
    }
291 285
@ -304,8 +298,7 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
304 298
            double i = mid / maxSize;
305 299
            // 开始压缩 此处用到平方根 将宽带和高度压缩掉对应的平方根倍
306 300
            // (1.保持刻度和高度和原bitmap比率一致,压缩后也达到了最大大小占用空间的大小)
307
            bm = zoomImage(bm, bm.getWidth() / Math.sqrt(i), bm.getHeight()
308
                    / Math.sqrt(i));
301
            bm = zoomImage(bm, bm.getWidth() / Math.sqrt(i), bm.getHeight() / Math.sqrt(i));
309 302
        }
310 303
311 304
@ -323,10 +316,7 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
323 316
        float scaleHeight = ((float) newHeight) / height;
324 317
        // 缩放图片动作
325 318
        matrix.postScale(scaleWidth, scaleHeight);
326
        Bitmap bitmap = Bitmap.createBitmap(bgimage, 0, 0, (int) width,
327
                (int) height, matrix, true);
328
//        iv_2.setImageBitmap(bitmap);
329
//        tv_2.setText(bitmap.getRowBytes() * bitmap.getHeight() + "");
319
        Bitmap bitmap = Bitmap.createBitmap(bgimage, 0, 0, (int) width, (int) height, matrix, true);
330 320
        return bitmap;
331 321
    }
332 322
@ -344,27 +334,18 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
344 334
345 335
                try {
346 336
                    et_new_content.measure(0, 0);
347
                    int width = ScreenUtils.getScreenWidth(EditAnswerActivity.this);
348
                    int height = ScreenUtils.getScreenHeight(EditAnswerActivity.this);
349
                    ArrayList<String> photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
350
                    //可以同时插入多张图片
351
                    for (String imagePath : photos) {
352
                        //Log.i("NewActivity", "###path=" + imagePath);
353
                        Bitmap bitmap = ImageUitl.getSmallBitmap(imagePath, width, height);//压缩图片
354
                        if (ImageUtils.readPictureDegree(imagePath) != 0) {
355
                            bitmap = imageZoom(ImageUtils.toturn(bitmap));
356
                        } else {
357
                            bitmap = imageZoom(bitmap);
358
                        }
359
//                        Log.e(TAG, "call: "+imagePath );
360
                        c_path = imagePath;
361
                        //bitmap = BitmapFactory.decodeFile(imagePath);
362
                        imagePath = SDCardUtil.saveToSdCard(bitmap);
363
                        u_path = imagePath;
364
//                        Log.e(TAG, "call: "+imagePath );
365
                        //Log.i("NewActivity", "###imagePath="+imagePath);
366
                        subscriber.onNext(imagePath);
367
                    }
337
                    List<Uri> uriList = Matisse.obtainResult(data);
338
                    Uri uri = uriList.get(0);
339
                    Bitmap bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(uri));
340
                    File file = FileUtils.from(EditAnswerActivity.this, uri);
341
342
                    bitmap = FileUtils.rotateIfRequired(file, bitmap);
343
                    bitmap = imageZoom(bitmap);
344
                    insertBitmap = bitmap;
345
346
                    u_path = SDCardUtil.saveToSdCard(bitmap);
347
348
                    subscriber.onNext(u_path);
368 349
                    subscriber.onComplete();
369 350
                } catch (Exception e) {
370 351
                    e.printStackTrace();
@ -378,13 +359,13 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
378 359
                    @Override
379 360
                    public void onComplete() {
380 361
                        insertDialog.dismiss();
381
                        compressAndUpload(c_path, u_path);
362
                        //compressAndUpload(c_path, u_path);
363
                        uploadPic(insertBitmap, u_path);
382 364
                    }
383 365
384 366
                    @Override
385 367
                    public void onError(Throwable e) {
386 368
                        insertDialog.dismiss();
387
//                        Log.e(TAG, "onError: "+ "图片插入失败:"+e.getMessage());
388 369
                        ToastUtil.showToast(getApplicationContext(), "图片插入失败", Toast.LENGTH_SHORT);
389 370
                    }
390 371
@ -402,19 +383,14 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
402 383
403 384
    private void compressAndUpload(String path, final String u_path) {
404 385
        loadingDialog.show();
405
//        Log.e(TAG, "compressAndUpload: path= "+path );
406 386
        File file = new File(path);
407
//        Log.e(TAG, "compressAndUpload: length= "+file.length()/1024+"kb" );
408 387
        Luban.with(EditAnswerActivity.this).load(file).setCompressListener(new OnCompressListener() {
409 388
            @Override
410 389
            public void onStart() {
411
412 390
            }
413 391
414 392
            @Override
415 393
            public void onSuccess(File file) {
416
//                Log.e(TAG, "onSuccess: path= "+file.getPath() );
417
//                Log.e(TAG, "onSuccess: length= "+file.length()/1024+"kb" );
418 394
                uploadPic(file.getPath(), u_path);
419 395
            }
420 396
@ -426,11 +402,7 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
426 402
    }
427 403
428 404
    private void uploadPic(String picPath, final String path) {
429
//        Log.e(TAG, "uploadPic: path= "+picPath );
430
//        Log.e(TAG, "uploadPic: length= "+new File(picPath).length()/1024+"kb" );
431 405
        Bitmap bitmap = BitmapFactory.decodeFile(picPath);
432
//        Log.e(TAG, "uploadPic: bit= "+bitmap.ge()/1024+"kb" );
433
434 406
        String url = MainApplication.url + "/zhannew/basic/web/index.php/fileupload/uploadone";
435 407
        OkHttpUtils.post().url(url).
436 408
                addParams("file", ImageUitl.bitmapToString(picPath)).
@ -439,26 +411,51 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
439 411
                .build().execute(new StringCallback() {
440 412
            @Override
441 413
            public void onError(Call call, Exception e) {
442
414
                e.printStackTrace();
443 415
            }
444 416
445 417
            @Override
446 418
            public void onResponse(String response) {
447 419
                loadingDialog.dismiss();
448
//                Log.e(TAG, "onResponse: "+response );
449 420
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
450 421
                if ("01".equals(rtnCode)) {
451 422
                    String fileUrl = JsonUtils.getKeyResult(response, "fileUrl");
452 423
                    map.put(path, fileUrl);
453 424
                    et_new_content.addEditTextAtIndex(et_new_content.getLastIndex(), " ");
454 425
                    ToastUtil.showToast(getApplicationContext(), "图片插入成功", Toast.LENGTH_SHORT);
455
//                    Log.e(TAG, "onResponse: map的key="+path+"的value="+map.get(path) );
456 426
                } else {
457 427
                    ToastUtil.showToast(getApplicationContext(), "图片插入失败", Toast.LENGTH_SHORT);
458 428
                }
459 429
            }
460 430
        });
431
    }
432
433
    private void uploadPic(Bitmap bitmap, final String path) {
434
        String url = MainApplication.url + "/zhannew/basic/web/index.php/fileupload/uploadone";
435
        OkHttpUtils.post().url(url).
436
                addParams("file", FileUtils.bitmapToString(bitmap)).
437
                addParams("filename", "android.jpg").
438
                addParams("id", creat_id)
439
                .build().execute(new StringCallback() {
440
            @Override
441
            public void onError(Call call, Exception e) {
442
                e.printStackTrace();
443
            }
461 444
445
            @Override
446
            public void onResponse(String response) {
447
                loadingDialog.dismiss();
448
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
449
                if ("01".equals(rtnCode)) {
450
                    String fileUrl = JsonUtils.getKeyResult(response, "fileUrl");
451
                    map.put(path, fileUrl);
452
                    et_new_content.addEditTextAtIndex(et_new_content.getLastIndex(), " ");
453
                    ToastUtil.showToast(getApplicationContext(), "图片插入成功", Toast.LENGTH_SHORT);
454
                } else {
455
                    ToastUtil.showToast(getApplicationContext(), "图片插入失败", Toast.LENGTH_SHORT);
456
                }
457
            }
458
        });
462 459
    }
463 460
464 461
    @Override
@ -506,13 +503,14 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
506 503
     * 调用图库选择
507 504
     */
508 505
    private void callGallery() {
509
        //调用第三方图库选择
510
        PhotoPicker.builder()
511
                .setPhotoCount(1)//可选择图片数量
512
                .setShowCamera(true)//是否显示拍照按钮
513
                .setShowGif(true)//是否显示动态图
514
                .setPreviewEnabled(true)//是否可以预览
515
                .start(this, PhotoPicker.REQUEST_CODE);
506
        Matisse.from(EditAnswerActivity.this)
507
                .choose(MimeType.of(MimeType.JPEG, MimeType.PNG, MimeType.GIF))
508
                .countable(true)
509
                .maxSelectable(1)
510
                .capture(true)
511
                .captureStrategy(new CaptureStrategy(true, "com.electric.chargingpile.provider"))
512
                .imageEngine(new GlideEngine())
513
                .forResult(REQUEST_CODE_CHOOSE);
516 514
    }
517 515
518 516
    @Override
@ -522,7 +520,7 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
522 520
            if (data != null) {
523 521
                if (requestCode == 1) {
524 522
                    //处理调用系统图库
525
                } else if (requestCode == PhotoPicker.REQUEST_CODE) {
523
                } else if (requestCode == REQUEST_CODE_CHOOSE) {
526 524
                    //异步方式插入图片
527 525
                    insertImagesSync(data);
528 526
                }
@ -543,7 +541,6 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
543 541
544 542
            @Override
545 543
            public void onResponse(String response) {
546
//                Log.e(TAG, "onResponse: id"+response );
547 544
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
548 545
                if ("01".equals(rtnCode)) {
549 546
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
@ -577,7 +574,6 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
577 574
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
578 575
                String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
579 576
                if ("01".equals(rtnCode)) {
580
//                    QaActivity.isRefresh = true;
581 577
                    QuestionActivity.isRefresh = true;
582 578
583 579
                    String plusScore = JsonUtils.getKeyResult(rtnMsg, "plusScore");
@ -622,10 +618,7 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
622 618
                                }
623 619
                            }
624 620
                        }, 1500);
625
626 621
                    }
627
628
629 622
                } else {
630 623
                    ToastUtil.showToast(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT);
631 624
                }
@ -645,35 +638,31 @@ public class EditAnswerActivity extends AppCompatActivity implements View.OnClic
645 638
646 639
    @Override
647 640
    public void onPermissionsGranted(int requestCode, List<String> perms) {
648
649 641
    }
650 642
651 643
    @Override
652 644
    public void onPermissionsDenied(int requestCode, List<String> perms) {
653
654 645
    }
655 646
656 647
    @AfterPermissionGranted(RC_ALBUM_PERM)
657 648
    public void permissionTask() {
658 649
        if (isPermissionOK()) {
659 650
            callGallery();
660
            // Have permission, do the thing!
661
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
662
//            ifTimeout();
663 651
        } else {
664
            // Ask for one permission
665 652
            EasyPermissions.requestPermissions(
666 653
                    this, "充电桩想要获取您的图片读取权限,是否允许?",
667 654
                    RC_ALBUM_PERM,
668 655
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
669
                    Manifest.permission.READ_EXTERNAL_STORAGE);
656
                    Manifest.permission.READ_EXTERNAL_STORAGE,
657
                    Manifest.permission.CAMERA);
670 658
        }
671 659
    }
672 660
673 661
    private boolean isPermissionOK() {
674 662
        return EasyPermissions.hasPermissions(this,
675 663
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
676
                Manifest.permission.READ_EXTERNAL_STORAGE
664
                Manifest.permission.READ_EXTERNAL_STORAGE,
665
                Manifest.permission.CAMERA
677 666
        );
678 667
    }
679 668
}

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

@ -115,7 +115,7 @@ public class FeedbackActivity extends Activity implements OnClickListener, EasyP
115 115
    LoadingDialog dialog;
116 116
    private ProgressDialog insertDialog;
117 117
    private static final int RC_ALBUM_PERM = 123;
118
    public static final int REQUEST_CODE_CHOOSE = 333;
118
    public static final int REQUEST_CODE_CHOOSE = 337;
119 119
    private Handler handler = new Handler() {
120 120
        // 主线程通过这个方法处理消息
121 121
        @Override

+ 0 - 2
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -1928,7 +1928,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1928 1928
1929 1929
            @Override
1930 1930
            public void onResponse(String response) {
1931
//                LogUtils.e(response);
1932 1931
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1933 1932
                if ("0".equals(rtnCode)) {
1934 1933
                    String data = JsonUtils.getKeyResult(response, "data");
@ -1949,7 +1948,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1949 1948
    }
1950 1949
1951 1950
    private void dealUpdateData(List<UpdateZhanDataBean> list) {
1952
//        LogUtils.e(list.size());
1953 1951
        String dbPath = "/data/user/0/com.electric.chargingpile/databases/zhan_list";
1954 1952
        try {
1955 1953
            SQLiteDatabase db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);

+ 4 - 2
app/src/main/java/com/electric/chargingpile/activity/ShareTwoEditActivity.java

@ -971,14 +971,16 @@ public class ShareTwoEditActivity extends Activity implements View.OnClickListen
971 971
                    this, "充电桩想要获取您的图片读取权限,是否允许?",
972 972
                    RC_ALBUM_PERM,
973 973
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
974
                    Manifest.permission.READ_EXTERNAL_STORAGE);
974
                    Manifest.permission.READ_EXTERNAL_STORAGE,
975
                    Manifest.permission.CAMERA);
975 976
        }
976 977
    }
977 978
978 979
    private boolean isPermissionOK() {
979 980
        return EasyPermissions.hasPermissions(this,
980 981
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
981
                Manifest.permission.READ_EXTERNAL_STORAGE
982
                Manifest.permission.READ_EXTERNAL_STORAGE,
983
                Manifest.permission.CAMERA
982 984
        );
983 985
    }
984 986

+ 0 - 18
app/src/main/java/com/electric/chargingpile/activity/UserInfoActivity.java

@ -553,7 +553,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
553 553
     * 调用图库选择
554 554
     */
555 555
    private void callGallery() {
556
//        Log.e(TAG, "callGallery: "+ (Bimp.max - Bimp.tempSelectBitmap.size() ));
557 556
        //调用第三方图库选择
558 557
        PhotoPicker.builder()
559 558
                .setPhotoCount(1)//可选择图片数量
@ -635,14 +634,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
635 634
        });
636 635
        // 设置PopupWindow的弹出和消失效果
637 636
        popupWindow.setAnimationStyle(R.style.popupAnimation);
638
//                confirmButton = (Button) popupWindowView
639
//                        .findViewById(R.id.confirmButton);
640
//                confirmButton.setOnClickListener(new OnClickListener() {
641
//                    @Override
642
//                    public void onClick(View view) {
643
//                        popupWindow.dismiss();
644
//                    }
645
//                });
646 637
        cancleButton = (Button) popupWindowView
647 638
                .findViewById(R.id.cancleButton);
648 639
        cancleButton.setOnClickListener(new View.OnClickListener() {
@ -702,10 +693,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
702 693
                Bitmap bm = imageZoom(photo);
703 694
                ss = bitmapToBase64(bm);
704 695
            }
705
//            else{
706
//                ss =bitmapToBase64(selectbm);
707
//            }
708
709 696
            par.put("file", ss);
710 697
            par.put("filename", "androidapp.jpg");
711 698
        } catch (Exception e) {
@ -762,8 +749,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
762 749
    @AfterPermissionGranted(RC_CAMERA_PERM)
763 750
    public void cameraTask() {
764 751
        if (hasCameraPermission()) {
765
            // Have permission, do the thing!
766
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
767 752
            showWindow();
768 753
        } else {
769 754
            // Ask for one permission
@ -804,9 +789,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
804 789
         */
805 790
        Intent intent = new Intent("com.android.camera.action.CROP");
806 791
        intent.setDataAndType(uri, "image/*");
807
//        Uri cropUri = Uri.fromFile(new File(
808
//                Environment.getExternalStorageDirectory() + "cdz_icon.png"));
809
//        intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
810 792
        intent.putExtra("crop", "true");
811 793
        // aspectX aspectY 是宽高的比例
812 794
        intent.putExtra("aspectX", 1);

+ 29 - 32
app/src/main/java/com/electric/chargingpile/activity/ZhanCommentActivity.java

@ -51,6 +51,7 @@ import com.electric.chargingpile.data.RObject;
51 51
import com.electric.chargingpile.util.BarColorUtil;
52 52
import com.electric.chargingpile.util.Bimp;
53 53
import com.electric.chargingpile.util.DES3;
54
import com.electric.chargingpile.util.FileUtils;
54 55
import com.electric.chargingpile.util.ImageItem;
55 56
import com.electric.chargingpile.util.ImageUtils;
56 57
import com.electric.chargingpile.util.JsonUtils;
@ -64,6 +65,10 @@ import com.electric.chargingpile.util.ToastUtil;
64 65
import com.electric.chargingpile.util.UploadUtil;
65 66
import com.electric.chargingpile.view.REditText;
66 67
import com.electric.chargingpile.view.RatingBarView;
68
import com.zhihu.matisse.Matisse;
69
import com.zhihu.matisse.MimeType;
70
import com.zhihu.matisse.engine.impl.GlideEngine;
71
import com.zhihu.matisse.internal.entity.CaptureStrategy;
67 72
import com.zhy.http.okhttp.OkHttpUtils;
68 73
import com.zhy.http.okhttp.callback.StringCallback;
69 74
import com.zhy.view.flowlayout.FlowLayout;
@ -138,6 +143,7 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
138 143
    public static ImageView point;
139 144
    private InputMethodManager imm = null;
140 145
    private static final int RC_ALBUM_PERM = 123;
146
    public static final int REQUEST_CODE_CHOOSE = 336;
141 147
    Handler handler = new Handler() {
142 148
        public void handleMessage(Message msg) {
143 149
            switch (msg.what) {
@ -543,16 +549,14 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
543 549
     * 调用图库选择
544 550
     */
545 551
    private void callGallery() {
546
        Log.e(TAG, "callGallery: " + (Bimp.max - Bimp.tempSelectBitmap.size()));
547
        //调用第三方图库选择
548
        PhotoPicker.builder()
549
                .setPhotoCount(PIC_NUM - Bimp.tempSelectBitmap.size())//可选择图片数量
550
                .setShowCamera(true)//是否显示拍照按钮
551
                .setShowGif(true)//是否显示动态图
552
                .setPreviewEnabled(true)//是否可以预览
553
                .start(this, PhotoPicker.REQUEST_CODE);
554
555
552
        Matisse.from(ZhanCommentActivity.this)
553
                .choose(MimeType.of(MimeType.JPEG, MimeType.PNG, MimeType.GIF))
554
                .countable(true)
555
                .maxSelectable(PIC_NUM - Bimp.tempSelectBitmap.size())
556
                .capture(true)
557
                .captureStrategy(new CaptureStrategy(true, "com.electric.chargingpile.provider"))
558
                .imageEngine(new GlideEngine())
559
                .forResult(REQUEST_CODE_CHOOSE);
556 560
    }
557 561
558 562
    @Override
@ -562,7 +566,7 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
562 566
            if (data != null) {
563 567
                if (requestCode == 1) {
564 568
                    //处理调用系统图库
565
                } else if (requestCode == PhotoPicker.REQUEST_CODE) {
569
                } else if (requestCode == REQUEST_CODE_CHOOSE) {
566 570
                    //异步方式插入图片
567 571
                    insertImagesSync(data);
568 572
                }
@ -581,24 +585,17 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
581 585
            @Override
582 586
            public void subscribe(ObservableEmitter<String> subscriber) throws Exception {
583 587
                try {
584
                    ArrayList<String> photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
585
                    //可以同时插入多张图片
586
                    for (String imagePath : photos) {
587
588
                        Log.e(TAG, "call: imagePath " + imagePath);
589
                        Bitmap bitmap = BitmapFactory.decodeFile(imagePath);//压缩图片
590
                        if (ImageUtils.readPictureDegree(imagePath) != 0) {
591
                            bitmap = imageZoom(ImageUtils.toturn(bitmap));
592
                        } else {
593
                            bitmap = imageZoom(bitmap);
594
                        }
588
                    List<Uri> uriList = Matisse.obtainResult(data);
589
                    for (Uri uri : uriList) {
590
                        Bitmap bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(uri));
591
                        File file = FileUtils.from(ZhanCommentActivity.this, uri);
592
593
                        bitmap = FileUtils.rotateIfRequired(file, bitmap);
594
                        bitmap = imageZoom(bitmap);
595 595
                        ImageItem takePhoto = new ImageItem();
596 596
                        takePhoto.setBitmap(bitmap);
597
                        takePhoto.setImagePath(imagePath);
598 597
                        Bimp.tempSelectBitmap.add(takePhoto);
599
//
600
//                        Log.e(TAG, "call: "+imagePath );
601
                        subscriber.onNext(imagePath);
598
                        subscriber.onNext("");
602 599
                    }
603 600
                    subscriber.onComplete();
604 601
                } catch (Exception e) {
@ -629,7 +626,8 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
629 626
                    }
630 627
631 628
                    @Override
632
                    public void onComplete() {   Log.e(TAG, "onCompleted: -------------");
629
                    public void onComplete() {
630
                        Log.e(TAG, "onCompleted: -------------");
633 631
                        insertDialog.dismiss();
634 632
                        adapter.update();
635 633
@ -950,23 +948,22 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
950 948
    public void permissionTask() {
951 949
        if (isPermissionOK()) {
952 950
            callGallery();
953
            // Have permission, do the thing!
954
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
955
//            ifTimeout();
956 951
        } else {
957 952
            // Ask for one permission
958 953
            EasyPermissions.requestPermissions(
959 954
                    this, "充电桩想要获取您的图片读取权限,是否允许?",
960 955
                    RC_ALBUM_PERM,
961 956
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
962
                    Manifest.permission.READ_EXTERNAL_STORAGE);
957
                    Manifest.permission.READ_EXTERNAL_STORAGE,
958
                    Manifest.permission.CAMERA);
963 959
        }
964 960
    }
965 961
966 962
    private boolean isPermissionOK() {
967 963
        return EasyPermissions.hasPermissions(this,
968 964
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
969
                Manifest.permission.READ_EXTERNAL_STORAGE
965
                Manifest.permission.READ_EXTERNAL_STORAGE,
966
                Manifest.permission.CAMERA
970 967
        );
971 968
    }
972 969

+ 0 - 2
app/src/main/java/com/electric/chargingpile/fragment/ChatRecommendFragment.java

@ -140,9 +140,7 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
140 140
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
141 141
        if (requestCode == ChatContentListActivity.REQUEST_CODE_CHAT_HOME) {
142 142
            Log.d(TAG, "onActivityResult: ");
143
//            ToastUtil.showToast(getContext(), "come on ", Toast.LENGTH_SHORT);
144 143
        }
145
//        ToastUtil.showToast(getContext(), "come on 2", Toast.LENGTH_SHORT);
146 144
    }
147 145
148 146
    private void initListener() {

+ 11 - 0
app/src/main/java/com/electric/chargingpile/util/FileUtils.java

@ -9,10 +9,12 @@ import android.net.Uri;
9 9
import android.os.Environment;
10 10
import android.provider.MediaStore;
11 11
import android.provider.OpenableColumns;
12
import android.util.Base64;
12 13
import android.util.Log;
13 14

14 15
import androidx.exifinterface.media.ExifInterface;
15 16

17
import java.io.ByteArrayOutputStream;
16 18
import java.io.File;
17 19
import java.io.FileNotFoundException;
18 20
import java.io.FileOutputStream;
@ -209,4 +211,13 @@ public class FileUtils {
209 211
        return count;
210 212
    }
211 213

214
    public static String bitmapToString(Bitmap bitmap) {
215
        String str = null;
216
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
217
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
218
        byte[] bytes = outputStream.toByteArray();
219
        str = Base64.encodeToString(bytes, Base64.DEFAULT);
220
        return str;
221
    }
222

212 223
}

+ 1 - 1
app/src/main/java/com/electric/chargingpile/view/xrichtext/RichTextView.java

@ -136,7 +136,7 @@ public class RichTextView extends ScrollView {
136 136
        final RelativeLayout imageLayout = createImageLayout();
137 137
        DataImageView imageView = (DataImageView) imageLayout.findViewById(R.id.edit_imageView);
138 138
        RequestOptions options = new RequestOptions().centerCrop();
139
        Glide.with(getContext()).load(imagePath).apply(options).into(imageView);
139
        Glide.with(getContext()).load(path).apply(options).into(imageView);
140 140
        //imageView.setImageBitmap(bmp);//这里改用Glide加载图片
141 141
        //imageView.setBitmap(bmp);//这句去掉,保留下面的图片地址即可,优化图片占用
142 142
//        imageView.setAbsolutePath(imagePath);//保留这句,后面保存数据会用

个人信息修改完成 · 2e20fd70e1 - Gogs: Go Git Service
Browse Source

个人信息修改完成

huyuguo 5 years ago
parent
commit
2e20fd70e1

+ 34 - 0
app/src/main/java/com/electric/chargingpile/activity/CarOwnerCertificateActivity.java

@ -1,6 +1,7 @@
1 1
package com.electric.chargingpile.activity;
2 2
3 3
import androidx.annotation.NonNull;
4
import androidx.annotation.Nullable;
4 5
import androidx.appcompat.app.AppCompatActivity;
5 6
import androidx.constraintlayout.widget.ConstraintLayout;
6 7
@ -25,6 +26,12 @@ import android.widget.TextView;
25 26
import android.widget.Toast;
26 27
27 28
import com.bumptech.glide.Glide;
29
import com.bumptech.glide.load.engine.DiskCacheStrategy;
30
import com.bumptech.glide.request.Request;
31
import com.bumptech.glide.request.target.CustomTarget;
32
import com.bumptech.glide.request.target.SizeReadyCallback;
33
import com.bumptech.glide.request.target.Target;
34
import com.bumptech.glide.request.transition.Transition;
28 35
import com.electric.chargingpile.R;
29 36
import com.electric.chargingpile.application.MainApplication;
30 37
import com.electric.chargingpile.data.CarOwnerCertificateBean;
@ -196,6 +203,33 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
196 203
            Gson gson = new Gson();
197 204
            CarSerieEvent event = new CarSerieEvent(gson.fromJson(carOwnerCertificateBean.getChexing(), CarSeriesEntity.class));
198 205
            onCarSeriesMessage(event);
206
207
            if (!TextUtils.isEmpty(carOwnerCertificateBean.getLicense_img1())) {
208
209
                Glide.with(this).asBitmap().load(MainApplication.pic_url + carOwnerCertificateBean.getLicense_img1()).diskCacheStrategy(DiskCacheStrategy.ALL).into(new CustomTarget<Bitmap>() {
210
                    @Override
211
                    public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
212
                        driving_license_icon.setImageBitmap(resource);
213
                        String base64 = bitmapToBase64(resource);
214
                        drivingLicenseBase64Data = "data:image/png;base64," + base64;
215
                    }
216
217
                    @Override
218
                    public void onLoadCleared(@Nullable Drawable placeholder) {
219
220
                    }
221
                });
222
//                Glide.with(this).load(MainApplication.pic_url + carOwnerCertificateBean.getLicense_img1()).into(driving_license_icon);
223
                driving_license_upload_icon.setVisibility(View.GONE);
224
                driving_license_text_view.setVisibility(View.GONE);
225
                driving_license_info.setVisibility(View.VISIBLE);
226
                plate_num.setText(carOwnerCertificateBean.getPlate_number());
227
                engine_num.setText(carOwnerCertificateBean.getEngine_number());
228
                register_date.setText(carOwnerCertificateBean.getRegdate());
229
            }
230
231
232
199 233
            if ("自用".equals(carOwnerCertificateBean.getCartype())) {
200 234
                drivingLicenseType = "自用";
201 235
                driving_license_type_first.setCompoundDrawables(selected, null, null, null);

+ 34 - 11
app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java

@ -57,6 +57,7 @@ import com.electric.chargingpile.util.NetUtil;
57 57
import com.electric.chargingpile.util.OkHttpUtil;
58 58
import com.electric.chargingpile.util.PicassoUtil;
59 59
import com.electric.chargingpile.util.Util;
60
import com.electric.chargingpile.view.AlertDialogTwo;
60 61
import com.electric.chargingpile.view.ObservableScrollView;
61 62
import com.electric.chargingpile.view.RoundImageView;
62 63
import com.electric.chargingpile.view.ScrollViewListener;
@ -787,7 +788,7 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
787 788
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
788 789
                    startActivity(new Intent(getApplication(), LoginActivity.class));
789 790
                } else {
790
                    getCarOwnerCertificateList();
791
                    getCarOwnerCertificateList("certificate");
791 792
                }
792 793
                break;
793 794
            case R.id.rl_publish_price: // 发表成交价
@ -795,11 +796,9 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
795 796
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
796 797
                    startActivity(new Intent(getApplication(), LoginActivity.class));
797 798
                } else {
798
                    // TODO 跳转html
799
                    System.out.println("come on");
799
                    getCarOwnerCertificateList("price");
800 800
                }
801 801
                break;
802
803 802
            case R.id.rl_chongzhi:
804 803
                if (!MainApplication.isLogin()) {
805 804
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
@ -1058,9 +1057,9 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1058 1057
        });
1059 1058
    }
1060 1059
1061
    private void getCarOwnerCertificateList() {
1060
    private void getCarOwnerCertificateList(String from) {
1062 1061
        loadDialog.show();
1063
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId ;
1062
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId;
1064 1063
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1065 1064
            @Override
1066 1065
            public void onError(Call call, Exception e) {
@ -1076,12 +1075,36 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1076 1075
                if ("01".equals(rtnCode)) {
1077 1076
                    String data = JsonUtils.getKeyResult(response, "data");
1078 1077
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1079
                    if (list.size() == 0) {
1080
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1078
                    if ("price".equals(from)) {
1079
                        if (list.size() == 0) {
1080
                            new AlertDialogTwo(UserCenterActivity.this).builder()
1081
                                    .setMsg("您还没有认证车主,认证车主可获双倍奖励哦。")
1082
                                    .setPositiveButton("继续发表", new View.OnClickListener() {
1083
                                        @Override
1084
                                        public void onClick(View v) {
1085
                                            Intent intent = new Intent(getApplication(), MyWebViewActivity.class);
1086
                                            intent.putExtra("url", "https://www.d1ev.com/special/models/wap/webView/index.html");
1087
                                            startActivity(intent);
1088
                                        }
1089
                                    }).setNegativeButton("去认证", new View.OnClickListener() {
1090
                                @Override
1091
                                public void onClick(View v) {
1092
                                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1093
                                }
1094
                            }).show();
1095
                        } else {
1096
                            Intent intent = new Intent(getApplication(), MyWebViewActivity.class);
1097
                            intent.putExtra("url", "https://www.d1ev.com/special/models/wap/webView/index.html");
1098
                            startActivity(intent);
1099
                        }
1081 1100
                    } else {
1082
                        Intent intent = new Intent(getApplication(), CarOwnerCertificateListActivity.class);
1083
                        intent.putExtra("data", data);
1084
                        startActivity(intent);
1101
                        if (list.size() == 0) {
1102
                            startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1103
                        } else {
1104
                            Intent intent = new Intent(getApplication(), CarOwnerCertificateListActivity.class);
1105
                            intent.putExtra("data", data);
1106
                            startActivity(intent);
1107
                        }
1085 1108
                    }
1086 1109
                } else {
1087 1110
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");

+ 106 - 313
app/src/main/java/com/electric/chargingpile/activity/UserInfoActivity.java

@ -22,7 +22,9 @@ import android.os.Environment;
22 22
import android.os.Handler;
23 23
import android.os.Message;
24 24
import android.provider.MediaStore;
25
25 26
import androidx.core.content.FileProvider;
27
26 28
import android.text.TextUtils;
27 29
import android.util.Log;
28 30
import android.view.Gravity;
@ -47,8 +49,10 @@ import android.widget.ToggleButton;
47 49
48 50
import com.electric.chargingpile.R;
49 51
import com.electric.chargingpile.application.MainApplication;
52
import com.electric.chargingpile.data.CarOwnerCertificateBean;
50 53
import com.electric.chargingpile.data.Cars;
51 54
import com.electric.chargingpile.data.Province;
55
import com.electric.chargingpile.entity.CarSeriesEntity;
52 56
import com.electric.chargingpile.manager.ProfileManager;
53 57
import com.electric.chargingpile.util.BarColorUtil;
54 58
import com.electric.chargingpile.util.DES3;
@ -60,14 +64,18 @@ import com.electric.chargingpile.util.PhotoUtils;
60 64
import com.electric.chargingpile.util.StatusConstants;
61 65
import com.electric.chargingpile.util.ToastUtil;
62 66
import com.electric.chargingpile.util.UploadUtil;
67
import com.electric.chargingpile.view.AlertDialogTwo;
63 68
import com.electric.chargingpile.view.CustomProgressDialog;
64 69
import com.electric.chargingpile.view.RoundImageView;
65 70
import com.electric.chargingpile.view.xrichtext.SDCardUtil;
71
import com.google.gson.Gson;
66 72
import com.squareup.okhttp.Request;
67 73
import com.squareup.okhttp.Response;
68 74
import com.squareup.picasso.Picasso;
69 75
import com.squareup.picasso.Target;
70 76
import com.umeng.analytics.MobclickAgent;
77
import com.zhy.http.okhttp.OkHttpUtils;
78
import com.zhy.http.okhttp.callback.StringCallback;
71 79
72 80
import org.json.JSONArray;
73 81
import org.json.JSONException;
@ -83,6 +91,7 @@ import java.util.HashMap;
83 91
import java.util.List;
84 92
import java.util.Map;
85 93
94
import okhttp3.Call;
86 95
import pub.devrel.easypermissions.AfterPermissionGranted;
87 96
import pub.devrel.easypermissions.EasyPermissions;
88 97
@ -92,17 +101,14 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
92 101
    private ImageView back;
93 102
    private EditText et_nickName;
94 103
    private EditText et_realName;
95
    private TextView et_che;
96 104
    private ToggleButton btn_sex, btn_car;
97
    private RelativeLayout rl_icon, rl_select_car, rl_isBuy;
105
    private RelativeLayout rl_icon;
98 106
    private Button cancleButton, btn_one, btn_two;
99 107
    private PopupWindow popupWindow;
100 108
    private View popupWindowView;
101 109
    private RoundImageView iconPic;
102 110
    private TextView tv_save, onclick;
103 111
    private String sex = "1";
104
    private String nocar = "";
105
    private String havecar = "";
106 112
    private Bitmap download_bmp;
107 113
    LoadingDialog dialog;
108 114
    String name0 = "";
@ -124,9 +130,8 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
124 130
    String chexing;
125 131
    String yichexing;
126 132
    private ImageView point;
127
    public static final int REQUSET = 11;
128 133
    String select_pinpai = "", select_chexing = "";
129
    private TextView tv_point, tv_buy;
134
    private TextView tv_point;
130 135
    private RelativeLayout rl_point;
131 136
    private android.view.animation.Animation animation;
132 137
    private File fileUri = new File(Environment.getExternalStorageDirectory().getPath() + "/photo.jpg");
@ -134,6 +139,13 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
134 139
    private Uri imageUri;
135 140
    private Uri cropImageUri;
136 141
    private static final int RC_CAMERA_PERM = 123;
142
    private LoadingDialog loadDialog;
143
    // 1.去认证车主(获得充电优惠)      > 2.认证车主             审核中  3.认证车主             宝马
144
    private int certificateStatus = 0; // 1 去认证  2审核中  3认证车主
145
    private RelativeLayout go_certificate;
146
    private TextView go_title;
147
    private TextView go_desc;
148
    private ImageView go_cursor;
137 149
138 150
    @Override
139 151
    protected void onCreate(Bundle savedInstanceState) {
@ -144,28 +156,21 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
144 156
        dialog.setCanceledOnTouchOutside(false);
145 157
        mContext = this;
146 158
        initView();
147
//        getFromServer();
148 159
        spinner();
149 160
        getFromServer();
150 161
    }
151 162
152 163
    public void onEventMainThread(Province b) {
153
        Log.e("ffff", b.getName() + "   " + b.getCities().get(b.getId()).getName());
154
//        Toast.makeText(this, b.getName()+ "   " + b.getCities().get(b.getId()).getName(), Toast.LENGTH_SHORT).show();
155
        et_che.setText(b.getName() + " - " + b.getCities().get(b.getId()).getName());
156 164
        car_brand = b.getName();
157 165
        car_type = b.getCities().get(b.getId()).getName();
158 166
    }
159 167
160 168
    private void initView() {
161
        tv_buy = (TextView) findViewById(R.id.tv_buy);
169
        loadDialog = new LoadingDialog(this);
170
        loadDialog.setCanceledOnTouchOutside(false);
162 171
        rl_point = (RelativeLayout) findViewById(R.id.rl_point);
163
        rl_isBuy = (RelativeLayout) findViewById(R.id.rl_isBuy);
164
        rl_isBuy.setOnClickListener(this);
165 172
        tv_point = (TextView) findViewById(R.id.tv_point);
166 173
        animation = AnimationUtils.loadAnimation(UserInfoActivity.this, R.anim.nn);
167
        rl_select_car = (RelativeLayout) findViewById(R.id.rl_select_car);
168
        rl_select_car.setOnClickListener(this);
169 174
170 175
        animation = AnimationUtils.loadAnimation(UserInfoActivity.this, R.anim.nn);
171 176
        point = (ImageView) findViewById(R.id.tv_one);
@ -179,20 +184,11 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
179 184
            }
180 185
        });
181 186
        et_realName = (EditText) findViewById(R.id.et_realName);
182
        et_che = (TextView) findViewById(R.id.et_che);
183 187
        Log.e(TAG, "initView: " + MainApplication.userCar);
184 188
        if (MainApplication.userCar.equals("")) {
185
            tv_buy.setText("");
186
            rl_select_car.setVisibility(View.GONE);
187 189
        } else if ("待购".equals(MainApplication.userCar)) {
188
            tv_buy.setText("未购买");
189
            rl_select_car.setVisibility(View.GONE);
190
            et_che.setText("");
191 190
        } else {
192 191
            String car = MainApplication.userCar.replace("$$", " ");
193
            tv_buy.setText("已购买");
194
            rl_select_car.setVisibility(View.VISIBLE);
195
            et_che.setText(car);
196 192
            String[] strarray = car.split(" ");
197 193
            if (strarray.length > 1) {
198 194
                car_brand = strarray[0];
@ -242,25 +238,11 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
242 238
        tv_save = (TextView) findViewById(R.id.tv_make_sure);
243 239
        tv_save.setOnClickListener(this);
244 240
245
//        rl_brand = (RelativeLayout) findViewById(R.id.rl_1);
246
//        rl_brand.setOnClickListener(this);
247
//        rl_type = (RelativeLayout) findViewById(R.id.rl_2);
248
//        rl_type.setOnClickListener(this);
249
//        long appTime1 = System.currentTimeMillis()/1000;
250
////        Log.d("appTime(long)---", appTime1+"");
251
//        String apptime = String.valueOf(appTime1);
252
//        int updateapptime = Integer.valueOf(apptime);
253
//
254
//        if(MainFragment.cha>0){
255
//            cha = updateapptime - (MainFragment.cha);
256
//        }else if (MainFragment.cha<0){
257
//            cha = updateapptime+(MainFragment.cha);
258
//        }else {
259
//            cha = updateapptime;
260
//        }
261
//        chatime = String.valueOf(cha);
262
//        Log.i("updatetime----",updateapptime+"");
263
//        Log.i("cha",chatime);
241
        go_certificate = findViewById(R.id.go_certificate);
242
        go_certificate.setOnClickListener(this);
243
        go_title = findViewById(R.id.go_title);
244
        go_desc = findViewById(R.id.go_desc);
245
        go_cursor = findViewById(R.id.go_cursor);
264 246
    }
265 247
266 248
    private void setIcon() {
@ -288,38 +270,15 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
288 270
            iconPic.setImageResource(R.drawable.icon_face2_0);
289 271
            photo = ((BitmapDrawable) iconPic.getDrawable()).getBitmap();
290 272
        }
291
//        if (ImageTools.findPhotoFromSDCard(MainApplication.storePath,"user_icon")){
292
//            Bitmap bmp = BitmapFactory.decodeFile(MainApplication.storePath+"/user_icon.png");
293
//            photo = bmp;
294
//            iconPic.setImageBitmap(bmp);
295
//        }else {
296
//            Log.e(TAG, "setIcon: "+MainApplication.userIcon );
297
//            new Task().execute(MainApplication.userIcon);
298
//        }
299
300 273
    }
301 274
302 275
    private void spinner() {
303 276
        List<Cars> cars = new ArrayList<Cars>();
304 277
        Cars car = new Cars("E140ev", "1", "1");
305
//        Cars car1=new Cars("E150ev","1","2");
306
//        Cars car2=new Cars("EV160","1","3");
307
//        Cars car3=new Cars("EV200","1","4");
308 278
        cars.add(car);
309
//        cars.add(car1);
310
//        cars.add(car2);
311
//        cars.add(car3);
312
//
313 279
        List<Cars> cars2 = new ArrayList<Cars>();
314 280
        Cars car0 = new Cars("车型", "1", "1");
315
//        Cars car11=new Cars("2222","1","2");
316
//        Cars car22=new Cars("33333","1","3");
317
//        Cars car33=new Cars("4444","1","4");
318 281
        cars2.add(car0);
319
//        cars2.add(car11);
320
//        cars2.add(car22);
321
//        cars2.add(car33);
322
//		// spinner方面的东西
323 282
        spinnerProvince = (Spinner) this
324 283
                .findViewById(R.id.spinner_province_search_event);
325 284
        spinnerCity = (Spinner) this
@ -328,24 +287,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
328 287
        p.setCities(cars2);
329 288
        p.setId(1);
330 289
        p.setName("品牌");
331
//		Province p2=new Province("比亚迪1", 2, cars2);
332
//		Province p3=new Province("比亚迪2", 2, cars);
333
//		Province p4=new Province("比亚迪3", 2, cars);
334
//		Province p5=new Province("比亚迪4", 2, cars);
335
//		Province p6=new Province("比亚迪5", 2, cars);
336
//		Province p7=new Province("比亚迪6", 2, cars);
337
//		Province p8=new Province("比亚迪7", 2, cars);
338
//		Province p9=new Province("比亚迪8", 2, cars);
339 290
        pr.add(p);
340
//		pr.add(p2);
341
//		pr.add(p3);
342
//		pr.add(p4);
343
//		pr.add(p5);
344
//		pr.add(p6);
345
//		pr.add(p7);
346
//		pr.add(p8);
347
//		pr.add(p9);
348
//		pr.add(p2);
349 291
        ArrayAdapter<Province> provinceAdapter = new ArrayAdapter<Province>(UserInfoActivity.this, R.layout.simple_spinner_item, pr);
350 292
        spinnerProvince.setAdapter(provinceAdapter);
351 293
@ -374,7 +316,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
374 316
                                   int position, long id) {
375 317
            onProvinChange(position);
376 318
            Province d = pr.get(position);
377
//            btnP.setText(d.getName());
378 319
            try {
379 320
                car_brand = d.getName();
380 321
            } catch (Exception e) {
@ -396,14 +337,12 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
396 337
    final class CityAdapter extends ProvinceAdapter {
397 338
        @Override
398 339
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
399
//			currentCity = currentProvince.getCities().get(position);
400 340
            car_type = (String) spinnerCity.getSelectedItem();
401 341
            Log.e("car_type", car_type);
402 342
        }
403 343
    }
404 344
405 345
    public void onProvinChange(int position) {
406
//		currentProvince = parse.getProvinces().get(position);
407 346
        List<Cars> car = pr.get(position).getCities();
408 347
        List<String> strName = new ArrayList<String>();
409 348
        for (int i = 0; i < car.size(); i++) {
@ -421,101 +360,12 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
421 360
            spinnerCity.setSelection(default_type);
422 361
            default_type = -1;
423 362
        }
424
425
//        Log.e("default_type",default_type+"");
426
//        if (default_type==-1){
427
//            spinnerCity.setSelection(0);
428
//            default_type=-1;
429
//        }else{
430
//            spinnerCity.setSelection(default_type);
431
//        }
432
433
//		if (currentProvince.getCities().size() > 0) {
434
//			cityAdapter.notifyDataSetChanged();
435
//			spinnerCity.setSelection(0);
436
//		}
437 363
    }
438 364
439 365
440 366
    @Override
441 367
    public void onClick(View v) {
442 368
        switch (v.getId()) {
443
            case R.id.rl_select_car:
444
                MobclickAgent.onEvent(getApplicationContext(), "0802", new HashMap<String, String>().put("type", "车型"));
445
//                startActivityForResult(new Intent(UserInfoActivity.this,
446
//                        ChePaiActivity.class), 55);
447
                startActivityForResult(new Intent(UserInfoActivity.this, SelectCarActivity.class), REQUSET);
448
                break;
449
            case R.id.rl_isBuy:
450
                MobclickAgent.onEvent(getApplicationContext(), "0802", new HashMap<String, String>().put("type", "是否购车"));
451
                LayoutInflater inflater1 = (LayoutInflater) getSystemService(mContext.LAYOUT_INFLATER_SERVICE);
452
                View popupWindowView = inflater1.inflate(R.layout.layout_isbuy, null);
453
                final PopupWindow popupWindow1 = new PopupWindow(popupWindowView,
454
                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
455
                        true);
456
                popupWindow1.setBackgroundDrawable(getResources().getDrawable(R.drawable.bg_yinying531));
457
                popupWindow1.setOutsideTouchable(true);
458
                popupWindowView.setOnKeyListener(new View.OnKeyListener() {
459
                    @Override
460
                    public boolean onKey(View v, int keyCode, KeyEvent event) {
461
                        if ((keyCode == KeyEvent.KEYCODE_MENU) && (popupWindow1.isShowing())) {
462
                            popupWindow1.dismiss();
463
                            return true;
464
                        }
465
                        return false;
466
                    }
467
                });
468
                popupWindowView.setOnTouchListener(new View.OnTouchListener() {
469
470
                    @Override
471
                    public boolean onTouch(View v, MotionEvent event) {
472
                        if (popupWindow1.isShowing()) {
473
                            popupWindow1.dismiss();
474
                        }
475
                        return false;
476
                    }
477
                });
478
                // 设置PopupWindow的弹出和消失效果
479
                popupWindow1.setAnimationStyle(R.style.popupAnimation);
480
                Button cancleButton = (Button) popupWindowView
481
                        .findViewById(R.id.cancleButton);
482
                cancleButton.setOnClickListener(new View.OnClickListener() {
483
                    @Override
484
                    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>