Ver Código Fonte

修改站点功能开发完成

huyuguo 4 anos atrás
pai
commit
eb46b26633

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

@ -200,6 +200,13 @@
200 200
            android:screenOrientation="portrait"
201 201
            android:windowSoftInputMode="adjustPan" /> <!-- 微信分享回调 -->
202 202
        <activity
203
            android:name=".activity.ShareTwoEditActivity"
204
            android:configChanges="keyboardHidden|orientation|screenSize"
205
            android:label="@string/title_activity_share_two_edit"
206
            android:launchMode="singleTask"
207
            android:screenOrientation="portrait"
208
            android:windowSoftInputMode="adjustPan" /> <!-- 微信分享回调 -->
209
        <activity
203 210
            android:name=".activity.ZhanDetailsNew"
204 211
            android:label="@string/title_activity_zhan_details_new"
205 212
            android:launchMode="singleTop"

+ 0 - 5
app/src/main/java/com/electric/chargingpile/activity/AlbumActivity.java

@ -91,8 +91,6 @@ public class AlbumActivity extends Activity {
91 91
    private class AlbumSendListener implements OnClickListener {
92 92
        public void onClick(View v) {
93 93
            overridePendingTransition(R.anim.activity_translate_in, R.anim.activity_translate_out);
94
//            intent.setClass(mContext, ShareTwoActivity.class);
95
//            startActivity(intent);
96 94
            finish();
97 95
        }
98 96
@ -109,9 +107,6 @@ public class AlbumActivity extends Activity {
109 107
    // 取消按钮的监听
110 108
    private class CancelListener implements OnClickListener {
111 109
        public void onClick(View v) {
112
//            Bimp.tempSelectBitmap.clear();
113
//            intent.setClass(mContext, ShareTwoActivity.class);
114
//            startActivity(intent);
115 110
            AlbumHelper.bucketList.clear();
116 111
            finish();
117 112
        }

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

@ -92,8 +92,6 @@ public class AlbumActivity4claim extends Activity {
92 92
    private class AlbumSendListener implements OnClickListener {
93 93
        public void onClick(View v) {
94 94
            overridePendingTransition(R.anim.activity_translate_in, R.anim.activity_translate_out);
95
//            intent.setClass(mContext, ShareTwoActivity.class);
96
//            startActivity(intent);
97 95
            finish();
98 96
        }
99 97

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

@ -91,8 +91,6 @@ public class AlbumPrivateActivity extends Activity {
91 91
    private class AlbumSendListener implements OnClickListener {
92 92
        public void onClick(View v) {
93 93
            overridePendingTransition(R.anim.activity_translate_in, R.anim.activity_translate_out);
94
//            intent.setClass(mContext, ShareTwoActivity.class);
95
//            startActivity(intent);
96 94
            finish();
97 95
        }
98 96

+ 0 - 137
app/src/main/java/com/electric/chargingpile/activity/ClaimSurveyTwoActivity.java

@ -224,143 +224,6 @@ public class ClaimSurveyTwoActivity extends Activity implements View.OnClickList
224 224
     * See https://g.co/AppIndexing/AndroidStudio for more information.
225 225
     */
226 226
    private GoogleApiClient client;
227
//    String camePath;
228
229
230
    //    InputMethodManager imm;
231
//    private Handler handler = new Handler() {
232
//        @Override
233
//        public void handleMessage(Message msg) {
234
//            // TODO Auto-generated method stub
235
//            super.handleMessage(msg);
236
//
237
//            String ss = (String) msg.obj;
238
//            if (msg.what == 1) {
239
//                if (ss.equals("1")) {
240
//                    System.out.println(ss);
241
//
242
//                    Toast.makeText(getApplicationContext(), "提交成功!", Toast.LENGTH_SHORT).show();
243
//                    startActivity(new Intent(ShareTwoActivity.this, MainActicity.class));
244
//                    finish();
245
//
246
//                } else {
247
//                    Toast.makeText(getApplicationContext(), "提交失败!", Toast.LENGTH_LONG).show();
248
//                }
249
//            } else if (msg.what == 2) {
250
//                Toast.makeText(getApplicationContext(), "请求网络超时!", Toast.LENGTH_LONG).show();
251
//            }
252
//
253
//        }
254
//    };
255
256
//    private Handler handler = new Handler() {
257
//        // 主线程通过这个方法处理消息
258
//        @Override
259
//        public void handleMessage(Message msg) {
260
//            switch (msg.what) {
261
//                case 1:
262
//                    try {
263
//                        JSONObject jsonObj = new JSONObject(msg.obj.toString());
264
//                        String status=jsonObj.getString("status");
265
//                        String info = jsonObj.getString("info");
266
//                        Log.e("成长模块测试",info);
267
//                    } catch (JSONException e) {
268
//                        e.printStackTrace();
269
//                    }
270
//                    break;
271
//                case 2:
272
//                    try {
273
//                        JSONObject jsonObj = new JSONObject(msg.obj.toString());
274
//                        String submit_state=jsonObj.getString("submit_state");
275
//                        zhan_id = jsonObj.getString("zhan_id");
276
//                        if (submit_state.equals("1")) {
277
//
278
//                            String s =bitmapToBase64(photo);
279
//                            addPHoto(s);
280
//                            userGrowUp();
281
//                            Toast.makeText(ShareTwoActivity.this,"分享成功",Toast.LENGTH_SHORT).show();
282
//                            dismissDialog();
283
//                            startActivity(new Intent(ShareTwoActivity.this,MainActicity.class));
284
//                            finish();
285
//                        }else {
286
//                            Toast.makeText(ShareTwoActivity.this,"分享失败,请重试",Toast.LENGTH_SHORT).show();
287
//                            dismissDialog();
288
//                        }
289
//                    } catch (JSONException e) {
290
//                        e.printStackTrace();
291
//                    }
292
//                    break;
293
//                case 3:
294
//                    Toast.makeText(ShareTwoActivity.this, "服务器处理错误", Toast.LENGTH_SHORT).show();
295
//                    break;
296
//                case 5:
297
//                    try{
298
//                        JSONObject jsonObj = new JSONObject(msg.obj.toString());
299
//                        String status=jsonObj.getString("rtnCode");
300
//                        String info=jsonObj.getString("rtnMsg");
301
//                        if (status.equals("01")) {
302
//                            userGrowUp();
303
//                            dismissDialog();
304
//                        }else {
305
//                            Toast.makeText(ShareTwoActivity.this,"图片上传失败,请重试",Toast.LENGTH_SHORT).show();
306
//
307
//                        }
308
//
309
//
310
//                    }catch (Exception e){
311
//                        e.printStackTrace();
312
//                    }
313
//                    break;
314
//                default:
315
//                    break;
316
//            }
317
//        }
318
//    };
319
320
321
//    private void submitShareTwo() {
322
//
323
//        if (!NetUtil.CheckNetwork(this)) {
324
//            Toast.makeText(this, "请检查网络", Toast.LENGTH_SHORT).show();
325
//            return;
326
//        }
327
//        TelephonyManager telephonyManager=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
328
//        String imem=telephonyManager.getDeviceId();
329
//        SimpleDateFormat dateFormat = new SimpleDateFormat(
330
//                "HH:mm");
331
//        String  qTime=dateFormat.format(new Date());
332
//        Request request = new Request.Builder().url("http://123.56.88.79/zhan/index.php?" +
333
//                "m=content&c=index&a=add2&catid=9&zhan_name="+zhan_name+"&city="+city+"&district=&" +
334
//                "zhan_address="+zhan_address+"&user_id="+ MainApplication.userPhone+"&poi_jing="+poi_jing+"&" +
335
//                "poi_wei="+poi_wei+"&zhan_type=&audit=&total_num=&" +
336
//                "fast_num="+fast_num+"&slow_num="+slow_num+"&suit_car=&work_open="+open_time.getText().toString()+"&belong_attribute="+tv_belong_type.getText().toString()+"&work_close="+close_time.getText().toString()+"&company_name=&charge_cost="+et_chargeCost.getText().toString()+"&" +
337
//                "charge_cost_way="+et_style.getText().toString()+"&other_cost="+charge_cost+"&stop_cost="+stop_cost+"&pic=&holiday_open="+holiday_open.getText().toString()+"&holiday_close="+holiday_close.getText().toString()+"&open_object=&stop_cost_way=&" +
338
//                "person_name=&telephone="+et_phone.getText().toString()+"&imem="+imem+"&sf_cost=&zy_num="+et_zyNum.getText().toString()+"&park_location="+park+"&remark="+et_remark.getText().toString()+"&suit_car2="+suit_car2).build();
339
//        Response response = null;
340
//        try {
341
//            response = OkHttpUtil.execute(request);
342
//            if (response.code() == 200) {
343
//                String json = "";
344
//                try {
345
//                    json = response.body().string();
346
//                    Message msg = new Message();
347
//                    msg.obj = json;
348
//                    msg.what = 2;
349
//                    handler.sendMessage(msg);
350
//                } catch (Exception e) {
351
//                    e.printStackTrace();
352
//                    Message msg = new Message();
353
//                    msg.what = 3;
354
//                    handler.sendMessage(msg);
355
//                }
356
//            }
357
//        } catch (Exception e) {
358
//            e.printStackTrace();
359
//            Message msg = new Message();
360
//            msg.what = 3;
361
//            handler.sendMessage(msg);
362
//        }
363
//    }
364 227
365 228
366 229
    @Override

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

@ -143,8 +143,6 @@ public class GalleryPrivateActivity extends Activity {
143 143
    private class GallerySendListener implements OnClickListener {
144 144
        public void onClick(View v) {
145 145
            finish();
146
//            intent.setClass(mContext,ShareTwoActivity.class);
147
//            startActivity(intent);
148 146
        }
149 147
150 148
    }

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

@ -1,6 +1,7 @@
1 1
package com.electric.chargingpile.activity;
2 2
3 3
import android.app.Activity;
4
import android.content.Intent;
4 5
import android.os.Bundle;
5 6
import android.os.Handler;
6 7
import android.os.Message;
@ -70,7 +71,6 @@ public class ShareListActivity extends Activity {
70 71
71 72
    ArrayList<JSONObject> datas = new ArrayList<JSONObject>();
72 73
    private Handler handler = new Handler() {
73
        // ���߳�ͨ���������������Ϣ
74 74
        @Override
75 75
        public void handleMessage(Message msg) {
76 76
            switch (msg.what) {
@ -93,6 +93,15 @@ public class ShareListActivity extends Activity {
93 93
                        }
94 94
                        shareListAdapter = new ShareListAdapter(datas);
95 95
                        listview.setAdapter(shareListAdapter);
96
                        shareListAdapter.setEditListener(new ShareListAdapter.OnEditListener() {
97
                            @Override
98
                            public void edit(String zhanId) {
99
                                Intent intent = new Intent(ShareListActivity.this, ShareTwoEditActivity.class);
100
                                intent.putExtra("zhan_id", zhanId);
101
                                startActivity(intent);
102
                            }
103
                        });
104
96 105
                    } catch (Exception e) {
97 106
                        e.printStackTrace();
98 107
                    }

+ 36 - 22
app/src/main/java/com/electric/chargingpile/activity/ShareTwoActivity.java

@ -686,7 +686,8 @@ public class ShareTwoActivity extends Activity implements View.OnClickListener,
686 686
                startActivity(new Intent(ShareTwoActivity.this, ChargeCostWayActivity.class));
687 687
                break;
688 688
            case R.id.share_next: // 立即提交
689
                if (et_share_address.getText().toString().equals("")) {
689
                if (!checkPictureOk()) {
690
                } else if (et_share_address.getText().toString().equals("")) {
690 691
                    Toast.makeText(this, "请选择充电站地址", Toast.LENGTH_SHORT).show();
691 692
                } else if (zhanName.getText().toString().equals("")) {
692 693
                    Toast.makeText(this, "请填写名称", Toast.LENGTH_SHORT).show();
@ -704,8 +705,6 @@ public class ShareTwoActivity extends Activity implements View.OnClickListener,
704 705
                    Toast.makeText(this, "请选择运营商", Toast.LENGTH_SHORT).show();
705 706
                } else if (telephone.getText().toString().equals("")) {
706 707
                    Toast.makeText(this, "请填写运营商电话", Toast.LENGTH_SHORT).show();
707
                } else if (Bimp.tempSelectBitmap.size() == 0) {
708
                    Toast.makeText(this, "请上传图片", Toast.LENGTH_SHORT).show();
709 708
                } else {
710 709
                    if (fastNum.getText().toString().equals("") && !slowNum.getText().toString().equals("")) {
711 710
                        fastNum.setText("0");
@ -775,6 +774,27 @@ public class ShareTwoActivity extends Activity implements View.OnClickListener,
775 774
        }
776 775
    }
777 776
777
    private boolean checkPictureOk() {
778
779
        if (selectBitmap[0] == null) {
780
            Toast.makeText(this, "请上传建筑或小区图片", Toast.LENGTH_SHORT).show();
781
            return false;
782
        }
783
784
        if (selectBitmap[1] == null) {
785
            Toast.makeText(this, "请上传站点图片", Toast.LENGTH_SHORT).show();
786
            return false;
787
        }
788
789
        if (selectBitmap[2] == null) {
790
            Toast.makeText(this, "请上传充电桩图片", Toast.LENGTH_SHORT).show();
791
            return false;
792
        }
793
794
795
        return true;
796
    }
797
778 798
779 799
    public boolean onKeyDown(int keyCode, KeyEvent event) {
780 800
        if (keyCode == KeyEvent.KEYCODE_BACK) {
@ -883,17 +903,17 @@ public class ShareTwoActivity extends Activity implements View.OnClickListener,
883 903
        String token = String.valueOf(updatetime);
884 904
        Log.i("token---", token);
885 905
886
        for (int i = 0; i < Bimp.tempSelectBitmap.size(); i++) {
887
            try {
888
                bm = imageZoom(Bimp.tempSelectBitmap.get(i).getBitmap());
889
                file = bitmapToBase64(bm);
890
                par.put("file" + (i + 1), file);
891
                Log.i("file--------" + (i + 1), file);
892
                par.put("filename" + (i + 1), "androidapp.jpg");
893
            } catch (Exception e) {
894
                e.printStackTrace();
906
        for (int i = 0; i < selectBitmap.length; i++) {
907
            if (selectBitmap[i] != null) {
908
                try {
909
                    bm = imageZoom(selectBitmap[i].getBitmap());
910
                    file = bitmapToBase64(bm);
911
                    par.put("file" + (i + 1), file);
912
                    par.put("filename" + (i + 1), "androidapp.jpg");
913
                } catch (Exception e) {
914
                    e.printStackTrace();
915
                }
895 916
            }
896
897 917
        }
898 918
899 919
        par.put("zhan_name", zhanName.getText().toString());
@ -901,7 +921,6 @@ public class ShareTwoActivity extends Activity implements View.OnClickListener,
901 921
        par.put("user_id", MainApplication.userId);
902 922
        par.put("zhan_address", et_share_address.getText().toString());
903 923
        String jingg = roundByScale(Double.parseDouble(jing), 16);
904
        ;
905 924
        String weii = roundByScale(Double.parseDouble(wei), 16);
906 925
        par.put("poi_jing", jingg);
907 926
        par.put("poi_wei", weii);
@ -937,12 +956,7 @@ public class ShareTwoActivity extends Activity implements View.OnClickListener,
937 956
        par.put("park_location", park);
938 957
        par.put("token", DES3.encode(token));
939 958
        try {
940
            String u = UploadUtil.post(
941
//                    "http://123.57.6.131/zhannew/basic/web/index.php/zhanlist/add",
942
                    MainApplication.url + "/zhannew/basic/web/index.php/zhanlist/add",
943
                    par, null);
944
            System.err.println(u);
945
            // submit(u);
959
            String u = UploadUtil.post(MainApplication.url + "/zhannew/basic/web/index.php/zhanlist/add", par, null);
946 960
            Message msg = new Message();
947 961
            msg.obj = u;
948 962
            msg.what = 2;
@ -1258,12 +1272,12 @@ public class ShareTwoActivity extends Activity implements View.OnClickListener,
1258 1272
        et_share_address.setText(address);
1259 1273
        costWay.setText(costway);
1260 1274
1261
        for (int i=0;i<selectBitmap.length;i++) {
1275
        for (int i = 0; i < selectBitmap.length; i++) {
1262 1276
            ImageItem imageItem = selectBitmap[i];
1263 1277
            if (imageItem == null) {
1264 1278
                takeImageCameraList.get(i).setVisibility(View.VISIBLE);
1265 1279
                ImageView takeImageView = takeImageViewList.get(i);
1266
                takeImageView.setImageResource(Res.getDrawableID("add_picture_" + (i+1)));
1280
                takeImageView.setImageResource(Res.getDrawableID("add_picture_" + (i + 1)));
1267 1281
                takeImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
1268 1282
1269 1283
                ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams) takeImageView.getLayoutParams();

+ 1298 - 0
app/src/main/java/com/electric/chargingpile/activity/ShareTwoEditActivity.java

@ -0,0 +1,1298 @@
1
package com.electric.chargingpile.activity;
2
3
import android.Manifest;
4
import android.annotation.SuppressLint;
5
import android.app.Activity;
6
import android.app.ProgressDialog;
7
import android.app.TimePickerDialog;
8
import android.content.Context;
9
import android.content.Intent;
10
import android.content.SharedPreferences;
11
import android.graphics.Bitmap;
12
import android.graphics.BitmapFactory;
13
import android.graphics.Color;
14
import android.graphics.Matrix;
15
import android.graphics.drawable.BitmapDrawable;
16
import android.graphics.drawable.ColorDrawable;
17
import android.graphics.drawable.Drawable;
18
import android.net.Uri;
19
import android.os.Bundle;
20
import android.os.Environment;
21
import android.os.Handler;
22
import android.os.Message;
23
import android.provider.MediaStore;
24
import android.support.annotation.NonNull;
25
import android.support.annotation.Nullable;
26
import android.support.constraint.ConstraintLayout;
27
import android.support.v4.content.FileProvider;
28
import android.util.Base64;
29
import android.util.Log;
30
import android.view.KeyEvent;
31
import android.view.LayoutInflater;
32
import android.view.View;
33
import android.view.ViewGroup;
34
import android.widget.AdapterView;
35
import android.widget.AdapterView.OnItemClickListener;
36
import android.widget.BaseAdapter;
37
import android.widget.Button;
38
import android.widget.EditText;
39
import android.widget.GridView;
40
import android.widget.ImageView;
41
import android.widget.LinearLayout;
42
import android.widget.PopupWindow;
43
import android.widget.RadioButton;
44
import android.widget.RadioGroup;
45
import android.widget.RelativeLayout;
46
import android.widget.Switch;
47
import android.widget.TextView;
48
import android.widget.TimePicker;
49
import android.widget.Toast;
50
import android.widget.ToggleButton;
51
52
import com.bumptech.glide.Glide;
53
import com.bumptech.glide.load.DataSource;
54
import com.bumptech.glide.load.engine.GlideException;
55
import com.bumptech.glide.request.RequestListener;
56
import com.bumptech.glide.request.target.Target;
57
import com.electric.chargingpile.R;
58
import com.electric.chargingpile.application.MainApplication;
59
import com.electric.chargingpile.data.Zhan;
60
import com.electric.chargingpile.util.BarColorUtil;
61
import com.electric.chargingpile.util.Bimp;
62
import com.electric.chargingpile.util.DES3;
63
import com.electric.chargingpile.util.DensityUtil;
64
import com.electric.chargingpile.util.ImageItem;
65
import com.electric.chargingpile.util.ImageUtils;
66
import com.electric.chargingpile.util.JsonUtils;
67
import com.electric.chargingpile.util.OkHttpUtil;
68
import com.electric.chargingpile.util.PublicWayFour;
69
import com.electric.chargingpile.util.Res;
70
import com.electric.chargingpile.util.SharedPreferencesUtil;
71
import com.electric.chargingpile.util.ToastUtil;
72
import com.electric.chargingpile.util.UploadUtil;
73
import com.electric.chargingpile.view.CustomProgressDialog;
74
import com.electric.chargingpile.view.ShareDialog;
75
import com.squareup.okhttp.Request;
76
import com.squareup.okhttp.Response;
77
import com.tencent.bugly.crashreport.CrashReport;
78
import com.zhy.http.okhttp.OkHttpUtils;
79
import com.zhy.http.okhttp.callback.StringCallback;
80
81
import org.json.JSONArray;
82
import org.json.JSONException;
83
import org.json.JSONObject;
84
85
import java.io.ByteArrayInputStream;
86
import java.io.ByteArrayOutputStream;
87
import java.io.File;
88
import java.io.IOException;
89
import java.net.URLEncoder;
90
import java.text.DecimalFormat;
91
import java.util.ArrayList;
92
import java.util.Calendar;
93
import java.util.HashMap;
94
import java.util.List;
95
import java.util.Map;
96
import java.util.TimeZone;
97
98
import io.reactivex.Observable;
99
import io.reactivex.ObservableEmitter;
100
import io.reactivex.ObservableOnSubscribe;
101
import io.reactivex.Observer;
102
import io.reactivex.android.schedulers.AndroidSchedulers;
103
import io.reactivex.disposables.Disposable;
104
import io.reactivex.schedulers.Schedulers;
105
import me.iwf.photopicker.PhotoPicker;
106
import okhttp3.Call;
107
import pub.devrel.easypermissions.AfterPermissionGranted;
108
import pub.devrel.easypermissions.EasyPermissions;
109
110
public class ShareTwoEditActivity extends Activity implements View.OnClickListener, EasyPermissions.PermissionCallbacks {
111
    private static final String TAG = "ShareTwoActivity";
112
    private static final int PIC_NUM = 4;
113
    private ImageView ivBack, ivType;
114
    Bitmap bm = null;
115
    private TextView shareList, tvO, tvT, tvTh, tvF, tvFi, zhuangType, costWay, shareNext;
116
117
    private TimePickerDialog tpd_open = null;
118
    private TimePickerDialog tpd_close = null;
119
    private String camePath;//拍照路径
120
121
    private static final String PHOTO_FILE_NAME = "android.jpg";
122
    private static final String PHOTO_FILE_PATH = getPath(Environment.getExternalStorageDirectory() + "/" + "cdz");
123
    private File tempFile;
124
    private static final int PHOTO_REQUEST_CAMERA = 1;
125
    private static final int PHOTO_REQUEST_GALLERY = 2;
126
    private static final int PHOTO_REQUEST_CUT = 3;
127
128
    private ImageView inBtn, outBtn;
129
    private String jing, wei;
130
131
132
    public static boolean isFirstLoc = true;
133
    private Switch sh_cost;
134
    private Button submitLocation;
135
    private ImageView test, iv1, iv2, iv3, iv4, iv_back;
136
    private LinearLayout ll_tvOne, ll_tvTwo, ll_tvThree, ll_tvFour, ll_buchong, ll_type, ll_costWay;
137
    private List<Zhan> list = new ArrayList<Zhan>();
138
    private Zhan zhan;
139
140
    ToggleButton carType;
141
    private String suit_car2 = "国标";
142
    private TextView et_share_address;
143
144
    Context mContext;
145
146
    TextView tv;
147
    private Toast toast = null;
148
    private String park = "1";
149
    private ImageView ib_loaction, ib_add, ib_jian, iv_chakan;
150
    private RelativeLayout tv_notice;
151
    private EditText zhanName, fastNum, slowNum, parkCost, chargeCost, et_serviceCost, et_remark;
152
    private CustomProgressDialog pd_info;
153
154
    private RadioButton rb_guo, rb_te, rb_shang, rb_xia;
155
    private RadioGroup rg_claimtype, rg_park;
156
    public static Bitmap bimap;
157
    private View parentView;
158
    private PopupWindow pop = null;
159
    private LinearLayout ll_popup;
160
    private TextView open_time, close_time;
161
    private RelativeLayout rl_address;
162
    private ProgressDialog insertDialog;
163
    private static final int RC_ALBUM_PERM = 123;
164
165
    public static ImageItem[] selectBitmap = new ImageItem[4];
166
    private int selectIndex = 0;
167
168
    private ArrayList<ImageView> takeImageViewList = new ArrayList<>();
169
    private ArrayList<ImageView> takeImageCameraList = new ArrayList<>();
170
    private boolean isTakePhoto = false; // 是否更新图片
171
172
    private Handler handler = new Handler() {
173
        // 主线程通过这个方法处理消息
174
        @Override
175
        public void handleMessage(Message msg) {
176
            switch (msg.what) {
177
                case 1:
178
                    int index = msg.arg1;
179
                    ImageView iv = takeImageViewList.get(index);
180
                    iv.setImageBitmap(selectBitmap[index].getBitmap());
181
                    iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
182
                    ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams) iv.getLayoutParams();
183
                    lp.width = DensityUtil.dip2px(ShareTwoEditActivity.this, 82);
184
                    lp.height = DensityUtil.dip2px(ShareTwoEditActivity.this, 70);
185
                    iv.setLayoutParams(lp);
186
                    takeImageCameraList.get(index).setVisibility(View.GONE);
187
                    break;
188
                case 2:
189
                    Toast.makeText(ShareTwoEditActivity.this, "提交信息成功,感谢您的分享", Toast.LENGTH_SHORT).show();
190
                    dismissDialog();
191
                    startActivity(new Intent(getApplication(), ShareListActivity.class));
192
                    SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
193
                    sharedPreferencesUtil.setFileName("shareInfo");
194
                    sharedPreferencesUtil.clearData();
195
                    finish();
196
                    break;
197
                case 3:
198
                    dismissDialog();
199
                    Toast.makeText(ShareTwoEditActivity.this, "服务器处理错误", Toast.LENGTH_SHORT).show();
200
                    break;
201
202
                case 5:
203
204
                    break;
205
                case 6:
206
                    try {
207
                        Log.e("!!!", msg.toString());
208
                        JSONObject jsonObject = new JSONObject(msg.obj.toString());
209
                        Log.e("!!!!!!", msg.obj.toString());
210
                        String rtnCode = jsonObject.getString("rtnCode");
211
                        String rtnMsg = jsonObject.getString("rtnMsg");
212
                        if (rtnCode.equals("01")) {
213
                            dismissDialog();
214
                            String s = "“雷锋同志”您提交的信息已成功";
215
                            String s1 = "非常感谢您的支持,我们将尽快审核添加到APP中";
216
                            new com.electric.chargingpile.view.AlertDialog(ShareTwoEditActivity.this).builder()
217
                                    .setMsg(s + "\n" + s1)
218
                                    .setNegativeButton("确认关闭", new View.OnClickListener() {
219
                                        @Override
220
                                        public void onClick(View v) {
221
                                            startActivity(new Intent(ShareTwoEditActivity.this, ShareListActivity.class));
222
                                            finish();
223
                                        }
224
                                    }).show();
225
226
227
                        } else {
228
                            dismissDialog();
229
                            Toast.makeText(ShareTwoEditActivity.this, "提交失败", Toast.LENGTH_SHORT).show();
230
                        }
231
                    } catch (JSONException e) {
232
                        e.printStackTrace();
233
                    }
234
                    break;
235
236
                default:
237
                    break;
238
            }
239
        }
240
    };
241
    private EditText chargeCostWay;
242
    private EditText telephone;
243
    private ConstraintLayout take_image_0;
244
    private ConstraintLayout take_image_1;
245
    private ConstraintLayout take_image_2;
246
    private ConstraintLayout take_image_3;
247
    private String zhanId;
248
    private String recordId = "";
249
250
251
    @Override
252
    protected void onCreate(Bundle savedInstanceState) {
253
        super.onCreate(savedInstanceState);
254
        tempFile = getFile(PHOTO_FILE_PATH + "/" + PHOTO_FILE_NAME);
255
        Res.init(this);
256
        bimap = BitmapFactory.decodeResource(
257
                getResources(),
258
                R.drawable.addpic65);
259
        PublicWayFour.activityList.add(this);
260
261
        setContentView(R.layout.activity_share_two_edit);
262
        list = new ArrayList<>();
263
        mContext = this;
264
        BarColorUtil.initStatusBarColor(ShareTwoEditActivity.this);
265
        initView();
266
        Init();
267
268
        zhanId = getIntent().getStringExtra("zhan_id");
269
        if (zhanId == null || zhanId.equals("")) {
270
            Toast.makeText(this, "获取站点信息失败", Toast.LENGTH_SHORT).show();
271
            finish();
272
        } else {
273
            getZhanInfo();
274
        }
275
    }
276
277
278
    private void showTextToast(String msg) {
279
        if (toast == null) {
280
            toast = Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT);
281
        } else {
282
            toast.setText(msg);
283
        }
284
        toast.show();
285
    }
286
287
    public void dismissDialog() {
288
        if (pd_info != null) {
289
            pd_info.dismiss();
290
            pd_info = null;
291
        }
292
    }
293
294
    public void Init() {
295
        selectBitmap[0] = null;
296
        selectBitmap[1] = null;
297
        selectBitmap[2] = null;
298
        selectBitmap[3] = null;
299
300
        pop = new PopupWindow(ShareTwoEditActivity.this);
301
302
        View view = getLayoutInflater().inflate(R.layout.item_popupwindows, null);
303
304
        ll_popup = (LinearLayout) view.findViewById(R.id.ll_popup);
305
306
        pop.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
307
        pop.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
308
        pop.setBackgroundDrawable(new BitmapDrawable());
309
        pop.setFocusable(true);
310
        pop.setOutsideTouchable(true);
311
        pop.setContentView(view);
312
313
        final RelativeLayout parent = (RelativeLayout) view.findViewById(R.id.parent);
314
        Button bt1 = (Button) view
315
                .findViewById(R.id.item_popupwindows_camera);
316
        Button bt2 = (Button) view
317
                .findViewById(R.id.item_popupwindows_Photo);
318
        Button bt3 = (Button) view
319
                .findViewById(R.id.item_popupwindows_cancel);
320
        parent.setOnClickListener(new View.OnClickListener() {
321
322
            @Override
323
            public void onClick(View v) {
324
                // TODO Auto-generated method stub
325
                pop.dismiss();
326
                ll_popup.clearAnimation();
327
            }
328
        });
329
        bt1.setOnClickListener(new View.OnClickListener() {
330
            public void onClick(View v) {
331
                pop.dismiss();
332
                ll_popup.clearAnimation();
333
334
                if (MainScanActivity.isCameraUseable()) {
335
                    photo();
336
                } else {
337
                    ToastUtil.showToast(getApplicationContext(), "您当前关闭了调用摄像头权限,可前往设置开启权限", Toast.LENGTH_SHORT);
338
                }
339
340
            }
341
        });
342
        bt2.setOnClickListener(new View.OnClickListener() {
343
            public void onClick(View v) {
344
                Intent intent = new Intent(ShareTwoEditActivity.this,
345
                        AlbumActivity.class);
346
                startActivity(intent);
347
                overridePendingTransition(R.anim.activity_translate_in, R.anim.activity_translate_out);
348
                pop.dismiss();
349
                ll_popup.clearAnimation();
350
            }
351
        });
352
        bt3.setOnClickListener(new View.OnClickListener() {
353
            public void onClick(View v) {
354
                pop.dismiss();
355
                ll_popup.clearAnimation();
356
            }
357
        });
358
    }
359
360
    /**
361
     * 调用图库选择
362
     */
363
    private void callGallery() {
364
        //调用第三方图库选择
365
        PhotoPicker.builder()
366
                .setPhotoCount(1)//可选择图片数量
367
                .setShowCamera(true)//是否显示拍照按钮
368
                .setShowGif(true)//是否显示动态图
369
                .setPreviewEnabled(true)//是否可以预览
370
                .start(this, PhotoPicker.REQUEST_CODE);
371
    }
372
373
    @Override
374
    protected void onActivityResult(int requestCode, int resultCode, final Intent data) {
375
        super.onActivityResult(requestCode, resultCode, data);
376
        if (resultCode == RESULT_OK) {
377
            if (data != null) {
378
                if (requestCode == 1) {
379
                    //处理调用系统图库
380
                } else if (requestCode == PhotoPicker.REQUEST_CODE) {
381
                    //异步方式插入图片
382
                    insertImagesSync(data);
383
                }
384
            }
385
        }
386
    }
387
388
    /**
389
     * 异步方式插入图片
390
     *
391
     * @param data
392
     */
393
    private void insertImagesSync(final Intent data) {
394
        insertDialog.show();
395
        Observable.create(new ObservableOnSubscribe<String>() {
396
            @Override
397
            public void subscribe(ObservableEmitter<String> subscriber) throws Exception {
398
399
                try {
400
                    ArrayList<String> photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
401
                    //可以同时插入多张图片
402
                    for (String imagePath : photos) {
403
404
                        Log.e(TAG, "call: imagePath " + imagePath);
405
                        Bitmap bitmap = BitmapFactory.decodeFile(imagePath);//压缩图片
406
                        if (ImageUtils.readPictureDegree(imagePath) != 0) {
407
                            bitmap = imageZoom(ImageUtils.toturn(bitmap));
408
                        } else {
409
                            bitmap = imageZoom(bitmap);
410
                        }
411
                        ImageItem takePhoto = new ImageItem();
412
                        takePhoto.setBitmap(bitmap);
413
                        takePhoto.setImagePath(imagePath);
414
                        //Bimp.tempSelectBitmap.add(takePhoto);
415
                        selectBitmap[selectIndex] = takePhoto;
416
                        isTakePhoto = true;
417
//
418
                        subscriber.onNext(imagePath);
419
                    }
420
                    subscriber.onComplete();
421
                } catch (Exception e) {
422
                    e.printStackTrace();
423
                    subscriber.onError(e);
424
                }
425
            }
426
        })
427
                .subscribeOn(Schedulers.io())//生产事件在io
428
                .observeOn(AndroidSchedulers.mainThread())//消费事件在UI线程
429
                .subscribe(new Observer<String>() {
430
                    @Override
431
                    public void onComplete() {
432
                        Log.e(TAG, "onCompleted: -------------");
433
                        insertDialog.dismiss();
434
                        Message msg = new Message();
435
                        msg.arg1 = selectIndex;
436
                        msg.what = 1;
437
                        handler.sendMessage(msg);
438
//                        adapter.update();
439
440
441
                    }
442
443
                    @Override
444
                    public void onError(Throwable e) {
445
                        insertDialog.dismiss();
446
                        Log.e(TAG, "onError: " + "图片插入失败:" + e.getMessage());
447
                        ToastUtil.showToast(getApplicationContext(), "图片插入失败", Toast.LENGTH_SHORT);
448
                    }
449
450
                    @Override
451
                    public void onSubscribe(Disposable d) {
452
453
                    }
454
455
                    @Override
456
                    public void onNext(String imagePath) {
457
458
                    }
459
                });
460
    }
461
462
463
    private void initView() {
464
        pd_info = CustomProgressDialog.createDialog(mContext);
465
        pd_info.setMessage(mContext.getResources().getString(
466
                R.string.version_refreshing));
467
        pd_info.show();
468
        insertDialog = new ProgressDialog(this);
469
        insertDialog.setMessage("正在插入图片...");
470
        insertDialog.setCanceledOnTouchOutside(false);
471
        et_serviceCost = (EditText) findViewById(R.id.et_serviceCost);
472
473
        iv_chakan = (ImageView) findViewById(R.id.iv_chakan);
474
        iv_chakan.setOnClickListener(this);
475
        inBtn = (ImageView) findViewById(R.id.zoomin1);
476
        outBtn = (ImageView) findViewById(R.id.zoomout1);
477
        inBtn.setOnClickListener(this);
478
        outBtn.setOnClickListener(this);
479
480
        rl_address = (RelativeLayout) findViewById(R.id.ll_address);
481
        rl_address.setOnClickListener(this);
482
        shareNext = (TextView) findViewById(R.id.share_next);
483
        shareNext.setOnClickListener(this);
484
485
        et_serviceCost = (EditText) findViewById(R.id.et_serviceCost);
486
        et_remark = (EditText) findViewById(R.id.et_remarkclaim);
487
        et_remark = (EditText) findViewById(R.id.et_remarkclaim);
488
        zhanName = (EditText) findViewById(R.id.et_zhanName);
489
        fastNum = (EditText) findViewById(R.id.et_fastNum);
490
        slowNum = (EditText) findViewById(R.id.et_slowNum);
491
        parkCost = (EditText) findViewById(R.id.et_parkCost);
492
        chargeCost = (EditText) findViewById(R.id.et_chargeCost);
493
        chargeCostWay = findViewById(R.id.et_charge_cost_way); // 收费方式
494
        costWay = (TextView) findViewById(R.id.tv_costtype);
495
        telephone = findViewById(R.id.et_telephone);   // 运营商电话
496
        costWay.setOnClickListener(this);
497
        ib_loaction = (ImageView) findViewById(R.id.ib_location);
498
        ib_loaction.setOnClickListener(this);
499
500
        tv_notice = (RelativeLayout) findViewById(R.id.tv_notice);
501
        tv_notice.setOnClickListener(this);
502
503
        rg_claimtype = (RadioGroup) findViewById(R.id.rg_claimtype);
504
        rg_claimtype.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
505
            @Override
506
            public void onCheckedChanged(RadioGroup group, int checkedId) {
507
                if (checkedId == rb_guo.getId()) {
508
                    suit_car2 = "国标";
509
                }
510
                if (checkedId == rb_te.getId()) {
511
                    suit_car2 = "特斯拉";
512
                }
513
            }
514
        });
515
        rg_park = (RadioGroup) findViewById(R.id.rg_park);
516
        rg_park.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
517
            @Override
518
            public void onCheckedChanged(RadioGroup group, int checkedId) {
519
                if (checkedId == rb_shang.getId()) {
520
                    park = "1";
521
                }
522
                if (checkedId == rb_xia.getId()) {
523
                    park = "0";
524
                }
525
            }
526
        });
527
528
        rb_guo = (RadioButton) findViewById(R.id.rb_guo);
529
        rb_guo.setOnClickListener(this);
530
        rb_te = (RadioButton) findViewById(R.id.rb_te);
531
        rb_te.setOnClickListener(this);
532
533
        rb_shang = (RadioButton) findViewById(R.id.rb_shang);
534
        rb_shang.setOnClickListener(this);
535
        rb_xia = (RadioButton) findViewById(R.id.rb_xia);
536
        rb_xia.setOnClickListener(this);
537
538
        ivBack = (ImageView) findViewById(R.id.iv_back);
539
        ivBack.setOnClickListener(this);
540
541
        open_time = (TextView) findViewById(R.id.tv_prefect_start_time);
542
        open_time.setOnClickListener(this);
543
        close_time = (TextView) findViewById(R.id.tv_ferfect_time);
544
        close_time.setOnClickListener(this);
545
546
        et_share_address = (TextView) findViewById(R.id.et_share_address);
547
        zhuangType = (TextView) findViewById(R.id.tv_zhuangType);
548
        take_image_0 = findViewById(R.id.take_image_0);
549
        take_image_1 = findViewById(R.id.take_image_1);
550
        take_image_2 = findViewById(R.id.take_image_2);
551
        take_image_3 = findViewById(R.id.take_image_3);
552
553
        take_image_0.setOnClickListener(this);
554
        take_image_1.setOnClickListener(this);
555
        take_image_2.setOnClickListener(this);
556
        take_image_3.setOnClickListener(this);
557
558
        ImageView take_image_view_0 = findViewById(R.id.take_image_view_0);
559
        ImageView take_image_view_1 = findViewById(R.id.take_image_view_1);
560
        ImageView take_image_view_2 = findViewById(R.id.take_image_view_2);
561
        ImageView take_image_view_3 = findViewById(R.id.take_image_view_3);
562
        takeImageViewList.add(take_image_view_0);
563
        takeImageViewList.add(take_image_view_1);
564
        takeImageViewList.add(take_image_view_2);
565
        takeImageViewList.add(take_image_view_3);
566
567
        ImageView take_image_camera_0 = findViewById(R.id.take_image_camera_0);
568
        ImageView take_image_camera_1 = findViewById(R.id.take_image_camera_1);
569
        ImageView take_image_camera_2 = findViewById(R.id.take_image_camera_2);
570
        ImageView take_image_camera_3 = findViewById(R.id.take_image_camera_3);
571
        takeImageCameraList.add(take_image_camera_0);
572
        takeImageCameraList.add(take_image_camera_1);
573
        takeImageCameraList.add(take_image_camera_2);
574
        takeImageCameraList.add(take_image_camera_3);
575
576
    }
577
578
579
    @Override
580
    public void onClick(View v) {
581
        switch (v.getId()) {
582
            case R.id.take_image_0:
583
                selectIndex = 0;
584
                if (selectBitmap[0] == null) {
585
                    permissionTask();
586
                } else {
587
                    Intent intent = new Intent(ShareTwoEditActivity.this, ShareTwoPictureActivity.class);
588
                    intent.putExtra("selectIndex", selectIndex);
589
                    intent.putExtra("from", "edit");
590
                    startActivity(intent);
591
                }
592
                break;
593
            case R.id.take_image_1:
594
                selectIndex = 1;
595
                if (selectBitmap[1] == null) {
596
                    permissionTask();
597
                } else {
598
                    Intent intent = new Intent(ShareTwoEditActivity.this, ShareTwoPictureActivity.class);
599
                    intent.putExtra("selectIndex", selectIndex);
600
                    intent.putExtra("from", "edit");
601
                    startActivity(intent);
602
                }
603
                break;
604
            case R.id.take_image_2:
605
                selectIndex = 2;
606
                if (selectBitmap[2] == null) {
607
                    permissionTask();
608
                } else {
609
                    Intent intent = new Intent(ShareTwoEditActivity.this, ShareTwoPictureActivity.class);
610
                    intent.putExtra("selectIndex", selectIndex);
611
                    intent.putExtra("from", "edit");
612
                    startActivity(intent);
613
                }
614
                break;
615
            case R.id.take_image_3:
616
                selectIndex = 3;
617
                if (selectBitmap[3] == null) {
618
                    permissionTask();
619
                } else {
620
                    Intent intent = new Intent(ShareTwoEditActivity.this, ShareTwoPictureActivity.class);
621
                    intent.putExtra("selectIndex", selectIndex);
622
                    intent.putExtra("from", "edit");
623
                    startActivity(intent);
624
                }
625
                break;
626
            case R.id.iv_chakan:
627
                new ShareDialog(this).builder()
628
                        .setCancelable(true)
629
                        .show();
630
                break;
631
            case R.id.ll_address:
632
                startActivity(new Intent(ShareTwoEditActivity.this, ShareMapActivity.class));
633
                break;
634
            case R.id.rb_guo:
635
                rb_guo.setBackgroundResource(R.drawable.icon_guoselected1105);
636
                rb_te.setBackgroundResource(R.drawable.icon_tenormal1105);
637
                break;
638
639
            case R.id.rb_te:
640
                rb_guo.setBackgroundResource(R.drawable.icon_guonormal1105);
641
                rb_te.setBackgroundResource(R.drawable.icon_teselected1105);
642
                break;
643
644
            case R.id.rb_shang:
645
                rb_shang.setBackgroundResource(R.drawable.icon_shangselected1105);
646
                rb_xia.setBackgroundResource(R.drawable.icon_xianormal1105);
647
                break;
648
649
            case R.id.rb_xia:
650
                rb_shang.setBackgroundResource(R.drawable.icon_shangnormal1105);
651
                rb_xia.setBackgroundResource(R.drawable.icon_xiaselected1105);
652
                break;
653
654
            case R.id.tv_notice:
655
                tv_notice.setVisibility(View.GONE);
656
                break;
657
658
            case R.id.tv_costtype:
659
                startActivity(new Intent(ShareTwoEditActivity.this, ChargeCostWayActivity.class));
660
                break;
661
            case R.id.share_next: // 立即提交
662
                if (!checkPictureOk()) {
663
                } else if (et_share_address.getText().toString().equals("")) {
664
                    Toast.makeText(this, "请选择充电站地址", Toast.LENGTH_SHORT).show();
665
                } else if (zhanName.getText().toString().equals("")) {
666
                    Toast.makeText(this, "请填写名称", Toast.LENGTH_SHORT).show();
667
                } else if (fastNum.getText().toString().equals("") && slowNum.getText().toString().equals("")) {
668
                    Toast.makeText(this, "请填写桩数量", Toast.LENGTH_SHORT).show();
669
                } else if (chargeCost.getText().toString().equals("")) {
670
                    Toast.makeText(this, "请填写充电费", Toast.LENGTH_SHORT).show();
671
                } else if (chargeCostWay.getText().toString().equals("")) {
672
                    Toast.makeText(this, "请填写收费方式", Toast.LENGTH_SHORT).show();
673
                } else if (et_serviceCost.getText().toString().equals("")) {
674
                    Toast.makeText(this, "请填写服务费", Toast.LENGTH_SHORT).show();
675
                } else if (parkCost.getText().toString().equals("")) {
676
                    Toast.makeText(this, "请填写停车费", Toast.LENGTH_SHORT).show();
677
                } else if (costWay.getText().toString().equals("")) {
678
                    Toast.makeText(this, "请选择运营商", Toast.LENGTH_SHORT).show();
679
                } else if (telephone.getText().toString().equals("")) {
680
                    Toast.makeText(this, "请填写运营商电话", Toast.LENGTH_SHORT).show();
681
                } else {
682
                    if (fastNum.getText().toString().equals("") && !slowNum.getText().toString().equals("")) {
683
                        fastNum.setText("0");
684
                    }
685
                    if (!fastNum.getText().toString().equals("") && slowNum.getText().toString().equals("")) {
686
                        slowNum.setText("0");
687
                    }
688
                    if (open_time.getText().toString().equals("")) {
689
                        open_time.setText("00:00");
690
                    }
691
                    if (close_time.getText().toString().equals("")) {
692
                        close_time.setText("24:00");
693
                    }
694
695
                    if (pd_info == null) {
696
                        pd_info = CustomProgressDialog.createDialog(mContext);
697
                    }
698
699
                    pd_info.setMessage(mContext.getResources().getString(R.string.version_updating));
700
                    pd_info.show();
701
702
                    new Thread(new Runnable() {
703
                        @Override
704
                        public void run() {
705
                            try {
706
                                shite("");
707
708
                            } catch (Exception e) {
709
                                e.printStackTrace();
710
                            }
711
                        }
712
                    }).start();
713
                }
714
715
                break;
716
717
            case R.id.tv_prefect_start_time:
718
                if (tpd_open == null) {
719
                    TimePickerDialog.OnTimeSetListener otsl = new TimePickerDialog.OnTimeSetListener() {
720
                        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
721
                            open_time.setText(((hourOfDay < 10 ? 0 + "" + hourOfDay : hourOfDay) + ":" + (minute < 10 ? 0 + "" + minute : minute)).toString());
722
                            //close_time.setText(((hourOfDay < 10 ? 0 +""+ hourOfDay : hourOfDay)+":"+(minute<10?0+""+minute:minute)).toString());
723
                            tpd_open.dismiss();
724
                        }
725
                    };
726
                    Calendar calendar = Calendar.getInstance(TimeZone.getDefault());
727
                    int hourOfDay = calendar.get(Calendar.HOUR_OF_DAY);
728
                    int minute = calendar.get(Calendar.MINUTE);
729
                    tpd_open = new TimePickerDialog(this, otsl, hourOfDay, minute, true);
730
                }
731
                tpd_open.show();
732
                break;
733
            case R.id.tv_ferfect_time:
734
                if (tpd_close == null) {
735
                    TimePickerDialog.OnTimeSetListener otsl = new TimePickerDialog.OnTimeSetListener() {
736
                        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
737
                            close_time.setText(((hourOfDay < 10 ? 0 + "" + hourOfDay : hourOfDay) + ":" + (minute < 10 ? 0 + "" + minute : minute)).toString());
738
                            tpd_close.dismiss();
739
                        }
740
                    };
741
                    Calendar calendar = Calendar.getInstance(TimeZone.getDefault());
742
                    int hourOfDay = calendar.get(Calendar.HOUR_OF_DAY);
743
                    int minute = calendar.get(Calendar.MINUTE);
744
                    tpd_close = new TimePickerDialog(this, otsl, hourOfDay, minute, true);
745
                }
746
                tpd_close.show();
747
                break;
748
            case R.id.iv_back:
749
                SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
750
                sharedPreferencesUtil.setFileName("shareInfo");
751
                sharedPreferencesUtil.clearData();
752
                finish();
753
                break;
754
        }
755
    }
756
757
    private boolean checkPictureOk() {
758
759
        if (selectBitmap[0] == null) {
760
            Toast.makeText(this, "请上传建筑或小区图片", Toast.LENGTH_SHORT).show();
761
            return false;
762
        }
763
764
        if (selectBitmap[1] == null) {
765
            Toast.makeText(this, "请上传站点图片", Toast.LENGTH_SHORT).show();
766
            return false;
767
        }
768
769
        if (selectBitmap[2] == null) {
770
            Toast.makeText(this, "请上传充电桩图片", Toast.LENGTH_SHORT).show();
771
            return false;
772
        }
773
774
775
        return true;
776
    }
777
778
779
    public boolean onKeyDown(int keyCode, KeyEvent event) {
780
        if (keyCode == KeyEvent.KEYCODE_BACK) {
781
            SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
782
            sharedPreferencesUtil.setFileName("shareInfo");
783
            sharedPreferencesUtil.clearData();
784
            finish();
785
        }
786
        return false;
787
788
    }
789
790
791
    private void submitShowMap(String sms) {
792
793
        Log.e("url", sms);
794
        Request request = new Request.Builder().url(sms).build();
795
        Response response = null;
796
        try {
797
            if (request == null) {
798
                Message msg = new Message();
799
                msg.what = 3;
800
                handler.sendMessage(msg);
801
                return;
802
            }
803
            response = OkHttpUtil.execute(request);
804
            if (response.code() == 200) {
805
                String json = "";
806
                try {
807
                    json = response.body().string();
808
                    Message msg = new Message();
809
                    msg.obj = json;
810
                    msg.what = 5;
811
                    handler.sendMessage(msg);
812
                    Log.e("url", json);
813
                } catch (Exception e) {
814
                    e.printStackTrace();
815
                    Message msg = new Message();
816
                    msg.what = 3;
817
                    handler.sendMessage(msg);
818
                }
819
            }
820
        } catch (Exception e) {
821
            e.printStackTrace();
822
            Message msg = new Message();
823
            msg.what = 3;
824
            handler.sendMessage(msg);
825
        }
826
    }
827
828
    private String bitmapToBase64(Bitmap bitmap) {
829
830
        String result = null;
831
        ByteArrayOutputStream baos = null;
832
        try {
833
            if (bitmap != null) {
834
                baos = new ByteArrayOutputStream();
835
                bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
836
                baos.flush();
837
                baos.close();
838
                byte[] bitmapBytes = baos.toByteArray();
839
                result = Base64.encodeToString(bitmapBytes, Base64.DEFAULT);
840
            }
841
        } catch (IOException e) {
842
            e.printStackTrace();
843
        } finally {
844
            try {
845
                if (baos != null) {
846
                    baos.flush();
847
                    baos.close();
848
                }
849
            } catch (IOException e) {
850
                e.printStackTrace();
851
            }
852
        }
853
        return result;
854
    }
855
856
857
    public static String roundByScale(double v, int scale) {
858
        if (scale < 0) {
859
            throw new IllegalArgumentException(
860
                    "The   scale   must   be   a   positive   integer   or   zero");
861
        }
862
        if (scale == 0) {
863
            return new DecimalFormat("0").format(v);
864
        }
865
        String formatStr = "0.";
866
        for (int i = 0; i < scale; i++) {
867
            formatStr = formatStr + "0";
868
        }
869
        return new DecimalFormat(formatStr).format(v);
870
    }
871
872
873
    public void shite(String s) throws Exception {
874
875
876
        Map<String, String> par = new HashMap<String, String>();
877
        String file;
878
        long appTime1 = System.currentTimeMillis() / 1000;
879
        Log.i("appTime(long)---", appTime1 + "");
880
        long updatetime = appTime1 - MainMapActivity.cha;
881
        Log.i("updatetime(long)---", updatetime + "");
882
        Log.i("cha---", MainMapActivity.cha + "");
883
        String token = String.valueOf(updatetime);
884
        Log.i("token---", token);
885
886
        if (selectBitmap[0] == null || selectBitmap[1] == null || selectBitmap[2] == null) {
887
            isTakePhoto = true;
888
        }
889
890
        if (isTakePhoto) {
891
            for (int i = 0; i < selectBitmap.length; i++) {
892
                if (selectBitmap[i] != null) {
893
                    try {
894
                        bm = imageZoom(selectBitmap[i].getBitmap());
895
                        file = bitmapToBase64(bm);
896
                        par.put("file" + (i + 1), file);
897
                        par.put("filename" + (i + 1), "androidapp.jpg");
898
                    } catch (Exception e) {
899
                        e.printStackTrace();
900
                    }
901
                }
902
            }
903
        }
904
905
        par.put("id", recordId);
906
        par.put("zhan_name", zhanName.getText().toString());
907
        par.put("zhan_id", zhanId);
908
        par.put("user_id", MainApplication.userId);
909
        par.put("zhan_address", et_share_address.getText().toString());
910
911
        String jingg = roundByScale(Double.parseDouble(jing), 16);
912
        String weii = roundByScale(Double.parseDouble(wei), 16);
913
        par.put("poi_jing", jingg);
914
        par.put("poi_wei", weii);
915
        par.put("total_num", "");
916
        par.put("fast_num", fastNum.getText().toString());
917
        par.put("slow_num", slowNum.getText().toString());
918
        par.put("open_object", "");
919
        par.put("charges", "");
920
        par.put("stop_cost", parkCost.getText().toString());
921
        par.put("stop_cost_way", "");
922
        par.put("charge_cost", chargeCost.getText().toString());
923
        par.put("charge_cost_way", "");
924
        par.put("telephone", telephone.getText().toString());
925
        par.put("charge_cost_way", chargeCostWay.getText().toString());
926
        par.put("other_cost", et_serviceCost.getText().toString());
927
        par.put("zhuang_produce", "");
928
        par.put("remarks", et_remark.getText().toString());
929
        Log.e("remarks", et_remark.getText().toString());
930
        par.put("city", "");
931
        par.put("supplier", costWay.getText().toString());
932
        par.put("facilities_classify", "");
933
        par.put("belong_attribute", "");
934
        par.put("operation_state", "");
935
        par.put("work_open", open_time.getText().toString());
936
        par.put("work_close", close_time.getText().toString());
937
        par.put("holiday_open", "");
938
        par.put("holiday_close", "");
939
        par.put("company_name", "");
940
        par.put("person_name", "");
941
        par.put("zhuang_num", "");
942
        par.put("zy_num", "");
943
        par.put("suit_car", suit_car2);
944
        par.put("park_location", park);
945
        par.put("token", DES3.encode(token));
946
        try {
947
            String u = UploadUtil.post(MainApplication.url + "/zhannew/basic/web/index.php/zhanlist/add", par, null);
948
            Message msg = new Message();
949
            msg.obj = u;
950
            msg.what = 2;
951
            handler.sendMessage(msg);
952
        } catch (IOException e) {
953
            e.printStackTrace();
954
        }
955
    }
956
957
    @Override
958
    public void onRequestPermissionsResult(int requestCode,
959
                                           @NonNull String[] permissions,
960
                                           @NonNull int[] grantResults) {
961
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
962
963
        // EasyPermissions handles the request result.
964
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
965
    }
966
967
    @Override
968
    public void onPermissionsGranted(int requestCode, List<String> perms) {
969
970
    }
971
972
    @Override
973
    public void onPermissionsDenied(int requestCode, List<String> perms) {
974
975
    }
976
977
    @AfterPermissionGranted(RC_ALBUM_PERM)
978
    public void permissionTask() {
979
        if (isPermissionOK()) {
980
            callGallery();
981
        } else {
982
            // Ask for one permission
983
            EasyPermissions.requestPermissions(
984
                    this, "充电桩想要获取您的图片读取权限,是否允许?",
985
                    RC_ALBUM_PERM,
986
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
987
                    Manifest.permission.READ_EXTERNAL_STORAGE);
988
        }
989
    }
990
991
    private boolean isPermissionOK() {
992
        return EasyPermissions.hasPermissions(this,
993
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
994
                Manifest.permission.READ_EXTERNAL_STORAGE
995
        );
996
    }
997
998
999
    public String getString(String s) {
1000
        String path = null;
1001
        if (s == null)
1002
            return "";
1003
        for (int i = s.length() - 1; i > 0; i++) {
1004
            s.charAt(i);
1005
        }
1006
        return path;
1007
    }
1008
1009
    protected void onRestart() {
1010
        super.onRestart();
1011
    }
1012
1013
    private static final int TAKE_PICTURE = 0x000001;
1014
1015
    public void photo() {
1016
        if (hasSdcard()) {
1017
            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
1018
            Uri photoURI = FileProvider.getUriForFile(getApplicationContext(), getApplicationContext().getPackageName() + ".provider", tempFile);
1019
            intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
1020
            startActivityForResult(intent, PHOTO_REQUEST_CAMERA);
1021
        }
1022
    }
1023
1024
1025
    @Override
1026
    protected void onDestroy() {
1027
        super.onDestroy();
1028
    }
1029
1030
1031
    private Bitmap compressBmpFromBmp(Bitmap image) {
1032
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
1033
        int options = 100;
1034
        image.compress(Bitmap.CompressFormat.JPEG, 60, baos);
1035
        while (baos.toByteArray().length / 1024 > 200) {
1036
            baos.reset();
1037
            options -= 10;
1038
            image.compress(Bitmap.CompressFormat.JPEG, options, baos);
1039
        }
1040
        ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());
1041
        Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, null);
1042
        return bitmap;
1043
    }
1044
1045
1046
    private void crop(Uri uri, Uri cutImgUri) {
1047
        Intent intent = new Intent("com.android.camera.action.CROP");
1048
        intent.setDataAndType(uri, "image/*");
1049
        intent.putExtra("crop", "true");
1050
        intent.putExtra("outputFormat", "JPEG");
1051
        intent.putExtra("noFaceDetection", true);
1052
        intent.putExtra("return-data", false);
1053
        intent.putExtra(MediaStore.EXTRA_OUTPUT, cutImgUri);
1054
        startActivityForResult(intent, PHOTO_REQUEST_CUT);
1055
    }
1056
1057
    private boolean hasSdcard() {
1058
        if (Environment.getExternalStorageState().equals(
1059
                Environment.MEDIA_MOUNTED)) {
1060
            return true;
1061
        } else {
1062
            return false;
1063
        }
1064
    }
1065
1066
    private static String getPath(String path) {
1067
        File f = new File(path);
1068
        if (!f.exists()) {
1069
            f.mkdirs();
1070
        }
1071
        return f.getAbsolutePath();
1072
    }
1073
1074
    private File getFile(String path) {
1075
        File f = new File(path);
1076
        if (!f.exists()) {
1077
            try {
1078
                f.createNewFile();
1079
            } catch (IOException e) {
1080
                e.printStackTrace();
1081
            }
1082
        }
1083
        return f;
1084
    }
1085
1086
1087
    private Bitmap compressImage(Bitmap image) {
1088
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
1089
        image.compress(Bitmap.CompressFormat.JPEG, 80, baos);//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中
1090
        int options = 70;
1091
        while (baos.toByteArray().length / 1024 > 300) {    //循环判断如果压缩后图片是否大于100kb,大于继续压缩
1092
            baos.reset();//重置baos即清空baos
1093
            options -= 10;//每次都减少10
1094
            image.compress(Bitmap.CompressFormat.JPEG, options, baos);//这里压缩options%,把压缩后的数据存放到baos中
1095
1096
        }
1097
        ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());//把压缩后的数据baos存放到ByteArrayInputStream中
1098
        Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, null);//把ByteArrayInputStream数据生成图片
1099
        return bitmap;
1100
    }
1101
1102
    private Bitmap imageZoom(Bitmap bm) {
1103
        // 图片允许最大空间 单位:KB
1104
        double maxSize = 200.00;
1105
        // 将bitmap放至数组中,意在bitmap的大小(与实际读取的原文件要大)
1106
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
1107
        bm.compress(Bitmap.CompressFormat.JPEG, 100, baos);
1108
        byte[] b = baos.toByteArray();
1109
        // 将字节换成KB
1110
        double mid = b.length / 1024;
1111
        // 判断bitmap占用空间是否大于允许最大空间 如果大于则压缩 小于则不压缩
1112
        if (mid > maxSize) {
1113
            // 获取bitmap大小 是允许最大大小的多少倍
1114
            double i = mid / maxSize;
1115
            // 开始压缩 此处用到平方根 将宽带和高度压缩掉对应的平方根倍
1116
            // (1.保持刻度和高度和原bitmap比率一致,压缩后也达到了最大大小占用空间的大小)
1117
            bm = zoomImage(bm, bm.getWidth() / Math.sqrt(i), bm.getHeight()
1118
                    / Math.sqrt(i));
1119
        }
1120
1121
1122
        return bm;
1123
    }
1124
1125
    public Bitmap zoomImage(Bitmap bgimage, double newWidth, double newHeight) {
1126
        // 获取这个图片的宽和高
1127
        float width = bgimage.getWidth();
1128
        float height = bgimage.getHeight();
1129
        // 创建操作图片用的matrix对象
1130
        Matrix matrix = new Matrix();
1131
        // 计算宽高缩放率
1132
        float scaleWidth = ((float) newWidth) / width;
1133
        float scaleHeight = ((float) newHeight) / height;
1134
        // 缩放图片动作
1135
        matrix.postScale(scaleWidth, scaleHeight);
1136
        Bitmap bitmap = Bitmap.createBitmap(bgimage, 0, 0, (int) width,
1137
                (int) height, matrix, true);
1138
        return bitmap;
1139
    }
1140
1141
    @Override
1142
    protected void onResume() {
1143
        super.onResume();
1144
        SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
1145
        sharedPreferencesUtil.setFileName("shareInfo");
1146
        jing = sharedPreferencesUtil.getString("poi_jing", "");
1147
        wei = sharedPreferencesUtil.getString("poi_wei", "");
1148
1149
        for (int i = 0; i < selectBitmap.length; i++) {
1150
            ImageItem imageItem = selectBitmap[i];
1151
            if (imageItem == null) {
1152
                takeImageCameraList.get(i).setVisibility(View.VISIBLE);
1153
                ImageView takeImageView = takeImageViewList.get(i);
1154
                takeImageView.setImageResource(Res.getDrawableID("add_picture_" + (i + 1)));
1155
                takeImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
1156
1157
                ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams) takeImageView.getLayoutParams();
1158
                lp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
1159
                lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
1160
                takeImageView.setLayoutParams(lp);
1161
1162
            } else {
1163
                takeImageCameraList.get(i).setVisibility(View.GONE);
1164
            }
1165
        }
1166
1167
    }
1168
1169
    private void getZhanInfo() {
1170
        try {
1171
            long appTime1 = System.currentTimeMillis() / 1000;
1172
            long updatetime = appTime1 - MainMapActivity.cha - 3;
1173
            String token = String.valueOf(updatetime);
1174
            final String replace = URLEncoder.encode(DES3.encode(token));
1175
            String url = MainApplication.url + "/zhannew/basic/web/index.php/zhanlist/getdeny?zhan_id=" + zhanId
1176
                    + "&token=" + replace;
1177
            OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1178
                @Override
1179
                public void onError(Call call, Exception e) {
1180
                    dismissDialog();
1181
                    ToastUtil.showToast(getApplicationContext(), "网络异常,请检查您的网络连接", Toast.LENGTH_SHORT);
1182
                    CrashReport.postCatchedException(e);
1183
                    finish();
1184
                }
1185
1186
                @Override
1187
                public void onResponse(String response) {
1188
                    dismissDialog();
1189
                    String info = JsonUtils.getKeyResult(response, "info");
1190
                    String pic = JsonUtils.getKeyResult(response, "pic");
1191
                    if (info != null && !info.equals("")) {
1192
                        initZhanInfo(info, pic);
1193
                    } else {
1194
                        showTextToast("获取站点信息错误");
1195
                        finish();
1196
                    }
1197
                }
1198
            });
1199
        } catch (Exception e) {
1200
            e.printStackTrace();
1201
        }
1202
    }
1203
1204
    private void initZhanInfo(String info, String pic) {
1205
        try {
1206
            JSONObject jsonObject = new JSONObject(info);
1207
            recordId = jsonObject.getString("id");
1208
            zhanName.setText(jsonObject.getString("zhan_name"));
1209
            et_share_address.setText(jsonObject.getString("zhan_address"));
1210
            suit_car2 = jsonObject.getString("suit_car");
1211
            if ("特斯拉".equals(suit_car2)) {
1212
                rb_guo.setBackgroundResource(R.drawable.icon_guonormal1105);
1213
                rb_te.setBackgroundResource(R.drawable.icon_teselected1105);
1214
            } else {
1215
                rb_guo.setBackgroundResource(R.drawable.icon_guoselected1105);
1216
                rb_te.setBackgroundResource(R.drawable.icon_tenormal1105);
1217
            }
1218
1219
            fastNum.setText(jsonObject.getString("fast_num"));
1220
            slowNum.setText(jsonObject.getString("slow_num"));
1221
            chargeCost.setText(jsonObject.getString("charge_cost"));
1222
            et_serviceCost.setText(jsonObject.getString("other_cost"));
1223
            chargeCostWay.setText(jsonObject.getString("charge_cost_way"));
1224
            parkCost.setText(jsonObject.getString("stop_cost"));
1225
            costWay.setText(jsonObject.getString("supplier"));
1226
            telephone.setText(jsonObject.getString("telephone"));
1227
1228
            park = jsonObject.getString("park_location");
1229
            if ("1".equals(park)) {
1230
                rb_shang.setBackgroundResource(R.drawable.icon_shangselected1105);
1231
                rb_xia.setBackgroundResource(R.drawable.icon_xianormal1105);
1232
            } else {
1233
                rb_shang.setBackgroundResource(R.drawable.icon_shangnormal1105);
1234
                rb_xia.setBackgroundResource(R.drawable.icon_xiaselected1105);
1235
            }
1236
1237
            open_time.setText(jsonObject.getString("work_open"));
1238
            close_time.setText(jsonObject.getString("work_close"));
1239
1240
            SharedPreferences mSharedPreferences = getSharedPreferences("shareInfo", Activity.MODE_PRIVATE);
1241
            SharedPreferences.Editor editor = mSharedPreferences.edit();
1242
            editor.putString("poi_jing", jsonObject.getString("poi_jing"));
1243
            editor.putString("poi_wei", jsonObject.getString("poi_wei"));
1244
            editor.commit();
1245
1246
            jing = jsonObject.getString("poi_jing");
1247
            wei = jsonObject.getString("poi_wei");
1248
1249
            et_remark.setText(jsonObject.getString("remarks"));
1250
1251
1252
        } catch (Exception e) {
1253
            e.printStackTrace();
1254
            showTextToast("获取站点信息错误");
1255
        }
1256
1257
        try {
1258
            JSONArray jsonArray = new JSONArray(pic);
1259
            for (int i = 0; i < jsonArray.length(); i++) {
1260
                JSONObject jo = new JSONObject(jsonArray.get(i).toString());
1261
                String url = jo.get("url").toString();
1262
                int finalI = i;
1263
                Glide.with(this).load(MainApplication.url + "/zhannew/uploadfile/" + url).listener(new RequestListener<Drawable>() {
1264
                    @Override
1265
                    public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
1266
                        return false;
1267
                    }
1268
1269
                    @Override
1270
                    public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
1271
                        takeImageCameraList.get(finalI).setVisibility(View.GONE);
1272
                        ImageView iv = takeImageViewList.get(finalI);
1273
                        iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
1274
                        ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams) iv.getLayoutParams();
1275
                        lp.width = DensityUtil.dip2px(ShareTwoEditActivity.this, 82);
1276
                        lp.height = DensityUtil.dip2px(ShareTwoEditActivity.this, 70);
1277
                        iv.setLayoutParams(lp);
1278
                        new Handler().postDelayed(new Runnable() {
1279
                            @Override
1280
                            public void run() {
1281
                                BitmapDrawable drawable = (BitmapDrawable) iv.getDrawable();
1282
                                Bitmap bitmap = drawable.getBitmap();
1283
                                ImageItem takePhoto = new ImageItem();
1284
                                takePhoto.setBitmap(bitmap);
1285
                                selectBitmap[finalI] = takePhoto;
1286
                            }
1287
                        }, 500);// 0.5秒后,执行
1288
                        return false;
1289
                    }
1290
                }).into(takeImageViewList.get(i));
1291
            }
1292
1293
1294
        } catch (Exception e) {
1295
            e.printStackTrace();
1296
        }
1297
    }
1298
}

+ 14 - 2
app/src/main/java/com/electric/chargingpile/activity/ShareTwoPictureActivity.java

@ -14,6 +14,7 @@ public class ShareTwoPictureActivity extends AppCompatActivity {
14 14
    private TextView gallery_del;
15 15
    private int selectIndex;
16 16
    private ImageView picture;
17
    private String from;
17 18
18 19
    @Override
19 20
    protected void onCreate(Bundle savedInstanceState) {
@ -24,9 +25,15 @@ public class ShareTwoPictureActivity extends AppCompatActivity {
24 25
25 26
    private void initView() {
26 27
        selectIndex = getIntent().getIntExtra("selectIndex", 0);
28
        from = getIntent().getStringExtra("from");
27 29
        picture = findViewById(R.id.picture);
28 30
29
        picture.setImageBitmap(ShareTwoActivity.selectBitmap[selectIndex].getBitmap());
31
        if ("edit".equals(from)) {
32
            picture.setImageBitmap(ShareTwoEditActivity.selectBitmap[selectIndex].getBitmap());
33
        } else {
34
            picture.setImageBitmap(ShareTwoActivity.selectBitmap[selectIndex].getBitmap());
35
        }
36
30 37
        gallery_icon = findViewById(R.id.gallery_icon);
31 38
        gallery_icon.setOnClickListener(new View.OnClickListener() {
32 39
            @Override
@ -38,7 +45,12 @@ public class ShareTwoPictureActivity extends AppCompatActivity {
38 45
        gallery_del.setOnClickListener(new View.OnClickListener() {
39 46
            @Override
40 47
            public void onClick(View v) {
41
                ShareTwoActivity.selectBitmap[selectIndex] = null;
48
                if ("edit".equals(from)) {
49
                    ShareTwoEditActivity.selectBitmap[selectIndex] = null;
50
                } else {
51
                    ShareTwoActivity.selectBitmap[selectIndex] = null;
52
                }
53
42 54
                finish();
43 55
            }
44 56
        });

+ 41 - 62
app/src/main/java/com/electric/chargingpile/adapter/ShareListAdapter.java

@ -1,10 +1,10 @@
1 1
package com.electric.chargingpile.adapter;
2 2
3
import android.util.Log;
4 3
import android.view.LayoutInflater;
5 4
import android.view.View;
6 5
import android.view.ViewGroup;
7 6
import android.widget.BaseAdapter;
7
import android.widget.LinearLayout;
8 8
import android.widget.TextView;
9 9
10 10
import com.electric.chargingpile.R;
@ -21,8 +21,13 @@ import java.util.Date;
21 21
 */
22 22
public class ShareListAdapter extends BaseAdapter {
23 23
    private ArrayList<JSONObject> datas;
24
    private OnEditListener editListener;
24 25
25 26
27
    public void setEditListener(OnEditListener editListener) {
28
        this.editListener = editListener;
29
    }
30
26 31
    public ShareListAdapter(ArrayList<JSONObject> datas) {
27 32
        setData(datas);
28 33
    }
@ -68,20 +73,26 @@ public class ShareListAdapter extends BaseAdapter {
68 73
        if (holder == null) {
69 74
            holder = new ViewHolder();
70 75
71
            holder.tv_shareName = (TextView) convertView
72
                    .findViewById(R.id.tv_shareName);
73
            holder.tv_shareAddress = (TextView) convertView
74
                    .findViewById(R.id.tv_shareAddress);
75
            holder.tv_shareTime = (TextView) convertView
76
                    .findViewById(R.id.tv_shareTime);
77
//            holder.tv_id = (TextView) convertView.findViewById(R.id.tv_id);
76
            holder.tv_shareName = (TextView) convertView.findViewById(R.id.tv_shareName);
77
            holder.tv_shareAddress = (TextView) convertView.findViewById(R.id.tv_shareAddress);
78
            holder.tv_shareTime = (TextView) convertView.findViewById(R.id.tv_shareTime);
78 79
            holder.tv_shareState = (TextView) convertView.findViewById(R.id.tv_shareState);
80
            holder.tv_reason = convertView.findViewById(R.id.tv_reason);
81
            holder.tv_edit = convertView.findViewById(R.id.tv_edit);
82
            holder.tv_edit.setOnClickListener(new View.OnClickListener() {
83
                @Override
84
                public void onClick(View v) {
85
                    if (editListener != null) {
86
                        try {
87
                            editListener.edit(datas.get(position).getString("zhan_id"));
88
                        } catch (Exception e) {
89
                            e.printStackTrace();
90
                        }
91
                    }
92
                }
93
            });
79 94
80 95
81
//            holder.tv_write = (TextView) convertView
82
//                    .findViewById(R.id.tv_write);
83
//            holder.tv_claimState = (TextView) convertView
84
//                    .findViewById(R.id.tv_claimState);
85 96
        }
86 97
87 98
        if (holder != null && convertView != null) {
@ -90,17 +101,10 @@ public class ShareListAdapter extends BaseAdapter {
90 101
91 102
        {
92 103
            try {
93
                Log.i("zhan_name", datas.get(position).getString(
94
                        "zhan_name"));
95
                holder.tv_shareName.setText(datas.get(position).getString(
96
                        "zhan_name"));
97
//                holder.tv_id.setText(datas.get(position).getString(
98
//                        "zhan_id"));
99
                holder.tv_shareAddress.setText(datas.get(position).getString(
100
                        "zhan_address"));
104
                holder.tv_shareName.setText(datas.get(position).getString("zhan_name"));
105
                holder.tv_shareAddress.setText(datas.get(position).getString("zhan_address"));
101 106
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
102
                String date = sdf.format(new Date(Long.parseLong(datas.get(
103
                        position).getLong("inputtime") + "000")));
107
                String date = sdf.format(new Date(Long.parseLong(datas.get(position).getLong("inputtime") + "000")));
104 108
                holder.tv_shareTime.setText(date);
105 109
                if ((datas.get(position).getString("status")).equals("1")) {
106 110
                    holder.tv_shareState.setText("正在审核中");
@ -113,50 +117,19 @@ public class ShareListAdapter extends BaseAdapter {
113 117
                if ((datas.get(position).getString("status")).equals("3")) {
114 118
                    holder.tv_shareState.setText("信息不完善");
115 119
                    holder.tv_shareState.setTextColor(convertView.getResources().getColor(R.color.juhuang));
120
                    holder.tv_reason.setText("原因:" + datas.get(position).getString("deny_inf"));
121
                    holder.tv_reason.setVisibility(View.VISIBLE);
122
                    holder.tv_edit.setVisibility(View.VISIBLE);
123
                } else {
124
                    holder.tv_reason.setVisibility(View.GONE);
125
                    holder.tv_edit.setVisibility(View.GONE);
116 126
                }
127
117 128
                if ((datas.get(position).getString("status")).equals("0")) {
118 129
                    holder.tv_shareState.setText("添加未通过");
119 130
                    holder.tv_shareState.setTextColor(convertView.getResources().getColor(R.color.hongse));
120 131
                }
121 132
122
//                holder.tv_write.setTag((datas.get(
123
//                        position).getString("record_time")));
124
//                final String poi_jing = datas.get(position).getString("poi_jing");
125
//                final String poi_wei = datas.get(position).getString("poi_wei");
126
////                String zhan_id = datas.get(position).getString("zhan_id");
127
//                Log.i("!!!!!!!",poi_jing+"---"+poi_wei);
128
//                holder.tv_write.setOnClickListener(new View.OnClickListener() {
129
//                    @Override
130
//                    public void onClick(View view) {
131
//
132
//                            Intent intent = new Intent(view.getContext(), ClaimSurveyOneActivity.class);
133
//                            try {
134
//                                intent.putExtra("zhan_id", datas.get(position).getString("zhan_id"));
135
//                                Log.i("--------",datas.get(position).getString("zhan_id"));
136
//                                intent.putExtra("poi_jing",datas.get(position).getString("poi_jing"));
137
//                                Log.i("--------",datas.get(position).getString("poi_jing"));
138
//                                intent.putExtra("poi_wei",datas.get(position).getString("poi_wei"));
139
//                                Log.i("--------",datas.get(position).getString("poi_wei"));
140
//                            } catch (JSONException e) {
141
//                                e.printStackTrace();
142
//                            }
143
//                            view.getContext().startActivity(intent);
144
//                        }
145
//
146
//
147
//                });
148
//                taskStage = datas.get(position).getString("taskStage");
149
//                holder.tv_claimState.setTag((datas.get(
150
//                        position).getString("record_time")));
151
//                holder.tv_claimState.setOnClickListener(new View.OnClickListener() {
152
//                    @Override
153
//                    public void onClick(View view) {
154
////                        Toast.makeText(view.getContext(),"请等待后台审核您提交的数据",Toast.LENGTH_SHORT).show();
155
//                        Intent intent = new Intent(view.getContext(), ClaimStateActivity.class);
156
//                        intent.putExtra("taskStage",taskStage);
157
//                        view.getContext().startActivity(intent);
158
//                    }
159
//                });
160 133
            } catch (JSONException e) {
161 134
                e.printStackTrace();
162 135
            }
@ -166,8 +139,14 @@ public class ShareListAdapter extends BaseAdapter {
166 139
    }
167 140
168 141
    private class ViewHolder {
169
        TextView tv_shareName, tv_shareAddress, tv_shareTime, tv_shareState, tv_write, tv_claimState,
170
                tv_taskStage, tv_id, poi_jing, poi_wei;
142
        TextView tv_shareName, tv_shareAddress, tv_shareTime, tv_shareState, tv_reason;
143
        LinearLayout tv_edit;
171 144
    }
172 145
146
147
    public interface OnEditListener {
148
        void edit(String zhanId);
149
    }
150
151
173 152
}

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

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

+ 3 - 3
app/src/main/res/layout/activity_share_two.xml

@ -23,7 +23,7 @@
23 23
            android:layout_centerVertical="true"
24 24
            android:contentDescription="@null"
25 25
            android:paddingLeft="44px"
26

26
            android:paddingRight="44px"
27 27
            android:src="@drawable/icon_lvback1119" />
28 28

29 29
        <TextView
@ -770,7 +770,7 @@
770 770
                    android:layout_weight="5"
771 771
                    android:background="@color/white"
772 772
                    android:gravity="center|right"
773
                    android:hint="特来电APP"
773
                    android:hint="请填写充电收费方式"
774 774
                    android:inputType="text"
775 775
                    android:text=""
776 776
                    android:textColor="@color/ui_62"
@ -937,7 +937,7 @@
937 937
                    android:layout_weight="5"
938 938
                    android:background="@color/white"
939 939
                    android:gravity="center|right"
940
                    android:hint="请输入电话号码"
940
                    android:hint="请填写运营商电话"
941 941
                    android:inputType="text"
942 942
                    android:text=""
943 943
                    android:textColor="@color/ui_62"

+ 1126 - 0
app/src/main/res/layout/activity_share_two_edit.xml

@ -0,0 +1,1126 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<com.zhy.autolayout.AutoRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    android:id="@+id/claim"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    android:background="@color/activity_bgcolor"
8
    android:focusable="true"
9
    android:focusableInTouchMode="true">
10

11
    <com.zhy.autolayout.AutoRelativeLayout
12
        android:id="@+id/rl_title"
13
        android:layout_width="fill_parent"
14
        android:layout_height="130px"
15
        android:layout_alignParentTop="true"
16
        android:background="@color/title_background">
17

18
        <ImageView
19
            android:id="@+id/iv_back"
20
            android:layout_width="wrap_content"
21
            android:layout_height="match_parent"
22
            android:layout_alignParentLeft="true"
23
            android:layout_centerVertical="true"
24
            android:contentDescription="@null"
25
            android:paddingLeft="44px"
26
            android:paddingRight="44px"
27
            android:src="@drawable/icon_lvback1119" />
28

29
        <TextView
30
            android:id="@+id/textview"
31
            android:layout_width="wrap_content"
32
            android:layout_height="wrap_content"
33
            android:layout_centerInParent="true"
34
            android:text="编辑站点"
35
            android:textColor="@color/ui_62"
36
            android:textSize="16sp" />
37
    </com.zhy.autolayout.AutoRelativeLayout>
38

39
    <View
40
        android:layout_width="match_parent"
41
        android:layout_height="0.5dp"
42
        android:background="@color/ui_titleline"
43
        android:visibility="gone" />
44

45
    <RelativeLayout
46
        android:id="@+id/tv_notice"
47
        android:layout_width="match_parent"
48
        android:layout_height="38dp"
49
        android:background="@drawable/bg_notice1105"
50
        android:orientation="horizontal"
51
        android:visibility="gone">
52

53
        <TextView
54
            android:layout_width="wrap_content"
55
            android:layout_height="wrap_content"
56
            android:layout_centerHorizontal="true"
57
            android:layout_centerVertical="true"
58
            android:layout_gravity="center_horizontal"
59
            android:drawableRight="@drawable/icon_close1105"
60
            android:drawablePadding="16dp"
61
            android:text="轻点地图即可选取位置,添加未被收录的站点"
62
            android:textColor="#099234"
63
            android:textSize="14sp" />
64
    </RelativeLayout>
65

66

67
    <RelativeLayout
68
        android:layout_width="match_parent"
69
        android:layout_height="300dp"
70
        android:visibility="gone">
71

72

73
        <ImageView
74
            android:id="@+id/ib_location"
75
            android:layout_width="wrap_content"
76
            android:layout_height="wrap_content"
77
            android:layout_alignParentStart="true"
78
            android:layout_alignParentLeft="true"
79
            android:layout_alignParentBottom="true"
80
            android:layout_marginStart="8dp"
81
            android:layout_marginLeft="8dp"
82
            android:layout_marginBottom="32dp"
83
            android:background="@drawable/icon_location2_0" />
84

85
        <LinearLayout
86
            android:id="@+id/zoom_in_out"
87
            android:layout_width="wrap_content"
88
            android:layout_height="wrap_content"
89
            android:layout_alignBottom="@+id/iv_point_again"
90
            android:layout_alignParentEnd="true"
91
            android:layout_alignParentRight="true"
92
            android:layout_alignParentBottom="true"
93
            android:layout_marginEnd="8dp"
94
            android:layout_marginRight="8dp"
95
            android:layout_marginBottom="32dp"
96
            android:background="@color/transparent"
97
            android:orientation="vertical">
98

99
            <ImageView
100
                android:id="@+id/zoomin1"
101
                android:layout_width="wrap_content"
102
                android:layout_height="wrap_content"
103
                android:contentDescription="@null"
104
                android:src="@drawable/icon_jia2_0" />
105

106

107
            <ImageView
108
                android:id="@+id/zoomout1"
109
                android:layout_width="wrap_content"
110
                android:layout_height="wrap_content"
111
                android:contentDescription="@null"
112
                android:src="@drawable/icon_jian2_0" />
113
        </LinearLayout>
114

115

116
    </RelativeLayout>
117

118
    <View
119
        android:id="@+id/view_title"
120
        android:layout_width="match_parent"
121
        android:layout_height="0.5dp"
122
        android:layout_below="@+id/rl_title"
123
        android:background="@color/ui_titleline" />
124

125

126
    <ScrollView
127
        android:layout_width="match_parent"
128
        android:layout_height="match_parent"
129
        android:layout_above="@+id/share_next"
130
        android:layout_below="@+id/view_title">
131

132
        <com.zhy.autolayout.AutoLinearLayout
133
            android:layout_width="match_parent"
134
            android:layout_height="match_parent"
135
            android:background="@color/white"
136
            android:orientation="vertical">
137

138
            <com.zhy.autolayout.AutoLinearLayout
139
                android:id="@+id/ll_add_photo"
140
                android:layout_width="match_parent"
141
                android:layout_height="wrap_content"
142
                android:background="@color/bg_row"
143
                android:orientation="vertical"
144
                android:visibility="visible">
145

146
                <GridView
147
                    android:id="@+id/noScrollgridview"
148
                    android:layout_width="match_parent"
149
                    android:layout_height="wrap_content"
150
                    android:layout_marginLeft="16dp"
151
                    android:layout_marginTop="14dp"
152
                    android:layout_marginRight="16dp"
153
                    android:horizontalSpacing="3dp"
154
                    android:numColumns="4"
155
                    android:scrollbars="none"
156
                    android:verticalSpacing="5dp"
157
                    android:visibility="gone"></GridView>
158

159
                <LinearLayout
160
                    android:layout_width="match_parent"
161
                    android:layout_height="wrap_content"
162
                    android:layout_marginLeft="15dp"
163
                    android:layout_marginTop="10dp"
164
                    android:layout_marginRight="15dp"
165
                    android:orientation="horizontal">
166

167
                    <android.support.constraint.ConstraintLayout
168
                        android:id="@+id/take_image_0"
169
                        android:layout_width="0dp"
170
                        android:layout_height="wrap_content"
171
                        android:layout_marginLeft="2.5dp"
172
                        android:layout_marginRight="2.5dp"
173
                        android:layout_weight="1">
174

175
                        <ImageView
176
                            android:id="@+id/take_image_view_0"
177
                            android:layout_width="wrap_content"
178
                            android:layout_height="wrap_content"
179
                            android:src="@drawable/add_picture_1"
180
                            app:layout_constraintBottom_toBottomOf="parent"
181
                            app:layout_constraintLeft_toLeftOf="parent"
182
                            app:layout_constraintRight_toRightOf="parent"
183
                            app:layout_constraintTop_toTopOf="parent" />
184

185
                        <ImageView
186
                            android:id="@+id/take_image_camera_0"
187
                            android:layout_width="wrap_content"
188
                            android:layout_height="wrap_content"
189
                            android:layout_marginTop="5dp"
190
                            android:layout_marginRight="5dp"
191
                            android:src="@drawable/camera_icon"
192
                            app:layout_constraintRight_toRightOf="@+id/take_image_view_0"
193
                            app:layout_constraintTop_toTopOf="@+id/take_image_view_0" />
194

195

196
                    </android.support.constraint.ConstraintLayout>
197

198
                    <android.support.constraint.ConstraintLayout
199
                        android:id="@+id/take_image_1"
200
                        android:layout_width="0dp"
201
                        android:layout_height="wrap_content"
202
                        android:layout_marginLeft="2.5dp"
203
                        android:layout_marginRight="2.5dp"
204
                        android:layout_weight="1">
205

206
                        <ImageView
207
                            android:id="@+id/take_image_view_1"
208
                            android:layout_width="wrap_content"
209
                            android:layout_height="wrap_content"
210
                            android:src="@drawable/add_picture_2"
211
                            app:layout_constraintBottom_toBottomOf="parent"
212
                            app:layout_constraintLeft_toLeftOf="parent"
213
                            app:layout_constraintRight_toRightOf="parent"
214
                            app:layout_constraintTop_toTopOf="parent" />
215

216
                        <ImageView
217
                            android:id="@+id/take_image_camera_1"
218
                            android:layout_width="wrap_content"
219
                            android:layout_height="wrap_content"
220
                            android:layout_marginTop="5dp"
221
                            android:layout_marginRight="5dp"
222
                            android:src="@drawable/camera_icon"
223
                            app:layout_constraintRight_toRightOf="@+id/take_image_view_1"
224
                            app:layout_constraintTop_toTopOf="@+id/take_image_view_1" />
225
                    </android.support.constraint.ConstraintLayout>
226

227
                    <android.support.constraint.ConstraintLayout
228
                        android:id="@+id/take_image_2"
229
                        android:layout_width="0dp"
230
                        android:layout_height="wrap_content"
231
                        android:layout_marginLeft="2.5dp"
232
                        android:layout_marginRight="2.5dp"
233
                        android:layout_weight="1">
234

235
                        <ImageView
236
                            android:id="@+id/take_image_view_2"
237
                            android:layout_width="wrap_content"
238
                            android:layout_height="wrap_content"
239
                            android:src="@drawable/add_picture_3"
240
                            app:layout_constraintBottom_toBottomOf="parent"
241
                            app:layout_constraintLeft_toLeftOf="parent"
242
                            app:layout_constraintRight_toRightOf="parent"
243
                            app:layout_constraintTop_toTopOf="parent" />
244

245
                        <ImageView
246
                            android:id="@+id/take_image_camera_2"
247
                            android:layout_width="wrap_content"
248
                            android:layout_height="wrap_content"
249
                            android:layout_marginTop="5dp"
250
                            android:layout_marginRight="5dp"
251
                            android:src="@drawable/camera_icon"
252
                            app:layout_constraintRight_toRightOf="@+id/take_image_view_2"
253
                            app:layout_constraintTop_toTopOf="@+id/take_image_view_2" />
254
                    </android.support.constraint.ConstraintLayout>
255

256
                    <android.support.constraint.ConstraintLayout
257
                        android:id="@+id/take_image_3"
258
                        android:layout_width="0dp"
259
                        android:layout_height="wrap_content"
260
                        android:layout_marginLeft="2.5dp"
261
                        android:layout_marginRight="2.5dp"
262
                        android:layout_weight="1">
263

264
                        <ImageView
265
                            android:id="@+id/take_image_view_3"
266
                            android:layout_width="wrap_content"
267
                            android:layout_height="wrap_content"
268
                            android:src="@drawable/add_picture_4"
269
                            app:layout_constraintBottom_toBottomOf="parent"
270
                            app:layout_constraintLeft_toLeftOf="parent"
271
                            app:layout_constraintRight_toRightOf="parent"
272
                            app:layout_constraintTop_toTopOf="parent" />
273

274
                        <ImageView
275
                            android:id="@+id/take_image_camera_3"
276
                            android:layout_width="wrap_content"
277
                            android:layout_height="wrap_content"
278
                            android:layout_marginTop="5dp"
279
                            android:layout_marginRight="5dp"
280
                            android:src="@drawable/camera_icon"
281
                            app:layout_constraintRight_toRightOf="@+id/take_image_view_3"
282
                            app:layout_constraintTop_toTopOf="@+id/take_image_view_3" />
283

284
                    </android.support.constraint.ConstraintLayout>
285

286
                </LinearLayout>
287

288
                <RelativeLayout
289
                    android:layout_width="match_parent"
290
                    android:layout_height="wrap_content"
291
                    android:layout_marginLeft="44px"
292
                    android:layout_marginTop="8dp"
293
                    android:layout_marginRight="44px"
294
                    android:layout_marginBottom="8dp">
295

296
                    <TextView
297
                        android:layout_width="wrap_content"
298
                        android:layout_height="wrap_content"
299
                        android:layout_alignParentLeft="true"
300
                        android:layout_centerVertical="true"
301
                        android:text="照片规范:增加通过几率哦~"
302
                        android:textColor="@color/ui_68"
303
                        android:textSize="12sp" />
304

305
                    <ImageView
306
                        android:id="@+id/iv_chakan"
307
                        android:layout_width="wrap_content"
308
                        android:layout_height="wrap_content"
309
                        android:layout_alignParentRight="true"
310
                        android:layout_gravity="center"
311
                        android:src="@drawable/icon_chakan" />
312

313
                </RelativeLayout>
314

315

316
            </com.zhy.autolayout.AutoLinearLayout>
317

318
            <View
319
                android:layout_width="match_parent"
320
                android:layout_height="0.5dp"
321
                android:layout_marginLeft="44px"
322
                android:background="@color/ui_line" />
323

324
            <com.zhy.autolayout.AutoLinearLayout
325
                android:layout_width="match_parent"
326
                android:layout_height="139px"
327
                android:background="@color/bg_row"
328
                android:orientation="horizontal">
329

330
                <TextView
331
                    android:layout_width="wrap_content"
332
                    android:layout_height="wrap_content"
333
                    android:layout_centerInParent="true"
334
                    android:layout_marginLeft="44px"
335
                    android:layout_marginRight="8px"
336
                    android:text="*"
337
                    android:textColor="@color/xinghao"
338
                    android:textSize="15sp" />
339

340
                <TextView
341
                    android:layout_width="wrap_content"
342
                    android:layout_height="wrap_content"
343
                    android:text="站名称"
344
                    android:textColor="@color/ui_65"
345
                    android:textSize="15sp" />
346

347
                <EditText
348
                    android:id="@+id/et_zhanName"
349
                    android:layout_width="0dp"
350
                    android:layout_height="match_parent"
351
                    android:layout_marginLeft="10dp"
352
                    android:layout_marginRight="44px"
353
                    android:layout_weight="5"
354
                    android:background="@color/white"
355
                    android:editable="true"
356
                    android:gravity="center|right"
357
                    android:hint="请以地名或建筑命名"
358
                    android:singleLine="true"
359
                    android:text=""
360
                    android:textColor="@color/ui_62"
361
                    android:textColorHint="@color/ui_68"
362
                    android:textSize="15sp" />
363

364

365
            </com.zhy.autolayout.AutoLinearLayout>
366

367
            <View
368
                android:layout_width="match_parent"
369
                android:layout_height="0.5dp"
370
                android:layout_marginLeft="44px"
371
                android:background="@color/ui_line" />
372

373
            <com.zhy.autolayout.AutoRelativeLayout
374
                android:id="@+id/ll_address"
375
                android:layout_width="match_parent"
376
                android:layout_height="139px"
377
                android:background="@color/bg_row"
378
                android:orientation="horizontal">
379

380
                <TextView
381
                    android:id="@+id/textView25"
382
                    android:layout_width="wrap_content"
383
                    android:layout_height="wrap_content"
384
                    android:layout_alignParentStart="true"
385
                    android:layout_alignParentLeft="true"
386
                    android:layout_centerInParent="true"
387
                    android:layout_marginLeft="44px"
388
                    android:layout_marginRight="8px"
389
                    android:text="*"
390
                    android:textColor="@color/xinghao"
391
                    android:textSize="15sp" />
392

393
                <TextView
394
                    android:id="@+id/address"
395
                    android:layout_width="wrap_content"
396
                    android:layout_height="match_parent"
397
                    android:layout_alignParentTop="true"
398
                    android:layout_toEndOf="@+id/textView25"
399
                    android:layout_toRightOf="@+id/textView25"
400
                    android:gravity="center"
401
                    android:text="站地址"
402
                    android:textColor="@color/ui_65"
403
                    android:textSize="15sp" />
404

405

406
                <TextView
407
                    android:id="@+id/et_share_address"
408
                    style="?android:attr/textViewStyle"
409
                    android:layout_width="match_parent"
410
                    android:layout_height="match_parent"
411
                    android:layout_alignParentTop="true"
412
                    android:layout_alignParentEnd="true"
413
                    android:layout_alignParentRight="true"
414
                    android:layout_marginLeft="30px"
415
                    android:layout_marginEnd="16dp"
416
                    android:layout_marginRight="44px"
417
                    android:layout_toRightOf="@+id/address"
418
                    android:background="@null"
419
                    android:drawableRight="@drawable/icon_select"
420
                    android:drawablePadding="20px"
421
                    android:ellipsize="end"
422
                    android:gravity="center|right"
423
                    android:hint="请选择"
424
                    android:singleLine="true"
425
                    android:text=""
426
                    android:textColor="@color/ui_62"
427
                    android:textColorHint="@color/ui_68"
428
                    android:textSize="15sp" />
429

430

431
            </com.zhy.autolayout.AutoRelativeLayout>
432

433
            <View
434
                android:layout_width="match_parent"
435
                android:layout_height="0.5dp"
436
                android:layout_marginLeft="16dp"
437
                android:background="@color/Line" />
438

439
            <com.zhy.autolayout.AutoRelativeLayout
440
                android:id="@+id/ll_type"
441
                android:layout_width="match_parent"
442
                android:layout_height="139px"
443
                android:background="@drawable/click_effect">
444

445
                <TextView
446
                    android:id="@+id/textView18"
447
                    android:layout_width="wrap_content"
448
                    android:layout_height="wrap_content"
449
                    android:layout_alignTop="@+id/textView19"
450
                    android:layout_alignParentStart="true"
451
                    android:layout_alignParentLeft="true"
452
                    android:layout_centerInParent="true"
453
                    android:layout_marginLeft="44px"
454
                    android:layout_marginRight="8px"
455
                    android:text="*"
456
                    android:textColor="@color/xinghao"
457
                    android:textSize="15sp" />
458

459
                <TextView
460
                    android:id="@+id/textView19"
461
                    android:layout_width="wrap_content"
462
                    android:layout_height="wrap_content"
463
                    android:layout_centerVertical="true"
464
                    android:layout_gravity="center"
465
                    android:layout_toEndOf="@+id/textView18"
466
                    android:layout_toRightOf="@+id/textView18"
467
                    android:text="电桩类型"
468
                    android:textColor="@color/ui_65"
469
                    android:textSize="15sp" />
470

471
                <RadioGroup
472
                    android:id="@+id/rg_claimtype"
473
                    android:layout_width="wrap_content"
474
                    android:layout_height="wrap_content"
475
                    android:layout_alignParentEnd="true"
476
                    android:layout_alignParentRight="true"
477
                    android:layout_centerVertical="true"
478
                    android:layout_marginEnd="16dp"
479
                    android:layout_marginRight="16dp"
480
                    android:orientation="horizontal">
481

482
                    <RadioButton
483
                        android:id="@+id/rb_guo"
484
                        android:layout_width="wrap_content"
485
                        android:layout_height="wrap_content"
486
                        android:layout_marginLeft="44px"
487
                        android:background="@drawable/icon_guoselected1105"
488
                        android:button="@null" />
489

490
                    <RadioButton
491
                        android:id="@+id/rb_te"
492
                        android:layout_width="wrap_content"
493
                        android:layout_height="wrap_content"
494
                        android:layout_marginLeft="44px"
495
                        android:background="@drawable/icon_tenormal1105"
496
                        android:button="@null" />
497
                </RadioGroup>
498

499
            </com.zhy.autolayout.AutoRelativeLayout>
500

501
            <View
502
                android:layout_width="match_parent"
503
                android:layout_height="0.5dp"
504
                android:layout_marginLeft="16dp"
505
                android:background="@color/ui_line" />
506

507
            <com.zhy.autolayout.AutoRelativeLayout
508
                android:layout_width="match_parent"
509
                android:layout_height="139px"
510
                android:background="@color/bg_row">
511

512
                <TextView
513
                    android:id="@+id/textView21"
514
                    android:layout_width="wrap_content"
515
                    android:layout_height="wrap_content"
516
                    android:layout_alignTop="@+id/textView22"
517
                    android:layout_alignParentStart="true"
518
                    android:layout_alignParentLeft="true"
519
                    android:layout_centerInParent="true"
520
                    android:layout_marginLeft="44px"
521
                    android:layout_marginRight="8px"
522
                    android:text="*"
523
                    android:textColor="@color/xinghao"
524
                    android:textSize="15sp" />
525

526
                <TextView
527
                    android:id="@+id/textView22"
528
                    android:layout_width="wrap_content"
529
                    android:layout_height="wrap_content"
530
                    android:layout_alignTop="@+id/imageView3"
531
                    android:layout_toEndOf="@+id/textView21"
532
                    android:layout_toRightOf="@+id/textView21"
533
                    android:text="数量"
534
                    android:textColor="@color/ui_65"
535
                    android:textSize="15sp" />
536

537
                <ImageView
538
                    android:id="@+id/imageView3"
539
                    android:layout_width="wrap_content"
540
                    android:layout_height="wrap_content"
541
                    android:layout_alignTop="@+id/imageView2"
542
                    android:layout_gravity="center"
543
                    android:layout_marginRight="20px"
544
                    android:layout_toStartOf="@+id/et_fastNum"
545
                    android:layout_toLeftOf="@+id/et_fastNum"
546
                    android:src="@drawable/icon_kuai1105" />
547

548
                <EditText
549
                    android:id="@+id/et_fastNum"
550
                    android:layout_width="wrap_content"
551
                    android:layout_height="match_parent"
552
                    android:layout_alignParentTop="true"
553
                    android:layout_marginRight="44px"
554
                    android:layout_toStartOf="@+id/imageView2"
555
                    android:layout_toLeftOf="@+id/imageView2"
556
                    android:layout_weight="1"
557
                    android:background="@color/white"
558
                    android:editable="true"
559
                    android:gravity="center"
560
                    android:hint="桩数"
561
                    android:inputType="number"
562
                    android:text=""
563
                    android:textColor="@color/ui_62"
564
                    android:textColorHint="@color/ui_68"
565
                    android:textSize="15sp" />
566

567
                <ImageView
568
                    android:id="@+id/imageView2"
569
                    android:layout_width="wrap_content"
570
                    android:layout_height="wrap_content"
571
                    android:layout_centerVertical="true"
572
                    android:layout_gravity="center"
573
                    android:layout_marginRight="20px"
574
                    android:layout_toLeftOf="@+id/et_slowNum"
575
                    android:src="@drawable/icon_man1105" />
576

577
                <EditText
578
                    android:id="@+id/et_slowNum"
579
                    android:layout_width="wrap_content"
580
                    android:layout_height="match_parent"
581
                    android:layout_alignParentTop="true"
582
                    android:layout_alignParentEnd="true"
583
                    android:layout_alignParentRight="true"
584
                    android:layout_marginRight="44px"
585
                    android:layout_weight="1"
586
                    android:background="@color/white"
587
                    android:editable="true"
588
                    android:gravity="center"
589
                    android:hint="桩数"
590
                    android:inputType="number"
591
                    android:text=""
592
                    android:textColor="@color/ui_62"
593
                    android:textColorHint="@color/ui_68"
594
                    android:textSize="15sp" />
595

596
            </com.zhy.autolayout.AutoRelativeLayout>
597

598
            <View
599
                android:layout_width="match_parent"
600
                android:layout_height="0.5dp"
601
                android:background="@color/ui_line" />
602

603
            <View
604
                android:layout_width="match_parent"
605
                android:layout_height="44px"
606
                android:background="@color/activity_bgcolor" />
607

608
            <View
609
                android:layout_width="match_parent"
610
                android:layout_height="0.5dp"
611
                android:background="@color/ui_line" />
612

613
            <com.zhy.autolayout.AutoLinearLayout
614
                android:layout_width="match_parent"
615
                android:layout_height="120px"
616
                android:background="@color/bg_row"
617
                android:gravity="center">
618

619
                <TextView
620
                    android:layout_width="wrap_content"
621
                    android:layout_height="wrap_content"
622
                    android:layout_centerInParent="true"
623
                    android:layout_marginLeft="44px"
624
                    android:layout_marginRight="8px"
625
                    android:text="*"
626
                    android:textColor="@color/xinghao"
627
                    android:textSize="15sp" />
628

629
                <TextView
630
                    android:layout_width="wrap_content"
631
                    android:layout_height="wrap_content"
632
                    android:text="充电费"
633
                    android:textColor="@color/ui_65"
634
                    android:textSize="15sp" />
635

636

637
                <EditText
638
                    android:id="@+id/et_chargeCost"
639
                    android:layout_width="0dp"
640
                    android:layout_height="match_parent"
641
                    android:layout_marginLeft="20px"
642
                    android:layout_marginRight="44px"
643
                    android:layout_weight="5"
644
                    android:background="@color/white"
645
                    android:gravity="center|right"
646
                    android:hint="如:0.87元/度"
647
                    android:inputType="text"
648
                    android:text=""
649
                    android:textColor="@color/ui_62"
650
                    android:textColorHint="@color/ui_68"
651
                    android:textSize="15sp" />
652

653

654
            </com.zhy.autolayout.AutoLinearLayout>
655

656
            <TextView
657
                android:layout_width="match_parent"
658
                android:layout_height="wrap_content"
659
                android:layout_marginLeft="44px"
660
                android:layout_marginRight="44px"
661
                android:text="如存在分时电价,请在照片中上传包含电价信息的照片或截图"
662
                android:textColor="@color/ui_68"
663
                android:textSize="12sp" />
664

665
            <View
666
                android:layout_width="match_parent"
667
                android:layout_height="0.5dp"
668
                android:layout_marginLeft="44px"
669
                android:layout_marginTop="12dp"
670
                android:background="@color/ui_line" />
671

672
            <com.zhy.autolayout.AutoRelativeLayout
673
                android:id="@+id/rl_zyNum"
674
                android:layout_width="match_parent"
675
                android:layout_height="139px"
676
                android:background="@color/bg_row">
677

678
                <TextView
679
                    android:id="@+id/textView23"
680
                    android:layout_width="wrap_content"
681
                    android:layout_height="wrap_content"
682
                    android:layout_alignParentStart="true"
683
                    android:layout_alignParentLeft="true"
684
                    android:layout_centerInParent="true"
685
                    android:layout_marginLeft="44px"
686
                    android:layout_marginRight="8px"
687
                    android:text="*"
688
                    android:textColor="@color/xinghao"
689
                    android:textSize="15sp" />
690

691
                <TextView
692
                    android:layout_width="wrap_content"
693
                    android:layout_height="wrap_content"
694
                    android:layout_alignTop="@+id/textView23"
695
                    android:layout_toEndOf="@+id/textView23"
696
                    android:layout_toRightOf="@+id/textView23"
697
                    android:text="服务费"
698
                    android:textColor="@color/ui_65"
699
                    android:textSize="15sp" />
700

701
                <EditText
702
                    android:id="@+id/et_serviceCost"
703
                    style="?android:attr/textViewStyle"
704
                    android:layout_width="wrap_content"
705
                    android:layout_height="match_parent"
706
                    android:layout_alignParentEnd="true"
707
                    android:layout_alignParentRight="true"
708
                    android:layout_centerVertical="true"
709
                    android:layout_marginRight="44px"
710
                    android:background="@null"
711
                    android:contentDescription="@null"
712
                    android:gravity="center|right"
713
                    android:hint="如:0.8元/度"
714
                    android:inputType="text"
715
                    android:text=""
716
                    android:textColor="@color/ui_62"
717
                    android:textColorHint="@color/ui_68"
718
                    android:textSize="15sp" />
719
            </com.zhy.autolayout.AutoRelativeLayout>
720

721
            <View
722
                android:layout_width="match_parent"
723
                android:layout_height="0.5dp"
724
                android:layout_marginLeft="44px"
725
                android:background="@color/ui_line" />
726

727
            <com.zhy.autolayout.AutoLinearLayout
728
                android:layout_width="match_parent"
729
                android:layout_height="139px"
730
                android:background="@color/bg_row"
731
                android:gravity="center">
732

733
                <TextView
734
                    android:layout_width="wrap_content"
735
                    android:layout_height="wrap_content"
736
                    android:layout_centerInParent="true"
737
                    android:layout_marginLeft="44px"
738
                    android:layout_marginRight="8px"
739
                    android:text="*"
740
                    android:textColor="@color/xinghao"
741
                    android:textSize="15sp" />
742

743
                <TextView
744
                    android:layout_width="wrap_content"
745
                    android:layout_height="wrap_content"
746
                    android:text="收费方式"
747
                    android:textColor="@color/ui_65"
748
                    android:textSize="15sp" />
749

750

751
                <EditText
752
                    android:id="@+id/et_charge_cost_way"
753
                    android:layout_width="0dp"
754
                    android:layout_height="match_parent"
755
                    android:layout_marginLeft="20px"
756
                    android:layout_marginRight="44px"
757
                    android:layout_weight="5"
758
                    android:background="@color/white"
759
                    android:gravity="center|right"
760
                    android:hint="请填写充电收费方式"
761
                    android:inputType="text"
762
                    android:text=""
763
                    android:textColor="@color/ui_62"
764
                    android:textColorHint="@color/ui_68"
765
                    android:textSize="15sp" />
766

767

768
            </com.zhy.autolayout.AutoLinearLayout>
769

770
            <View
771
                android:layout_width="match_parent"
772
                android:layout_height="0.5dp"
773
                android:layout_marginLeft="44px"
774
                android:background="@color/ui_line" />
775

776
            <com.zhy.autolayout.AutoLinearLayout
777
                android:layout_width="match_parent"
778
                android:layout_height="139px"
779
                android:background="@color/bg_row"
780
                android:gravity="center">
781

782
                <TextView
783
                    android:layout_width="wrap_content"
784
                    android:layout_height="wrap_content"
785
                    android:layout_centerInParent="true"
786
                    android:layout_marginLeft="44px"
787
                    android:layout_marginRight="8px"
788
                    android:text="*"
789
                    android:textColor="@color/xinghao"
790
                    android:textSize="15sp" />
791

792
                <TextView
793
                    android:layout_width="wrap_content"
794
                    android:layout_height="wrap_content"
795
                    android:text="停车费"
796
                    android:textColor="@color/ui_65"
797
                    android:textSize="15sp" />
798

799

800
                <EditText
801
                    android:id="@+id/et_parkCost"
802
                    android:layout_width="0dp"
803
                    android:layout_height="match_parent"
804
                    android:layout_marginLeft="20px"
805
                    android:layout_marginRight="44px"
806
                    android:layout_weight="5"
807
                    android:background="@color/white"
808
                    android:gravity="center|right"
809
                    android:hint="如:5元/时"
810
                    android:inputType="text"
811
                    android:text=""
812
                    android:textColor="@color/ui_62"
813
                    android:textColorHint="@color/ui_68"
814
                    android:textSize="15sp" />
815

816

817
            </com.zhy.autolayout.AutoLinearLayout>
818

819
            <View
820
                android:layout_width="match_parent"
821
                android:layout_height="0.5dp"
822
                android:layout_marginLeft="44px"
823
                android:background="@color/ui_line" />
824

825

826
            <com.zhy.autolayout.AutoRelativeLayout
827
                android:id="@+id/ll_select_cost_type"
828
                android:layout_width="match_parent"
829
                android:layout_height="139px"
830
                android:background="@color/bg_row">
831

832
                <TextView
833
                    android:id="@+id/textView20"
834
                    android:layout_width="wrap_content"
835
                    android:layout_height="wrap_content"
836
                    android:layout_alignTop="@+id/textView17"
837
                    android:layout_alignParentStart="true"
838
                    android:layout_alignParentLeft="true"
839
                    android:layout_centerInParent="true"
840
                    android:layout_marginLeft="44px"
841
                    android:layout_marginRight="8px"
842
                    android:text="*"
843
                    android:textColor="@color/xinghao"
844
                    android:textSize="15sp" />
845

846
                <TextView
847
                    android:id="@+id/textView17"
848
                    android:layout_width="wrap_content"
849
                    android:layout_height="wrap_content"
850
                    android:layout_centerVertical="true"
851
                    android:layout_toEndOf="@+id/textView20"
852
                    android:layout_toRightOf="@+id/textView20"
853
                    android:text="运营商"
854
                    android:textColor="@color/ui_65"
855
                    android:textSize="15sp" />
856

857

858
                <TextView
859
                    android:id="@+id/tv_costtype"
860
                    android:layout_width="wrap_content"
861
                    android:layout_height="match_parent"
862
                    android:layout_centerVertical="true"
863
                    android:layout_marginRight="20px"
864
                    android:layout_toLeftOf="@+id/imageView4"
865
                    android:background="@color/white"
866
                    android:gravity="center|right"
867
                    android:hint="请选择运营商"
868
                    android:paddingLeft="300px"
869
                    android:text=""
870
                    android:textColor="@color/ui_62"
871
                    android:textColorHint="@color/ui_68"
872
                    android:textSize="15sp" />
873

874
                <ImageView
875
                    android:id="@+id/imageView4"
876
                    android:layout_width="wrap_content"
877
                    android:layout_height="wrap_content"
878
                    android:layout_alignParentEnd="true"
879
                    android:layout_alignParentRight="true"
880
                    android:layout_centerVertical="true"
881
                    android:layout_marginRight="44px"
882
                    android:src="@drawable/icon_select" />
883

884

885
            </com.zhy.autolayout.AutoRelativeLayout>
886

887
            <!-- 运营商电话 -->
888
            <View
889
                android:layout_width="match_parent"
890
                android:layout_height="0.5dp"
891
                android:layout_marginLeft="44px"
892
                android:background="@color/ui_line" />
893

894
            <com.zhy.autolayout.AutoLinearLayout
895
                android:layout_width="match_parent"
896
                android:layout_height="139px"
897
                android:background="@color/bg_row"
898
                android:gravity="center">
899

900
                <TextView
901
                    android:layout_width="wrap_content"
902
                    android:layout_height="wrap_content"
903
                    android:layout_centerInParent="true"
904
                    android:layout_marginLeft="44px"
905
                    android:layout_marginRight="8px"
906
                    android:text="*"
907
                    android:textColor="@color/xinghao"
908
                    android:textSize="15sp" />
909

910
                <TextView
911
                    android:layout_width="wrap_content"
912
                    android:layout_height="wrap_content"
913
                    android:text="运营商电话"
914
                    android:textColor="@color/ui_65"
915
                    android:textSize="15sp" />
916

917

918
                <EditText
919
                    android:id="@+id/et_telephone"
920
                    android:layout_width="0dp"
921
                    android:layout_height="match_parent"
922
                    android:layout_marginLeft="20px"
923
                    android:layout_marginRight="44px"
924
                    android:layout_weight="5"
925
                    android:background="@color/white"
926
                    android:gravity="center|right"
927
                    android:hint="请填写运营商电话"
928
                    android:inputType="text"
929
                    android:text=""
930
                    android:textColor="@color/ui_62"
931
                    android:textColorHint="@color/ui_68"
932
                    android:textSize="15sp" />
933

934

935
            </com.zhy.autolayout.AutoLinearLayout>
936

937
            <View
938
                android:layout_width="match_parent"
939
                android:layout_height="0.5dp"
940
                android:background="@color/ui_line" />
941

942
            <View
943
                android:layout_width="match_parent"
944
                android:layout_height="44px"
945
                android:background="@color/activity_bgcolor" />
946

947
            <View
948
                android:layout_width="match_parent"
949
                android:layout_height="0.5dp"
950
                android:background="@color/ui_line" />
951

952
            <com.zhy.autolayout.AutoRelativeLayout
953
                android:id="@+id/rl_parkLocation"
954
                android:layout_width="match_parent"
955
                android:layout_height="139px"
956
                android:background="@color/white">
957

958
                <TextView
959
                    android:id="@+id/textView24"
960
                    android:layout_width="wrap_content"
961
                    android:layout_height="wrap_content"
962
                    android:layout_alignParentStart="true"
963
                    android:layout_alignParentLeft="true"
964
                    android:layout_centerInParent="true"
965
                    android:layout_marginLeft="44px"
966
                    android:layout_marginRight="8px"
967
                    android:text="*"
968
                    android:textColor="@color/xinghao"
969
                    android:textSize="15sp" />
970

971
                <TextView
972
                    android:id="@+id/textView13"
973
                    android:layout_width="wrap_content"
974
                    android:layout_height="wrap_content"
975
                    android:layout_alignTop="@+id/textView24"
976
                    android:layout_toEndOf="@+id/textView24"
977
                    android:layout_toRightOf="@+id/textView24"
978
                    android:text="停车场地"
979
                    android:textColor="@color/ui_65"
980
                    android:textSize="15sp" />
981

982
                <RadioGroup
983
                    android:id="@+id/rg_park"
984
                    android:layout_width="wrap_content"
985
                    android:layout_height="wrap_content"
986
                    android:layout_alignParentEnd="true"
987
                    android:layout_alignParentRight="true"
988
                    android:layout_centerVertical="true"
989
                    android:layout_marginEnd="44px"
990
                    android:layout_marginRight="44px"
991
                    android:orientation="horizontal">
992

993
                    <RadioButton
994
                        android:id="@+id/rb_shang"
995
                        android:layout_width="wrap_content"
996
                        android:layout_height="wrap_content"
997
                        android:layout_marginLeft="44px"
998
                        android:background="@drawable/icon_shangselected1105"
999
                        android:button="@null" />
1000

1001
                    <RadioButton
1002
                        android:id="@+id/rb_xia"
1003
                        android:layout_width="wrap_content"
1004
                        android:layout_height="wrap_content"
1005
                        android:layout_marginLeft="44px"
1006
                        android:background="@drawable/icon_xianormal1105"
1007
                        android:button="@null" />
1008
                </RadioGroup>
1009

1010
            </com.zhy.autolayout.AutoRelativeLayout>
1011

1012
            <View
1013
                android:layout_width="fill_parent"
1014
                android:layout_height="0.5dp"
1015
                android:layout_marginLeft="44px"
1016
                android:background="@color/ui_line" />
1017

1018
            <com.zhy.autolayout.AutoLinearLayout
1019
                android:id="@+id/rl_prefect_time"
1020
                android:layout_width="match_parent"
1021
                android:layout_height="139px"
1022
                android:background="@color/bg_row">
1023

1024
                <TextView
1025
                    android:id="@+id/tv_prefect_time"
1026
                    android:layout_width="0dp"
1027
                    android:layout_height="wrap_content"
1028
                    android:layout_alignParentLeft="true"
1029
                    android:layout_centerVertical="true"
1030
                    android:layout_weight="1.5"
1031
                    android:paddingLeft="44px"
1032
                    android:text="开放时间"
1033
                    android:textColor="@color/ui_65"
1034
                    android:textSize="15sp" />
1035

1036
                <TextView
1037
                    android:id="@+id/tv_prefect_start_time"
1038
                    android:layout_width="wrap_content"
1039
                    android:layout_height="match_parent"
1040
                    android:layout_centerVertical="true"
1041
                    android:layout_toEndOf="@+id/tv_prefect_time"
1042
                    android:layout_toRightOf="@+id/tv_prefect_time"
1043
                    android:gravity="center"
1044
                    android:hint="00:00"
1045
                    android:paddingLeft="44px"
1046
                    android:paddingRight="20px"
1047
                    android:text=""
1048
                    android:textColor="@color/ui_62"
1049
                    android:textColorHint="@color/ui_68"
1050
                    android:textSize="15sp" />
1051

1052
                <ImageView
1053
                    android:layout_width="wrap_content"
1054
                    android:layout_height="match_parent"
1055
                    android:layout_centerVertical="true"
1056
                    android:layout_toEndOf="@id/tv_prefect_time"
1057
                    android:layout_toRightOf="@id/tv_prefect_start_time"
1058
                    android:src="@drawable/icon_zhi2_0" />
1059

1060
                <TextView
1061
                    android:id="@+id/tv_ferfect_time"
1062
                    android:layout_width="wrap_content"
1063
                    android:layout_height="match_parent"
1064
                    android:layout_alignParentEnd="true"
1065
                    android:layout_alignParentRight="true"
1066
                    android:layout_centerVertical="true"
1067
                    android:contentDescription="@null"
1068
                    android:gravity="center"
1069
                    android:hint="24:00"
1070
                    android:paddingLeft="20px"
1071
                    android:paddingRight="44px"
1072
                    android:text=""
1073
                    android:textColor="@color/ui_62"
1074
                    android:textColorHint="@color/ui_68"
1075

1076
                    android:textSize="15sp" />
1077
            </com.zhy.autolayout.AutoLinearLayout>
1078

1079
            <View
1080
                android:layout_width="fill_parent"
1081
                android:layout_height="0.5dp"
1082
                android:layout_marginLeft="44px"
1083
                android:background="@color/ui_line" />
1084

1085
            <EditText
1086
                android:id="@+id/et_remarkclaim"
1087
                android:layout_width="match_parent"
1088
                android:layout_height="wrap_content"
1089
                android:background="@color/white"
1090
                android:gravity="left|top"
1091
                android:hint="备注说明"
1092
                android:paddingLeft="44px"
1093
                android:paddingTop="48px"
1094
                android:paddingRight="44px"
1095
                android:paddingBottom="50px"
1096
                android:textColor="@color/ui_62"
1097
                android:textColorHint="@color/ui_68"
1098
                android:textSize="15sp" />
1099

1100
            <View
1101
                android:layout_width="fill_parent"
1102
                android:layout_height="0.5dp"
1103
                android:background="@color/ui_line" />
1104

1105
            <View
1106
                android:layout_width="match_parent"
1107
                android:layout_height="44px"
1108
                android:background="@color/activity_bgcolor" />
1109
        </com.zhy.autolayout.AutoLinearLayout>
1110

1111
    </ScrollView>
1112

1113
    <TextView
1114
        android:id="@+id/share_next"
1115
        android:layout_width="match_parent"
1116
        android:layout_height="127px"
1117
        android:layout_alignParentBottom="true"
1118
        android:layout_gravity="center"
1119
        android:background="@color/lvse"
1120
        android:gravity="center"
1121
        android:text="立即提交"
1122
        android:textColor="@color/white"
1123
        android:textSize="15sp" />
1124

1125

1126
</com.zhy.autolayout.AutoRelativeLayout>

+ 2 - 2
app/src/main/res/layout/activity_share_two_picture.xml

@ -37,9 +37,9 @@
37 37
        android:id="@+id/picture"
38 38
        android:layout_width="match_parent"
39 39
        android:layout_height="0dp"
40
        android:background="@color/orange"
41 40
        android:scaleType="centerCrop"
42 41
        app:layout_constraintBottom_toBottomOf="parent"
43
        app:layout_constraintTop_toBottomOf="@+id/nav_bar" />
42
        app:layout_constraintTop_toBottomOf="@+id/nav_bar"
43
        tools:background="@color/orange" />
44 44
45 45
</android.support.constraint.ConstraintLayout>

+ 2 - 2
app/src/main/res/layout/item_share_dialog.xml

@ -24,11 +24,11 @@
24 24
            android:layout_width="match_parent"
25 25
            android:layout_height="wrap_content"
26 26
            android:layout_marginLeft="20dp"
27
            android:layout_marginRight="20dp"
27
            android:layout_marginRight="10dp"
28 28
            android:textSize="14sp"
29 29
            android:lineSpacingMultiplier="1.5"
30 30
            android:textColor="@color/ui_65"
31
            android:text="照片内容需包含以下信息,最多张:\n1、站点周围环境照片,如XX酒店、XX银行;\n2、充电站照片,需要包含充电桩;\n3、充电中的照片,可以是车桩连接的照片或者充电桩显示屏正在充电的照片\n4、分时电价、分时停车费等信息可以拍照或截图上传(非必需)"
31
            android:text="添加照片包含以下信息,最多4张:\n1、站点周围建筑或小区图片,如xx酒店、xx银行;\n2、充电站全景照片,需要包含充电桩;\n3、充电桩图片,可以是具体的桩或车连接的照片;\n4、分时电价、分时停车费等信息(非必填)。"
32 32
            android:layout_marginTop="17dp"
33 33
            android:layout_marginBottom="30dp"/>
34 34

+ 73 - 45
app/src/main/res/layout/share_list_adapter.xml

@ -1,20 +1,15 @@
1
<LinearLayout
2
    xmlns:android="http://schemas.android.com/apk/res/android"
1
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
    xmlns:tools="http://schemas.android.com/tools"
3 3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
4 5
    android:background="@color/activity_bgcolor"
5
    android:orientation="vertical"
6
    android:layout_height="match_parent">
6
    android:orientation="vertical">
7 7
8 8
    <LinearLayout
9 9
        android:layout_width="match_parent"
10 10
        android:layout_height="wrap_content"
11 11
        android:background="@color/bg_row"
12 12
        android:orientation="vertical">
13
        <View
14
            android:layout_width="match_parent"
15
            android:layout_height="0.5dp"
16
            android:background="@color/Line"
17
            android:visibility="gone"/>
18 13
19 14
        <RelativeLayout
20 15
            android:id="@+id/shareName"
@ -26,30 +21,28 @@
26 21
                android:id="@+id/tv_shareName"
27 22
                android:layout_width="match_parent"
28 23
                android:layout_height="wrap_content"
29
                android:gravity="center_vertical"
24
                android:layout_alignParentLeft="true"
30 25
                android:layout_marginLeft="16dp"
31 26
                android:layout_marginRight="90dp"
32
                android:singleLine="true"
33 27
                android:ellipsize="end"
34
                android:layout_alignParentLeft="true"
35
                android:text=""
28
                android:gravity="center_vertical"
29
                android:singleLine="true"
36 30
                android:textColor="@color/ui_62"
37
                android:textSize="15sp" />
31
                android:textSize="15sp"
32
                tools:text="走起" />
38 33
39 34
            <TextView
40 35
                android:id="@+id/tv_shareState"
41 36
                android:layout_width="wrap_content"
42 37
                android:layout_height="wrap_content"
38
                android:layout_alignParentRight="true"
39
                android:layout_marginRight="16dp"
43 40
                android:gravity="center_vertical"
44
                android:text=""
45 41
                android:textColor="@color/title_row"
46 42
                android:textSize="14sp"
47
                android:layout_marginRight="16dp"
48
                android:layout_alignParentRight="true" />
49
50
51
43
                tools:text="信息不完整" />
52 44
        </RelativeLayout>
45
53 46
        <RelativeLayout
54 47
            android:id="@+id/shareAddress"
55 48
            android:layout_width="match_parent"
@ -60,50 +53,85 @@
60 53
                android:id="@+id/tv_shareAddress"
61 54
                android:layout_width="match_parent"
62 55
                android:layout_height="wrap_content"
56
                android:layout_alignParentLeft="true"
57
                android:layout_alignParentTop="true"
58
                android:layout_marginLeft="16dp"
59
                android:layout_marginRight="16dp"
60
                android:ellipsize="end"
63 61
                android:gravity="center_vertical"
64
                android:text=""
62
                android:lines="2"
65 63
                android:textColor="@color/ui_65"
66 64
                android:textSize="14sp"
67
                android:singleLine="true"
68
                android:ellipsize="end"
69
                android:layout_marginLeft="16dp"
70
                android:layout_alignParentLeft="true"
71
                android:layout_alignParentTop="true"/>
72
73
74
65
                tools:text="北京市朝阳区八里庄街道住邦2000商务楼2号楼从南门入,上12楼右拐即可" />
75 66
        </RelativeLayout>
76 67
77 68
        <LinearLayout
78
            android:id="@+id/shareTime"
79 69
            android:layout_width="match_parent"
80 70
            android:layout_height="wrap_content"
81
            android:gravity="center"
71
            android:layout_marginLeft="16dp"
82 72
            android:layout_marginTop="6dp"
73
            android:gravity="center_vertical"
83 74
            android:orientation="horizontal">
84 75
85
            <TextView
86
                android:id="@+id/tv_shareTime"
87
                android:layout_width="match_parent"
76
            <LinearLayout
77
                android:layout_width="0dp"
88 78
                android:layout_height="wrap_content"
89
                android:layout_marginLeft="16dp"
90
                android:gravity="center_vertical"
91
                android:textColor="@color/ui_68"
92
                android:textSize="14sp"
93
                android:text=""/>
94
            <TextView
95
                android:id="@+id/tv_id"
79
                android:layout_weight="1"
80
                android:orientation="vertical">
81
82
                <TextView
83
                    android:id="@+id/tv_shareTime"
84
                    android:layout_width="match_parent"
85
                    android:layout_height="wrap_content"
86
                    android:textColor="@color/ui_68"
87
                    android:textSize="14sp"
88
89
                    tools:text="2020-05-21 11:26:25" />
90
91
                <TextView
92
                    android:id="@+id/tv_reason"
93
                    android:layout_width="match_parent"
94
                    android:layout_height="wrap_content"
95
                    android:layout_marginTop="5dp"
96
                    android:textColor="#E02020"
97
                    android:textSize="12sp"
98
                    tools:text="原因:缺少站点图片,都是客服经理的说法框架克鲁赛德荆防颗粒的是的考虑是否就看了多少积分开了电视剧付款了大家是否考虑的设计费恐龙当家时空裂缝都是风景的考虑是否觉得卡死了" />
99
100
            </LinearLayout>
101
102
            <LinearLayout
103
                android:id="@+id/tv_edit"
96 104
                android:layout_width="wrap_content"
97
                android:layout_height="wrap_content"
98
                android:visibility="gone"/>
99
105
                android:layout_height="match_parent"
106
                android:gravity="center_vertical"
107
                android:visibility="gone"
108
                tools:background="#ff0000"
109
                tools:visibility="visible">
110
111
                <TextView
112
                    android:layout_width="wrap_content"
113
                    android:layout_height="wrap_content"
114
                    android:layout_marginLeft="16dp"
115
                    android:layout_marginTop="10dp"
116
                    android:layout_marginRight="16dp"
117
                    android:layout_marginBottom="10dp"
118
                    android:background="@drawable/btn_edit_shape"
119
                    android:paddingLeft="10dp"
120
                    android:paddingTop="2dp"
121
                    android:paddingRight="10dp"
122
                    android:paddingBottom="2dp"
123
                    android:text="编辑"
124
                    android:textColor="#444444"
125
                    android:textSize="12sp" />
126
            </LinearLayout>
100 127
        </LinearLayout>
101 128
129
102 130
        <View
103 131
            android:layout_width="match_parent"
104 132
            android:layout_height="0.5dp"
105 133
            android:layout_marginTop="14dp"
106
            android:background="@color/ui_line"/>
134
            android:background="@color/ui_line" />
107 135
108 136
    </LinearLayout>
109 137

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

@ -50,6 +50,7 @@
50 50
    <string name="title_activity_alter_two">AlterTwoActivity</string>
51 51
    <string name="title_activity_alter_three">AlterThreeActivity</string>
52 52
    <string name="title_activity_share_two">ShareTwoActivity</string>
53
    <string name="title_activity_share_two_edit">ShareTwoEditActivity</string>
53 54
    <string name="title_activity_share_three">ShareThreeActivity</string>
54 55
    <string name="title_activity_zhan_details_new">ZhanDetailsNew</string>
55 56
    <string name="title_activity_my_share">MyShareActivity</string>