202
                if (EmptyUtils.isNotEmpty(response)) {
203
                    dismissDialog();
204
                    handlingOperations(response, startInterface);
205
                }
206
207
            }
208
        });
209
    }
210
211
    private void handlingOperations(String response, int interfaceType) {
212
        String rtnCode = com.google.zxing.client.android.JsonUtils.getKeyResult(response, "rtnCode");
213
        String rtnMsg = com.google.zxing.client.android.JsonUtils.getKeyResult(response, "rtnMsg");
214
        switch (rtnCode) {
215
            case "01":
216
                if (interfaceType == startInterface) {
217
                    String data = JsonUtils.getKeyResult(response, "data");
218
                    String orderid = JsonUtils.getKeyResult(data, "orderId");
219
                    Intent intent = new Intent(getApplicationContext(), TLDLoadingActivity.class);
220
                    intent.putExtra(com.electric.chargingpile.constant.ChargingConstants.ORDERID, orderid);
221
                    startActivity(intent);
222
                    finish();
223
                }
224
                break;
225
            case "304":
226
                alertDialog.builder()
227
                        .setMsg(rtnMsg)
228
                        .setPositiveButton("去充值", new View.OnClickListener() {
229
                            @Override
230
                            public void onClick(View v) {
231
                                Intent intent = new Intent(getApplicationContext(), AccountRechargeActivity.class);
232
                                startActivity(intent);
233
                            }
234
                        })
235
//                        .setNegativeButton("开通免密支付", new View.OnClickListener() {
236
//                    @Override
237
//                    public void onClick(View v) {
238
//                        Intent intent = new Intent(getApplicationContext(),NonSecretSeettingActivity.class);
239
//                        Uri uri = Uri.parse("chongdianzhuang://");
240
//                        intent.setData(uri);
241
//                        startActivity(intent);
242
//                    }
243
//                })
244
                        .show();
245
                break;
246
            case "305":
247
                alertDialog.builder()
248
                        .setMsg(rtnMsg)
249
                        .setPositiveButton("联系客服", new View.OnClickListener() {
250
                            @Override
251
                            public void onClick(View v) {
252
                                tellTask();
253
                            }
254
                        }).setNegativeButton("取消", new View.OnClickListener() {
255
                    @Override
256
                    public void onClick(View v) {
257
                    }
258
                }).show();
259
                break;
260
            case "309":
261
                alertDialog.builder()
262
                        .setMsg(rtnMsg)
263
                        .setPositiveButton("联系客服", new View.OnClickListener() {
264
                            @Override
265
                            public void onClick(View v) {
266
                                tellTask();
267
                            }
268
                        }).setNegativeButton("取消", new View.OnClickListener() {
269
                    @Override
270
                    public void onClick(View v) {
271
                    }
272
                }).show();
273
                break;
274
            case "306":
275
                //跳转到充电详情界面
276
                String data306 = JsonUtils.getKeyResult(response, "data");
277
                String orderid = JsonUtils.getKeyResult(data306, "orderId");
278
                Intent intent306 = new Intent(getApplicationContext(), ChargingStatusActivity.class);
279
                intent306.putExtra(com.electric.chargingpile.constant.ChargingConstants.ORDERID, orderid);
280
                startActivity(intent306);
281
                finish();
282
                break;
283
            case "307":
284
                alertDialog.builder()
285
                        .setMsg(rtnMsg)
286
                        .setPositiveButton("去充值", new View.OnClickListener() {
287
                            @Override
288
                            public void onClick(View v) {
289
                                Intent intent = new Intent(getApplicationContext(), AccountRechargeActivity.class);
290
                                startActivity(intent);
291
                            }
292
                        }).show();
293
                break;
294
            case "311":
295
                alertDialog.builder()
296
                        .setMsg(rtnMsg)
297
                        .setPositiveButton("开通免密支付", new View.OnClickListener() {
298
                            @Override
299
                            public void onClick(View v) {
300
                                Intent intent = new Intent(getApplicationContext(), NonSecretSeettingActivity.class);
301
                                Uri uri = Uri.parse("chongdianzhuang://");
302
                                intent.setData(uri);
303
                                startActivity(intent);
304
                            }
305
                        }).show();
306
                break;
307
            case "1800":
308
                String data1800 = JsonUtils.getKeyResult(response, "data");
309
                String pileId = JsonUtils.getKeyResult(data1800, "pileId");
310
                Intent intent1800 = new Intent(getApplicationContext(), SelectPileActivity.class);
311
                intent1800.putExtra(com.electric.chargingpile.constant.ChargingConstants.ORDERID, pileId);
312
                startActivity(intent1800);
313
                break;
314
315
            case "1000":
316
                String data1000 = JsonUtils.getKeyResult(response, "data");
317
                String pileIds = JsonUtils.getKeyResult(data1000, "pileId");
318
                ChargingPileActivity.actionStart(this,pileIds);
319
                break;
320
            default:
321
                ToastUtil.showToast(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT);
322
                break;
323
        }
324
    }
325
326
    @AfterPermissionGranted(RC_TELL_PERM)
327
    public void tellTask() {
328
        if (hasTellPermission()) {
329
            // Have permission, do the thing!
330
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
331
            String telNum = "4008810405";
332
            Intent intent = new Intent();
333
            intent.setAction("android.intent.action.CALL");
334
            intent.addCategory("android.intent.category.DEFAULT");
335
            intent.setData(Uri.parse("tel:" + telNum));
336
            ChargingPileActivity.this.startActivity(intent);
337
338
        } else {
339
            LogUtils.e("@@@@@@@");
340
            // Ask for one permission
341
            EasyPermissions.requestPermissions(
342
                    this,
343
                    "该功能需要开启拨号权限,是否前往开启?",
344
                    RC_TELL_PERM,
345
                    Manifest.permission.CALL_PHONE);
346
        }
347
    }
348
349
    private boolean hasTellPermission() {
350
        return EasyPermissions.hasPermissions(this, Manifest.permission.CALL_PHONE);
351
    }
352
353
    @Override
354
    public void onPermissionsGranted(int requestCode, List<String> perms) {
355
356
    }
357
358
    @Override
359
    public void onPermissionsDenied(int requestCode, List<String> perms) {
360
        if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
361
            new AppSettingsDialog.Builder(ChargingPileActivity.this).build().show();
362
        }
363
    }
364
365
    private void dismissDialog() {
366
        if (this != null && !isFinishing()) {
367
            if (loadingDialog.isShowing()) {
368
                loadingDialog.dismiss();
369
            }
370
        }
371
    }
144 372
145 373
146 374
    public static void actionStart(Context context,String pileId){

+ 47 - 5
app/src/main/java/com/electric/chargingpile/activity/ChargingStatusActivity.java

@ -51,6 +51,7 @@ import com.tencent.bugly.crashreport.CrashReport;
51 51
import com.umeng.analytics.MobclickAgent;
52 52
import com.zhy.http.okhttp.OkHttpUtils;
53 53
import com.zhy.http.okhttp.callback.StringCallback;
54
import com.zhy.http.okhttp.request.RequestCall;
54 55
55 56
import java.net.URLEncoder;
56 57
import java.text.SimpleDateFormat;
@ -70,7 +71,7 @@ import okhttp3.Call;
70 71
public class ChargingStatusActivity extends Activity implements View.OnClickListener {
71 72
    private static final String TAG = "ChargingStatusActivity";
72 73
    private ImageView iv_charging, iv_back, iv_activity;
73
    private TextView tv_charging, tv_stop, tv_activity;
74
    private TextView tv_charging, tv_stop;
74 75
    private TextView tv_chongdianliang, tv_zhuang_num, tv_jindu, tv_dianya, tv_dianliu, tv_time, tv_cost, tv_help;
75 76
    String result, stubGroupId;
76 77
    CircleProgressBar bar;
@ -116,6 +117,7 @@ public class ChargingStatusActivity extends Activity implements View.OnClickList
116 117
    private LinearLayout layoutCarCertificate;
117 118
    private ImageView imgA,imgV,imgProgrees;
118 119
    private TextView certifiedCarOwner;
120
    private TextView tv_overage;
119 121
120 122
121 123
    @Override
@ -138,6 +140,7 @@ public class ChargingStatusActivity extends Activity implements View.OnClickList
138 140
        // start timer task
139 141
        setTimerTask();
140 142
        msgStatus();
143
        getUserIntegral();
141 144
    }
142 145
143 146
@ -158,8 +161,6 @@ public class ChargingStatusActivity extends Activity implements View.OnClickList
158 161
                    String icon = JsonUtils.getKeyResult(response, "icon");
159 162
                    String url = JsonUtils.getKeyResult(response, "url");
160 163
                    if (status.equals("1")) {
161
//                        tv_activity.setVisibility(View.VISIBLE);
162
//                        tv_activity.setText(message);
163 164
                        Picasso.with(MainApplication.context)
164 165
                                .load(icon)
165 166
                                .into(iv_activity);
@ -205,8 +206,6 @@ public class ChargingStatusActivity extends Activity implements View.OnClickList
205 206
        iv_activity = (ImageView) findViewById(R.id.iv_activity);
206 207
        iv_back.setOnClickListener(this);
207 208
        iv_activity.setOnClickListener(this);
208
        tv_activity = (TextView) findViewById(R.id.tv_activity);
209
        tv_activity.setOnClickListener(this);
210 209
211 210
        tv_help = findViewById(R.id.tv_help);
212 211
        tv_help.setOnClickListener(this);
@ -226,6 +225,7 @@ public class ChargingStatusActivity extends Activity implements View.OnClickList
226 225
        tv_dianya = (TextView) findViewById(R.id.tv_dianya);
227 226
        tv_dianliu = (TextView) findViewById(R.id.tv_dianliu);
228 227
        tv_time = (TextView) findViewById(R.id.tv_time);
228
        tv_overage = (TextView) findViewById(R.id.tv_overage);
229 229
        layoutCarCertificate = findViewById(R.id.layoutCarCertificate);
230 230
231 231
        imgA = findViewById(R.id.imgA);
@ -649,6 +649,48 @@ public class ChargingStatusActivity extends Activity implements View.OnClickList
649 649
        }
650 650
    }
651 651
652
    private void getUserIntegral() {
653
        String replace = null;
654
        try {
655
            long appTime1 = System.currentTimeMillis() / 1000;
656
            long updatetime = appTime1 - MainMapActivity.cha - 3;
657
            String token = String.valueOf(updatetime);
658
            String encode_token = DES3.encode(token);
659
            replace = URLEncoder.encode(encode_token);
660
        } catch (Exception e) {
661
            e.printStackTrace();
662
        }
663
        String url = MainApplication.url + "/zhannew/basic/web/index.php/member/get-score?id=" + MainApplication.userId +
664
                "&phone=" + MainApplication.userPhone + "&password=" + URLEncoder.encode(MainApplication.userPassword) + "&token=" + replace;
665
        RequestCall call = OkHttpUtils.get().url(url).build();
666
        call.execute(new StringCallback() {
667
            @Override
668
            public void onError(Call call, Exception e) {
669
670
            }
671
672
            @Override
673
            public void onResponse(String response) {
674
//                Log.e(TAG, "onResponse:getUserIntegral= "+response );
675
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
676
                if (null != rtnCode && rtnCode.equals("01")) {
677
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
678
                    String money = JsonUtils.getKeyResult(rtnMsg, "money");
679
                    if (null != money && !money.equals("")) {
680
                        tv_overage.setText(money);
681
                    }
682
                } else {
683
                    ProfileManager.getInstance().setUsername(getApplicationContext(), "");
684
                    MainApplication.userPhone = "";
685
                    Toast.makeText(getApplicationContext(), "登录已失效,请重新登录", Toast.LENGTH_SHORT).show();
686
                    startActivity(new Intent(getApplicationContext(), LoginActivity.class));
687
                }
688
            }
689
        });
690
691
    }
692
693
652 694
    private void chargingChangeStatus(String third_id) {
653 695
        String url = MainApplication.url + "/zhannew/basic/web/index.php/kazuma/offline";
654 696
        OkHttpUtils.get().url(url)

+ 11 - 5
app/src/main/java/com/electric/chargingpile/activity/ConfirmOrderActivity.java

@ -59,6 +59,8 @@ public class ConfirmOrderActivity extends AppCompatActivity implements View.OnCl
59 59
    private LoadingDialog mDialog;
60 60
    private int try_count=0;
61 61
    private int delayedSettlementCount=0;
62
    private RelativeLayout rl_number_plate;
63
    private TextView tv_num_plate;
62 64
63 65
    @Override
64 66
    protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
@ -172,6 +174,8 @@ public class ConfirmOrderActivity extends AppCompatActivity implements View.OnCl
172 174
        rl_end_info=findViewById(R.id.rl_end_info);
173 175
174 176
        tv_gocomment = findViewById(R.id.tv_gocomment);
177
        rl_number_plate = findViewById(R.id.rl_number_plate);
178
        tv_num_plate = findViewById(R.id.tv_num_plate);
175 179
176 180
        iv_back.setOnClickListener(this);
177 181
        layoutRed.setOnClickListener(this);
@ -193,12 +197,14 @@ public class ConfirmOrderActivity extends AppCompatActivity implements View.OnCl
193 197
            tv_charging_time.setText(mChargingBean.getTimeCharge());
194 198
            tv_charging_liang.setText(mChargingBean.getPower()+"度");
195 199
196
           /* if (TextUtils.isEmpty(mChargingBean.getEndInfo())) {
197
                rl_end_info.setVisibility(View.GONE);
200
            String plate_number = mChargingBean.getPlate_number();
201
202
            if (plate_number == null || plate_number.equals("")){
203
                rl_number_plate.setVisibility(View.GONE);
198 204
            }else{
199
                tv_tishi.setText(mChargingBean.getEndInfo());
200
                rl_end_info.setVisibility(View.VISIBLE);
201
            }*/
205
                rl_number_plate.setVisibility(View.VISIBLE);
206
                tv_num_plate.setText(plate_number);
207
            }
202 208
        }
203 209
    }
204 210

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

@ -498,7 +498,8 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
498 498
                                if (key.length - 1 > 2) {
499 499
                                    permissionTask();
500 500
                                } else {
501
                                    dialogup();
501
//                                    dialogup();
502
                                    permissionTask();
502 503
                                }
503 504
                            }
504 505
@ -3430,6 +3431,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3430 3431
    private void dialogup_other() {
3431 3432
        int code = Integer.parseInt(now_versionCode);
3432 3433
        if (code - getVersionCode(getApplication()) > 0) {
3434
//           if(true){
3433 3435
            alterDialog = new AlertDialogUpdate(MainMapActivity.this);
3434 3436
3435 3437
            alterDialog.builder()
@ -3457,8 +3459,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3457 3459
        }
3458 3460
    }
3459 3461
    private void downLoadFile() {
3460
        String url = "http://cdz.evcharge.cc/app/app.apk";
3461
3462 3462
        showProgressWindow();
3463 3463
        ToastUtil.showToast(getApplicationContext(), "正在下载中", Toast.LENGTH_SHORT);
3464 3464
        OkHttpUtils.get().url("http://cdz.evcharge.cc/app/app.apk").build()

+ 18 - 7
app/src/main/java/com/electric/chargingpile/activity/OderDetailsActivity.java

@ -67,6 +67,9 @@ public class OderDetailsActivity extends Activity implements View.OnClickListene
67 67
    private LinearLayout red_paper_bag_bottom;
68 68
    private RelativeLayout rl_end_info;
69 69
    private String name;
70
    private TextView tv_num_plate;
71
    private RelativeLayout rl_number_plate;
72
    private String plate_number;
70 73
71 74
    @Override
72 75
    protected void onCreate(Bundle savedInstanceState) {
@ -89,6 +92,10 @@ public class OderDetailsActivity extends Activity implements View.OnClickListene
89 92
        tv_pinglun = (TextView) findViewById(R.id.tv_pinglun);
90 93
        tv_gocomment = (TextView) findViewById(R.id.tv_gocomment);
91 94
        red_paper_bag_bottom = findViewById(R.id.red_paper_bag_bottom);
95
96
        rl_number_plate = findViewById(R.id.rl_number_plate);
97
        tv_num_plate = findViewById(R.id.tv_num_plate);
98
92 99
        iv = (ImageView) findViewById(R.id.iv);
93 100
94 101
        tv_gocomment.setOnClickListener(this);
@ -120,21 +127,23 @@ public class OderDetailsActivity extends Activity implements View.OnClickListene
120 127
121 128
        tv_tishi = (TextView) findViewById(R.id.tv_tishi);
122 129
        rl_end_info = (RelativeLayout) findViewById(R.id.rl_end_info);
123
//        if (ChargingStatusActivity.no == 0){
124
//            tv_tishi.setVisibility(View.GONE);
125
//        }else{
130
126 131
        if (end_info.equals("")) {
127 132
            rl_end_info.setVisibility(View.GONE);
128 133
        } else {
129 134
            rl_end_info.setVisibility(View.VISIBLE);
130 135
            tv_tishi.setText(end_info);
131 136
        }
132
//            tv_tishi.setVisibility(View.VISIBLE);
133
//            tv_tishi.setText(end_info);
134
//        }
137
138
        if (plate_number == null || plate_number.equals("")){
139
            rl_number_plate.setVisibility(View.GONE);
140
        }else{
141
            rl_number_plate.setVisibility(View.VISIBLE);
142
            tv_num_plate.setText(plate_number);
143
        }
144
135 145
136 146
        if (EmptyUtils.isNotEmpty(activeUrl)) {
137
//            ToastUtil.showToast(getApplicationContext(),activeUrl,Toast.LENGTH_LONG);
138 147
            new Handler().postDelayed(new Runnable() {
139 148
                @Override
140 149
                public void run() {
@ -165,6 +174,8 @@ public class OderDetailsActivity extends Activity implements View.OnClickListene
165 174
        zhan_idc = chargingBean.getZhanID();
166 175
        order_id = chargingBean.getOrderId();
167 176
        out_order_id = chargingBean.getOutOrderId();
177
        plate_number = chargingBean.getPlate_number();
178
168 179
//        settlement = getIntent().getStringExtra("settlement");
169 180
        name = chargingBean.getZhanname();
170 181
        serviceCharge = chargingBean.getServiceMoney();

+ 3 - 1
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

@ -52,7 +52,6 @@ import org.jetbrains.annotations.NotNull;
52 52

53 53
import java.io.BufferedReader;
54 54
import java.io.BufferedWriter;
55
import java.io.File;
56 55
import java.io.IOException;
57 56
import java.io.InputStreamReader;
58 57
import java.io.OutputStreamWriter;
@ -187,6 +186,9 @@ public class MainApplication extends MultiDexApplication implements CameraXConfi
187 186
        initImageLoader(getApplicationContext());
188 187

189 188
        try {
189
            if (BuildConfig.DEBUG){
190
                OkHttpUtils.getInstance().debug("hyc",true);
191
            }
190 192
            OkHttpUtils.getInstance().setCertificates(getAssets().open("ca.crt"));
191 193
            OkHttpUtils.getInstance().setCertificates();
192 194
        } catch (IOException e) {

+ 1 - 0
app/src/main/java/com/electric/chargingpile/constant/ChargingConstants.java

@ -6,5 +6,6 @@ public interface ChargingConstants {
6 6
    String URL = "url";
7 7
    String FLAG = "flag";
8 8
    String ORDERID = "orderid";
9
    String PLATE_NUM = "plate_num";
9 10
    String TYPE = "type";
10 11
}

+ 9 - 0
app/src/main/java/com/electric/chargingpile/data/ChargingBean.java

@ -44,6 +44,15 @@ public class ChargingBean implements Serializable {
44 44
    private String serviceMoney;
45 45
    private String totalMoney;
46 46
    private String redMoney;
47
    private String plate_number;
48
49
    public String getPlate_number() {
50
        return plate_number;
51
    }
52
53
    public void setPlate_number(String plate_number) {
54
        this.plate_number = plate_number;
55
    }
47 56
48 57
    public String getOrderId() {
49 58
        return orderId;

+ 1 - 2
app/src/main/java/com/electric/chargingpile/manager/ProfileManager.java

@ -742,11 +742,10 @@ public class ProfileManager {
742 742

743 743
    public void setLicensePlateHistory(String str) {
744 744
        ArrayList<String> list = getLicensePlateHistory();
745
        list.remove(str); //除重
745 746
        if (list.size() >= 6){
746 747
            list.remove(list.size() -1 );
747 748
        }
748

749
        list.remove(str);
750 749
        list.add(0,str);
751 750
        PreferenceManager.getInstance(MainApplication.context).putString(KEY_LICENSE_PLATE_HISTORY, new Gson().toJson(list));
752 751
    }

+ 1 - 0
app/src/main/java/com/electric/chargingpile/view/UpdateDialog.java

@ -2,6 +2,7 @@ package com.electric.chargingpile.view;
2 2
3 3
import android.app.Dialog;
4 4
import android.content.Context;
5
import android.util.Log;
5 6
import android.view.Display;
6 7
import android.view.LayoutInflater;
7 8
import android.view.View;

+ 1 - 1
app/src/main/res/layout/activity_charging_pile.xml

@ -159,7 +159,7 @@
159 159
    </androidx.constraintlayout.widget.ConstraintLayout>
160 160
161 161
    <View
162
        android:layout_width="1dp"
162
        android:layout_width="match_parent"
163 163
        android:layout_height="0dp"
164 164
        android:layout_weight="1" />
165 165

+ 34 - 24
app/src/main/res/layout/activity_charging_status.xml

@ -231,16 +231,6 @@
231 231
                    app:wlv_waveColor="#3fffffff"
232 232
                    app:wlv_wave_background_Color="#00ffffff" />
233 233
234
235
                <!--<com.loonggg.circleprogressbarlibrary.view.CircleProgressBar-->
236
                <!--android:id="@+id/pb"-->
237
                <!--android:layout_width="143dp"-->
238
                <!--android:layout_height="143dp"-->
239
                <!--android:visibility="gone"-->
240
                <!--android:layout_centerInParent="true"-->
241
                <!--loonggg:bgProgressBarColor="#efefef"-->
242
                <!--loonggg:circleStrokeWidth="5dp" />-->
243
244 234
                <LinearLayout
245 235
                    android:layout_width="wrap_content"
246 236
                    android:layout_height="wrap_content"
@ -347,10 +337,43 @@
347 337
348 338
                </RelativeLayout>
349 339
340
                <View
341
                    android:layout_width="0.5dp"
342
                    android:layout_height="match_parent"
343
                    android:background="@color/ui_6d" />
344
345
                <RelativeLayout
346
                    android:layout_width="0dp"
347
                    android:layout_height="match_parent"
348
                    android:layout_weight="1">
349
350
                    <TextView
351
                        android:layout_width="wrap_content"
352
                        android:layout_height="wrap_content"
353
                        android:layout_alignParentTop="true"
354
                        android:layout_centerHorizontal="true"
355
                        android:text="账户余额"
356
                        android:textColor="@color/ui_68"
357
                        android:textSize="12sp" />
358
359
                    <TextView
360
                        android:id="@+id/tv_overage"
361
                        android:layout_width="wrap_content"
362
                        android:layout_height="wrap_content"
363
                        android:layout_alignParentBottom="true"
364
                        android:layout_centerHorizontal="true"
365
                        android:layout_centerVertical="true"
366
                        android:text="--"
367
                        android:textColor="@color/ui_62"
368
                        android:textSize="21sp" />
369
370
                </RelativeLayout>
371
350 372
            </LinearLayout>
351 373
352 374
353 375
            <RelativeLayout
376
                android:paddingBottom="30dp"
354 377
                android:layout_width="match_parent"
355 378
                android:layout_height="match_parent">
356 379
                <LinearLayout
@ -385,6 +408,7 @@
385 408
386 409
                </LinearLayout>
387 410
                <ImageView
411
                    tools:src="@drawable/ic_charging_pile"
388 412
                    tools:visibility="visible"
389 413
                    android:id="@+id/iv_activity"
390 414
                    android:layout_width="wrap_content"
@ -396,20 +420,6 @@
396 420
                    android:visibility="gone" />
397 421
398 422
                <TextView
399
                    tools:visibility="visible"
400
                    android:id="@+id/tv_activity"
401
                    android:layout_width="wrap_content"
402
                    android:layout_height="wrap_content"
403
                    android:layout_below="@+id/tv_stop"
404
                    android:layout_centerHorizontal="true"
405
                    android:paddingTop="20dp"
406
                    android:paddingBottom="15dp"
407
                    android:text=""
408
                    android:textColor="#ffa900"
409
                    android:textSize="14sp"
410
                    android:visibility="visible" />
411
412
                <TextView
413 423
                    android:layout_centerHorizontal="true"
414 424
                    android:textStyle="bold"
415 425
                    android:id="@+id/tv_stop"

+ 28 - 0
app/src/main/res/layout/activity_oder_details.xml

@ -273,6 +273,34 @@
273 273
                android:textSize="14sp" />
274 274
275 275
        </RelativeLayout>
276
        <RelativeLayout
277
            tools:visibility="visible"
278
            android:visibility="gone"
279
            android:id="@+id/rl_number_plate"
280
            android:layout_width="match_parent"
281
            android:layout_height="wrap_content"
282
            android:layout_marginTop="13dp">
283
284
            <TextView
285
                android:layout_width="wrap_content"
286
                android:layout_height="wrap_content"
287
                android:layout_alignParentLeft="true"
288
                android:layout_marginLeft="15dp"
289
                android:text="充电车辆"
290
                android:textColor="@color/ui_68"
291
                android:textSize="14sp" />
292
293
            <TextView
294
                android:id="@+id/tv_num_plate"
295
                android:layout_width="wrap_content"
296
                android:layout_height="wrap_content"
297
                android:layout_alignParentRight="true"
298
                android:layout_marginRight="15dp"
299
                tools:text="--"
300
                android:textColor="@color/ui_68"
301
                android:textSize="14sp" />
302
303
        </RelativeLayout>
276 304
277 305
278 306
    </LinearLayout>

+ 29 - 0
app/src/main/res/layout/activity_submit_orders.xml

@ -282,6 +282,35 @@
282 282
                android:textSize="14sp" />
283 283
284 284
        </RelativeLayout>
285
286
        <RelativeLayout
287
            tools:visibility="visible"
288
            android:visibility="gone"
289
            android:id="@+id/rl_number_plate"
290
            android:layout_width="match_parent"
291
            android:layout_height="wrap_content"
292
            android:layout_marginTop="13dp">
293
294
            <TextView
295
                android:layout_width="wrap_content"
296
                android:layout_height="wrap_content"
297
                android:layout_alignParentLeft="true"
298
                android:layout_marginLeft="15dp"
299
                android:text="充电车辆"
300
                android:textColor="@color/ui_68"
301
                android:textSize="14sp" />
302
303
            <TextView
304
                android:id="@+id/tv_num_plate"
305
                android:layout_width="wrap_content"
306
                android:layout_height="wrap_content"
307
                android:layout_alignParentRight="true"
308
                android:layout_marginRight="15dp"
309
                tools:text="--"
310
                android:textColor="@color/ui_68"
311
                android:textSize="14sp" />
312
313
        </RelativeLayout>
285 314
    </LinearLayout>
286 315
287 316
    <TextView

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

@ -21,9 +21,9 @@
21 21
    <com.qmuiteam.qmui.widget.QMUIProgressBar
22 22
        android:id="@+id/qMUIProgressBar"
23 23
        android:layout_width="match_parent"
24
        android:layout_height="16dp"
24
        android:layout_height="12dp"
25 25
        android:textColor="@color/lvse"
26
        android:textSize="16sp"
26
        android:textSize="12sp"
27 27
        android:layout_marginBottom="20dp"
28 28
        android:layout_marginLeft="16dp"
29 29
        android:layout_marginRight="16dp"

详情开发 · dd941c98a5 - Gogs: Go Git Service
Bladeren bron

详情开发

huyuguo 6 jaren geleden
bovenliggende
commit
dd941c98a5

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

@ -12,6 +12,7 @@ import android.os.Bundle;
12 12
import android.text.TextUtils;
13 13
import android.text.method.ScrollingMovementMethod;
14 14
import android.view.LayoutInflater;
15
import android.view.MotionEvent;
15 16
import android.view.View;
16 17
import android.view.ViewGroup;
17 18
import android.widget.ImageView;
@ -44,6 +45,8 @@ import com.squareup.picasso.Picasso;
44 45
import com.zhy.http.okhttp.OkHttpUtils;
45 46
import com.zhy.http.okhttp.callback.StringCallback;
46 47
48
import org.w3c.dom.Text;
49
47 50
import java.util.HashMap;
48 51
import java.util.Map;
49 52
@ -221,6 +224,9 @@ public class ChatContentListActivity extends AppCompatActivity {
221 224
        private TextView topicTitle;
222 225
        private ConstraintLayout userInfo;
223 226
        private ConstraintLayout statusBar;
227
        private TextView commentNumber;
228
        private ConstraintLayout allComments;
229
        private ConstraintLayout allCommentsContainer;
224 230
225 231
        public static ChatContentFragment newInstance(int index, String from) {
226 232
            ChatContentFragment fragment = new ChatContentFragment();
@ -329,6 +335,10 @@ public class ChatContentListActivity extends AppCompatActivity {
329 335
            fold.setOnClickListener(this);
330 336
            closeUnfold.setOnClickListener(this);
331 337
            rootView.findViewById(R.id.bottomView).setOnClickListener(this);
338
            rootView.findViewById(R.id.writeComment).setOnClickListener(this);
339
            rootView.findViewById(R.id.comment).setOnClickListener(this);
340
            allCommentsContainer.setOnClickListener(this);
341
            allComments.setOnClickListener(this);
332 342
        }
333 343
334 344
        @Override
@ -360,6 +370,13 @@ public class ChatContentListActivity extends AppCompatActivity {
360 370
                    break;
361 371
                case R.id.bottomView: // to do nothing
362 372
                    break;
373
                case R.id.writeComment: // 评论列表
374
                case R.id.comment:
375
                    allCommentsContainer.setVisibility(View.VISIBLE);
376
                    break;
377
                case R.id.allCommentsContainer:
378
                    allCommentsContainer.setVisibility(View.GONE);
379
                    break;
363 380
            }
364 381
365 382
        }
@ -378,6 +395,10 @@ public class ChatContentListActivity extends AppCompatActivity {
378 395
            closeUnfold = rootView.findViewById(R.id.closeUnfold);
379 396
            topicTitle = rootView.findViewById(R.id.topicTitle);
380 397
            userInfo = rootView.findViewById(R.id.userInfo);
398
            commentNumber = rootView.findViewById(R.id.commentNumber);
399
400
            allCommentsContainer = rootView.findViewById(R.id.allCommentsContainer);
401
            allComments = rootView.findViewById(R.id.allComments);
381 402
382 403
            ConstraintLayout.LayoutParams statusBarParams = (ConstraintLayout.LayoutParams) statusBar.getLayoutParams();
383 404
            statusBarParams.height = statusBarHeight;
@ -430,6 +451,19 @@ public class ChatContentListActivity extends AppCompatActivity {
430 451
                topicTitle.setText(bean.topicName);
431 452
                topicInfo.setVisibility(View.VISIBLE);
432 453
            }
454
455
            if (bean.commentNums == 0) {
456
                commentNumber.setText("");
457
            } else {
458
                commentNumber.setText(bean.commentNums + "");
459
            }
460
461
            rootView.findViewById(R.id.allCommentsContainer).setOnTouchListener(new View.OnTouchListener() {
462
                @Override
463
                public boolean onTouch(View view, MotionEvent motionEvent) {
464
                    return false;
465
                }
466
            });
433 467
        }
434 468
435 469
        /**

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

@ -49,12 +49,11 @@ public class PublishItemsActivity extends AppCompatActivity implements View.OnCl
49 49
    private ImageView publish_radio;
50 50
    private boolean publishRadioSelected = false;
51 51
    private PublishItemSerializable intentData;
52
    private int activity_publish_items;
53 52
54 53
    @Override
55 54
    protected void onCreate(Bundle savedInstanceState) {
56 55
        super.onCreate(savedInstanceState);
57
        setContentView(activity_publish_items);
56
        setContentView(R.layout.activity_publish_items);
58 57
        BarColorUtil.initStatusBarColor(PublishItemsActivity.this);
59 58
        initView();
60 59
    }

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

@ -0,0 +1,9 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:shape="rectangle">
4
5
    <corners
6
        android:topLeftRadius="6dp"
7
        android:topRightRadius="6dp" />
8
    <solid android:color="#606060" />
9
</shape>

+ 10 - 0
app/src/main/res/drawable/bg_comment_shape.xml

@ -0,0 +1,10 @@
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="14.5dp" />
6
7
    <solid android:color="#606060" />
8
9
10
</shape>

+ 1 - 0
app/src/main/res/layout/activity_chat_content_list.xml

@ -14,4 +14,5 @@
14 14
        app:layout_constraintEnd_toEndOf="parent"
15 15
        app:layout_constraintStart_toStartOf="parent"
16 16
        app:layout_constraintTop_toTopOf="parent"></fr.castorflex.android.verticalviewpager.VerticalViewPager>
17
17 18
</android.support.constraint.ConstraintLayout>

+ 114 - 0
app/src/main/res/layout/fragment_chat_content_comment_list.xml

@ -0,0 +1,114 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:id="@+id/allCommentsContainer"
4
    xmlns:app="http://schemas.android.com/apk/res-auto"
5
    xmlns:tools="http://schemas.android.com/tools"
6
    android:layout_width="match_parent"
7
    android:layout_height="match_parent"
8
    tools:background="#68b8be">
9
10
    <android.support.constraint.ConstraintLayout
11
        android:id="@+id/allComments"
12
        android:layout_width="match_parent"
13
        android:layout_height="480dp"
14
        android:background="@drawable/bg_all_comment_shape"
15
        app:layout_constraintBottom_toBottomOf="parent"
16
        app:layout_constraintLeft_toLeftOf="parent"
17
        app:layout_constraintRight_toRightOf="parent">
18
19
20
        <android.support.constraint.ConstraintLayout
21
            android:layout_width="match_parent"
22
            android:layout_height="40dp"
23
            app:layout_constraintTop_toTopOf="parent">
24
            <TextView
25
                android:id="@+id/allCommentTitle"
26
                tools:text="全部评论 12"
27
                app:layout_constraintTop_toTopOf="parent"
28
                app:layout_constraintBottom_toBottomOf="parent"
29
                android:gravity="center_horizontal"
30
                android:textSize="14sp"
31
                android:textColor="#c2c2c2"
32
                android:layout_width="match_parent"
33
                android:layout_height="wrap_content" />
34
            <ImageView
35
                android:id="@+id/allCommentsClose"
36
                android:src="@drawable/icon_close"
37
                android:scaleType="center"
38
                app:layout_constraintRight_toRightOf="parent"
39
                android:layout_width="45dp"
40
                android:layout_height="match_parent" />
41
42
            <View
43
                android:background="#505050"
44
                android:layout_width="match_parent"
45
                android:layout_height="1dp"
46
                app:layout_constraintBottom_toBottomOf="parent" />
47
        </android.support.constraint.ConstraintLayout>
48
49
        <!-- 底部评论输入及发布 -->
50
        <android.support.constraint.ConstraintLayout
51
            android:layout_width="match_parent"
52
            android:layout_height="54dp"
53
            android:background="#535353"
54
            app:layout_constraintBottom_toBottomOf="parent"
55
            app:layout_constraintEnd_toEndOf="parent"
56
            app:layout_constraintStart_toStartOf="parent">
57
58
            <android.support.constraint.ConstraintLayout
59
                android:layout_width="0dp"
60
                android:layout_height="30dp"
61
                android:layout_marginLeft="15dp"
62
                android:background="@drawable/bg_comment_shape"
63
                app:layout_constraintBottom_toBottomOf="parent"
64
                app:layout_constraintLeft_toLeftOf="parent"
65
                app:layout_constraintRight_toLeftOf="@+id/bPublish"
66
                app:layout_constraintTop_toTopOf="parent">
67
68
                <ImageView
69
                    android:id="@+id/bCommentIcon"
70
                    android:layout_width="wrap_content"
71
                    android:layout_height="wrap_content"
72
                    android:layout_marginStart="15dp"
73
                    android:paddingRight="5dp"
74
                    app:layout_constraintBottom_toBottomOf="parent"
75
                    app:layout_constraintStart_toStartOf="parent"
76
                    app:layout_constraintTop_toTopOf="parent"
77
                    app:srcCompat="@drawable/write_comment_icon" />
78
79
                <TextView
80
                    android:id="@+id/bCommentContent"
81
                    android:layout_width="0dp"
82
                    android:layout_height="wrap_content"
83
                    android:ellipsize="end"
84
                    android:gravity="center_vertical"
85
                    android:hint="写评论"
86
                    android:maxLines="1"
87
                    android:textColor="#ffffff"
88
                    android:textColorHint="#c2c2c2"
89
                    android:textSize="14sp"
90
                    app:layout_constraintBottom_toBottomOf="parent"
91
                    app:layout_constraintLeft_toRightOf="@+id/bCommentIcon"
92
                    app:layout_constraintRight_toRightOf="parent"
93
                    app:layout_constraintTop_toTopOf="parent" />
94
            </android.support.constraint.ConstraintLayout>
95
96
            <TextView
97
                android:id="@+id/bPublish"
98
                android:layout_width="wrap_content"
99
                android:layout_height="0dp"
100
                android:gravity="center_vertical"
101
                android:paddingLeft="13dp"
102
                android:paddingRight="15dp"
103
                android:text="发布"
104
                android:textColor="#7e7e7e"
105
                android:textSize="14sp"
106
                app:layout_constraintBottom_toBottomOf="parent"
107
                app:layout_constraintRight_toRightOf="parent"
108
                app:layout_constraintTop_toTopOf="parent"
109
                tools:layout_editor_absoluteX="348dp"
110
                tools:layout_editor_absoluteY="19dp" />
111
        </android.support.constraint.ConstraintLayout>
112
    </android.support.constraint.ConstraintLayout>
113
114
</android.support.constraint.ConstraintLayout>

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

@ -289,11 +289,11 @@
289 289
                    android:layout_height="wrap_content"
290 290
                    android:src="@drawable/comment_icon"
291 291
                    app:layout_constraintBottom_toBottomOf="parent"
292
                    app:layout_constraintRight_toLeftOf="@+id/commentLabel"
292
                    app:layout_constraintRight_toLeftOf="@+id/commentNumber"
293 293
                    app:layout_constraintTop_toTopOf="parent" />
294 294
295 295
                <TextView
296
                    android:id="@+id/commentLabel"
296
                    android:id="@+id/commentNumber"
297 297
                    android:layout_width="wrap_content"
298 298
                    android:layout_height="match_parent"
299 299
                    android:gravity="center"

+ 8 - 5
app/src/main/res/layout/fragment_chat_content_pictures.xml

@ -1,11 +1,14 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout
3
    xmlns:android="http://schemas.android.com/apk/res/android"
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
4 3
    xmlns:app="http://schemas.android.com/apk/res-auto"
5 4
    xmlns:tools="http://schemas.android.com/tools"
6
    android:background="#990545"
7 5
    android:layout_width="match_parent"
8
    android:layout_height="match_parent">
6
    android:layout_height="match_parent"
7
    android:background="#990545">
9 8
10
    <include layout="@layout/fragment_chat_content_common"/>
9
    <include layout="@layout/fragment_chat_content_common" />
10
11
    <include
12
        layout="@layout/fragment_chat_content_comment_list"
13
        android:visibility="gone" />
11 14
</android.support.constraint.ConstraintLayout>

+ 5 - 1
app/src/main/res/layout/fragment_chat_content_video.xml

@ -44,5 +44,9 @@
44 44
45 45
    </android.support.constraint.ConstraintLayout>
46 46
47
    <include layout="@layout/fragment_chat_content_common"/>
47
    <include layout="@layout/fragment_chat_content_common" />
48
49
    <include
50
        layout="@layout/fragment_chat_content_comment_list"
51
        android:visibility="gone" />
48 52
</android.support.constraint.ConstraintLayout>