Explorar el Código

首页搜索相关问题修复

huyuguo %!s(int64=5) %!d(string=hace) años
padre
commit
da3749f236

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

1664
1664
1665
        String search_address = ProfileManager.getInstance().getSearchAddress(this);
1665
        String search_address = ProfileManager.getInstance().getSearchAddress(this);
1666
        if (search_address.equals("")) {
1666
        if (search_address.equals("")) {
1667
            tv_search.setText("请输入要查找的地名");
1667
            tv_search.setText("请输入地址/关键字");
1668
            iv_clear_address.setVisibility(View.INVISIBLE);
1668
            iv_clear_address.setVisibility(View.INVISIBLE);
1669
        } else {
1669
        } else {
1670
            tv_search.setText(search_address);
1670
            tv_search.setText(search_address);
2814
                MobclickAgent.onEvent(context, "0068");
2814
                MobclickAgent.onEvent(context, "0068");
2815
                break;
2815
                break;
2816
            case R.id.iv_clear_address:
2816
            case R.id.iv_clear_address:
2817
                tv_search.setText("请输入要查找的地名");
2817
                tv_search.setText("请输入地址/关键字");
2818
                iv_clear_address.setVisibility(View.INVISIBLE);
2818
                iv_clear_address.setVisibility(View.INVISIBLE);
2819
                ProfileManager.getInstance().setSearchAddress(this, "");
2819
                ProfileManager.getInstance().setSearchAddress(this, "");
2820
//                if (search_marker != null){
2820
//                if (search_marker != null){

+ 52 - 28
app/src/main/java/com/electric/chargingpile/activity/SearchActivity.java

86
    private HistoryInfo history;
86
    private HistoryInfo history;
87

87

88
    private List<RecommendZhan> pointList = new ArrayList<>();
88
    private List<RecommendZhan> pointList = new ArrayList<>();
89
    private List<RecommendZhan> pointAllList = new ArrayList<>();
90
    private String pointAllData = "";
89
    public static List<RecommendZhan> pointAllList = new ArrayList<>();
91

90

92
    private Map<String, String> map;
91
    private Map<String, String> map;
93

92

109
    private Button cancleButton;
108
    private Button cancleButton;
110
    private TextView tvOne, tvTwo, tvThree;
109
    private TextView tvOne, tvTwo, tvThree;
111
    private Double bd_lon, bd_lat, bd_jing, bd_wei;
110
    private Double bd_lon, bd_lat, bd_jing, bd_wei;
111
    private TextView no_result;
112

112

113
    @Override
113
    @Override
114
    protected void onCreate(Bundle savedInstanceState) {
114
    protected void onCreate(Bundle savedInstanceState) {
129
        tvSearch.setOnClickListener(this);
129
        tvSearch.setOnClickListener(this);
130
        ivClear = (ImageView) findViewById(R.id.iv_search_clear);
130
        ivClear = (ImageView) findViewById(R.id.iv_search_clear);
131
        ivClear.setOnClickListener(this);
131
        ivClear.setOnClickListener(this);
132
        no_result = findViewById(R.id.no_result);
132

133

133
        etSearch = (EditText) findViewById(R.id.et_search);
134
        etSearch = (EditText) findViewById(R.id.et_search);
134
        etSearch.setOnClickListener(new OnClickListener() {
135
        etSearch.setOnClickListener(new OnClickListener() {
174
                    pointList.clear();
175
                    pointList.clear();
175
                    addressAllList.clear();
176
                    addressAllList.clear();
176
                    pointAllList.clear();
177
                    pointAllList.clear();
177
                    pointAllData = "";
178
                    adapter.notifyDataSetChanged();
178
                    adapter.notifyDataSetChanged();
179

179

180
                } else {
180
                } else {
205
                        Toast.makeText(SearchActivity.this, "搜索内容不能为空", Toast.LENGTH_SHORT).show();
205
                        Toast.makeText(SearchActivity.this, "搜索内容不能为空", Toast.LENGTH_SHORT).show();
206
                        addressList.clear();
206
                        addressList.clear();
207
                        addressAllList.clear();
207
                        addressAllList.clear();
208
                        pointAllList.clear();
209
                        pointList.clear();
210
                        adapter.notifyDataSetChanged();
208
                        historyList.setVisibility(View.VISIBLE);
211
                        historyList.setVisibility(View.VISIBLE);
209
                        lvContent.setVisibility(View.GONE);
212
                        lvContent.setVisibility(View.GONE);
210
                    } else {
213
                    } else {
214
                        no_result.setVisibility(View.GONE);
211
                        keyWord = s;
215
                        keyWord = s;
212
                        doSearchQuery();
216
                        doSearchQuery();
213
                        doPointNameSearchQuery();
217
                        doPointNameSearchQuery();
298
                values.put("type", addressList.get(position).get("address"));
302
                values.put("type", addressList.get(position).get("address"));
299
                values.put("jing", addressList.get(position).get("jing"));
303
                values.put("jing", addressList.get(position).get("jing"));
300
                values.put("wei", addressList.get(position).get("wei"));
304
                values.put("wei", addressList.get(position).get("wei"));
305
                db.del(addressList.get(position).get("name"), addressList.get(position).get("address"));
301
                db.insert(values);
306
                db.insert(values);
302

307

303
                Cursor c = db.query();
308
                Cursor c = db.query();
318
                if (v != null) {
323
                if (v != null) {
319
                    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
324
                    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
320
                }
325
                }
326
                db.close();
321
                finish();
327
                finish();
322
            }
328
            }
323
        });
329
        });
474
                                });
480
                                });
475
                            }
481
                            }
476

482

483
                            if (addressList.size() == 0 && pointList.size() == 0) {
484
                                no_result.setVisibility(View.VISIBLE);
485
                            } else {
486
                                no_result.setVisibility(View.GONE);
487
                            }
488

477
                        } catch (Exception e) {
489
                        } catch (Exception e) {
478
                            e.printStackTrace();
490
                            e.printStackTrace();
479
                        }
491
                        }
482
                        addressList.clear();
494
                        addressList.clear();
483
                        addressAllList.clear();
495
                        addressAllList.clear();
484
                        adapter.notifyDataSetChanged();
496
                        adapter.notifyDataSetChanged();
497

498
                        if (addressList.size() == 0 && pointList.size() == 0) {
499
                            no_result.setVisibility(View.VISIBLE);
500
                        } else {
501
                            no_result.setVisibility(View.GONE);
502
                        }
485
                    }
503
                    }
486
                }
504
                }
487
            } else {
505
            } else {
624
                @Override
642
                @Override
625
                public void onClick(View v) { // 全部目的地
643
                public void onClick(View v) { // 全部目的地
626
                    Intent intent = new Intent();
644
                    Intent intent = new Intent();
627
                    intent.putExtra("key_word",keyWord);
645
                    intent.putExtra("key_word", keyWord);
628
                    intent.setClass(getApplicationContext(), SearchAllActivity.class);
646
                    intent.setClass(getApplicationContext(), SearchAllActivity.class);
629
                    Bundle bundle = new Bundle();
647
                    Bundle bundle = new Bundle();
630
                    ArrayList arrayList = new ArrayList();
648
                    ArrayList arrayList = new ArrayList();
656
                viewHolder.point_header_title.setVisibility(View.GONE);
674
                viewHolder.point_header_title.setVisibility(View.GONE);
657
            }
675
            }
658

676

659
            if (position == list.size() + pList.size() - 1 && pointAllList.size() > 3) {
677
            if (position == list.size() + pList.size() - 1 && pointAllList.size() > 5) {
660
                viewHolder.query_all_points.setVisibility(View.VISIBLE);
678
                viewHolder.query_all_points.setVisibility(View.VISIBLE);
661
            } else {
679
            } else {
662
                viewHolder.query_all_points.setVisibility(View.GONE);
680
                viewHolder.query_all_points.setVisibility(View.GONE);
668
                    Intent intent = new Intent();
686
                    Intent intent = new Intent();
669
                    intent.setClass(getApplicationContext(), SearchAllActivity.class);
687
                    intent.setClass(getApplicationContext(), SearchAllActivity.class);
670
                    intent.putExtra("title", "全部站点");
688
                    intent.putExtra("title", "全部站点");
671
                    intent.putExtra("data", pointAllData);
672
                    startActivity(intent);
689
                    startActivity(intent);
673
                }
690
                }
674
            });
691
            });
741
                }
758
                }
742
            }
759
            }
743

760

761
            viewHolder.fenshi_info_textview.setText("");
762

744
            if ("1".equals(point.getFenshi_is())) {
763
            if ("1".equals(point.getFenshi_is())) {
745
                viewHolder.fenshi_info_textview.setText("");
746
                ArrayList<PileData.FenshiInfoBean> fenshiList = (ArrayList<PileData.FenshiInfoBean>) JsonUtils.parseToObjectList(point.getFenshi_info(), PileData.FenshiInfoBean.class);
764
                ArrayList<PileData.FenshiInfoBean> fenshiList = (ArrayList<PileData.FenshiInfoBean>) JsonUtils.parseToObjectList(point.getFenshi_info(), PileData.FenshiInfoBean.class);
747
                Calendar calendar = Calendar.getInstance();
748
                int hours = calendar.get(Calendar.HOUR_OF_DAY);
749
                int minutes = calendar.get(Calendar.MINUTE);
750
                int totalMinutes = hours * 60 + minutes;
751

752
                for (PileData.FenshiInfoBean bean : fenshiList) {
753
                    if (bean.getStartTotalMinutes() > totalMinutes) {
754
                        double service_free = 0;
755
                        double charge_free = 0;
756
                        try {
757
                            service_free = Double.valueOf(bean.getService_free());
758
                            charge_free = Double.valueOf(bean.getCharge_free());
759
                        } catch (Exception e) {
760
                            e.printStackTrace();
765
                if (fenshiList.size() == 1) {
766
                    viewHolder.fenshi_info_textview.setText("全天价格统一");
767
                } else {
768
                    Calendar calendar = Calendar.getInstance();
769
                    int hours = calendar.get(Calendar.HOUR_OF_DAY);
770
                    int minutes = calendar.get(Calendar.MINUTE);
771
                    int totalMinutes = hours * 60 + minutes;
772

773
                    for (PileData.FenshiInfoBean bean : fenshiList) {
774
                        if (bean.getStartTotalMinutes() > totalMinutes) {
775
                            double service_free = 0;
776
                            double charge_free = 0;
777
                            try {
778
                                service_free = Double.valueOf(bean.getService_free());
779
                                charge_free = Double.valueOf(bean.getCharge_free());
780
                            } catch (Exception e) {
781
                                e.printStackTrace();
782
                            }
783
                            viewHolder.fenshi_info_textview.setText(String.format("%s开始 %.2f元/度", bean.getStart(), service_free + charge_free));
784
                            break;
761
                        }
785
                        }
762
                        viewHolder.fenshi_info_textview.setText(String.format("%s开始 %.2f元/度", bean.getStart(), service_free + charge_free));
763
                        break;
764
                    }
786
                    }
765
                }
787
                }
766
            } else {
767
                viewHolder.fenshi_info_textview.setText("");
768
            }
788
            }
769

789

770
            viewHolder.iv_label_public.setText(point.getBelong_attribute());
790
            viewHolder.iv_label_public.setText(point.getBelong_attribute());
919
                    }
939
                    }
920
                    if (null != info_decode && !info_decode.equals("")) {
940
                    if (null != info_decode && !info_decode.equals("")) {
921
                        pointAllList.clear();
941
                        pointAllList.clear();
922
                        pointAllData = "";
923
                        pointList.clear();
942
                        pointList.clear();
924

943

925
                        List<RecommendZhan> list = JsonUtils.parseToObjectList(info_decode, RecommendZhan.class);
944
                        List<RecommendZhan> list = JsonUtils.parseToObjectList(info_decode, RecommendZhan.class);
926
                        if (list != null) {
945
                        if (list != null) {
927
                            pointAllData = info_decode;
928
                            for (RecommendZhan point : list) {
946
                            for (RecommendZhan point : list) {
929
                                String wei = point.getPoi_wei().trim();
947
                                String wei = point.getPoi_wei().trim();
930
                                String jing = point.getPoi_jing().trim();
948
                                String jing = point.getPoi_jing().trim();
950

968

951
                            for (RecommendZhan point : pointAllList) {
969
                            for (RecommendZhan point : pointAllList) {
952
                                pointList.add(point);
970
                                pointList.add(point);
953
                                if (pointList.size() >= 3) {
971
                                if (pointList.size() >= 5) {
954
                                    break;
972
                                    break;
955
                                }
973
                                }
956
                            }
974
                            }
961
                        }
979
                        }
962
                    }
980
                    }
963
                }
981
                }
982

983
                if (addressList.size() == 0 && pointList.size() == 0) {
984
                    no_result.setVisibility(View.VISIBLE);
985
                } else {
986
                    no_result.setVisibility(View.GONE);
987
                }
964
            }
988
            }
965
        });
989
        });
966

990


+ 31 - 22
app/src/main/java/com/electric/chargingpile/activity/SearchAllActivity.java

61
        iv_title.setText(title);
61
        iv_title.setText(title);
62
62
63
        List<Map<String, String>> addressAllList;
63
        List<Map<String, String>> addressAllList;
64
        List<RecommendZhan> pointAllList;
64
        List<RecommendZhan> pointAllList = new ArrayList<>();
65
        if ("全部目的地".equals(title)) {
65
        if ("全部目的地".equals(title)) {
66
            ArrayList arrayList = getIntent().getExtras().getParcelableArrayList("list");
66
            ArrayList arrayList = getIntent().getExtras().getParcelableArrayList("list");
67
            addressAllList = (List<Map<String, String>>) arrayList.get(0);
67
            addressAllList = (List<Map<String, String>>) arrayList.get(0);
69
            pointAllList = new ArrayList<>();
69
            pointAllList = new ArrayList<>();
70
        } else {
70
        } else {
71
            addressAllList = new ArrayList<>();
71
            addressAllList = new ArrayList<>();
72
            String data = getIntent().getStringExtra("data");
73
            pointAllList = JsonUtils.parseToObjectList(data, RecommendZhan.class);
72
            pointAllList.addAll(SearchActivity.pointAllList);
74
        }
73
        }
75
74
76
75
94
            }
93
            }
95
        });
94
        });
96
95
96
        findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
97
            @Override
98
            public void onClick(View v) {
99
                finish();
100
            }
101
        });
102
97
    }
103
    }
98
104
99
    public class SearchAdapter extends BaseAdapter {
105
    public class SearchAdapter extends BaseAdapter {
293
                    viewHolder.comment_cnt.setText(point.getComment_cnt() / 10000 + "w+次评论");
299
                    viewHolder.comment_cnt.setText(point.getComment_cnt() / 10000 + "w+次评论");
294
                }
300
                }
295
            }
301
            }
302
            viewHolder.fenshi_info_textview.setText("");
296
303
297
            if ("1".equals(point.getFenshi_is())) {
304
            if ("1".equals(point.getFenshi_is())) {
298
                viewHolder.fenshi_info_textview.setText("");
305
299
                ArrayList<PileData.FenshiInfoBean> fenshiList = (ArrayList<PileData.FenshiInfoBean>) JsonUtils.parseToObjectList(point.getFenshi_info(), PileData.FenshiInfoBean.class);
306
                ArrayList<PileData.FenshiInfoBean> fenshiList = (ArrayList<PileData.FenshiInfoBean>) JsonUtils.parseToObjectList(point.getFenshi_info(), PileData.FenshiInfoBean.class);
300
                Calendar calendar = Calendar.getInstance();
301
                int hours = calendar.get(Calendar.HOUR_OF_DAY);
302
                int minutes = calendar.get(Calendar.MINUTE);
303
                int totalMinutes = hours * 60 + minutes;
304
305
                for (PileData.FenshiInfoBean bean : fenshiList) {
306
                    if (bean.getStartTotalMinutes() > totalMinutes) {
307
                        double service_free = 0;
308
                        double charge_free = 0;
309
                        try {
310
                            service_free = Double.valueOf(bean.getService_free());
311
                            charge_free = Double.valueOf(bean.getCharge_free());
312
                        } catch (Exception e) {
313
                            e.printStackTrace();
307
                if (fenshiList.size() == 1) {
308
                    viewHolder.fenshi_info_textview.setText("全天价格统一");
309
                } else {
310
                    Calendar calendar = Calendar.getInstance();
311
                    int hours = calendar.get(Calendar.HOUR_OF_DAY);
312
                    int minutes = calendar.get(Calendar.MINUTE);
313
                    int totalMinutes = hours * 60 + minutes;
314
315
                    for (PileData.FenshiInfoBean bean : fenshiList) {
316
                        if (bean.getStartTotalMinutes() > totalMinutes) {
317
                            double service_free = 0;
318
                            double charge_free = 0;
319
                            try {
320
                                service_free = Double.valueOf(bean.getService_free());
321
                                charge_free = Double.valueOf(bean.getCharge_free());
322
                            } catch (Exception e) {
323
                                e.printStackTrace();
324
                            }
325
                            viewHolder.fenshi_info_textview.setText(String.format("%s开始 %.2f元/度", bean.getStart(), service_free + charge_free));
326
                            break;
314
                        }
327
                        }
315
                        viewHolder.fenshi_info_textview.setText(String.format("%s开始 %.2f元/度", bean.getStart(), service_free + charge_free));
316
                        break;
317
                    }
328
                    }
318
                }
329
                }
319
            } else {
320
                viewHolder.fenshi_info_textview.setText("");
321
            }
330
            }
322
331
323
            viewHolder.iv_label_public.setText(point.getBelong_attribute());
332
            viewHolder.iv_label_public.setText(point.getBelong_attribute());

+ 6 - 0
app/src/main/java/com/electric/chargingpile/util/DBOpenHandler.java

68
            // 获取SQLiteDatabase
68
            // 获取SQLiteDatabase
69
            db = getWritableDatabase();
69
            db = getWritableDatabase();
70
        db.delete(TABLE_NAME_HISTORYINFO, "keyword=?", new String[]{keyword});
70
        db.delete(TABLE_NAME_HISTORYINFO, "keyword=?", new String[]{keyword});
71
    }
71

72

73
    public void del(String keyword, String type) {
74
        if (db == null)
75
            // 获取SQLiteDatabase
76
            db = getWritableDatabase();
77
        db.delete(TABLE_NAME_HISTORYINFO, "keyword=? and type=?", new String[]{keyword, type});
72
    }
78
    }
73

79

74
    // 关闭数据库
80
    // 关闭数据库

+ 172 - 155
app/src/main/res/layout/activity_search.xml

1
<?xml version="1.0" encoding="utf-8"?>
1
<?xml version="1.0" encoding="utf-8"?>
2
<com.zhy.autolayout.AutoLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:tools="http://schemas.android.com/tools"
3
    xmlns:tools="http://schemas.android.com/tools"
4
    android:layout_width="match_parent"
4
    android:layout_width="match_parent"
5
    android:layout_height="match_parent"
6
    android:background="@color/activity_bgcolor"
7
    android:orientation="vertical">
5
    android:layout_height="match_parent">
8

6

7
    <TextView
8
        android:id="@+id/no_result"
9
        android:layout_width="match_parent"
10
        android:layout_height="match_parent"
11
        android:gravity="center"
12
        android:text="没有匹配到搜索结果"
13
        android:textColor="#999999"
14
        android:visibility="gone"
15
        tools:visibility="visible"
16
        android:textSize="16sp" />
9
    <com.zhy.autolayout.AutoLinearLayout
17
    <com.zhy.autolayout.AutoLinearLayout
10
        android:layout_width="match_parent"
18
        android:layout_width="match_parent"
11
        android:layout_height="130px"
12
        android:background="@color/titlebar_color"
13
        android:orientation="horizontal">
14

15
        <RelativeLayout
16
            android:layout_width="0dp"
17
            android:layout_height="match_parent"
18
            android:layout_marginLeft="16dp"
19
            android:layout_marginTop="7dp"
20
            android:layout_marginBottom="7dp"
21
            android:layout_weight="5"
22
            android:background="@drawable/bg">
23

24

25
            <EditText
26
                android:id="@+id/et_search"
27
                android:layout_width="fill_parent"
28
                android:layout_height="match_parent"
29
                android:layout_alignParentTop="true"
30
                android:layout_marginTop="1dp"
31
                android:layout_marginRight="13dp"
32
                android:layout_marginBottom="1dp"
33
                android:layout_toRightOf="@+id/iv_sou"
34
                android:background="#f1f1f1"
35
                android:focusable="true"
36
                android:hint="请输入要查找的地名"
37
                android:imeOptions="actionSearch"
38
                android:singleLine="true"
39
                android:text=""
40
                android:textColorHint="@color/ui_68"
41
                android:textCursorDrawable="@drawable/search_biao"
42
                android:textSize="14sp" />
43

44
            <ImageView
45
                android:id="@+id/iv_search_clear"
46
                android:layout_width="wrap_content"
47
                android:layout_height="wrap_content"
48
                android:layout_alignEnd="@+id/et_search"
49
                android:layout_alignRight="@+id/et_search"
50
                android:layout_centerVertical="true"
51
                android:contentDescription="@null"
52
                android:padding="5dp"
53
                android:src="@drawable/icon_edit_delete2_0" />
19
        android:layout_height="match_parent"
20
        android:background="@color/activity_bgcolor"
21
        android:orientation="vertical">
54

22

55
            <ImageView
56
                android:id="@+id/iv_sou"
57
                android:layout_width="wrap_content"
58
                android:layout_height="wrap_content"
59
                android:layout_centerVertical="true"
60
                android:layout_marginLeft="42px"
61
                android:layout_marginRight="15px"
62
                android:src="@drawable/icon_search1118" />
63
        </RelativeLayout>
64

65
        <TextView
66
            android:id="@+id/tv_search"
67
            android:layout_width="wrap_content"
68
            android:layout_height="match_parent"
69
            android:layout_alignParentRight="true"
70
            android:layout_centerVertical="true"
71
            android:contentDescription="@null"
72
            android:gravity="center"
73
            android:paddingLeft="16dp"
74
            android:paddingTop="5dp"
75
            android:paddingRight="16dp"
76
            android:paddingBottom="5dp"
77
            android:text="取消"
78
            android:textColor="@color/lvse"
79
            android:textSize="15sp" />
80

81
        <LinearLayout
82
            android:id="@+id/ll_menu"
23
        <com.zhy.autolayout.AutoLinearLayout
83
            android:layout_width="match_parent"
24
            android:layout_width="match_parent"
84
            android:layout_height="50dp"
85
            android:background="@color/white"
25
            android:layout_height="130px"
26
            android:background="@color/titlebar_color"
27
            android:orientation="horizontal">
28

29
            <RelativeLayout
30
                android:layout_width="0dp"
31
                android:layout_height="match_parent"
32
                android:layout_marginLeft="16dp"
33
                android:layout_marginTop="7dp"
34
                android:layout_marginBottom="7dp"
35
                android:layout_weight="5"
36
                android:background="@drawable/bg">
86

37

87
            android:orientation="vertical"
88
            android:visibility="gone">
89

38

90
            <LinearLayout
91
                android:id="@+id/ll_address"
92
                android:layout_width="match_parent"
93
                android:layout_height="0dp"
94
                android:layout_weight="1">
39
                <EditText
40
                    android:id="@+id/et_search"
41
                    android:layout_width="fill_parent"
42
                    android:layout_height="match_parent"
43
                    android:layout_alignParentTop="true"
44
                    android:layout_marginTop="1dp"
45
                    android:layout_marginRight="13dp"
46
                    android:layout_marginBottom="1dp"
47
                    android:layout_toRightOf="@+id/iv_sou"
48
                    android:background="#f1f1f1"
49
                    android:focusable="true"
50
                    android:hint="请输入地址/关键字"
51
                    android:imeOptions="actionSearch"
52
                    android:singleLine="true"
53
                    android:text=""
54
                    android:textColorHint="@color/ui_68"
55
                    android:textCursorDrawable="@drawable/search_biao"
56
                    android:textSize="14sp" />
95

57

96
                <ImageView
58
                <ImageView
97
                    android:layout_width="0dp"
98
                    android:layout_height="match_parent"
99
                    android:layout_weight="1"
59
                    android:id="@+id/iv_search_clear"
60
                    android:layout_width="wrap_content"
61
                    android:layout_height="wrap_content"
62
                    android:layout_alignEnd="@+id/et_search"
63
                    android:layout_alignRight="@+id/et_search"
64
                    android:layout_centerVertical="true"
65
                    android:contentDescription="@null"
100
                    android:padding="5dp"
66
                    android:padding="5dp"
101
                    android:src="@drawable/icon_screening" />
67
                    android:src="@drawable/icon_edit_delete2_0" />
102

68

103
                <TextView
104
                    android:id="@+id/address_search"
105
                    android:layout_width="0dp"
106
                    android:layout_height="match_parent"
107
                    android:layout_weight="6"
108
                    android:gravity="center_vertical"
109
                    android:paddingLeft="5dp"
110
                    android:text="找地名:"
111
                    android:textColor="@color/text_light_grey"
112
                    android:textSize="18sp" />
113
            </LinearLayout>
114

115
            <View
116
                android:layout_width="match_parent"
117
                android:layout_height="0.5dp"
118
                android:background="@color/title_line"
119
                android:visibility="gone" />
69
                <ImageView
70
                    android:id="@+id/iv_sou"
71
                    android:layout_width="wrap_content"
72
                    android:layout_height="wrap_content"
73
                    android:layout_centerVertical="true"
74
                    android:layout_marginLeft="42px"
75
                    android:layout_marginRight="15px"
76
                    android:src="@drawable/icon_search1118" />
77
            </RelativeLayout>
78

79
            <TextView
80
                android:id="@+id/tv_search"
81
                android:layout_width="wrap_content"
82
                android:layout_height="match_parent"
83
                android:layout_alignParentRight="true"
84
                android:layout_centerVertical="true"
85
                android:contentDescription="@null"
86
                android:gravity="center"
87
                android:paddingLeft="16dp"
88
                android:paddingTop="5dp"
89
                android:paddingRight="16dp"
90
                android:paddingBottom="5dp"
91
                android:text="取消"
92
                android:textColor="@color/lvse"
93
                android:textSize="15sp" />
120

94

121
            <LinearLayout
95
            <LinearLayout
122
                android:id="@+id/ll_zhan"
96
                android:id="@+id/ll_menu"
123
                android:layout_width="match_parent"
97
                android:layout_width="match_parent"
124
                android:layout_height="0dp"
125
                android:layout_weight="1">
126

127
                <ImageView
128
                    android:layout_width="0dp"
129
                    android:layout_height="match_parent"
130
                    android:layout_weight="1"
131
                    android:padding="5dp"
132
                    android:src="@drawable/icon_screening" />
133

134
                <TextView
135
                    android:id="@+id/zhan_search"
136
                    android:layout_width="0dp"
137
                    android:layout_height="match_parent"
138
                    android:layout_weight="6"
139
                    android:gravity="center_vertical"
140
                    android:paddingLeft="5dp"
141
                    android:text="找电桩:"
142
                    android:textColor="@color/text_light_grey"
143
                    android:textSize="18sp" />
98
                android:layout_height="50dp"
99
                android:background="@color/white"
100

101
                android:orientation="vertical"
102
                android:visibility="gone">
103

104
                <LinearLayout
105
                    android:id="@+id/ll_address"
106
                    android:layout_width="match_parent"
107
                    android:layout_height="0dp"
108
                    android:layout_weight="1">
109

110
                    <ImageView
111
                        android:layout_width="0dp"
112
                        android:layout_height="match_parent"
113
                        android:layout_weight="1"
114
                        android:padding="5dp"
115
                        android:src="@drawable/icon_screening" />
116

117
                    <TextView
118
                        android:id="@+id/address_search"
119
                        android:layout_width="0dp"
120
                        android:layout_height="match_parent"
121
                        android:layout_weight="6"
122
                        android:gravity="center_vertical"
123
                        android:paddingLeft="5dp"
124
                        android:text="找地名:"
125
                        android:textColor="@color/text_light_grey"
126
                        android:textSize="18sp" />
127
                </LinearLayout>
128

129
                <View
130
                    android:layout_width="match_parent"
131
                    android:layout_height="0.5dp"
132
                    android:background="@color/title_line"
133
                    android:visibility="gone" />
134

135
                <LinearLayout
136
                    android:id="@+id/ll_zhan"
137
                    android:layout_width="match_parent"
138
                    android:layout_height="0dp"
139
                    android:layout_weight="1">
140

141
                    <ImageView
142
                        android:layout_width="0dp"
143
                        android:layout_height="match_parent"
144
                        android:layout_weight="1"
145
                        android:padding="5dp"
146
                        android:src="@drawable/icon_screening" />
147

148
                    <TextView
149
                        android:id="@+id/zhan_search"
150
                        android:layout_width="0dp"
151
                        android:layout_height="match_parent"
152
                        android:layout_weight="6"
153
                        android:gravity="center_vertical"
154
                        android:paddingLeft="5dp"
155
                        android:text="找电桩:"
156
                        android:textColor="@color/text_light_grey"
157
                        android:textSize="18sp" />
158
                </LinearLayout>
144
            </LinearLayout>
159
            </LinearLayout>
145
        </LinearLayout>
146

160

161
        </com.zhy.autolayout.AutoLinearLayout>
162

163
        <View
164
            android:layout_width="match_parent"
165
            android:layout_height="0.5dp"
166
            android:background="@color/ui_titleline"
167
            android:visibility="visible" />
168

169
        <ListView
170
            android:id="@+id/lv_search_list"
171
            android:layout_width="fill_parent"
172
            android:layout_height="0dp"
173
            android:layout_weight="9.8"
174
            android:background="@color/white"
175
            android:cacheColorHint="@color/transparent"
176
            android:fadingEdge="none"
177
            android:listSelector="@color/transparent" />
178

179
        <ListView
180
            android:id="@+id/lv_history_list"
181
            android:layout_width="fill_parent"
182
            android:layout_height="0dp"
183
            android:layout_weight="9.8"
184
            android:background="@color/white"
185
            android:cacheColorHint="@color/transparent"
186
            android:divider="@drawable/list_item_divider"
187
            android:dividerHeight="0.5dp"
188
            android:fadingEdge="none"
189
            android:listSelector="@color/transparent" />
147
    </com.zhy.autolayout.AutoLinearLayout>
190
    </com.zhy.autolayout.AutoLinearLayout>
148

191

149
    <View
150
        android:layout_width="match_parent"
151
        android:layout_height="0.5dp"
152
        android:background="@color/ui_titleline"
153
        android:visibility="visible" />
154

155
    <ListView
156
        android:id="@+id/lv_search_list"
157
        android:layout_width="fill_parent"
158
        android:layout_height="0dp"
159
        android:layout_weight="9.8"
160
        android:background="@color/white"
161
        android:cacheColorHint="@color/transparent"
162
        android:fadingEdge="none"
163
        android:listSelector="@color/transparent" />
164

165
    <ListView
166
        android:id="@+id/lv_history_list"
167
        android:layout_width="fill_parent"
168
        android:layout_height="0dp"
169
        android:layout_weight="9.8"
170
        android:background="@color/white"
171
        android:cacheColorHint="@color/transparent"
172
        android:divider="@drawable/list_item_divider"
173
        android:dividerHeight="0.5dp"
174
        android:fadingEdge="none"
175
        android:listSelector="@color/transparent" />
176
</com.zhy.autolayout.AutoLinearLayout>
192

193
</androidx.constraintlayout.widget.ConstraintLayout>

+ 9 - 9
app/src/main/res/layout/activity_search_all.xml

14
        app:layout_constraintRight_toRightOf="parent"
14
        app:layout_constraintRight_toRightOf="parent"
15
        app:layout_constraintTop_toTopOf="parent">
15
        app:layout_constraintTop_toTopOf="parent">
16
16
17
        <TextView
18
            android:id="@+id/iv_title"
19
            android:layout_width="match_parent"
20
            android:layout_height="match_parent"
21
            android:gravity="center"
22
            android:textColor="#222222"
23
            android:textSize="18sp"
24
            tools:text="全部目的地" />
25
17
        <ImageView
26
        <ImageView
18
            android:id="@+id/iv_back"
27
            android:id="@+id/iv_back"
19
            android:layout_width="wrap_content"
28
            android:layout_width="wrap_content"
26
            app:layout_constraintLeft_toLeftOf="parent"
35
            app:layout_constraintLeft_toLeftOf="parent"
27
            app:layout_constraintTop_toTopOf="parent" />
36
            app:layout_constraintTop_toTopOf="parent" />
28
37
29
        <TextView
30
            android:id="@+id/iv_title"
31
            android:layout_width="match_parent"
32
            android:layout_height="match_parent"
33
            android:gravity="center"
34
            android:textColor="#222222"
35
            android:textSize="18sp"
36
            tools:text="全部目的地" />
37
38
        <View
38
        <View
39
            android:layout_width="match_parent"
39
            android:layout_width="match_parent"
40
            android:layout_height="0.5dp"
40
            android:layout_height="0.5dp"