*/
1596
    private void getVacancy() {
1597
        Map<String, String> map = new HashMap<>();
1598
        map.put("zhanid", NewZhanDetailsActivity.zhan_id + "");
1599
        CommonParams.addCommonParams(map);
1600
        String query = Util.convertMap2Query(map);
1601
1602
        String url = MainApplication.url + ":9080/get_vacancy?" + query;
1603
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1604
            @Override
1605
            public void onError(Call call, Exception e) {
1606
                loadingDialog.dismiss();
1607
                parking_icon.setVisibility(View.GONE);
1608
            }
1609
1610
            @Override
1611
            public void onResponse(String response) {
1612
                loadingDialog.dismiss();
1613
                vacancyCode = JsonUtils.getKeyResult(response, "rtnCode");
1614
                updateParkingIcon();
1615
            }
1616
        });
1617
    }
1618
1619
    /**
1620
     * 上传空车位
1621
     */
1622
1623
    private void addVacancy() {
1624
        if (!MainApplication.isLogin()) {
1625
            startActivity(new Intent(getActivity().getApplicationContext(), LoginActivity.class));
1626
            ToastUtil.showToast(getActivity().getApplicationContext(), "请先登录", Toast.LENGTH_SHORT);
1627
            return;
1628
        }
1629
1630
        loadingDialog.show();
1631
        MobclickAgent.onEvent(getContext(), "1128");
1632
        Map<String, String> map = new HashMap<>();
1633
        map.put("zhanid", NewZhanDetailsActivity.zhan_id + "");
1634
        map.put("userid", MainApplication.userId);
1635
        String timer = getMD5(String.valueOf((System.currentTimeMillis() / 1000 - MainMapActivity.cha) / 10) + "qwerty");
1636
        map.put("timer", timer);
1637
        CommonParams.addCommonParams(map);
1638
        String query = Util.convertMap2Query(map);
1639
        String url = MainApplication.url + ":9080/add_vacancy?" + query;
1640
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1641
            @Override
1642
            public void onError(Call call, Exception e) {
1643
                loadingDialog.dismiss();
1644
            }
1645
1646
            @Override
1647
            public void onResponse(String response) {
1648
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1649
                String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
1650
                if ("0".equals(rtnCode)) {
1651
                    ToastUtil.showToast(getContext(), rtnMsg, Toast.LENGTH_SHORT);
1652
                    getVacancy();
1653
                } else {
1654
                    loadingDialog.dismiss();
1655
                    ToastUtil.showToast(getContext(), rtnMsg, Toast.LENGTH_SHORT);
1656
                }
1657
1658
            }
1659
        });
1660
    }
1661
1662
    private void updateParkingIcon() {
1663
        if ("2000".equals(vacancyCode)) { //
1664
            parking_icon.setVisibility(View.GONE);
1665
        } else {
1666
            parking_icon.setVisibility(View.VISIBLE);
1667
            if ("1".equals(freeStatus)) { // 有状态的站点
1668
                if ("0".equals(acableNum) && "0".equals(dcableNum)) { // 无空闲桩
1669
                    parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_no_parking));
1670
                } else {
1671
                    if ("1002".equals(vacancyCode)) { // 无有空闲桩
1672
                        parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_report_parking));
1673
                    } else { // 有空闲桩
1674
                        parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_parking));
1675
                    }
1676
                }
1677
            } else {
1678
                if ("1002".equals(vacancyCode)) { // 无有空闲桩
1679
                    parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_report_parking));
1680
                } else { // 有空闲桩
1681
                    parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_parking));
1682
                }
1683
            }
1684
        }
1685
    }
1686
1687 1510
    @Override
1688 1511
    public void onDestroyView() {
1689 1512
        try {
@ -1695,7 +1518,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1695 1518
    }
1696 1519
1697 1520
    public static String getMD5(String content) {
1698
1699 1521
        try {
1700 1522
1701 1523
            MessageDigest digest = MessageDigest.getInstance("MD5");

+ 0 - 145
app/src/main/java/com/electric/chargingpile/fragment/ReportParkingDialogFragment.java

@ -1,145 +0,0 @@
1
package com.electric.chargingpile.fragment;
2
3
import android.app.Dialog;
4
import android.os.Bundle;
5
import androidx.constraintlayout.widget.ConstraintLayout;
6
import androidx.fragment.app.DialogFragment;
7
import android.view.Gravity;
8
import android.view.View;
9
import android.view.Window;
10
import android.view.WindowManager;
11
import android.widget.Button;
12
import android.widget.ImageView;
13
14
import com.electric.chargingpile.R;
15
16
public class ReportParkingDialogFragment extends DialogFragment implements View.OnClickListener {
17
18
    public static final String TYPE_FIRST = "first";
19
    public static final String TYPE_SECOND = "second";
20
    public static final String TYPE_THIRD = "third";
21
22
    private static Dialog mDialog;
23
    private String mType;
24
    private ConstraintLayout container;
25
    private ConstraintLayout first;
26
    private ImageView first_close;
27
    private ConstraintLayout second;
28
    private ImageView second_close;
29
    private Button cancel_report;
30
    private Button report;
31
    private ConstraintLayout third;
32
    private ImageView third_close;
33
    private OnReportParkingDialogFragmentListener reportParkingDialogFragmentListener;
34
35
    public static ReportParkingDialogFragment newInstance(String type) {
36
        Bundle args = new Bundle();
37
        args.putSerializable("type", type);
38
        ReportParkingDialogFragment fragment = new ReportParkingDialogFragment();
39
        fragment.setArguments(args);
40
        return fragment;
41
    }
42
43
    @Override
44
    public Dialog onCreateDialog(Bundle savedInstanceState) {
45
        mDialog = new Dialog(getActivity(), R.style.CenterDialog);
46
        mDialog.setCancelable(true);
47
        mDialog.setCanceledOnTouchOutside(true);
48
49
        mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
50
        mDialog.setContentView(R.layout.fragment_dialog_report_parking);
51
52
        Window window = mDialog.getWindow();
53
        WindowManager.LayoutParams layoutParams = window.getAttributes();
54
        // 布局属性位于整个窗口底部
55
        layoutParams.gravity = Gravity.CENTER;
56
        // 布局属性宽度填充整个窗口,默认是有margin的
57
        layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
58
        window.setAttributes(layoutParams);
59
60
        initDialog();
61
        initListener();
62
63
        return mDialog;
64
    }
65
66
    private void initDialog() {
67
        mType = (String)getArguments().get("type");
68
        container = mDialog.findViewById(R.id.container);
69
        first = mDialog.findViewById(R.id.first);
70
        first_close = mDialog.findViewById(R.id.first_close);
71
72
        second = mDialog.findViewById(R.id.second);
73
        second_close = mDialog.findViewById(R.id.second_close);
74
        cancel_report = mDialog.findViewById(R.id.cancel_report);
75
        report = mDialog.findViewById(R.id.report);
76
77
        third = mDialog.findViewById(R.id.third);
78
        third_close = mDialog.findViewById(R.id.third_close);
79
80
81
        if (TYPE_FIRST.equals(mType)) {
82
            first.setVisibility(View.VISIBLE);
83
            second.setVisibility(View.GONE);
84
            third.setVisibility(View.GONE);
85
        } else if (TYPE_SECOND.equals(mType)) {
86
            first.setVisibility(View.GONE);
87
            second.setVisibility(View.VISIBLE);
88
            third.setVisibility(View.GONE);
89
        } else {
90
            first.setVisibility(View.GONE);
91
            second.setVisibility(View.GONE);
92
            third.setVisibility(View.VISIBLE);
93
        }
94
    }
95
96
    private void initListener() {
97
        container.setOnClickListener(this);
98
99
        first.setOnClickListener(this);
100
        first_close.setOnClickListener(this);
101
102
        second.setOnClickListener(this);
103
        second_close.setOnClickListener(this);
104
        cancel_report.setOnClickListener(this);
105
        report.setOnClickListener(this);
106
107
        third.setOnClickListener(this);
108
        third_close.setOnClickListener(this);
109
    }
110
111
    @Override
112
    public void onClick(View v) {
113
        switch (v.getId()) {
114
            case R.id.container:
115
                mDialog.dismiss();
116
                break;
117
            case R.id.first_close:
118
                mDialog.dismiss();
119
                break;
120
            case R.id.second_close:
121
                mDialog.dismiss();
122
                break;
123
            case R.id.cancel_report:
124
                mDialog.dismiss();
125
                break;
126
            case R.id.report:
127
                if (reportParkingDialogFragmentListener != null) {
128
                    reportParkingDialogFragmentListener.report();
129
                }
130
                mDialog.dismiss();
131
                break;
132
            case R.id.third_close:
133
                mDialog.dismiss();
134
                break;
135
        }
136
    }
137
138
    public interface OnReportParkingDialogFragmentListener {
139
        void report();
140
    }
141
142
    public void setOnReportParkingDialogFragmentListener(OnReportParkingDialogFragmentListener listener) {
143
        this.reportParkingDialogFragmentListener = listener;
144
    }
145
}

BIN
app/src/main/res/drawable-hdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-hdpi/detail_parking.png


BIN
app/src/main/res/drawable-hdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-hdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-hdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-hdpi/detail_report_parking.png


BIN
app/src/main/res/drawable-mdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-mdpi/detail_parking.png


BIN
app/src/main/res/drawable-mdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-mdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-mdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-mdpi/detail_report_parking.png


BIN
app/src/main/res/drawable-xhdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-xhdpi/detail_parking.png


BIN
app/src/main/res/drawable-xhdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-xhdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-xhdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-xhdpi/detail_report_parking.png


BIN
app/src/main/res/drawable-xxhdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-xxhdpi/detail_report_parking.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_report_parking.png


+ 0 - 36
app/src/main/res/layout/activity_new_zhan_details.xml

@ -352,42 +352,6 @@
352 352
            android:textAppearance="?android:attr/textAppearanceMedium"
353 353
            android:textColor="@color/white" />
354 354
355
356
        <!--<TextView-->
357
        <!--android:id="@+id/tv_chenggong"-->
358
        <!--android:layout_width="wrap_content"-->
359
        <!--android:layout_height="wrap_content"-->
360
        <!--android:paddingLeft="8dp"-->
361
        <!--android:paddingRight="8dp"-->
362
        <!--android:paddingBottom="4dp"-->
363
        <!--android:paddingTop="4dp"-->
364
        <!--android:text="成功"-->
365
        <!--android:textColor="@color/white"-->
366
        <!--android:background="@drawable/textview_bglv"-->
367
        <!--android:textSize="16sp"-->
368
        <!--android:layout_marginRight="16dp"-->
369
        <!--android:layout_alignTop="@+id/tv_shibai"-->
370
        <!--android:layout_toLeftOf="@+id/tv_shibai"-->
371
        <!--android:layout_toStartOf="@+id/tv_shibai" />-->
372
373
        <!--<TextView-->
374
        <!--android:id="@+id/tv_shibai"-->
375
        <!--android:layout_width="wrap_content"-->
376
        <!--android:layout_height="wrap_content"-->
377
        <!--android:paddingLeft="8dp"-->
378
        <!--android:paddingRight="8dp"-->
379
        <!--android:paddingBottom="4dp"-->
380
        <!--android:paddingTop="4dp"-->
381
        <!--android:text="失败"-->
382
        <!--android:textColor="@color/white"-->
383
        <!--android:background="@drawable/textview_bgju"-->
384
        <!--android:textSize="16sp"-->
385
        <!--android:layout_marginRight="16dp"-->
386
        <!--android:layout_centerVertical="true"-->
387
        <!--android:layout_alignParentRight="true"-->
388
        <!--android:layout_alignParentEnd="true" />-->
389
390 355
    </LinearLayout>
391 356
392
393 357
</LinearLayout>

+ 5 - 18
app/src/main/res/layout/fragmen_details_new.xml

@ -448,8 +448,8 @@
448 448
                        android:layout_width="0dp"
449 449
                        android:layout_height="wrap_content"
450 450
                        android:layout_weight="3"
451
                        tools:background="#00ff00"
452
                        android:orientation="vertical">
451
                        android:orientation="vertical"
452
                        tools:background="#00ff00">
453 453
454 454
                        <LinearLayout
455 455
                            android:layout_width="wrap_content"
@ -489,8 +489,8 @@
489 489
                        android:layout_width="0dp"
490 490
                        android:layout_height="match_parent"
491 491
                        android:layout_weight="2"
492
                        tools:background="#ff0000"
493
                        android:gravity="center_vertical|right">
492
                        android:gravity="center_vertical|right"
493
                        tools:background="#ff0000">
494 494
495 495
                        <TextView
496 496
                            android:layout_width="wrap_content"
@ -499,6 +499,7 @@
499 499
                            android:text="电价详情"
500 500
                            android:textColor="@color/color_222222"
501 501
                            android:textSize="14sp" />
502
502 503
                        <ImageView
503 504
                            android:layout_width="wrap_content"
504 505
                            android:layout_height="wrap_content"
@ -827,19 +828,5 @@
827 828
            </RelativeLayout>
828 829
829 830
        </LinearLayout>
830
831 831
    </com.electric.chargingpile.view.CustomScrollView>
832
833
    <ImageView
834
        android:id="@+id/parking_icon"
835
        android:layout_width="wrap_content"
836
        android:layout_height="wrap_content"
837
        android:layout_marginRight="15dp"
838
        android:layout_marginBottom="15dp"
839
        android:src="@drawable/detail_report_parking"
840
        android:visibility="gone"
841
        app:layout_constraintBottom_toBottomOf="parent"
842
        app:layout_constraintRight_toRightOf="parent"
843
        tools:visibility="visible" />
844
845 832
</androidx.constraintlayout.widget.ConstraintLayout>

+ 0 - 224
app/src/main/res/layout/fragment_dialog_report_parking.xml

@ -1,224 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:id="@+id/container"
6
    android:layout_width="match_parent"
7
    android:layout_height="match_parent"
8
    android:background="#a0000000">
9
10
    <androidx.constraintlayout.widget.ConstraintLayout
11
        android:id="@+id/first"
12
        android:layout_width="310dp"
13
        android:layout_height="255dp"
14
        android:visibility="gone"
15
        app:layout_constraintBottom_toBottomOf="parent"
16
        app:layout_constraintLeft_toLeftOf="parent"
17
        app:layout_constraintRight_toRightOf="parent"
18
        app:layout_constraintTop_toTopOf="parent">
19
20
        <ImageView
21
            android:layout_width="match_parent"
22
            android:layout_height="match_parent"
23
            android:src="@drawable/detail_parking_alert_first" />
24
25
        <ImageView
26
            android:id="@+id/first_close"
27
            android:layout_width="wrap_content"
28
            android:layout_height="wrap_content"
29
            android:layout_marginTop="40dp"
30
            android:padding="10dp"
31
            android:src="@drawable/report_parking_close"
32
            app:layout_constraintRight_toRightOf="parent"
33
            app:layout_constraintTop_toTopOf="parent" />
34
35
        <TextView
36
            android:id="@+id/first_msg"
37
            android:layout_width="match_parent"
38
            android:layout_height="wrap_content"
39
            android:layout_marginLeft="28dp"
40
            android:layout_marginTop="90dp"
41
            android:layout_marginRight="28dp"
42
            android:text="对不起,请在该充电站100米范围内上报“有充电车位”信息"
43
            android:textColor="#222222"
44
            android:textSize="14sp"
45
            app:layout_constraintLeft_toLeftOf="parent"
46
            app:layout_constraintRight_toRightOf="parent"
47
            app:layout_constraintTop_toTopOf="parent" />
48
49
        <TextView
50
            android:layout_width="match_parent"
51
            android:layout_height="wrap_content"
52
            android:layout_marginLeft="28dp"
53
            android:layout_marginTop="10dp"
54
            android:layout_marginRight="28dp"
55
            android:text="非常感谢,您的信息可以帮助到更多的充电用户"
56
            android:textColor="#bcbcbc"
57
            android:textSize="14sp"
58
            app:layout_constraintLeft_toLeftOf="parent"
59
            app:layout_constraintRight_toRightOf="parent"
60
            app:layout_constraintTop_toBottomOf="@+id/first_msg" />
61
62
        <TextView
63
            android:layout_width="match_parent"
64
            android:layout_height="wrap_content"
65
            android:layout_marginBottom="10dp"
66
            android:text="有任何疑问可以联系充电桩客服微信\nchongdianzhuang2"
67
            android:textAlignment="center"
68
            android:textColor="#a7a7a7"
69
            android:textSize="12sp"
70
            app:layout_constraintBottom_toBottomOf="parent"
71
            app:layout_constraintLeft_toLeftOf="parent"
72
            app:layout_constraintRight_toRightOf="parent" />
73
74
    </androidx.constraintlayout.widget.ConstraintLayout>
75
76
    <androidx.constraintlayout.widget.ConstraintLayout
77
        android:id="@+id/second"
78
        android:layout_width="310dp"
79
        android:layout_height="320dp"
80
        android:visibility="gone"
81
        app:layout_constraintBottom_toBottomOf="parent"
82
        app:layout_constraintLeft_toLeftOf="parent"
83
        app:layout_constraintRight_toRightOf="parent"
84
        app:layout_constraintTop_toTopOf="parent">
85
86
        <ImageView
87
            android:layout_width="match_parent"
88
            android:layout_height="match_parent"
89
            android:src="@drawable/detail_parking_alert_second" />
90
91
        <ImageView
92
            android:id="@+id/second_close"
93
            android:layout_width="wrap_content"
94
            android:layout_height="wrap_content"
95
            android:layout_marginTop="40dp"
96
            android:padding="10dp"
97
            android:src="@drawable/report_parking_close"
98
            app:layout_constraintRight_toRightOf="parent"
99
            app:layout_constraintTop_toTopOf="parent" />
100
101
        <TextView
102
            android:id="@+id/second_msg"
103
            android:layout_width="match_parent"
104
            android:layout_height="wrap_content"
105
            android:layout_marginLeft="28dp"
106
            android:layout_marginTop="90dp"
107
            android:layout_marginRight="28dp"
108
            android:text="您上报的“有充电车位”信息,可以作为其他用户到此充电的重要参考依据,务必真实上报"
109
            android:textColor="#222222"
110
            android:textSize="14sp"
111
            app:layout_constraintLeft_toLeftOf="parent"
112
            app:layout_constraintRight_toRightOf="parent"
113
            app:layout_constraintTop_toTopOf="parent" />
114
115
        <TextView
116
            android:id="@+id/second_desc"
117
            android:layout_width="match_parent"
118
            android:layout_height="wrap_content"
119
            android:layout_marginLeft="28dp"
120
            android:layout_marginTop="10dp"
121
            android:layout_marginRight="28dp"
122
            android:text="非常感谢,您的信息可以帮助到更多的充电用户"
123
            android:textColor="#bcbcbc"
124
            android:textSize="14sp"
125
            app:layout_constraintLeft_toLeftOf="parent"
126
            app:layout_constraintRight_toRightOf="parent"
127
            app:layout_constraintTop_toBottomOf="@+id/second_msg" />
128
129
        <LinearLayout
130
            android:layout_width="match_parent"
131
            android:layout_height="35dp"
132
            android:layout_marginTop="20dp"
133
            android:gravity="center"
134
            app:layout_constraintTop_toBottomOf="@+id/second_desc">
135
136
            <Button
137
                android:id="@+id/cancel_report"
138
                android:layout_width="100dp"
139
                android:layout_height="match_parent"
140
                android:background="@drawable/cancel_report_parking_shap"
141
                android:text="取消上报"
142
                android:textColor="#999999"
143
                android:textSize="13sp" />
144
145
            <Button
146
                android:id="@+id/report"
147
                android:layout_width="100dp"
148
                android:layout_height="match_parent"
149
                android:layout_marginLeft="10dp"
150
                android:background="@drawable/report_parking_shape"
151
                android:text="上报空停车位"
152
                android:textColor="#ffffff"
153
                android:textSize="13sp" />
154
155
        </LinearLayout>
156
157
158
        <TextView
159
            android:layout_width="match_parent"
160
            android:layout_height="wrap_content"
161
            android:layout_marginBottom="10dp"
162
            android:text="有任何疑问可以联系充电桩客服微信\nchongdianzhuang2"
163
            android:textAlignment="center"
164
            android:textColor="#a7a7a7"
165
            android:textSize="12sp"
166
            app:layout_constraintBottom_toBottomOf="parent"
167
            app:layout_constraintLeft_toLeftOf="parent"
168
            app:layout_constraintRight_toRightOf="parent" />
169
170
    </androidx.constraintlayout.widget.ConstraintLayout>
171
172
    <androidx.constraintlayout.widget.ConstraintLayout
173
        android:id="@+id/third"
174
        android:layout_width="310dp"
175
        android:layout_height="200dp"
176
        app:layout_constraintBottom_toBottomOf="parent"
177
        app:layout_constraintLeft_toLeftOf="parent"
178
        app:layout_constraintRight_toRightOf="parent"
179
        app:layout_constraintTop_toTopOf="parent">
180
181
        <ImageView
182
            android:layout_width="match_parent"
183
            android:layout_height="match_parent"
184
            android:src="@drawable/detail_parking_alert_third" />
185
186
        <ImageView
187
            android:id="@+id/third_close"
188
            android:layout_width="wrap_content"
189
            android:layout_height="wrap_content"
190
            android:layout_marginTop="40dp"
191
            android:padding="10dp"
192
            android:src="@drawable/report_parking_close"
193
            app:layout_constraintRight_toRightOf="parent"
194
            app:layout_constraintTop_toTopOf="parent" />
195
196
        <TextView
197
            android:id="@+id/third_msg"
198
            android:layout_width="match_parent"
199
            android:layout_height="wrap_content"
200
            android:layout_marginLeft="28dp"
201
            android:layout_marginTop="90dp"
202
            android:layout_marginRight="28dp"
203
            android:text="该充电站目前没有充电车位"
204
            android:textColor="#222222"
205
            android:textSize="14sp"
206
            app:layout_constraintLeft_toLeftOf="parent"
207
            app:layout_constraintRight_toRightOf="parent"
208
            app:layout_constraintTop_toTopOf="parent" />
209
210
        <TextView
211
            android:layout_width="match_parent"
212
            android:layout_height="wrap_content"
213
            android:layout_marginBottom="10dp"
214
            android:text="有任何疑问可以联系充电桩客服微信\nchongdianzhuang2"
215
            android:textAlignment="center"
216
            android:textColor="#a7a7a7"
217
            android:textSize="12sp"
218
            app:layout_constraintBottom_toBottomOf="parent"
219
            app:layout_constraintLeft_toLeftOf="parent"
220
            app:layout_constraintRight_toRightOf="parent" />
221
222
    </androidx.constraintlayout.widget.ConstraintLayout>
223
224
</androidx.constraintlayout.widget.ConstraintLayout>

就隐私协议去除 · 2b7c54e97c - Gogs: Go Git Service
Parcourir la Source

就隐私协议去除

huyuguo 5 ans auparavant
Parent
commit
2b7c54e97c

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

@ -335,9 +335,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
335 335
    public static RelativeLayout paoRl;
336 336
    public static LinearLayout rl_control;
337 337
    private RelativeLayout rela, ll_comment, rl_ad, rl_grade, rl_search, ll_paoxiang, rl_charging_notice;
338
    private ConstraintLayout rl_privacy_protocol;
339
    private ImageView private_protocol_sure_and_go;
340
    private Button private_protocol_web;
341 338
    private RelativeLayout tv_notice, tv_citynotice, rl_mapList, ll_tab_find;
342 339
    private LinearLayout ll_paogo, ll_title, ll_open, tab_me, tab_screen;
343 340
    public static LinearLayout ll_tuijian, ll_top_right;
@ -429,7 +426,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
429 426
                    break;
430 427
                //获取版本号及首页广告
431 428
                case 2:
432
                    boolean showedPrivateProtocol = sharedPreferencesUtil.hasKey("cdz_private_protocol");
433 429
                    try {
434 430
                        String data = JsonUtils.getKeyResult(msg.obj.toString(), "data");
435 431
                        if (!data.equals("")) {
@ -444,30 +440,18 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
444 440
                            }
445 441
446 442
                            String adin = JsonUtils.getKeyResult(data, "adin");
447
                            if (null == adin) {
448
                                if (!showedPrivateProtocol) {
449
                                    rl_privacy_protocol.setVisibility(View.VISIBLE);
450
                                }
451
                            } else {
443
                            if (null != adin) {
452 444
                                List<Adin> listAdin = JsonUtils.parseToObjectList(adin, Adin.class);
453 445
                                System.out.print("size:" + listAdin.size());
454 446
                                if (listAdin.size() > 0) {
455 447
                                    sav.initData(listAdin);
456
                                    if (!showedPrivateProtocol) {
457
                                        rl_privacy_protocol.setVisibility(View.VISIBLE);
458
                                    } else {
459
                                        rl_ad.setVisibility(View.VISIBLE);
460
                                        for (Adin item : listAdin) {
461
                                            if (item.getAdvertiser().equals("1")) {
462
                                                loadDmpData();
463
                                                break;
464
                                            }
448
                                    rl_ad.setVisibility(View.VISIBLE);
449
                                    for (Adin item : listAdin) {
450
                                        if (item.getAdvertiser().equals("1")) {
451
                                            loadDmpData();
452
                                            break;
465 453
                                        }
466 454
                                    }
467
                                } else {
468
                                    if (!showedPrivateProtocol) {
469
                                        rl_privacy_protocol.setVisibility(View.VISIBLE);
470
                                    }
471 455
                                }
472 456
                            }
473 457
@ -491,16 +475,9 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
491 475
                                }
492 476
                            }
493 477
494
                        } else {
495
                            if (!showedPrivateProtocol) {
496
                                rl_privacy_protocol.setVisibility(View.VISIBLE);
497
                            }
498 478
                        }
499 479
                    } catch (Exception e) {
500 480
                        e.printStackTrace();
501
                        if (!showedPrivateProtocol) {
502
                            rl_privacy_protocol.setVisibility(View.VISIBLE);
503
                        }
504 481
                    }
505 482
506 483
@ -1408,15 +1385,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1408 1385
        //首页广告关闭按钮
1409 1386
        iv_clear = (ImageView) findViewById(R.id.iv_clear);
1410 1387
        iv_clear.setOnClickListener(this);
1411
        // 首页隐私协议
1412
        rl_privacy_protocol = findViewById(R.id.rl_privacy_protocol);
1413
        rl_privacy_protocol.setOnClickListener(this);
1414
1415
        private_protocol_sure_and_go = findViewById(R.id.private_protocol_sure_and_go);
1416
        private_protocol_sure_and_go.setOnClickListener(this);
1417
1418
        private_protocol_web = findViewById(R.id.private_protocol_web);
1419
        private_protocol_web.setOnClickListener(this);
1420 1388
1421 1389
        tv_citynotice = (RelativeLayout) findViewById(R.id.tv_citynotice);
1422 1390
        tv_citynotice.setOnClickListener(new View.OnClickListener() {
@ -2876,15 +2844,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
2876 2844
            case R.id.iv_clear:
2877 2845
                rl_ad.setVisibility(View.GONE);
2878 2846
                break;
2879
            case R.id.private_protocol_sure_and_go:
2880
                sharedPreferencesUtil.putBoolean("cdz_private_protocol", true);
2881
                rl_privacy_protocol.setVisibility(View.GONE);
2882
                break;
2883
            case R.id.private_protocol_web:
2884
                intent = new Intent(getApplication(), IntegralDescriptionActivity.class);
2885
                intent.putExtra("url", "http://evcharge.cc/pc/agreement.html");
2886
                startActivity(intent);
2887
                break;
2888 2847
            case R.id.rl_search:
2889 2848
                if (isListShow == false) {
2890 2849
                    windowLayout.setVisibility(View.GONE);

BIN
app/src/main/res/drawable-hdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-hdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-mdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-mdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-xhdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-xhdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-xxhdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-xxhdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-xxxhdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-xxxhdpi/private_protocol_btn.png


+ 0 - 47
app/src/main/res/layout/activity_main_map.xml

@ -1790,51 +1790,4 @@
1790 1790
            android:src="@drawable/icon_adbutton2_0" />
1791 1791
    </com.zhy.autolayout.AutoRelativeLayout>
1792 1792
    <!-- 首页弹出广告布局 end -->
1793
    <!-- 首页首次启动弹出隐私协议 start -->
1794
    <androidx.constraintlayout.widget.ConstraintLayout
1795
        android:id="@+id/rl_privacy_protocol"
1796
        android:layout_width="match_parent"
1797
        android:layout_height="match_parent"
1798
        android:background="@drawable/bg_black2_0"
1799
        android:visibility="gone">
1800
1801
        <androidx.constraintlayout.widget.ConstraintLayout
1802
            android:layout_width="wrap_content"
1803
            android:layout_height="wrap_content"
1804
            app:layout_constraintBottom_toBottomOf="parent"
1805
            app:layout_constraintLeft_toLeftOf="parent"
1806
            app:layout_constraintRight_toRightOf="parent"
1807
            app:layout_constraintTop_toTopOf="parent">
1808
1809
            <ImageView
1810
                android:layout_width="wrap_content"
1811
                android:layout_height="wrap_content"
1812
                android:src="@drawable/private_protocol_bg"
1813
                app:layout_constraintBottom_toBottomOf="parent"
1814
                app:layout_constraintLeft_toLeftOf="parent"
1815
                app:layout_constraintRight_toRightOf="parent"
1816
                app:layout_constraintTop_toTopOf="parent" />
1817
1818
            <ImageView
1819
                android:id="@+id/private_protocol_sure_and_go"
1820
                android:layout_width="wrap_content"
1821
                android:layout_height="wrap_content"
1822
                android:layout_marginBottom="15dp"
1823
                android:src="@drawable/private_protocol_btn"
1824
                app:layout_constraintBottom_toBottomOf="parent"
1825
                app:layout_constraintLeft_toLeftOf="parent"
1826
                app:layout_constraintRight_toRightOf="parent" />
1827
1828
            <Button
1829
                android:id="@+id/private_protocol_web"
1830
                android:layout_width="120dp"
1831
                android:layout_height="36dp"
1832
                android:layout_marginLeft="15dp"
1833
                android:layout_marginBottom="15dp"
1834
                android:background="@color/transparent"
1835
                app:layout_constraintBottom_toTopOf="@+id/private_protocol_sure_and_go"
1836
                app:layout_constraintLeft_toLeftOf="parent" />
1837
        </androidx.constraintlayout.widget.ConstraintLayout>
1838
    </androidx.constraintlayout.widget.ConstraintLayout>
1839
    <!-- 首页首次启动弹出隐私协议 end -->
1840 1793
</RelativeLayout>