|
@ -2,6 +2,7 @@ package com.electric.chargingpile.activity;
|
2
|
2
|
|
3
|
3
|
import android.Manifest;
|
4
|
4
|
import android.app.Activity;
|
|
5
|
import android.app.Application;
|
5
|
6
|
import android.content.BroadcastReceiver;
|
6
|
7
|
import android.content.ContentValues;
|
7
|
8
|
import android.content.Context;
|
|
@ -681,32 +682,16 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
681
|
682
|
cityList.clear();
|
682
|
683
|
aMap.clear();
|
683
|
684
|
if (ll != null && ll.size() > 0) {
|
684
|
|
// List<Zhan> ll = DES3.encode(l);
|
685
|
685
|
cityList.addAll(ll);
|
686
|
|
// Log.e("size", cityList.size() + "");
|
687
|
|
// initOverlayy(cityList);
|
688
|
686
|
if (center != null) {
|
689
|
687
|
for (int i = 0; i < cityList.size(); i++) {
|
690
|
|
double dwei = Double.parseDouble(list.get(i)
|
691
|
|
.getPoi_wei());
|
692
|
|
double djing = Double.parseDouble(list.get(i)
|
693
|
|
.getPoi_jing());
|
|
688
|
double dwei = Double.parseDouble(list.get(i).getPoi_wei());
|
|
689
|
double djing = Double.parseDouble(list.get(i).getPoi_jing());
|
694
|
690
|
LatLng lll = new LatLng(dwei, djing);
|
695
|
|
// double d = DistanceUtil.getDistance(center, ll);
|
696
|
|
// cityList.get(i).setDistance(Util.getDistance(d));
|
697
|
691
|
}
|
698
|
|
|
699
|
692
|
}
|
700
|
|
// if (list.get(i).getSupplier().equals("特来电")){
|
701
|
|
// zhanOne=list.get(i);
|
702
|
|
// getDetailThread(list.get(i).getTid());
|
703
|
|
// }
|
704
|
|
// initOverlay(list);
|
705
|
693
|
|
706
|
694
|
} else {
|
707
|
|
// Toast.makeText(getActivity(), "没有合适的充电桩", Toast.LENGTH_SHORT)
|
708
|
|
// .show();
|
709
|
|
// showTextToast("没有合适的充电桩");
|
710
|
695
|
if (center != null) {
|
711
|
696
|
BitmapDescriptor point = BitmapDescriptorFactory
|
712
|
697
|
.fromResource(R.drawable.point_icon);
|
|
@ -1622,7 +1607,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
1622
|
1607
|
super.onResume();
|
1623
|
1608
|
|
1624
|
1609
|
String from = getIntent().getStringExtra("from");
|
1625
|
|
if ("search_all_activity".equals(from)) {
|
|
1610
|
if ("search_from_activity".equals(from)) {
|
1626
|
1611
|
searchAll();
|
1627
|
1612
|
}
|
1628
|
1613
|
|
|
@ -1643,8 +1628,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
1643
|
1628
|
}
|
1644
|
1629
|
|
1645
|
1630
|
if (onResumeRefresh == true) {
|
1646
|
|
// showMap();
|
1647
|
|
// ete("{\"fun\":\"timer\"}");
|
1648
|
1631
|
try {
|
1649
|
1632
|
getZhanData();
|
1650
|
1633
|
} catch (Exception e) {
|
|
@ -2442,224 +2425,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2442
|
2425
|
}).start();
|
2443
|
2426
|
}
|
2444
|
2427
|
|
2445
|
|
//这是请求回来的站点数据
|
2446
|
|
|
2447
|
|
|
2448
|
|
public void initOverlay(final List<Zhan> l) {
|
2449
|
|
// Toast.makeText(getApplicationContext(),android.os.Build.VERSION.RELEASE,Toast.LENGTH_SHORT).show();
|
2450
|
|
new Thread(new Runnable() {
|
2451
|
|
@Override
|
2452
|
|
public void run() {
|
2453
|
|
try {
|
2454
|
|
if (MainApplication.search_jing != 0.0 && MainApplication.search_wei != 0.0) {
|
2455
|
|
LatLng latLng = new LatLng(MainApplication.search_wei, MainApplication.search_jing);
|
2456
|
|
search_marker = aMap.addMarker(new MarkerOptions().position(latLng).icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory
|
2457
|
|
.decodeResource(getResources(), R.drawable.icon_search_address))));
|
2458
|
|
search_marker.setPeriod(8);
|
2459
|
|
}
|
2460
|
|
for (int i = 0; i < l.size(); i++) {
|
2461
|
|
String wei = l.get(i).getPoi_wei().trim();
|
2462
|
|
String jing = l.get(i).getPoi_jing().trim();
|
2463
|
|
if (wei.equals("")) {
|
2464
|
|
wei = "0";
|
2465
|
|
}
|
2466
|
|
if (jing.equals("")) {
|
2467
|
|
jing = "0";
|
2468
|
|
}
|
2469
|
|
|
2470
|
|
|
2471
|
|
int position_jing = jing.length() - jing.indexOf(".") - 1;
|
2472
|
|
int position_wei = wei.length() - wei.indexOf(".") - 1;
|
2473
|
|
|
2474
|
|
// Log.e("!!", position_jing + "--" + position_wei);
|
2475
|
|
|
2476
|
|
|
2477
|
|
LatLng ll;
|
2478
|
|
if (position_jing > 13 || position_wei > 13) {
|
2479
|
|
ll = new LatLng(Double.parseDouble(wei), Double.parseDouble(jing));
|
2480
|
|
} else {
|
2481
|
|
double dwei = Double.parseDouble(wei);
|
2482
|
|
double djing = Double.parseDouble(jing);
|
2483
|
|
getGaode(djing, dwei);
|
2484
|
|
// Log.e("qq", gd_jing + "\n" + gd_wei);
|
2485
|
|
ll = new LatLng(Double.parseDouble(gd_wei), Double.parseDouble(gd_jing));
|
2486
|
|
// Log.e("ll", ll.longitude + "\n" + ll.latitude);
|
2487
|
|
}
|
2488
|
|
|
2489
|
|
|
2490
|
|
String no = "";
|
2491
|
|
|
2492
|
|
if (!l.get(i).getAcNum().equals("")) {
|
2493
|
|
//有实时状态
|
2494
|
|
if (!l.get(i).getCompanycity().equals("")) {
|
2495
|
|
//有活动情况
|
2496
|
|
Bundle bundle = new Bundle();
|
2497
|
|
bundle.putSerializable("info", l.get(i));
|
2498
|
|
bundle.putString("type", "4");
|
2499
|
|
oogift = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(5)))
|
2500
|
|
.anchor(0.5f, 1.0f).zIndex(3);
|
2501
|
|
mMarkerGift = (Marker) aMap.addMarker(oogift);
|
2502
|
|
mMarkerGift.setPeriod(10);
|
2503
|
|
mMarkerGift.setObject(bundle);
|
2504
|
|
} else {
|
2505
|
|
if (l.get(i).getOwn_pay().equals("1")) {
|
2506
|
|
//可用本APP支付的
|
2507
|
|
Bundle bundle = new Bundle();
|
2508
|
|
bundle.putSerializable("info", l.get(i));
|
2509
|
|
bundle.putString("type", "3");
|
2510
|
|
int noo = Integer.parseInt(l.get(i).getAcableNum()) + Integer.parseInt(l.get(i).getDcableNum());
|
2511
|
|
|
2512
|
|
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromBitmap(getMarkerApps(noo));
|
2513
|
|
oono = new MarkerOptions().position(ll).icon(bitmap)
|
2514
|
|
.anchor(0.5f, 1.0f).zIndex(3);
|
2515
|
|
mMarkerNo = (Marker) aMap.addMarker(oono);
|
2516
|
|
mMarkerNo.setObject(bundle);
|
2517
|
|
} else {
|
2518
|
|
//不可用本app支付
|
2519
|
|
Bundle bundle = new Bundle();
|
2520
|
|
bundle.putSerializable("info", l.get(i));
|
2521
|
|
bundle.putString("type", "3");
|
2522
|
|
int noo = Integer.parseInt(l.get(i).getAcableNum()) + Integer.parseInt(l.get(i).getDcableNum());
|
2523
|
|
|
2524
|
|
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromBitmap(getMarkerBmp(noo));
|
2525
|
|
oote = new MarkerOptions().position(ll).icon(bitmap)
|
2526
|
|
.anchor(0.5f, 1.0f).zIndex(3);
|
2527
|
|
mMarkerTe = (Marker) aMap.addMarker(oote);
|
2528
|
|
mMarkerTe.setObject(bundle);
|
2529
|
|
}
|
2530
|
|
}
|
2531
|
|
} else {
|
2532
|
|
//没有实时状态
|
2533
|
|
if (!l.get(i).getCompanycity().equals("")) {
|
2534
|
|
//有活动情况
|
2535
|
|
Bundle bundle = new Bundle();
|
2536
|
|
bundle.putSerializable("info", l.get(i));
|
2537
|
|
bundle.putString("type", "4");
|
2538
|
|
oogift = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(5)))
|
2539
|
|
.anchor(0.5f, 1.0f).zIndex(3);
|
2540
|
|
mMarkerGift = (Marker) aMap.addMarker(oogift);
|
2541
|
|
mMarkerGift.setPeriod(10);
|
2542
|
|
mMarkerGift.setObject(bundle);
|
2543
|
|
} else {
|
2544
|
|
if (l.get(i).getOwn_pay().equals("1")) {
|
2545
|
|
//不能用本app支付
|
2546
|
|
Bundle bundle = new Bundle();
|
2547
|
|
bundle.putSerializable("info", l.get(i));
|
2548
|
|
bundle.putString("type", "1");
|
2549
|
|
ooyes = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(7)))
|
2550
|
|
.anchor(0.5f, 1.0f).zIndex(3);
|
2551
|
|
mMarkerYes = (Marker) aMap.addMarker(ooyes);
|
2552
|
|
mMarkerYes.setPeriod(1);
|
2553
|
|
mMarkerYes.setObject(bundle);
|
2554
|
|
} else {
|
2555
|
|
//不能用本app支付
|
2556
|
|
if (l.get(i).getStatus().equals("4")) {
|
2557
|
|
Bundle bundle = new Bundle();
|
2558
|
|
bundle.putSerializable("info", l.get(i));
|
2559
|
|
bundle.putString("type", "1");
|
2560
|
|
ooyes = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(1)))
|
2561
|
|
.anchor(0.5f, 1.0f).zIndex(3);
|
2562
|
|
mMarkerYes = (Marker) aMap.addMarker(ooyes);
|
2563
|
|
mMarkerYes.setPeriod(1);
|
2564
|
|
mMarkerYes.setObject(bundle);
|
2565
|
|
}
|
2566
|
|
}
|
2567
|
|
}
|
2568
|
|
}
|
2569
|
|
|
2570
|
|
// if (l.get(i).getStatus().equals("4") && l.get(i).getAcNum().equals("") &&
|
2571
|
|
// l.get(i).getAcableNum().equals("") && l.get(i).getDcNum().equals("")
|
2572
|
|
// && l.get(i).getDcableNum().equals("")) {
|
2573
|
|
// if (!l.get(i).getCompanycity().equals("")) {
|
2574
|
|
// Bundle bundle = new Bundle();
|
2575
|
|
// bundle.putSerializable("info", l.get(i));
|
2576
|
|
// bundle.putString("type", "4");
|
2577
|
|
// oogift = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(5)))
|
2578
|
|
// .anchor(0.5f, 1.0f).zIndex(3);
|
2579
|
|
// mMarkerGift = (Marker) aMap.addMarker(oogift);
|
2580
|
|
// mMarkerGift.setPeriod(10);
|
2581
|
|
// mMarkerGift.setObject(bundle);
|
2582
|
|
//
|
2583
|
|
//
|
2584
|
|
// } else {
|
2585
|
|
// Bundle bundle = new Bundle();
|
2586
|
|
// bundle.putSerializable("info", l.get(i));
|
2587
|
|
// bundle.putString("type", "1");
|
2588
|
|
// ooyes = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(1)))
|
2589
|
|
// .anchor(0.5f, 1.0f).zIndex(3);
|
2590
|
|
// mMarkerYes = (Marker) aMap.addMarker(ooyes);
|
2591
|
|
// mMarkerYes.setPeriod(1);
|
2592
|
|
// mMarkerYes.setObject(bundle);
|
2593
|
|
//
|
2594
|
|
// }
|
2595
|
|
// } else if (l.get(i).getStatus().equals("3") && l.get(i).getAcNum().equals("") &&
|
2596
|
|
// l.get(i).getAcableNum().equals("") && l.get(i).getDcNum().equals("")
|
2597
|
|
// && l.get(i).getDcableNum().equals("")) {
|
2598
|
|
//
|
2599
|
|
// if (!l.get(i).getCompanycity().equals("")) {
|
2600
|
|
// Bundle bundle = new Bundle();
|
2601
|
|
// bundle.putSerializable("info", l.get(i));
|
2602
|
|
// bundle.putString("type", "4");
|
2603
|
|
// oogift = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(5)))
|
2604
|
|
// .anchor(0.5f, 1.0f).zIndex(3);
|
2605
|
|
// mMarkerGift = (Marker) aMap.addMarker(oogift);
|
2606
|
|
// mMarkerGift.setObject(bundle);
|
2607
|
|
// } else {
|
2608
|
|
// Bundle bundle = new Bundle();
|
2609
|
|
// bundle.putSerializable("info", l.get(i));
|
2610
|
|
// bundle.putString("type", "2");
|
2611
|
|
// oono = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(3)))
|
2612
|
|
// .anchor(0.5f, 1.0f).zIndex(3);
|
2613
|
|
// mMarkerNo = (Marker) aMap.addMarker(oono);
|
2614
|
|
// mMarkerNo.setObject(bundle);
|
2615
|
|
// }
|
2616
|
|
// } else if (!l.get(i).getAcNum().equals("") &&
|
2617
|
|
// !l.get(i).getAcableNum().equals("") && !l.get(i).getDcNum().equals("")
|
2618
|
|
// && !l.get(i).getDcableNum().equals("")) {
|
2619
|
|
//
|
2620
|
|
// if (!l.get(i).getCompanycity().equals("")) {
|
2621
|
|
// Bundle bundle = new Bundle();
|
2622
|
|
// bundle.putSerializable("info", l.get(i));
|
2623
|
|
// bundle.putString("type", "4");
|
2624
|
|
// oogift = new MarkerOptions().position(ll).icon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(5)))
|
2625
|
|
// .anchor(0.5f, 1.0f).zIndex(3);
|
2626
|
|
// mMarkerGift = (Marker) aMap.addMarker(oogift);
|
2627
|
|
// mMarkerGift.setObject(bundle);
|
2628
|
|
// } else {
|
2629
|
|
// Bundle bundle = new Bundle();
|
2630
|
|
// bundle.putSerializable("info", l.get(i));
|
2631
|
|
// bundle.putString("type", "3");
|
2632
|
|
// int noo = Integer.parseInt(l.get(i).getAcableNum()) + Integer.parseInt(l.get(i).getDcableNum());
|
2633
|
|
//
|
2634
|
|
// BitmapDescriptor bitmap = BitmapDescriptorFactory.fromBitmap(getMarkerBmp(noo));
|
2635
|
|
// oote = new MarkerOptions().position(ll).icon(bitmap)
|
2636
|
|
// .anchor(0.5f, 1.0f).zIndex(3);
|
2637
|
|
// mMarkerTe = (Marker) aMap.addMarker(oote);
|
2638
|
|
// mMarkerTe.setObject(bundle);
|
2639
|
|
// }
|
2640
|
|
// }
|
2641
|
|
}
|
2642
|
|
if (center != null) {
|
2643
|
|
try {
|
2644
|
|
BitmapDescriptor point = BitmapDescriptorFactory
|
2645
|
|
.fromResource(R.drawable.point_icon);
|
2646
|
|
oo = new MarkerOptions().position(center).anchor(0.5f, 0.5f).zIndex(7).draggable(false).icon(point);
|
2647
|
|
aMap.addMarker(oo);
|
2648
|
|
} catch (Exception e) {
|
2649
|
|
e.printStackTrace();
|
2650
|
|
}
|
2651
|
|
|
2652
|
|
|
2653
|
|
}
|
2654
|
|
} catch (Exception e) {
|
2655
|
|
e.printStackTrace();
|
2656
|
|
}
|
2657
|
|
}
|
2658
|
|
}).start();
|
2659
|
|
|
2660
|
|
|
2661
|
|
}
|
2662
|
|
|
2663
|
2428
|
public static String getMD5(String content) {
|
2664
|
2429
|
try {
|
2665
|
2430
|
MessageDigest digest = MessageDigest.getInstance("MD5");
|
|
@ -2742,8 +2507,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2742
|
2507
|
private Bitmap getMarkerBmp1(int num) {
|
2743
|
2508
|
|
2744
|
2509
|
mIvMarkerBg1.setImageResource(R.drawable.icon_konglogb);
|
2745
|
|
// mTvMarkerViewNum.set
|
2746
|
|
|
2747
|
2510
|
if (num > 10) {
|
2748
|
2511
|
mTvMarkerViewNum1.setText(Integer.toString(num));
|
2749
|
2512
|
} else {
|
|
@ -2755,13 +2518,8 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2755
|
2518
|
|
2756
|
2519
|
private Bitmap getMarkerBmpCity(String num) {
|
2757
|
2520
|
String no = num;
|
2758
|
|
|
2759
|
2521
|
mIvMarkerBgcity.setImageResource(R.drawable.icon_cityno);
|
2760
|
|
// mTvMarkerViewNum.set
|
2761
|
|
|
2762
|
|
|
2763
|
2522
|
mTvMarkerViewNumcity.setText(no);
|
2764
|
|
|
2765
|
2523
|
Bitmap bmp = getBitmapFromView(mMarkerViewcity);
|
2766
|
2524
|
return bmp;
|
2767
|
2525
|
}
|
|
@ -2779,29 +2537,11 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2779
|
2537
|
return bitmap;
|
2780
|
2538
|
}
|
2781
|
2539
|
|
2782
|
|
// @Override
|
2783
|
|
// public boolean onMarkerClick(Marker marker) {
|
2784
|
|
// Log.e(TAG, "onMarkerClick: 111" );
|
2785
|
|
// return false;
|
2786
|
|
//
|
2787
|
|
// }
|
2788
|
|
|
2789
|
2540
|
@Override
|
2790
|
2541
|
public void onClick(View v) {
|
2791
|
2542
|
SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
|
2792
|
2543
|
switch (v.getId()) {
|
2793
|
|
// case R.id.rl_charging_notice:
|
2794
|
|
// startActivity(new Intent(getApplicationContext(), com.google.zxing.client.android.CaptureActivity.class));
|
2795
|
|
|
2796
|
|
// Intent intent33 = new Intent(getApplication(), MainScanActivity.class);
|
2797
|
|
// intent33.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
2798
|
|
// startActivity(intent33);
|
2799
|
|
// overridePendingTransition(0, 0);
|
2800
|
|
// ActivityManagerApplication.addDestoryActivity(MainMapActivity.this, "MainMapActivity");
|
2801
|
|
// break;
|
2802
|
2544
|
case R.id.iv_tuijian:
|
2803
|
|
|
2804
|
|
// startActivity(new Intent(getApplicationContext(),QuestionActivity.class));
|
2805
|
2545
|
if (null != center) {
|
2806
|
2546
|
MobclickAgent.onEvent(getApplicationContext(), "0111");
|
2807
|
2547
|
Intent i = new Intent(getApplicationContext(), RecommendZhanActivity.class);
|
|
@ -2817,9 +2557,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2817
|
2557
|
tv_search.setText("请输入地址/关键字");
|
2818
|
2558
|
iv_clear_address.setVisibility(View.INVISIBLE);
|
2819
|
2559
|
ProfileManager.getInstance().setSearchAddress(this, "");
|
2820
|
|
// if (search_marker != null){
|
2821
|
|
|
2822
|
|
// }
|
2823
|
2560
|
MainApplication.search_jing = 0.0;
|
2824
|
2561
|
MainApplication.search_wei = 0.0;
|
2825
|
2562
|
ete("{\"fun\":\"timer\"}");
|
|
@ -2911,11 +2648,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2911
|
2648
|
startActivity(adfloatIntent);
|
2912
|
2649
|
break;
|
2913
|
2650
|
case R.id.iv_roadCondition:
|
2914
|
|
// Intent intenti = new Intent(getApplicationContext(),MyWebViewActivity.class);
|
2915
|
|
// intenti.putExtra("url","http://evcharge.cc/test/test-js-native.html");
|
2916
|
|
// startActivity(intenti);
|
2917
|
|
|
2918
|
|
// startActivity(new Intent(getApplicationContext(),ChargingStatusActivity.class));
|
2919
|
2651
|
MobclickAgent.onEvent(getApplicationContext(), "0113");
|
2920
|
2652
|
if (ProfileManager.getInstance().getRoadCondition(getApplicationContext()) == false) {
|
2921
|
2653
|
iv_roadCondition.setImageResource(R.drawable.icon_youlukuang_main);
|
|
@ -2942,8 +2674,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2942
|
2674
|
controlZoomShow();
|
2943
|
2675
|
break;
|
2944
|
2676
|
case R.id.recommend_more_detail:
|
2945
|
|
// recommend_more_detail.setVisibility(View.GONE);
|
2946
|
|
// sharedPreferencesUtil.putBoolean("cdz_recommend_more_detail", true);
|
2947
|
2677
|
break;
|
2948
|
2678
|
//地图&列表切换按钮
|
2949
|
2679
|
case R.id.iv_list:
|
|
@ -2987,8 +2717,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
2987
|
2717
|
mlocationClient.startLocation();
|
2988
|
2718
|
}
|
2989
|
2719
|
windowLayout.setVisibility(View.GONE);
|
2990
|
|
// iv_news.setVisibility(View.VISIBLE);
|
2991
|
|
// iv_qiandao.setVisibility(View.VISIBLE);
|
2992
|
2720
|
rl_control.setVisibility(View.VISIBLE);
|
2993
|
2721
|
ll_open.setVisibility(View.GONE);
|
2994
|
2722
|
break;
|
|
@ -3019,10 +2747,8 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3019
|
2747
|
break;
|
3020
|
2748
|
|
3021
|
2749
|
case R.id.tv_shaixuan:
|
3022
|
|
// ToastUtil.showToast(getApplicationContext(),"123",Toast.LENGTH_SHORT);
|
3023
|
2750
|
isListShow = true;
|
3024
|
2751
|
windowLayout.setVisibility(View.GONE);
|
3025
|
|
// rl_control.setVisibility(View.VISIBLE);
|
3026
|
2752
|
if (null != current_chargePoint) {
|
3027
|
2753
|
resetMarker();
|
3028
|
2754
|
}
|
|
@ -3076,17 +2802,12 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3076
|
2802
|
iintent.putExtra("cha", MainMapActivity.cha);
|
3077
|
2803
|
iintent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
3078
|
2804
|
startActivity(iintent);
|
3079
|
|
// Intent intent3 = new Intent(getApplication(), MainScanActivity.class);
|
3080
|
|
// intent3.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
3081
|
|
// startActivity(intent3);
|
3082
|
|
// finish();
|
3083
|
2805
|
overridePendingTransition(0, 0);
|
3084
|
2806
|
if (count == 1) {
|
3085
|
2807
|
MobclickAgent.onEvent(getApplicationContext(), "0104");
|
3086
|
2808
|
count = 2;
|
3087
|
2809
|
}
|
3088
|
2810
|
}
|
3089
|
|
// ActivityManagerApplication.addDestoryActivity(this,"MainMapActivity");
|
3090
|
2811
|
break;
|
3091
|
2812
|
|
3092
|
2813
|
//发现界面tab
|
|
@ -3101,16 +2822,11 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3101
|
2822
|
Intent intent1 = new Intent(getApplication(), FindActivity.class);
|
3102
|
2823
|
intent1.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
3103
|
2824
|
startActivity(intent1);
|
3104
|
|
// if (sav.getVisibility() == View.VISIBLE) {
|
3105
|
|
// sav.setVisibility(View.GONE);
|
3106
|
|
// }
|
3107
|
|
// finish();
|
3108
|
2825
|
overridePendingTransition(0, 0);
|
3109
|
2826
|
if (count == 1) {
|
3110
|
2827
|
MobclickAgent.onEvent(getApplicationContext(), "0105");
|
3111
|
2828
|
count = 2;
|
3112
|
2829
|
}
|
3113
|
|
// ActivityManagerApplication.addDestoryActivity(this,"MainMapActivity");
|
3114
|
2830
|
break;
|
3115
|
2831
|
case R.id.tab_qa:
|
3116
|
2832
|
if (socket != null) {
|
|
@ -3144,13 +2860,11 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3144
|
2860
|
if (sav.getVisibility() == View.VISIBLE) {
|
3145
|
2861
|
sav.setVisibility(View.GONE);
|
3146
|
2862
|
}
|
3147
|
|
// finish();
|
3148
|
2863
|
overridePendingTransition(0, 0);
|
3149
|
2864
|
if (count == 1) {
|
3150
|
2865
|
MobclickAgent.onEvent(getApplicationContext(), "0106");
|
3151
|
2866
|
count = 2;
|
3152
|
2867
|
}
|
3153
|
|
// ActivityManagerApplication.addDestoryActivity(this,"MainMapActivity");
|
3154
|
2868
|
break;
|
3155
|
2869
|
case R.id.iv_clear:
|
3156
|
2870
|
rl_ad.setVisibility(View.GONE);
|
|
@ -3275,11 +2989,8 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3275
|
2989
|
}
|
3276
|
2990
|
rl_control.setVisibility(View.GONE);
|
3277
|
2991
|
iv_sceen.setVisibility(View.GONE);
|
3278
|
|
// mapView.setVisibility(View.GONE);
|
3279
|
2992
|
if (windowLayout.getVisibility() == View.VISIBLE) {
|
3280
|
2993
|
windowLayout.setVisibility(View.GONE);
|
3281
|
|
// iv_news.setVisibility(View.VISIBLE);
|
3282
|
|
// iv_qiandao.setVisibility(View.VISIBLE);
|
3283
|
2994
|
rl_control.setVisibility(View.VISIBLE);
|
3284
|
2995
|
ll_open.setVisibility(View.GONE);
|
3285
|
2996
|
}
|
|
@ -3288,67 +2999,24 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3288
|
2999
|
}
|
3289
|
3000
|
}
|
3290
|
3001
|
|
3291
|
|
// /**
|
3292
|
|
// * marker点击时跳动一下
|
3293
|
|
// */
|
3294
|
|
// public void jumpPoint(final Marker marker LatLng l) {
|
3295
|
|
// final Handler handler = new Handler();
|
3296
|
|
// final long start = SystemClock.uptimeMillis();
|
3297
|
|
// Projection proj = aMap.getProjection();
|
3298
|
|
// Point startPoint = proj.toScreenLocation(Constants.XIAN);
|
3299
|
|
// startPoint.offset(0, -100);
|
3300
|
|
// final LatLng startLatLng = proj.fromScreenLocation(startPoint);
|
3301
|
|
// final long duration = 1500;
|
3302
|
|
//
|
3303
|
|
// final Interpolator interpolator = new BounceInterpolator();
|
3304
|
|
// handler.post(new Runnable() {
|
3305
|
|
// @Override
|
3306
|
|
// public void run() {
|
3307
|
|
// long elapsed = SystemClock.uptimeMillis() - start;
|
3308
|
|
// float t = interpolator.getInterpolation((float) elapsed
|
3309
|
|
// / duration);
|
3310
|
|
// double lng = t * Constants.XIAN.longitude + (1 - t)
|
3311
|
|
// * startLatLng.longitude;
|
3312
|
|
// double lat = t * Constants.XIAN.latitude + (1 - t)
|
3313
|
|
// * startLatLng.latitude;
|
3314
|
|
// marker.setPosition(new LatLng(lat, lng));
|
3315
|
|
// if (t < 1.0) {
|
3316
|
|
// handler.postDelayed(this, 16);
|
3317
|
|
// }
|
3318
|
|
// }
|
3319
|
|
// });
|
3320
|
|
// }
|
3321
|
|
|
3322
|
3002
|
@Override
|
3323
|
3003
|
public void onMapLoaded() {
|
3324
|
3004
|
aMap.setMyLocationEnabled(true);// 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
|
3325
|
3005
|
// 设置定位的类型为定位模式 ,可以由定位、跟随或地图根据面向方向旋转几种
|
3326
|
3006
|
aMap.setMyLocationType(AMap.LOCATION_TYPE_LOCATE);
|
3327
|
|
// aMap.moveCamera();
|
3328
|
|
// new Handler().postDelayed(new Runnable() {
|
3329
|
|
// @Override
|
3330
|
|
// public void run() {
|
3331
|
3007
|
aMap.moveCamera(CameraUpdateFactory.zoomTo(14));
|
3332
|
|
// }
|
3333
|
|
// },200);
|
3334
|
|
|
3335
|
|
|
3336
|
3008
|
}
|
3337
|
3009
|
|
3338
|
3010
|
@Override
|
3339
|
3011
|
public void onCameraChange(CameraPosition cameraPosition) {
|
3340
|
|
|
3341
|
3012
|
}
|
3342
|
3013
|
|
3343
|
3014
|
@Override
|
3344
|
3015
|
public void onCameraChangeFinish(CameraPosition cameraPosition) {
|
3345
|
|
|
3346
|
|
|
3347
|
3016
|
}
|
3348
|
3017
|
|
3349
|
3018
|
@Override
|
3350
|
3019
|
public void onMapClick(LatLng latLng) {
|
3351
|
|
// ToastUtil.showToast(getApplicationContext(),"!!!!",Toast.LENGTH_SHORT);
|
3352
|
3020
|
float zoom = aMap.getCameraPosition().zoom;
|
3353
|
3021
|
aMap.moveCamera(CameraUpdateFactory.zoomTo(zoom));
|
3354
|
3022
|
Animation animation = AnimationUtils.loadAnimation(this, R.anim.out);
|
|
@ -3360,74 +3028,9 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3360
|
3028
|
windowLayout.setVisibility(View.GONE);
|
3361
|
3029
|
}
|
3362
|
3030
|
}, 500);
|
3363
|
|
|
3364
|
|
// if (mMarkerYes != null) {
|
3365
|
|
// mMarkerYes.remove();
|
3366
|
|
// }
|
3367
|
|
// if (mMarkerNo != null) {
|
3368
|
|
// mMarkerNo.remove();
|
3369
|
|
// }
|
3370
|
|
// if (mMarkerTe != null) {
|
3371
|
|
// mMarkerTe.remove();
|
3372
|
|
// }
|
3373
|
|
// if (mMarkerGift != null) {
|
3374
|
|
// mMarkerGift.remove();
|
3375
|
|
// }
|
3376
|
|
// ete("{\"fun\":\"timer\"}");
|
3377
|
|
// if (currentClickedMarker != null) {
|
3378
|
|
// SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
|
3379
|
|
// sharedPreferencesUtil.setFileName("CurrentMarkerInfo");
|
3380
|
|
// String status = sharedPreferencesUtil.getString("status", "");
|
3381
|
|
// String companycity = sharedPreferencesUtil.getString("companycity", "");
|
3382
|
|
// String acNum = sharedPreferencesUtil.getString("acNum", "");
|
3383
|
|
// String dcNum = sharedPreferencesUtil.getString("dcNum", "");
|
3384
|
|
// String acableNum = sharedPreferencesUtil.getString("acableNum", "");
|
3385
|
|
// String dcableNum = sharedPreferencesUtil.getString("dcableNum", "");
|
3386
|
|
// String ownpay = sharedPreferencesUtil.getString("ownpay", "");
|
3387
|
|
//
|
3388
|
|
// if (!acNum.equals("")) {
|
3389
|
|
// //有实时状态
|
3390
|
|
// if (!companycity.equals("")) {
|
3391
|
|
// //有活动情况
|
3392
|
|
// currentClickedMarker.setIcon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(5)));
|
3393
|
|
// }else {
|
3394
|
|
// int noo = Integer.parseInt(acableNum) + Integer.parseInt(dcableNum);
|
3395
|
|
// if (ownpay.equals("1")){
|
3396
|
|
// //可用本APP支付的
|
3397
|
|
// currentClickedMarker.setIcon(BitmapDescriptorFactory.fromBitmap(getMarkerApps(noo)));
|
3398
|
|
// } else {
|
3399
|
|
// //不可用本app支付
|
3400
|
|
// currentClickedMarker.setIcon(BitmapDescriptorFactory.fromBitmap(getMarkerBmp(noo)));
|
3401
|
|
// }
|
3402
|
|
// }
|
3403
|
|
// }else {
|
3404
|
|
// //没有实时状态
|
3405
|
|
// if (!companycity.equals("")) {
|
3406
|
|
// //有活动情况
|
3407
|
|
// currentClickedMarker.setIcon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(5)));
|
3408
|
|
// }else {
|
3409
|
|
// if (ownpay.equals("1")){
|
3410
|
|
// //不能用本app支付
|
3411
|
|
// currentClickedMarker.setIcon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(7)));
|
3412
|
|
// }else {
|
3413
|
|
// //不能用本app支付
|
3414
|
|
// if (status.equals("4")) {
|
3415
|
|
// currentClickedMarker.setIcon(BitmapDescriptorFactory.fromBitmap(getMarkerBmpYes(1)));
|
3416
|
|
// }
|
3417
|
|
// }
|
3418
|
|
// }
|
3419
|
|
// }
|
3420
|
|
// currentClickedMarker = null;
|
3421
|
|
// } else {
|
3422
|
|
//
|
3423
|
|
// }
|
3424
|
3031
|
SharedPreferencesUtil sharedPreferencesUtil1 = new SharedPreferencesUtil(getApplication());
|
3425
|
3032
|
sharedPreferencesUtil1.setFileName("CurrentMarkerInfo");
|
3426
|
3033
|
sharedPreferencesUtil1.clearData();
|
3427
|
|
|
3428
|
|
|
3429
|
|
// iv_news.setVisibility(View.VISIBLE);
|
3430
|
|
// iv_qiandao.setVisibility(View.VISIBLE);
|
3431
|
3034
|
rl_control.setVisibility(View.VISIBLE);
|
3432
|
3035
|
ll_open.setVisibility(View.GONE);
|
3433
|
3036
|
}
|
|
@ -3437,17 +3040,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3437
|
3040
|
if (rCode == 1000) {
|
3438
|
3041
|
if (weatherLiveResult != null & weatherLiveResult.getLiveResult() != null) {
|
3439
|
3042
|
LocalWeatherLive weatherlive = weatherLiveResult.getLiveResult();
|
3440
|
|
Log.e(TAG, "onWeatherLiveSearched: " + "-------" + weatherlive.getCity() + "-------" + weatherlive.getAdCode()
|
3441
|
|
+ "-------" + weatherlive.getHumidity() + "-------" + weatherlive.getProvince() + "-------" + weatherlive.getReportTime()
|
3442
|
|
+ "-------" + weatherlive.getTemperature() + "-------" + weatherlive.getWeather() + "-------" + weatherlive.getWindDirection()
|
3443
|
|
+ "-------" + weatherlive.getWindPower());
|
3444
|
|
// reporttime1.setText(weatherlive.getReportTime()+"发布");
|
3445
|
|
// weather.setText(weatherlive.getWeather());
|
3446
|
|
// Temperature.setText(weatherlive.getTemperature()+"°");
|
3447
|
|
// wind.setText(weatherlive.getWindDirection()+"风 "+weatherlive.getWindPower()+"级");
|
3448
|
|
// humidity.setText("湿度 "+weatherlive.getHumidity()+"%");
|
3449
|
3043
|
} else {
|
3450
|
|
// ToastUtil.show(WeatherSearchActivity.this, R.string.no_result);
|
3451
|
3044
|
}
|
3452
|
3045
|
} else {
|
3453
|
3046
|
ToastUtil.showToast(MainMapActivity.this, rCode + "", Toast.LENGTH_SHORT);
|
|
@ -3471,17 +3064,9 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
3471
|
3064
|
Log.e(TAG, "onWeatherForecastSearched: " + list.get(a).getNightWeather());
|
3472
|
3065
|
|
3473
|
3066
|
}
|
3474
|
|
|
3475
|
|
// reporttime1.setText(weatherlive.getReportTime()+"发布");
|
3476
|
|
// weather.setText(weatherlive.getWeather());
|
3477
|
|
// Temperature.setText(weatherlive.getTemperature()+"°");
|
3478
|
|
// wind.setText(weatherlive.getWindDirection()+"风 "+weatherlive.getWindPower()+"级");
|
3479
|
|
// humidity.setText("湿度 "+weatherlive.getHumidity()+"%");
|
3480
|
3067
|
} else {
|
3481
|
|
// ToastUtil.show(WeatherSearchActivity.this, R.string.no_result);
|
3482
|
3068
|
}
|
3483
|
3069
|
} else {
|
3484
|
|
// ToastUtil.showToast(MainMapActivity.this, rCode+"",Toast.LENGTH_SHORT);
|
3485
|
3070
|
}
|
3486
|
3071
|
}
|
3487
|
3072
|
|