} else if (i == 1) { 2009
                                            t = "免费停车";
1855
                                            t = "免费停车";
2029
            case R.id.rl_route_tip:
1875
            case R.id.rl_route_tip:
2030
                ivListStatus.setImageResource(R.drawable.icon_route_list_open);
1876
                ivListStatus.setImageResource(R.drawable.icon_route_list_open);
2031
                tvOpen.setText("显示地图");
1877
                tvOpen.setText("显示地图");
2032
//                Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_route);
2033
//                animation1.setDuration(2000);
2034
                lvRouteInfo.setVisibility(View.VISIBLE);
1878
                lvRouteInfo.setVisibility(View.VISIBLE);
2035
                AnimatorStart();
1879
                AnimatorStart();
2036
2037
//                llOpenView.startAnimation(animation1);
2038
                break;
1880
                break;
2039
            case R.id.ll_open:
1881
            case R.id.ll_open:
2040
                if (canRoute == false) {
1882
                if (canRoute == false) {
2044
                        showListData(routeOverlays, routeNum);
1886
                        showListData(routeOverlays, routeNum);
2045
                        ivListStatus.setImageResource(R.drawable.icon_route_list_open);
1887
                        ivListStatus.setImageResource(R.drawable.icon_route_list_open);
2046
                        tvOpen.setText("显示地图");
1888
                        tvOpen.setText("显示地图");
2047
//                Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_route);
2048
//                animation1.setDuration(2000);
2049
                        lvRouteInfo.setVisibility(View.VISIBLE);
1889
                        lvRouteInfo.setVisibility(View.VISIBLE);
2050
                        AnimatorStart();
1890
                        AnimatorStart();
2051
1891
2075
                dialog.show();
1915
                dialog.show();
2076
                new Handler().postDelayed(new Runnable() {
1916
                new Handler().postDelayed(new Runnable() {
2077
                    public void run() {
1917
                    public void run() {
2078
//                        showSimpleBottomSheetGrid();
2079
                        mapScreenShot();
1918
                        mapScreenShot();
2080
                    }
1919
                    }
2081
                }, 1000);
1920
                }, 1000);
2123
1962
2124
                    //必须告诉AMapNavi 你最后选择的哪条路
1963
                    //必须告诉AMapNavi 你最后选择的哪条路
2125
                    aMapNavi.selectRouteId(routeIds[0]);
1964
                    aMapNavi.selectRouteId(routeIds[0]);
2126
//                Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
2127
//                Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
2128
                    final List<NaviLatLng> nl = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
1965
                    final List<NaviLatLng> nl = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
2129
//                Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy(), Toast.LENGTH_SHORT).show();
2130
2131
2132
                    routeIndex++;
1966
                    routeIndex++;
2133
1967
2134
                    chooseRouteSuccess = true;
1968
                    chooseRouteSuccess = true;
2250
2084
2251
                    //必须告诉AMapNavi 你最后选择的哪条路
2085
                    //必须告诉AMapNavi 你最后选择的哪条路
2252
                    aMapNavi.selectRouteId(routeIds[2]);
2086
                    aMapNavi.selectRouteId(routeIds[2]);
2253
//                Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
2254
//                Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[2]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
2255
                    final List<NaviLatLng> nlll = (aMapNavi.getNaviPaths()).get(routeIds[2]).getCoordList();
2087
                    final List<NaviLatLng> nlll = (aMapNavi.getNaviPaths()).get(routeIds[2]).getCoordList();
2256
2257
//                Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[2]).getStrategy(), Toast.LENGTH_SHORT).show();
2258
2259
2260
                    routeIndex++;
2088
                    routeIndex++;
2261
2089
2262
                    chooseRouteSuccess = true;
2090
                    chooseRouteSuccess = true;
2286
                        MobclickAgent.onEvent(getApplicationContext(), "0308");
2114
                        MobclickAgent.onEvent(getApplicationContext(), "0308");
2287
                        if ("0".equals(save_id)) {
2115
                        if ("0".equals(save_id)) {
2288
                            if (noNameCount == haveNameCount)
2116
                            if (noNameCount == haveNameCount)
2289
//                                LogUtils.e(noNameCount+"---"+haveNameCount);
2290
                                creatSaveData();
2117
                                creatSaveData();
2291
                        } else {
2118
                        } else {
2292
                            AlertDialog.Builder builder = new AlertDialog.Builder(RoutePlanMapActivity.this);
2119
                            AlertDialog.Builder builder = new AlertDialog.Builder(RoutePlanMapActivity.this);
2297
                                @Override
2124
                                @Override
2298
                                public void onClick(DialogInterface dialog, int which) {
2125
                                public void onClick(DialogInterface dialog, int which) {
2299
                                    if (noNameCount == haveNameCount)
2126
                                    if (noNameCount == haveNameCount)
2300
//                                        LogUtils.e(noNameCount+"---"+haveNameCount);
2301
                                        creatSaveData();
2127
                                        creatSaveData();
2302
                                }
2128
                                }
2303
                            });
2129
                            });
2317
                } else {
2143
                } else {
2318
                    if (select == 0) {
2144
                    if (select == 0) {
2319
                        exchangeView(1);
2145
                        exchangeView(1);
2320
//                        amap.clear();
2321
                        for (int i = 0; i < routeIds.length; i++) {
2146
                        for (int i = 0; i < routeIds.length; i++) {
2322
                            AMapNaviPath path = (aMapNavi.getNaviPaths()).get(routeIds[i]);
2147
                            AMapNaviPath path = (aMapNavi.getNaviPaths()).get(routeIds[i]);
2323
                            //你可以通过这个AMapNaviPath生成一个RouteOverLay用于加在地图上
2148
                            //你可以通过这个AMapNaviPath生成一个RouteOverLay用于加在地图上
2344
2169
2345
                        }
2170
                        }
2346
                        routeOverlays.get(routeIds[0]).setTransparency(0.8f);
2171
                        routeOverlays.get(routeIds[0]).setTransparency(0.8f);
2347
2348
2349
                        //必须告诉AMapNavi 你最后选择的哪条路
2172
                        //必须告诉AMapNavi 你最后选择的哪条路
2350
                        aMapNavi.selectRouteId(routeIds[0]);
2173
                        aMapNavi.selectRouteId(routeIds[0]);
2351
//                Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
2352
//                Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
2353
                        List<NaviLatLng> nnll = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
2174
                        List<NaviLatLng> nnll = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
2354
//                Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy(), Toast.LENGTH_SHORT).show();
2355
2356
2357
                        routeIndex++;
2175
                        routeIndex++;
2358
2176
2359
                        chooseRouteSuccess = true;
2177
                        chooseRouteSuccess = true;
2360
//                        if (nnll != null) {
2361
//                            getRouteZhan(nnll);
2362
//                        }
2363
                    }
2178
                    }
2364
                    if (chooseRouteSuccess && calculateSuccess) {
2179
                    if (chooseRouteSuccess && calculateSuccess) {
2365
                        MobclickAgent.onEvent(getApplicationContext(), "0309");
2180
                        MobclickAgent.onEvent(getApplicationContext(), "0309");
2392
2207
2393
                break;
2208
                break;
2394
            case R.id.iv_back:
2209
            case R.id.iv_back:
2395
//                tag = 0;
2396
                finish();
2210
                finish();
2397
//                amap.setLocationSource(this);// 设置定位监听
2398
//            amap.setMyLocationEnabled(true);// 是否可触发定位并显示定位层
2399
////            ?aMap.moveCamera(CameraUpdateFactory.zoomTo(14));
2400
//            mlocationClient.startLocation();
2401
                break;
2211
                break;
2402
            default:
2212
            default:
2403
                break;
2213
                break;
2594
                        }
2404
                        }
2595
                        if (strategyFlag >= 0) {
2405
                        if (strategyFlag >= 0) {
2596
                            aMapNavi.calculateDriveRoute(startList, endList, zhongList, strategyFlag);
2406
                            aMapNavi.calculateDriveRoute(startList, endList, zhongList, strategyFlag);
2597
//                                                Toast.makeText(getApplicationContext(), "策略:" + strategyFlag, Toast.LENGTH_LONG).show();
2598
                        }
2407
                        }
2599
                        rl_infowindow.setVisibility(View.GONE);
2408
                        rl_infowindow.setVisibility(View.GONE);
2600
                    } else {
2409
                    } else {
2726
2535
2727
    }
2536
    }
2728
2537
2729
    private void getBaidu(Double jing, Double wei) {
2730
        double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
2731
        double x = jing;
2732
        double y = wei;
2733
        double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
2734
        double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
2735
        bd_lon = z * Math.cos(theta) + 0.0065;
2736
        bd_lat = z * Math.sin(theta) + 0.006;
2737
    }
2738
2739
    private boolean isAvilible(Context context, String packageName) {
2740
        //获取packagemanager
2741
        final PackageManager packageManager = context.getPackageManager();
2742
        //获取所有已安装程序的包信息
2743
        List<PackageInfo> packageInfos = packageManager.getInstalledPackages(0);
2744
        //用于存储所有已安装程序的包名
2745
        List<String> packageNames = new ArrayList<String>();
2746
        //从pinfo中将包名字逐一取出,压入pName list中
2747
        if (packageInfos != null) {
2748
            for (int i = 0; i < packageInfos.size(); i++) {
2749
                String packName = packageInfos.get(i).packageName;
2750
                packageNames.add(packName);
2751
            }
2752
        }
2753
        //判断packageNames中是否有目标程序的包名,有TRUE,没有FALSE
2754
        return packageNames.contains(packageName);
2755
    }
2756
2757
    public static Bitmap getBitmapFromView(View view) {
2538
    public static Bitmap getBitmapFromView(View view) {
2758
        view.destroyDrawingCache();
2539
        view.destroyDrawingCache();
2759
        view.measure(View.MeasureSpec.makeMeasureSpec(0,
2540
        view.measure(View.MeasureSpec.makeMeasureSpec(0,

cdzApp - Gogs: Go Git Service

充电桩app代码

huyuguo ad7d3228bc 车主认证图片上传 5 years ago
..
libs e292ef71fd 微信sdk更新 5 years ago
src ad7d3228bc 车主认证图片上传 5 years ago
.DS_Store de269dfd50 提交 6 years ago
build.gradle e292ef71fd 微信sdk更新 5 years ago
gradle.properties 2ccff5dbe6 配置优化 6 years ago
proguard-rules.pro e1ca1e4e50 配置信息更改 6 years ago