Quellcode durchsuchen

站点搜索开放

huyuguo vor 4 Jahren
Ursprung
Commit
24fea00ec7

+ 12 - 13
app/src/main/java/com/electric/chargingpile/activity/RecommendChargingStationActivity.java

@ -481,8 +481,7 @@ public class RecommendChargingStationActivity extends AppCompatActivity implemen
481 481
            holder.station_item.setOnClickListener(new View.OnClickListener() {
482 482
                @Override
483 483
                public void onClick(View v) {
484
                    Intent intent = new Intent(getApplication(),
485
                            NewZhanDetailsActivity.class);
484
                    Intent intent = new Intent(getApplication(), NewZhanDetailsActivity.class);
486 485
                    intent.putExtra("zhan_id", recommendZhan.getZhan_id());
487 486
                    startActivity(intent);
488 487
                }
@ -635,28 +634,28 @@ public class RecommendChargingStationActivity extends AppCompatActivity implemen
635 634
636 635
            holder.score_text.setText(String.format("%.1f分", star));
637 636
            if (star == 0) {
638
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_0xing));
637
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_0xing));
639 638
                holder.score_text.setText("暂无评分");
640 639
            } else if (star > 0 && star < 1) {
641
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_05xing));
640
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_05xing));
642 641
            } else if (star >= 1 && star < 1.5) {
643
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_1xing));
642
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_1xing));
644 643
            } else if (star >= 1.5 && star < 2) {
645
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_15xing));
644
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_15xing));
646 645
            } else if (star >= 2 && star < 2.5) {
647
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_2xing));
646
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_2xing));
648 647
            } else if (star >= 2.5 && star < 3) {
649
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_25xing));
648
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_25xing));
650 649
            } else if (star >= 3 && star < 3.5) {
651
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_3xing));
650
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_3xing));
652 651
            } else if (star >= 3.5 && star < 4) {
653
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_35xing));
652
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_35xing));
654 653
            } else if (star >= 4 && star < 4.5) {
655
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_4xing));
654
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_4xing));
656 655
            } else if (star >= 4.5 && star < 5) {
657
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_45xing));
656
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_45xing));
658 657
            } else {
659
                holder.score_img.setImageDrawable(getResources().getDrawable(R.drawable.icon_5xing));
658
                holder.score_img.setImageDrawable(getDrawable(R.drawable.icon_5xing));
660 659
            }
661 660
        }
662 661

+ 518 - 46
app/src/main/java/com/electric/chargingpile/activity/SearchActivity.java

@ -5,7 +5,10 @@ import android.content.ContentValues;
5 5
import android.content.Context;
6 6
import android.content.DialogInterface;
7 7
import android.content.Intent;
8
import android.content.pm.PackageInfo;
9
import android.content.pm.PackageManager;
8 10
import android.database.Cursor;
11
import android.graphics.drawable.BitmapDrawable;
9 12
import android.os.Bundle;
10 13
import android.os.Handler;
11 14

@ -15,6 +18,7 @@ import android.text.Editable;
15 18
import android.text.Html;
16 19
import android.text.TextUtils;
17 20
import android.text.TextWatcher;
21
import android.view.Gravity;
18 22
import android.view.KeyEvent;
19 23
import android.view.LayoutInflater;
20 24
import android.view.View;
@ -26,14 +30,18 @@ import android.widget.AbsListView;
26 30
import android.widget.AdapterView;
27 31
import android.widget.AdapterView.OnItemClickListener;
28 32
import android.widget.BaseAdapter;
33
import android.widget.Button;
29 34
import android.widget.EditText;
30 35
import android.widget.ImageView;
31 36
import android.widget.LinearLayout;
32 37
import android.widget.ListView;
38
import android.widget.PopupWindow;
33 39
import android.widget.SimpleCursorAdapter;
34 40
import android.widget.TextView;
35 41
import android.widget.Toast;
36 42

43
import com.amap.api.maps.AMapUtils;
44
import com.amap.api.maps.model.LatLng;
37 45
import com.amap.api.services.core.PoiItem;
38 46
import com.amap.api.services.core.SuggestionCity;
39 47
import com.amap.api.services.help.Inputtips;
@ -41,21 +49,24 @@ import com.amap.api.services.help.Tip;
41 49
import com.amap.api.services.poisearch.PoiResult;
42 50
import com.amap.api.services.poisearch.PoiSearch;
43 51
import com.amap.api.services.poisearch.PoiSearch.OnPoiSearchListener;
44
import com.electric.chargingpile.BuildConfig;
45 52
import com.electric.chargingpile.R;
46 53
import com.electric.chargingpile.application.MainApplication;
47 54
import com.electric.chargingpile.data.HistoryInfo;
55
import com.electric.chargingpile.data.PileData;
48 56
import com.electric.chargingpile.data.RecommendZhan;
49 57
import com.electric.chargingpile.manager.ProfileManager;
50 58
import com.electric.chargingpile.util.BarColorUtil;
51 59
import com.electric.chargingpile.util.DBOpenHandler;
52 60
import com.electric.chargingpile.util.DES3S;
53 61
import com.electric.chargingpile.util.JsonUtils;
62
import com.electric.chargingpile.util.Util;
54 63
import com.umeng.analytics.MobclickAgent;
55 64
import com.zhy.http.okhttp.OkHttpUtils;
56 65
import com.zhy.http.okhttp.callback.StringCallback;
57 66

67
import java.net.URISyntaxException;
58 68
import java.util.ArrayList;
69
import java.util.Calendar;
59 70
import java.util.HashMap;
60 71
import java.util.List;
61 72
import java.util.Map;
@ -91,6 +102,12 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
91 102
    private String keyWord = "";// 要输入的poi搜索关键字
92 103
    private static final String TAG = "SearchActivity";
93 104

105
    private String gd_jing, gd_wei;
106
    private View popupWindowView;
107
    private PopupWindow popupWindow;
108
    private Button cancleButton;
109
    private TextView tvOne, tvTwo, tvThree;
110
    private Double bd_lon, bd_lat, bd_jing, bd_wei;
94 111

95 112
    @Override
96 113
    protected void onCreate(Bundle savedInstanceState) {
@ -102,6 +119,7 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
102 119

103 120
    private void initView() {
104 121
        lvContent = (ListView) findViewById(R.id.lv_search_list);
122
        lvContent.setDividerHeight(0);
105 123
        historyList = (ListView) findViewById(R.id.lv_history_list);
106 124
        tvSearch = (TextView) findViewById(R.id.tv_search);
107 125
        tvSearch.setOnClickListener(this);
@ -236,7 +254,7 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
236 254

237 255
            }
238 256
        });
239
        adapter = new SearchAdapter(this, addressList);
257
        adapter = new SearchAdapter(this, addressList, pointList);
240 258
        lvContent.setAdapter(adapter);
241 259

242 260
        // 点击历史记录
@ -469,20 +487,26 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
469 487
    public class SearchAdapter extends BaseAdapter {
470 488
        private Context context;
471 489
        private List<Map<String, String>> list;
490
        private List<RecommendZhan> pList;
472 491

473
        public SearchAdapter(Context context, List<Map<String, String>> list) {
492
        public SearchAdapter(Context context, List<Map<String, String>> list, List<RecommendZhan> pointList) {
474 493
            this.context = context;
475 494
            this.list = list;
495
            this.pList = pointList;
476 496
        }
477 497

478 498
        @Override
479 499
        public int getCount() {
480
            return list.size();
500
            return list.size() + pointList.size();
481 501
        }
482 502

483 503
        @Override
484 504
        public Object getItem(int position) {
485
            return list.get(position);
505
            if (position < list.size()) {
506
                return list.get(position);
507
            } else {
508
                return pointList.get(position - list.size());
509
            }
486 510
        }
487 511

488 512
        @Override
@ -492,55 +516,306 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
492 516

493 517
        @Override
494 518
        public View getView(int position, View convertView, ViewGroup parent) {
495
            if (addressList.size() > 0 && position < addressList.size()) {
496
                ViewHolder viewHolder = null;
497
                if (convertView == null) {
498
                    convertView = LayoutInflater.from(context).inflate(R.layout.item_search, null);
499
                    viewHolder = new ViewHolder();
500
                    viewHolder.name = convertView.findViewById(R.id.search_name);
501
                    viewHolder.address = convertView.findViewById(R.id.search_address);
502
                    viewHolder.header_title = convertView.findViewById(R.id.header_title);
503
                    viewHolder.query_all_addresses = convertView.findViewById(R.id.query_all_addresses);
504
                    convertView.setTag(viewHolder);
505
                } else {
506
                    viewHolder = (ViewHolder) convertView.getTag();
519

520
            ViewHolder viewHolder = null;
521
            if (convertView == null) {
522
                convertView = LayoutInflater.from(context).inflate(R.layout.item_search, null);
523
                viewHolder = new ViewHolder();
524

525
                viewHolder.address_item = convertView.findViewById(R.id.address_item);
526
                viewHolder.point_item = convertView.findViewById(R.id.point_item);
527

528
                viewHolder.name = convertView.findViewById(R.id.search_name);
529
                viewHolder.address = convertView.findViewById(R.id.search_address);
530
                viewHolder.address_header_title = convertView.findViewById(R.id.address_header_title);
531
                viewHolder.query_all_addresses = convertView.findViewById(R.id.query_all_addresses);
532

533
                viewHolder.point_header_title = convertView.findViewById(R.id.point_header_title);
534
                viewHolder.query_all_points = convertView.findViewById(R.id.query_all_points);
535
                viewHolder.zhan_name = convertView.findViewById(R.id.zhan_name);
536
                viewHolder.red_paper_bag = convertView.findViewById(R.id.red_paper_bag);
537
                viewHolder.score_img = convertView.findViewById(R.id.score_img);
538
                viewHolder.score_text = convertView.findViewById(R.id.score_text);
539
                viewHolder.distance = convertView.findViewById(R.id.distance);
540
                viewHolder.zongjia_container = convertView.findViewById(R.id.zongjia_container);
541
                viewHolder.zongjia = convertView.findViewById(R.id.zongjia);
542
                viewHolder.charge_record_cnt = convertView.findViewById(R.id.charge_record_cnt);
543
                viewHolder.comment_cnt = convertView.findViewById(R.id.comment_cnt);
544
                viewHolder.times_line = convertView.findViewById(R.id.times_line);
545
                viewHolder.fenshi_info_textview = convertView.findViewById(R.id.fenshi_info_textview);
546
                viewHolder.iv_label_public = convertView.findViewById(R.id.iv_label_public);
547
                viewHolder.iv_label_ground = convertView.findViewById(R.id.iv_label_ground);
548
                viewHolder.iv_label_free_park = convertView.findViewById(R.id.iv_label_free_park);
549
                viewHolder.payment_method = convertView.findViewById(R.id.payment_method);
550
                viewHolder.recommend_nav = convertView.findViewById(R.id.recommend_nav);
551
                viewHolder.window_tv_fast_free_label = convertView.findViewById(R.id.window_tv_fast_free_label);
552
                viewHolder.window_tv_fast_free_num = convertView.findViewById(R.id.window_tv_fast_free_num);
553
                viewHolder.window_tv_fast_total_num = convertView.findViewById(R.id.window_tv_fast_total_num);
554
                viewHolder.window_tv_slow_free_label = convertView.findViewById(R.id.window_tv_slow_free_label);
555
                viewHolder.window_tv_slow_free_num = convertView.findViewById(R.id.window_tv_slow_free_num);
556
                viewHolder.window_tv_slow_total_num = convertView.findViewById(R.id.window_tv_slow_total_num);
557

558
                convertView.setTag(viewHolder);
559
            } else {
560
                viewHolder = (ViewHolder) convertView.getTag();
561
            }
562

563
            if (position < list.size()) {
564
                showAddressView(viewHolder, list.get(position), position);
565
            } else {
566
                RecommendZhan point = pList.get(position - list.size());
567
                showPointView(viewHolder, point, position);
568
            }
569

570
            return convertView;
571
        }
572

573
        class ViewHolder {
574
            LinearLayout address_item, point_item, zongjia_container;
575

576
            TextView name, address, address_header_title, query_all_addresses;
577

578
            TextView point_header_title, query_all_points, zhan_name, score_text, distance, zongjia,
579
                    charge_record_cnt, comment_cnt, fenshi_info_textview, iv_label_public, iv_label_ground,
580
                    iv_label_free_park, payment_method, window_tv_fast_free_label, window_tv_fast_free_num, window_tv_fast_total_num,
581
                    window_tv_slow_free_label, window_tv_slow_free_num, window_tv_slow_total_num;
582
            ImageView red_paper_bag, score_img;
583
            View times_line;
584
            Button recommend_nav;
585

586
        }
587

588
        private void showAddressView(ViewHolder viewHolder, Map<String, String> item, int position) {
589
            viewHolder.address_item.setVisibility(View.VISIBLE);
590
            viewHolder.point_item.setVisibility(View.GONE);
591

592
            String name = item.get("name");
593
            String address = item.get("address");
594
            name = name.replace(keyWord, "<font color=\"#1BB637\">" + keyWord + "</font>");
595
            address = address.replace(keyWord, "<font color=\"#1BB637\">" + keyWord + "</font>");
596
            viewHolder.name.setText(Html.fromHtml(name, Html.FROM_HTML_MODE_LEGACY));
597
            viewHolder.address.setText(Html.fromHtml(address, Html.FROM_HTML_MODE_LEGACY));
598

599
            if (position == 0) {
600
                viewHolder.address_header_title.setVisibility(View.VISIBLE);
601
                viewHolder.address_header_title.setText(keyWord + "相关目的地");
602
            } else {
603
                viewHolder.address_header_title.setVisibility(View.GONE);
604
            }
605

606
            if (position == list.size() - 1 && addressAllList.size() > 5) {
607
                viewHolder.query_all_addresses.setVisibility(View.VISIBLE);
608
            } else {
609
                viewHolder.query_all_addresses.setVisibility(View.GONE);
610
            }
611
            viewHolder.query_all_addresses.setOnClickListener(new View.OnClickListener() {
612

613
                @Override
614
                public void onClick(View v) { // 查看所有
615
                    // TODO by hyg add
616
                }
617
            });
618
        }
619

620
        private void showPointView(ViewHolder viewHolder, RecommendZhan point, int position) {
621

622
            viewHolder.point_item.setOnClickListener(new View.OnClickListener() {
623
                @Override
624
                public void onClick(View v) {
625
                    Intent intent = new Intent(getApplication(), NewZhanDetailsActivity.class);
626
                    intent.putExtra("zhan_id", point.getZhan_id());
627
                    startActivity(intent);
628
                }
629
            });
630
            viewHolder.address_item.setVisibility(View.GONE);
631
            viewHolder.point_item.setVisibility(View.VISIBLE);
632
            if (position == list.size()) {
633
                viewHolder.point_header_title.setVisibility(View.VISIBLE);
634
                viewHolder.point_header_title.setText(keyWord + "相关充电桩");
635
            } else {
636
                viewHolder.point_header_title.setVisibility(View.GONE);
637
            }
638

639
            if (position == list.size() + pList.size() - 1 && pointFullList.size() > 3) {
640
                viewHolder.query_all_points.setVisibility(View.VISIBLE);
641
            } else {
642
                viewHolder.query_all_points.setVisibility(View.GONE);
643
            }
644

645
            viewHolder.query_all_points.setOnClickListener(new View.OnClickListener() {
646
                @Override
647
                public void onClick(View v) { // 查看全部站点
648
                }
649
            });
650

651

652
            viewHolder.zhan_name.setText(point.getZhan_name());
653

654
            if ("1".equals(point.getOwn_pay())) {
655
                viewHolder.red_paper_bag.setVisibility(View.VISIBLE);
656
            } else {
657
                viewHolder.red_paper_bag.setVisibility(View.GONE);
658
            }
659

660
            viewHolder.red_paper_bag.setOnClickListener(new View.OnClickListener() {
661
                @Override
662
                public void onClick(View v) {
663
                    Intent intent_example = new Intent(getApplicationContext(), ExampleActivity.class);
664
                    intent_example.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
665
                    startActivity(intent_example);
666
                    overridePendingTransition(0, 0);
507 667
                }
668
            });
508 669

509
                String name = list.get(position).get("name");
510
                String address = list.get(position).get("address");
511
                name = name.replace(keyWord, "<font color=\"#1BB637\">" + keyWord + "</font>");
512
                address = address.replace(keyWord, "<font color=\"#1BB637\">" + keyWord + "</font>");
513
                viewHolder.name.setText(Html.fromHtml(name, Html.FROM_HTML_MODE_LEGACY));
514
                viewHolder.address.setText(Html.fromHtml(address, Html.FROM_HTML_MODE_LEGACY));
670
            showStarInfoView(viewHolder, point);
515 671

516
                if (position == 0) {
517
                    viewHolder.header_title.setVisibility(View.VISIBLE);
518
                    viewHolder.header_title.setText(keyWord + "相关目的地");
672
            if ("0m".equals(point.getDistance())) {
673
                viewHolder.distance.setText("未知");
674
            } else {
675
                viewHolder.distance.setText(point.getDistance());
676
            }
677

678
            if (point.getZongjia() == 0) {
679
                viewHolder.zongjia_container.setVisibility(View.GONE);
680
            } else {
681
                viewHolder.zongjia_container.setVisibility(View.VISIBLE);
682
                viewHolder.zongjia.setText(String.format("%.2f", point.getZongjia()));
683
            }
684

685
            if (point.getComment_cnt() == 0) {
686
                viewHolder.comment_cnt.setVisibility(View.GONE);
687
            } else {
688
                viewHolder.comment_cnt.setVisibility(View.VISIBLE);
689
                if (point.getComment_cnt() < 1000) {
690
                    viewHolder.comment_cnt.setText(point.getComment_cnt() + "次评论");
691
                } else if (point.getComment_cnt() < 10000) {
692
                    viewHolder.comment_cnt.setText(point.getComment_cnt() / 1000 + "k+次评论");
519 693
                } else {
520
                    viewHolder.header_title.setVisibility(View.GONE);
694
                    viewHolder.comment_cnt.setText(point.getComment_cnt() / 10000 + "w+次评论");
521 695
                }
522 696

523
                if (position == addressList.size() - 1 && addressAllList.size() > 5) {
524
                    viewHolder.query_all_addresses.setVisibility(View.VISIBLE);
697
            }
698

699
            if (point.getComment_cnt() == 0 || point.getCharge_record_cnt() == 0 && point.getComment_cnt() == 0) {
700
                viewHolder.times_line.setVisibility(View.GONE);
701
            } else {
702
                viewHolder.times_line.setVisibility(View.VISIBLE);
703
            }
704

705
            if (point.getComment_cnt() == 0) {
706
                viewHolder.comment_cnt.setVisibility(View.GONE);
707
            } else {
708
                viewHolder.comment_cnt.setVisibility(View.VISIBLE);
709
                if (point.getComment_cnt() < 1000) {
710
                    viewHolder.comment_cnt.setText(point.getComment_cnt() + "次评论");
711
                } else if (point.getComment_cnt() < 10000) {
712
                    viewHolder.comment_cnt.setText(point.getComment_cnt() / 1000 + "k+次评论");
525 713
                } else {
526
                    viewHolder.query_all_addresses.setVisibility(View.GONE);
714
                    viewHolder.comment_cnt.setText(point.getComment_cnt() / 10000 + "w+次评论");
527 715
                }
528
                viewHolder.query_all_addresses.setOnClickListener(new View.OnClickListener() {
716
            }
529 717

530
                    @Override
531
                    public void onClick(View v) { // 查看所有
532
                        // TODO by hyg add
718
            if ("1".equals(point.getFenshi_is())) {
719
                viewHolder.fenshi_info_textview.setText("");
720
                ArrayList<PileData.FenshiInfoBean> fenshiList = (ArrayList<PileData.FenshiInfoBean>) JsonUtils.parseToObjectList(point.getFenshi_info(), PileData.FenshiInfoBean.class);
721
                Calendar calendar = Calendar.getInstance();
722
                int hours = calendar.get(Calendar.HOUR_OF_DAY);
723
                int minutes = calendar.get(Calendar.MINUTE);
724
                int totalMinutes = hours * 60 + minutes;
725

726
                for (PileData.FenshiInfoBean bean : fenshiList) {
727
                    if (bean.getStartTotalMinutes() > totalMinutes) {
728
                        Double service_free = Double.valueOf(bean.getService_free());
729
                        Double charge_free = Double.valueOf(bean.getCharge_free());
730
                        viewHolder.fenshi_info_textview.setText(String.format("%s开始 %.2f元/度", bean.getStart(), service_free + charge_free));
731
                        break;
533 732
                    }
534
                });
733
                }
734
            } else {
735
                viewHolder.fenshi_info_textview.setText("");
736
            }
737

738
            viewHolder.iv_label_public.setText(point.getBelong_attribute());
739
            viewHolder.iv_label_ground.setText("0".equals(point.getPark_location()) ? "地下" : "地上");
740
            viewHolder.iv_label_free_park.setVisibility(point.getStop_cost().contains("免费") ? View.VISIBLE : View.GONE);
741

742
            if ("1".equals(point.getOwn_pay())) {
743
                viewHolder.payment_method.setText("可使用本APP扫码支付");
744
            } else {
745
                if ("".equals(point.getCharge_cost_way2())) {
746
                    viewHolder.payment_method.setText("暂无");
747
                } else {
748
                    viewHolder.payment_method.setText(point.getCharge_cost_way2());
749
                }
750
            }
751

752
            viewHolder.recommend_nav.setOnClickListener(new View.OnClickListener() {
753
                @Override
754
                public void onClick(View v) {
755
                    recommendNav(point);
756
                }
757
            });
758

759
            if (point.getFast_able_num() == null && point.getSlow_able_num() == null) {
760
                viewHolder.window_tv_fast_free_label.setVisibility(View.GONE);
761
                viewHolder.window_tv_fast_total_num.setVisibility(View.GONE);
762

763
                viewHolder.window_tv_slow_free_label.setVisibility(View.GONE);
764
                viewHolder.window_tv_slow_total_num.setVisibility(View.GONE);
765

766
                viewHolder.window_tv_fast_free_num.setText("".equals(point.getFast_num()) ? "0" : point.getFast_num());
767
                viewHolder.window_tv_slow_free_num.setText("".equals(point.getSlow_num()) ? "0" : point.getSlow_num());
768
            } else {
769
                viewHolder.window_tv_fast_free_label.setVisibility(View.VISIBLE);
770
                viewHolder.window_tv_fast_total_num.setVisibility(View.VISIBLE);
771

772
                viewHolder.window_tv_slow_free_label.setVisibility(View.VISIBLE);
773
                viewHolder.window_tv_slow_total_num.setVisibility(View.VISIBLE);
774

775
                viewHolder.window_tv_fast_free_num.setText(point.getFast_able_num());
776
                viewHolder.window_tv_slow_free_num.setText(point.getSlow_able_num());
777
                viewHolder.window_tv_fast_total_num.setText("".equals(point.getFast_num()) ? "0" : "/" + point.getFast_num());
778
                viewHolder.window_tv_slow_total_num.setText("".equals(point.getSlow_num()) ? "0" : "/" + point.getSlow_num());
535 779
            }
536 780

537
            return convertView;
538
        }
539 781

540
        class ViewHolder {
541
            TextView name, address, header_title, query_all_addresses;
542 782
        }
543 783

784
        private void showStarInfoView(ViewHolder viewHolder, RecommendZhan point) {
785
            String starStr = point.getStar();
786
            double star = 0.0;
787
            try {
788
                star = Double.parseDouble(starStr);
789
            } catch (NumberFormatException e) {
790
                e.printStackTrace();
791
            }
792

793
            viewHolder.score_text.setText(String.format("%.1f分", star));
794
            if (star == 0) {
795
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_0xing));
796
                viewHolder.score_text.setText("暂无评分");
797
            } else if (star > 0 && star < 1) {
798
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_05xing));
799
            } else if (star >= 1 && star < 1.5) {
800
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_1xing));
801
            } else if (star >= 1.5 && star < 2) {
802
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_15xing));
803
            } else if (star >= 2 && star < 2.5) {
804
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_2xing));
805
            } else if (star >= 2.5 && star < 3) {
806
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_25xing));
807
            } else if (star >= 3 && star < 3.5) {
808
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_3xing));
809
            } else if (star >= 3.5 && star < 4) {
810
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_35xing));
811
            } else if (star >= 4 && star < 4.5) {
812
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_4xing));
813
            } else if (star >= 4.5 && star < 5) {
814
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_45xing));
815
            } else {
816
                viewHolder.score_img.setImageDrawable(getDrawable(R.drawable.icon_5xing));
817
            }
818
        }
544 819
    }
545 820

546 821
    @Override
@ -588,7 +863,10 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
588 863
            longitude = MainApplication.center.longitude;
589 864
            latitude = MainApplication.center.latitude;
590 865
        }
591
        String url = MainApplication.url + "/zhannew/basic/web/index.php/name_search?city=" + MainApplication.atCity + "&poi_jing=" + longitude + "&poi_wei=" + latitude + "&version=" + MainApplication.current_code + "&zhan_name=" + keyWord + "&version_code=" + BuildConfig.VERSION_CODE;
866

867
        LatLng center = new LatLng(latitude, longitude);
868

869
        String url = MainApplication.url + "/zhannew/basic/web/index.php/name_search?city=" + MainApplication.atCity + "&poi_jing=" + longitude + "&poi_wei=" + latitude + "&version=" + MainApplication.current_code + "&zhan_name=" + keyWord;
592 870
        OkHttpUtils.get().url(url).build().readTimeOut(30000).connTimeOut(30000).execute(new StringCallback() {
593 871
            @Override
594 872
            public void onError(Call call, Exception e) {
@ -612,19 +890,213 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
612 890
                        pointList.clear();
613 891

614 892
                        List<RecommendZhan> list = JsonUtils.parseToObjectList(info_decode, RecommendZhan.class);
615
                        pointFullList.addAll(list);
893
                        if (list != null) {
894
                            for (RecommendZhan point : list) {
895
                                String wei = point.getPoi_wei().trim();
896
                                String jing = point.getPoi_jing().trim();
897

898
                                int position_jing = jing.length() - jing.indexOf(".") - 1;
899
                                int position_wei = wei.length() - wei.indexOf(".") - 1;
900

901
                                LatLng ll;
902

903
                                if (position_jing > 13 || position_wei > 13) {
904
                                    ll = new LatLng(Double.parseDouble(wei), Double.parseDouble(jing));
905
                                } else {
906
                                    double dwei = Double.parseDouble(wei);
907
                                    double djing = Double.parseDouble(jing);
908
                                    getGaode(djing, dwei);
909
                                    ll = new LatLng(Double.parseDouble(gd_wei), Double.parseDouble(gd_jing));
910
                                }
616 911

617
                        for (RecommendZhan point : pointFullList) {
618
                            pointList.add(point);
619
                            if (pointList.size() >= 3) {
620
                                break;
912
                                double d = AMapUtils.calculateLineDistance(center, ll);
913
                                point.setDistance(Util.getDistance(d));
914
                                pointFullList.add(point);
915
                            }
916

917
                            for (RecommendZhan point : pointFullList) {
918
                                pointList.add(point);
919
                                if (pointList.size() >= 3) {
920
                                    break;
921
                                }
922
                            }
923

924
                            if (pointList.size() > 0) {
925
                                adapter.notifyDataSetChanged();
621 926
                            }
622 927
                        }
623
                        System.out.println(info_decode);
624 928
                    }
625 929
                }
626 930
            }
627 931
        });
628 932

629 933
    }
934

935
    private void getGaode(Double jing, Double wei) {
936
        double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
937
        double gg_lon;
938
        double gg_lat;
939
        double x = jing - 0.0065, y = wei - 0.006;
940
        double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
941
        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
942
        gg_lon = z * Math.cos(theta);
943
        gd_jing = String.valueOf(gg_lon);
944
        gg_lat = z * Math.sin(theta);
945
        gd_wei = String.valueOf(gg_lat);
946
    }
947

948
    private void recommendNav(RecommendZhan rz) {
949

950
        String wei = rz.getPoi_wei().trim();
951
        String jing = rz.getPoi_jing().trim();
952
        int position_jing = jing.length() - jing.indexOf(".") - 1;
953
        int position_wei = wei.length() - wei.indexOf(".") - 1;
954
        final LatLng ll;
955
        if (position_jing > 13 || position_wei > 13) {
956
            ll = new LatLng(Double.parseDouble(wei), Double.parseDouble(jing));
957
        } else {
958
            double dwei = Double.parseDouble(wei);
959
            double djing = Double.parseDouble(jing);
960
            getGaode(djing, dwei);
961
            ll = new LatLng(Double.parseDouble(gd_wei), Double.parseDouble(gd_jing));
962
        }
963

964
        if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap") &&
965
                !isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
966
            Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
967
            intent.putExtra("start_jing", MainApplication.center.longitude + "");
968
            intent.putExtra("start_wei", MainApplication.center.latitude + "");
969
            intent.putExtra("stop_jing", ll.longitude + "");
970
            intent.putExtra("stop_wei", ll.latitude + "");
971
            startActivity(intent);
972
        } else {
973
            if (MainApplication.center != null) {
974
                LayoutInflater inflater1 = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
975
                popupWindowView = inflater1.inflate(R.layout.item_selectmap, null);
976
                popupWindow = new PopupWindow(popupWindowView,
977
                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
978
                        true);
979
                popupWindow.setBackgroundDrawable(new BitmapDrawable());
980
                // 设置PopupWindow的弹出和消失效果
981
                popupWindow.setAnimationStyle(R.style.popupAnimation);
982
                LinearLayout ll_tvTwo = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvTwo);
983
                if (!isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
984
                    ll_tvTwo.setVisibility(View.GONE);
985
                }
986
                LinearLayout ll_tvOne = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvOne);
987
                if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap")) {
988
                    ll_tvOne.setVisibility(View.GONE);
989
                }
990
                cancleButton = (Button) popupWindowView.findViewById(R.id.cancleButton);
991
                cancleButton.setOnClickListener(new View.OnClickListener() {
992
                    @Override
993
                    public void onClick(View view) {
994
                        popupWindow.dismiss();
995
                    }
996
                });
997
                tvThree = (TextView) popupWindowView.findViewById(R.id.tvThree);
998
                tvThree.setOnClickListener(new View.OnClickListener() {
999
                    @Override
1000
                    public void onClick(View v) {
1001
                        Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
1002
                        intent.putExtra("start_jing", MainApplication.center.longitude + "");
1003
                        intent.putExtra("start_wei", MainApplication.center.latitude + "");
1004
                        intent.putExtra("stop_jing", ll.longitude + "");
1005
                        intent.putExtra("stop_wei", ll.latitude + "");
1006
                        startActivity(intent);
1007
                        popupWindow.dismiss();
1008
                    }
1009
                });
1010
                tvOne = (TextView) popupWindowView.findViewById(R.id.tvOne);
1011
                tvOne.setOnClickListener(new View.OnClickListener() {
1012
                    @Override
1013
                    public void onClick(View view) {
1014
                        Intent intent = null;
1015
                        int position_jing = rz.getPoi_jing().length() - rz.getPoi_jing().indexOf(".") - 1;
1016
                        int position_wei = rz.getPoi_wei().length() - rz.getPoi_wei().indexOf(".") - 1;
1017
                        if (position_jing > 13 || position_wei > 13) {
1018
                            getBaidu1(Double.parseDouble(rz.getPoi_jing()), Double.parseDouble(rz.getPoi_wei()));
1019
                        } else {
1020
                            bd_jing = Double.parseDouble(rz.getPoi_jing());
1021
                            bd_wei = Double.parseDouble(rz.getPoi_wei());
1022
                        }
1023
                        getBaidu(MainApplication.center.longitude, MainApplication.center.latitude);
1024
                        try {
1025
                            String s = "intent://map/direction?" +
1026
                                    "origin=" + bd_lat + "," + bd_lon + "&" +
1027
                                    "destination=" + bd_wei + "," + bd_jing +
1028
                                    "&mode=driving&" +
1029
                                    "src=充电桩#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end";
1030
                            intent = Intent.getIntent(s);
1031
                        } catch (URISyntaxException e) {
1032
                            e.printStackTrace();
1033
                        }
1034
                        startActivity(intent);
1035
                        popupWindow.dismiss();
1036
                    }
1037
                });
1038
                tvTwo = (TextView) popupWindowView.findViewById(R.id.tvTwo);
1039
                tvTwo.setOnClickListener(new View.OnClickListener() {
1040
                    @Override
1041
                    public void onClick(View view) {
1042
                        try {
1043
                            Intent intent4 = new Intent("android.intent.action.VIEW",
1044
                                    android.net.Uri.parse("androidamap://route?sourceApplication=amap&slat=" + MainApplication.center.latitude + "&slon=" + MainApplication.center.longitude + "&sname=我的位置&dlat=" + ll.latitude + "&dlon=" + ll.longitude + "&dname=" + rz.getZhan_name() + "&dev=0&m=0&t=2"));
1045
                            intent4.setPackage("com.autonavi.minimap");
1046
                            startActivity(intent4);
1047
                            popupWindow.dismiss();
1048
                        } catch (Exception e) {
1049
                            e.printStackTrace();
1050
                            Toast.makeText(getApplication(), "请您确认是否安装高德地图APP", Toast.LENGTH_SHORT).show();
1051
                        }
1052

1053
                    }
1054
                });
1055
                popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
1056
            } else {
1057
                Toast.makeText(getApplication(),
1058
                        "没有定位到您的当前位置", Toast.LENGTH_SHORT)
1059
                        .show();
1060
            }
1061
        }
1062

1063
    }
1064

1065
    private boolean isAvilible(Context context, String packageName) {
1066
        //获取packagemanager
1067
        final PackageManager packageManager = context.getPackageManager();
1068
        //获取所有已安装程序的包信息
1069
        List<PackageInfo> packageInfos = packageManager.getInstalledPackages(0);
1070
        //用于存储所有已安装程序的包名
1071
        List<String> packageNames = new ArrayList<String>();
1072
        //从pinfo中将包名字逐一取出,压入pName list中
1073
        if (packageInfos != null) {
1074
            for (int i = 0; i < packageInfos.size(); i++) {
1075
                String packName = packageInfos.get(i).packageName;
1076
                packageNames.add(packName);
1077
            }
1078
        }
1079
        //判断packageNames中是否有目标程序的包名,有TRUE,没有FALSE
1080
        return packageNames.contains(packageName);
1081
    }
1082

1083
    private void getBaidu(Double jing, Double wei) {
1084
        double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
1085
        double x = jing;
1086
        double y = wei;
1087
        double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
1088
        double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
1089
        bd_lon = z * Math.cos(theta) + 0.0065;
1090
        bd_lat = z * Math.sin(theta) + 0.006;
1091
    }
1092

1093
    private void getBaidu1(Double jing, Double wei) {
1094
        double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
1095
        double x = jing;
1096
        double y = wei;
1097
        double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
1098
        double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
1099
        bd_jing = z * Math.cos(theta) + 0.0065;
1100
        bd_wei = z * Math.sin(theta) + 0.006;
1101
    }
630 1102
}

+ 31 - 30
app/src/main/java/com/electric/chargingpile/util/Util.java

@ -363,36 +363,37 @@ public class Util {
363 363
     * @param context
364 364
     */
365 365
    public static void setMapCustomStyleFile(AMap aMap, Context context) {
366
        byte[] buffer1 = null;
367
        byte[] buffer2 = null;
368
        InputStream is1 = null;
369
        InputStream is2 = null;
370
        try {
371
            is1 = context.getAssets().open("amap_custom_style_2019082001.data");
372
            int lenght1 = is1.available();
373
            buffer1 = new byte[lenght1];
374
            is1.read(buffer1);
375
            is2 = context.getAssets().open("amap_custom_style_extra_2019082001.data");
376
            int lenght2 = is2.available();
377
            buffer2 = new byte[lenght2];
378
            is2.read(buffer2);
379
        } catch (IOException e) {
380
            e.printStackTrace();
381
        } finally {
382
            try {
383
                if (is1 != null)
384
                    is1.close();
385
                if (is2 != null)
386
                    is2.close();
387
            } catch (IOException e) {
388
                e.printStackTrace();
389
            }
390
        }
391

392
        CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions();
393
        customMapStyleOptions.setStyleData(buffer1);
394
        customMapStyleOptions.setStyleExtraData(buffer2);
395
        aMap.setCustomMapStyle(customMapStyleOptions);
366
        // 取消地图自定义样式
367
//        byte[] buffer1 = null;
368
//        byte[] buffer2 = null;
369
//        InputStream is1 = null;
370
//        InputStream is2 = null;
371
//        try {
372
//            is1 = context.getAssets().open("amap_custom_style_2019082001.data");
373
//            int lenght1 = is1.available();
374
//            buffer1 = new byte[lenght1];
375
//            is1.read(buffer1);
376
//            is2 = context.getAssets().open("amap_custom_style_extra_2019082001.data");
377
//            int lenght2 = is2.available();
378
//            buffer2 = new byte[lenght2];
379
//            is2.read(buffer2);
380
//        } catch (IOException e) {
381
//            e.printStackTrace();
382
//        } finally {
383
//            try {
384
//                if (is1 != null)
385
//                    is1.close();
386
//                if (is2 != null)
387
//                    is2.close();
388
//            } catch (IOException e) {
389
//                e.printStackTrace();
390
//            }
391
//        }
392
//
393
//        CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions();
394
//        customMapStyleOptions.setStyleData(buffer1);
395
//        customMapStyleOptions.setStyleExtraData(buffer2);
396
//        aMap.setCustomMapStyle(customMapStyleOptions);
396 397
    }
397 398

398 399
    public static String generateDmpUrl(String url) {

+ 115 - 70
app/src/main/res/layout/item_search.xml

@ -6,92 +6,137 @@
6 6
    android:background="@color/white"
7 7
    android:orientation="vertical">
8 8

9
    <TextView
10
        android:id="@+id/header_title"
11
        android:layout_width="match_parent"
12
        android:layout_height="wrap_content"
13
        android:background="#F2F2F2"
14
        android:ellipsize="end"
15
        android:maxLines="2"
16
        android:paddingLeft="15dp"
17
        android:paddingTop="4dp"
18
        android:paddingRight="15dp"
19
        android:paddingBottom="4dp"
20
        android:textColor="#a2a2a2"
21
        android:textSize="12sp"
22
        android:visibility="gone"
23
        tools:text="朝阳相关目的地"
24
        tools:visibility="visible" />
25

26 9
    <LinearLayout
10
        android:id="@+id/address_item"
27 11
        android:layout_width="match_parent"
28 12
        android:layout_height="wrap_content"
29
        android:orientation="horizontal">
13
        android:orientation="vertical">
14

15
        <TextView
16
            android:id="@+id/address_header_title"
17
            android:layout_width="match_parent"
18
            android:layout_height="wrap_content"
19
            android:background="#F2F2F2"
20
            android:ellipsize="end"
21
            android:maxLines="2"
22
            android:paddingLeft="15dp"
23
            android:paddingTop="4dp"
24
            android:paddingRight="15dp"
25
            android:paddingBottom="4dp"
26
            android:textColor="#a2a2a2"
27
            android:textSize="12sp"
28
            android:visibility="gone"
29
            tools:text="朝阳相关目的地"
30
            tools:visibility="visible" />
30 31

31 32
        <LinearLayout
32
            android:layout_width="wrap_content"
33
            android:layout_height="match_parent"
34
            android:gravity="center_vertical">
33
            android:layout_width="match_parent"
34
            android:layout_height="wrap_content"
35
            android:orientation="horizontal">
35 36

36
            <ImageView
37
                android:id="@+id/search_image"
37
            <LinearLayout
38 38
                android:layout_width="wrap_content"
39
                android:layout_height="match_parent"
40
                android:gravity="center_vertical">
41

42
                <ImageView
43
                    android:id="@+id/search_image"
44
                    android:layout_width="wrap_content"
45
                    android:layout_height="wrap_content"
46
                    android:layout_centerVertical="true"
47
                    android:layout_marginLeft="15dp"
48
                    android:layout_marginTop="10dp"
49
                    android:layout_marginRight="10dp"
50
                    android:layout_marginBottom="10dp"
51
                    android:contentDescription="@null"
52
                    android:src="@drawable/icon_search1117" />
53
            </LinearLayout>
54

55
            <LinearLayout
56
                android:layout_width="match_parent"
39 57
                android:layout_height="wrap_content"
40
                android:layout_centerVertical="true"
41
                android:layout_marginLeft="15dp"
42
                android:layout_marginTop="10dp"
43
                android:layout_marginRight="10dp"
44
                android:layout_marginBottom="10dp"
45
                android:contentDescription="@null"
46
                android:src="@drawable/icon_search1117" />
58
                android:orientation="vertical"
59
                android:paddingTop="10dp"
60
                android:paddingRight="15dp"
61
                android:paddingBottom="8dp">
62

63
                <TextView
64
                    android:id="@+id/search_name"
65
                    android:layout_width="fill_parent"
66
                    android:layout_height="wrap_content"
67
                    android:ellipsize="end"
68
                    android:singleLine="true"
69
                    android:textColor="#151515"
70
                    android:textSize="15sp"
71
                    tools:text="sdfdsfdsfdsfdsasdasdasdasdasdasdasdsadasdasdasdasf" />
72

73
                <TextView
74
                    android:id="@+id/search_address"
75
                    android:layout_width="fill_parent"
76
                    android:layout_height="wrap_content"
77
                    android:layout_marginTop="2dp"
78
                    android:ellipsize="end"
79
                    android:maxLines="2"
80
                    android:textColor="#999999"
81
                    android:textSize="12sp"
82
                    tools:text="sdfdsfdsfdsfds" />
83
            </LinearLayout>
47 84
        </LinearLayout>
48 85

49
        <LinearLayout
86
        <View
87
            android:layout_width="match_parent"
88
            android:layout_height="0.5dp"
89
            android:layout_marginLeft="12dp"
90
            android:background="#DDDDDD" />
91

92
        <TextView
93
            android:id="@+id/query_all_addresses"
50 94
            android:layout_width="match_parent"
51 95
            android:layout_height="wrap_content"
52
            android:orientation="vertical"
96
            android:gravity="center_horizontal"
53 97
            android:paddingTop="10dp"
54
            android:paddingRight="15dp"
55
            android:paddingBottom="8dp">
56

57
            <TextView
58
                android:id="@+id/search_name"
59
                android:layout_width="fill_parent"
60
                android:layout_height="wrap_content"
61
                android:ellipsize="end"
62
                android:singleLine="true"
63
                android:textColor="#151515"
64
                android:textSize="15sp"
65
                tools:text="sdfdsfdsfdsfdsasdasdasdasdasdasdasdsadasdasdasdasf" />
66

67
            <TextView
68
                android:id="@+id/search_address"
69
                android:layout_width="fill_parent"
70
                android:layout_height="wrap_content"
71
                android:layout_marginTop="2dp"
72
                android:ellipsize="end"
73
                android:maxLines="2"
74
                android:textColor="#999999"
75
                android:textSize="12sp"
76
                tools:text="sdfdsfdsfdsfds" />
77
        </LinearLayout>
98
            android:paddingBottom="20dp"
99
            android:text="@string/query_all_addresses"
100
            android:textColor="#888888"
101
            android:textSize="12sp" />
78 102
    </LinearLayout>
79 103

80
    <View
81
        android:layout_width="match_parent"
82
        android:layout_height="0.5dp"
83
        android:layout_marginLeft="12dp"
84
        android:background="#DDDDDD" />
85

86
    <TextView
87
        android:id="@+id/query_all_addresses"
104
    <LinearLayout
105
        android:id="@+id/point_item"
88 106
        android:layout_width="match_parent"
89 107
        android:layout_height="wrap_content"
90
        android:gravity="center_horizontal"
91
        android:textSize="12sp"
92
        android:textColor="#888888"
93
        android:paddingTop="10dp"
94
        android:paddingBottom="20dp"
95
        android:text="@string/query_all_addresses" />
108
        android:orientation="vertical">
109

110
        <TextView
111
            android:id="@+id/point_header_title"
112
            android:layout_width="match_parent"
113
            android:layout_height="wrap_content"
114
            android:background="#F2F2F2"
115
            android:ellipsize="end"
116
            android:maxLines="2"
117
            android:paddingLeft="15dp"
118
            android:paddingTop="4dp"
119
            android:paddingRight="15dp"
120
            android:paddingBottom="4dp"
121
            android:textColor="#a2a2a2"
122
            android:textSize="12sp"
123
            android:visibility="gone"
124
            tools:text="朝阳相关充电站"
125
            tools:visibility="visible" />
126

127
        <include layout="@layout/recommend_charging_station_item" />
128

129
        <TextView
130
            android:id="@+id/query_all_points"
131
            android:layout_width="match_parent"
132
            android:layout_height="wrap_content"
133
            android:gravity="center_horizontal"
134
            android:paddingTop="10dp"
135
            android:paddingBottom="20dp"
136
            android:text="@string/query_all_points"
137
            android:textColor="#888888"
138
            android:textSize="12sp" />
139
    </LinearLayout>
140

96 141

97 142
</LinearLayout>

+ 4 - 3
app/src/main/res/layout/recommend_charging_station_item.xml

@ -22,13 +22,13 @@
22 22
            android:ellipsize="end"
23 23
            android:gravity="center_vertical"
24 24
            android:lines="1"
25
            android:maxEms="11"
26
            android:text="东方路希尔顿酒店充电站"
25
            android:maxEms="15"
27 26
            android:textColor="#222222"
28 27
            android:textSize="18sp"
29 28
            app:layout_constraintBottom_toBottomOf="parent"
30 29
            app:layout_constraintLeft_toLeftOf="parent"
31
            app:layout_constraintTop_toTopOf="parent" />
30
            app:layout_constraintTop_toTopOf="parent"
31
            tools:text="东方路希尔顿酒店充电站" />
32 32
33 33
34 34
        <ImageView
@ -253,6 +253,7 @@
253 253
        android:layout_width="match_parent"
254 254
        android:layout_height="48dp"
255 255
        android:gravity="center_vertical">
256
256 257
        <LinearLayout
257 258
258 259
            android:layout_width="0dp"

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

@ -207,4 +207,5 @@
207 207
    <string name="refresh_load_fail">Loading failed</string>
208 208
    <string name="personal_shar_info_content">快来分享吧\n小主大家都很期待你的精彩内容哦</string>
209 209
    <string name="query_all_addresses"><u>查看全部目的地</u></string>
210
    <string name="query_all_points"><u>查看全部站点</u></string>
210 211
</resources>