add-code nl-218 ol-218">
|
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
|
}
|
|
|
@ -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) {
|
|
|
@ -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>
|
|
|
@ -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"
|
|
|
@ -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>
|