e class="language-java"> //close_time.setText(((hourOfDay < 10 ? 0 +""+ hourOfDay : hourOfDay)+":"+(minute<10?0+""+minute:minute)).toString()); 1402 785
                            tpd_open.dismiss();
1403 786
                        }
1404 787
                    };
@ -1413,7 +796,6 @@ public class PrivateZhuangInfoActivity extends Activity implements View.OnClickL
1413 796
                if (tpd_close == null) {
1414 797
                    TimePickerDialog.OnTimeSetListener otsl = new TimePickerDialog.OnTimeSetListener() {
1415 798
                        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
1416
                            //open_time.setText(((hourOfDay < 10 ? 0 +""+ hourOfDay : hourOfDay)+":"+(minute<10?0+""+minute:minute)).toString());
1417 799
                            close_time.setText(((hourOfDay < 10 ? 0 + "" + hourOfDay : hourOfDay) + ":" + (minute < 10 ? 0 + "" + minute : minute)).toString());
1418 800
                            tpd_close.dismiss();
1419 801
                        }
@ -1425,318 +807,22 @@ public class PrivateZhuangInfoActivity extends Activity implements View.OnClickL
1425 807
                }
1426 808
                tpd_close.show();
1427 809
                break;
1428
//            case R.id.tv_next:
1429
//                Intent intent = new Intent(getApplication(), ShareThreeActivity.class);
1430
//                intent.putExtra("location", share_address);
1431
//                intent.putExtra("POI_jing", poi_jing);
1432
//                intent.putExtra("POI_wei", poi_wei);
1433
//                intent.putExtra("fast_num", et_fast_num.getText().toString());
1434
//                intent.putExtra("slow_num", et_slow_num.getText().toString());
1435
//                intent.putExtra("suit_car", tv_suit_car.getText().toString());
1436
//                intent.putExtra("belong_attribute", tv_belong_type.getText().toString());
1437
//                intent.putExtra("telephone", et_phone.getText().toString());
1438
//                intent.putExtra("Person_name", et_belong.getText().toString());
1439
//                intent.putExtra("company_name", et_belong.getText().toString());
1440
//                intent.putExtra("open_time", open_time.getText().toString());
1441
//                intent.putExtra("zhan_name", et_name.getText().toString());
1442
//                intent.putExtra("close_time", close_time.getText().toString());
1443
//                intent.putExtra("holiday_open", holiday_open.getText().toString());
1444
//                intent.putExtra("holiday_close", holiday_close.getText().toString());
1445
//                intent.putExtra("open_object", et_open_object.getText().toString());
1446
//                intent.putExtra("run_state", tv_run_state.getText().toString());
1447
//                intent.putExtra("pic", srcPath);
1448
//                intent.putExtra("city", city);
1449
//                if (checkText()) {
1450
//                    startActivity(intent);
1451
//                }
1452
//                break;
1453 810
            case R.id.iv_back:
1454
//                SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
1455
//                sharedPreferencesUtil.setFileName("shareInfo");
1456
//                sharedPreferencesUtil.clearData();
1457 811
                finish();
1458 812
                break;
1459
//            case R.id.iv_run_state:
1460
//                final String[] operationSelect = {"正常", "故障", "废弃", "调试"};
1461
//                new AlertDialog.Builder(ShareTwoActivity.this)
1462
//                        .setTitle("请选择")
1463
//                        .setItems(operationSelect, new DialogInterface.OnClickListener() {
1464
//                            @Override
1465
//                            public void onClick(DialogInterface dialog, int which) {
1466
//                                switch (which) {
1467
//                                    case 0:
1468
//                                        tv_run_state.setText(operationSelect[0]);
1469
//                                        break;
1470
//                                    case 1:
1471
//                                        tv_run_state.setText(operationSelect[1]);
1472
//                                        break;
1473
//                                    case 2:
1474
//                                        tv_run_state.setText(operationSelect[2]);
1475
//                                        break;
1476
//                                    case 3:
1477
//                                        tv_run_state.setText(operationSelect[3]);
1478
//                                    default:
1479
//                                        break;
1480
//                                }
1481
//                            }
1482
//                        })
1483
//                        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
1484
//                            @Override
1485
//                            public void onClick(DialogInterface dialog, int which) {
1486
//                                dialog.cancel();
1487
//                            }
1488
//                        }).show();
1489
//                break;
1490
//            case R.id.iv_prefect_change_suit:
1491
//
1492
//                String[] changeSelect = {"国标充电", "特斯拉", "德系"};
1493
//                new AlertDialog.Builder(ShareTwoActivity.this)
1494
//                        .setTitle("请选择")
1495
//                        .setItems(changeSelect, new DialogInterface.OnClickListener() {
1496
//                            @Override
1497
//                            public void onClick(DialogInterface dialog, int which) {
1498
//                                switch (which) {
1499
//                                    case 0:
1500
//                                        tv_suit_car.setText("国标充电");
1501
//                                        break;
1502
//                                    case 1:
1503
//                                        tv_suit_car.setText("特斯拉");
1504
//                                        break;
1505
//                                    case 2:
1506
//                                        tv_suit_car.setText("德系");
1507
//                                        break;
1508
//                                    default:
1509
//                                        break;
1510
//                                }
1511
//                            }
1512
//                        })
1513
//                        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
1514
//                            @Override
1515
//                            public void onClick(DialogInterface dialog, int which) {
1516
//                                dialog.cancel();
1517
//                            }
1518
//                        }).show();
1519
//                break;
1520
//            case R.id.rl_perfect_belong:
1521
//                final String[] belongSelect = {"企业", "私人"};
1522
//                new AlertDialog.Builder(ShareTwoActivity.this)
1523
//                        .setTitle("请选择")
1524
//                        .setItems(belongSelect, new DialogInterface.OnClickListener() {
1525
//                            @Override
1526
//                            public void onClick(DialogInterface dialog, int which) {
1527
//                                switch (which) {
1528
//                                    case 0:
1529
//                                        tv_belong_type.setText(belongSelect[0]);
1530
//                                        break;
1531
//                                    case 1:
1532
//                                        tv_belong_type.setText(belongSelect[1]);
1533
////                                        tv_belong_style.setText("联系人");
1534
////                                        et_belong.setText("王先生");
1535
//                                        break;
1536
//                                    default:
1537
//                                        break;
1538
//                                }
1539
//                            }
1540
//                        })
1541
//                        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
1542
//                            @Override
1543
//                            public void onClick(DialogInterface dialog, int which) {
1544
//                                dialog.cancel();
1545
//                            }
1546
//                        }).show();
1547
//                LayoutInflater inflater2 = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
1548
//                popupWindowView = inflater2.inflate(R.layout.popupwindow_belong, null);
1549
//                popupWindow = new PopupWindow(popupWindowView,
1550
//                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
1551
//                        true);
1552
//                popupWindow.setBackgroundDrawable(new BitmapDrawable());
1553
//                // 设置PopupWindow的弹出和消失效果
1554
//                popupWindow.setAnimationStyle(R.style.popupAnimation);
1555
//                confirmButton = (Button) popupWindowView
1556
//                        .findViewById(R.id.confirmButton);
1557
//                confirmButton.setOnClickListener(new View.OnClickListener() {
1558
//                    @Override
1559
//                    public void onClick(View view) {
1560
//                        Toast.makeText(ShareTwoActivity.this, "YES", Toast.LENGTH_SHORT).show();
1561
//                        popupWindow.dismiss();
1562
//                    }
1563
//                });
1564
//                cancleButton = (Button) popupWindowView
1565
//                        .findViewById(R.id.cancleButton);
1566
//                cancleButton.setOnClickListener(new View.OnClickListener() {
1567
//                    @Override
1568
//                    public void onClick(View view) {
1569
////                        Toast.makeText(ShareTwoActivity.this, "NO", Toast.LENGTH_SHORT).show();
1570
//                        popupWindow.dismiss();
1571
//                    }
1572
//                });
1573
//                TextView tvOne2 = (TextView) popupWindowView.findViewById(R.id.tvOne);
1574
//                tvOne2.setOnClickListener(new View.OnClickListener() {
1575
//                    @Override
1576
//                    public void onClick(View view) {
1577
//                        tv_belong_type.setText("企业");
1578
//                        popupWindow.dismiss();
1579
//                    }
1580
//                });
1581
//                TextView tvTwo2 = (TextView) popupWindowView.findViewById(R.id.tvTwo);
1582
//                tvTwo2.setOnClickListener(new View.OnClickListener() {
1583
//                    @Override
1584
//                    public void onClick(View view) {
1585
//                        tv_belong_type.setText("私人");
1586
//                        popupWindow.dismiss();
1587
//                    }
1588
//                });
1589
//                popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
1590
//                break;
1591
//            case R.id.tv_submit:
1592
//                if (!et_serviceCost.getText().toString().equals("")&& Bimp.tempSelectBitmap.size() != 0) {
1593
//                    createDialog();
1594
//                    new Thread(new Runnable() {
1595
//                        @Override
1596
//                        public void run() {
1597
////                       submitShareTwo();
1598
//
1599
//                            try {
1600
//
1601
//                                    shite("");
1602
//
1603
//
1604
//                            } catch (Exception e) {
1605
//                                e.printStackTrace();
1606
//                            }
1607
//
1608
////                    uploadFile();
1609
//                        }
1610
//                    }).start();
1611
//                }else if (Bimp.tempSelectBitmap.size() == 0){
1612
//                    Toast.makeText(getApplication(),"请提交站点照片",Toast.LENGTH_SHORT).show();
1613
//                } else{
1614
//                    Toast.makeText(ClaimSurveyTwoActivity.this,"请确认必填项是否全部填写",Toast.LENGTH_SHORT).show();
1615
//                }
1616
//                break;
1617
1618
//            case R.id.zoomin1:
1619
//                mBaiduMap.setMapStatus(MapStatusUpdateFactory
1620
//                        .zoomTo(mapStatus.zoom + 1));
1621
//                controlZoomShow();
1622
//                break;
1623
//            case R.id.zoomout1:
1624
//                mBaiduMap.setMapStatus(MapStatusUpdateFactory
1625
//                        .zoomTo(mapStatus.zoom - 1));
1626
//                controlZoomShow();
1627
//                break;
1628
1629 813
        }
1630
1631
//        mapStatus = mBaiduMap.getMapStatus();
1632
1633
1634 814
    }
1635 815
1636 816
1637 817
    public boolean onKeyDown(int keyCode, KeyEvent event) {
1638 818
        if (keyCode == KeyEvent.KEYCODE_BACK) {
1639
//            SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
1640
//            sharedPreferencesUtil.setFileName("shareInfo");
1641
//            sharedPreferencesUtil.clearData();
1642 819
            finish();
1643 820
        }
1644 821
        return false;
1645 822
1646 823
    }
1647 824
1648
    //地图缩放方法
1649
//    private void controlZoomShow() {
1650
//        float zoom = mBaiduMap.getMapStatus().zoom;
1651
//        try {
1652
//            if (zoom >= maxZoomLevel) {
1653
//                inBtn.setImageResource(R.drawable.icon_nojia2_0);
1654
//                inBtn.setEnabled(false);
1655
////                Toast.makeText(getApplication(), "已放大到最大级别", Toast.LENGTH_SHORT)
1656
////                        .show();
1657
//                return;
1658
//            } else {
1659
//                inBtn.setImageResource(R.drawable.icon_jia2_0);
1660
//                inBtn.setEnabled(true);
1661
//            }
1662
//
1663
//            if (zoom <= minZoomLevel) {
1664
//                outBtn.setImageResource(R.drawable.icon_nojian2_0);
1665
//                outBtn.setEnabled(false);
1666
////                Toast.makeText(getApplication(), "已缩小到最小级别", Toast.LENGTH_SHORT)
1667
////                        .show();
1668
//                return;
1669
//            } else {
1670
//                outBtn.setImageResource(R.drawable.icon_jian2_0);
1671
//                outBtn.setEnabled(true);
1672
//            }
1673
//        } catch (Exception e) {
1674
//            e.printStackTrace();
1675
//        }
1676
//
1677
//    }
1678
1679
//    public void getPoint() {
1680
//        if (!isGetData) {
1681
//            isGetData = true;
1682
//            new Handler().postDelayed(new Runnable() {
1683
//
1684
//                @Override
1685
//                public void run() {
1686
//                    MyLocationData locCenter = mBaiduMap.getLocationData();
1687
//                    if (locCenter != null) {
1688
//                        center = new LatLng(locCenter.latitude,
1689
//                                locCenter.longitude);
1690
//
1691
////                        mBaiduMap.addOverlay(new MarkerOptions().position(center).icon(
1692
////                                BitmapDescriptorFactory
1693
////                                        .fromResource(R.drawable.position_icon)));
1694
//                    } else {
1695
//                        return;
1696
//                    }
1697
////                    Point p1 = new Point(0, 0);
1698
////                    LatLng locLeftTop = mBaiduMap.getProjection()
1699
////                            .fromScreenLocation(p1);
1700
////                    Point p2 = new Point(MainApplication.mScreenWidth, mMapView
1701
////                            .getHeight());
1702
////                    LatLng llRightBottom = mBaiduMap.getProjection()
1703
////                            .fromScreenLocation(p2);
1704
////                    MainMap();
1705
//                }
1706
//            }, 500);
1707
//        }
1708
//    }
1709
1710
//    private void MainMap() {
1711
//        new Thread(new Runnable() {
1712
//            Point p1 = new Point(0,0);
1713
//            LatLng locLeftTop = mBaiduMap.getProjection()
1714
//                    .fromScreenLocation(p1);
1715
//            Point p2 = new Point(MainApplication.mScreenWidth, mMapView
1716
//                    .getHeight());
1717
//            LatLng llRightBottom = mBaiduMap.getProjection()
1718
//                    .fromScreenLocation(p2);
1719
//
1720
//
1721
//            //            GeoPoint centerPoint = mapview.getMapCenter();// 地图中心坐标
1722
////            int tbSpan = mapview.getLatitudeSpan();// 当前纬线的跨度(从地图的上边缘到下边缘)
1723
////            int lrSpan = mapview.getLongitudeSpan();// 当前经度的跨度(从地图的左边缘到地图的右边缘)
1724
////            GeoPoint ltPoint = new GeoPoint(centerPoint.getLatitudeE6() - tbSpan / 2, centerPoint.getLongitudeE6() - lrSpan
1725
////                    / 2);// 左上角坐标
1726
////            GeoPoint rbPoint = new GeoPoint(centerPoint.getLatitudeE6()// 右下角坐标
1727
////                    + tbSpan / 2, centerPoint.getLongitudeE6() + lrSpan / 2);
1728
//            @Override
1729
//            public void run() {
1730
//                String url=MainApplication.url+"/zhannew/basic/web/index.php/zhanlist/getlist?poi_lux="+ locLeftTop.longitude+""+"&poi_luy="+ locLeftTop.latitude+"" +"&poi_rdx="+ llRightBottom.longitude+""+"&poi_rdy="+ llRightBottom.latitude+ ""+"&suit_car2="+MainApplication.userTpye;
1731
//                submitShowMap(url);
1732
//            }
1733
//        }).start();
1734
//
1735
//    }
1736
1737 825
    private void submitShowMap(String sms) {
1738
1739
        Log.e("url", sms);
1740 826
        Request request = new Request.Builder().url(sms).build();
1741 827
        Response response = null;
1742 828
        try {
@ -1867,48 +953,11 @@ public class PrivateZhuangInfoActivity extends Activity implements View.OnClickL
1867 953
        par.put("slow_num", slowNum.getText().toString());
1868 954
        if (tag.equals("edit")) {
1869 955
            par.put("where", id);
1870
//            JSONObject jsonObject = new JSONObject();
1871
//            JSONArray jsonArray = new JSONArray();
1872
//            jsonArray.put(0,"a");
1873
//            jsonObject.put("jsonArray",jsonArray);
1874 956
            par.put("picid", "a");
1875 957
        }
1876 958
1877
//        if ()
1878
//        par.put("where", zhan_id);
1879
1880
1881
//        par.put("zhan_id", zhan_id);
1882
//        par.put("total_num", "");
1883
//
1884
//        par.put("open_object", "");
1885
//        par.put("charges", "");
1886
//
1887
//        par.put("stop_cost_way", "");
1888
//
1889
//
1890
//        par.put("other_cost", et_serviceCost.getText().toString());
1891
//
1892
//        par.put("zhuang_produce", "");
1893
//
1894
//        par.put("city", "");
1895
//        par.put("supplier", "");
1896
//        par.put("facilities_classify", "");
1897
//        par.put("belong_attribute", "");
1898
//        par.put("operation_state", "");
1899
//
1900
//        par.put("holiday_open", "");
1901
//        par.put("holiday_close", "");
1902
//        par.put("company_name", "");
1903
//        par.put("person_name", "");
1904
//        par.put("zhuang_num", "");
1905
//        par.put("zy_num", "");
1906
//
1907
//
1908
//        par.put("token", DES3.encode(token));
1909 959
        try {
1910 960
            String u = UploadUtil.post(
1911
//                    "http://123.57.6.131/zhannew/basic/web/index.php/zhanlist/add",
1912 961
                    MainApplication.url + "/zhannew/basic/web/index.php/applist/createpile",
1913 962
                    par, null);
1914 963
            System.err.println(u);
@ -1936,51 +985,25 @@ public class PrivateZhuangInfoActivity extends Activity implements View.OnClickL
1936 985
    public void permissionTask() {
1937 986
        if (isPermissionOK()) {
1938 987
            callGallery();
1939
            // Have permission, do the thing!
1940
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
1941
//            ifTimeout();
1942 988
        } else {
1943
            // Ask for one permission
1944 989
            EasyPermissions.requestPermissions(
1945 990
                    this, "充电桩想要获取您的图片读取权限,是否允许?",
1946 991
                    RC_ALBUM_PERM,
1947 992
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
1948
                    Manifest.permission.READ_EXTERNAL_STORAGE);
993
                    Manifest.permission.READ_EXTERNAL_STORAGE,
994
                    Manifest.permission.CAMERA
995
            );
1949 996
        }
1950 997
    }
1951 998
1952 999
    private boolean isPermissionOK() {
1953 1000
        return EasyPermissions.hasPermissions(this,
1954 1001
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
1955
                Manifest.permission.READ_EXTERNAL_STORAGE
1002
                Manifest.permission.READ_EXTERNAL_STORAGE,
1003
                Manifest.permission.CAMERA
1956 1004
        );
1957 1005
    }
1958 1006
1959
1960
//    @Override
1961
//    public void onGetGeoCodeResult(GeoCodeResult geoCodeResult) {
1962
//
1963
//    }
1964
//
1965
//    @Override
1966
//    public void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {
1967
//        if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
1968
//            Toast.makeText(ShareTwoActivity.this, "抱歉,未能找到结果",
1969
//                    Toast.LENGTH_LONG).show();
1970
//            return;
1971
//        }
1972
////        TextView tv = new TextView(this);
1973
////        tv.setBackgroundResource(R.color.bkg_button_green);
1974
////        tv.setPadding(7, 7, 7, 7);
1975
////        tv.setText(result.getAddress());
1976
////        tv.setTextColor(Color.WHITE);
1977
////        mInfoWindow = new InfoWindow(tv, llposition, -60);
1978
////        mBaiduMap.showInfoWindow(mInfoWindow);
1979
//        location = result.getAddress();
1980
//        city = Util.getCityName(result.getAddress());
1981
//        et_share_address.setText(location);
1982
//    }
1983
1984 1007
    @SuppressLint("HandlerLeak")
1985 1008
    public class GridAdapter extends BaseAdapter {
1986 1009
        private LayoutInflater inflater;
@ -2106,242 +1129,13 @@ public class PrivateZhuangInfoActivity extends Activity implements View.OnClickL
2106 1129
    private static final int TAKE_PICTURE = 0x000001;
2107 1130
2108 1131
    public void photo() {
2109
//		Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
2110
//		startActivityForResult(openCameraIntent, TAKE_PICTURE);
2111
//        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
2112
//        File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/myimage/", String.valueOf(System
2113
//                .currentTimeMillis()) + ".jpg");
2114
//        camePath = file.getPath();
2115
//        Uri imageUri = Uri.fromFile(file);
2116
//        intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
2117
//        startActivityForResult(intent, TAKE_PICTURE);
2118
2119 1132
        if (hasSdcard()) {
2120 1133
            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);//���������
2121 1134
            intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile));
2122
//            intent.putExtra(MediaStore.EXTRA_OUTPUT, cutImgUri);
2123 1135
            startActivityForResult(intent, PHOTO_REQUEST_CAMERA);
2124 1136
        }
2125
2126
//        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
2127
//        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
2128
//                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
2129
//        ((Activity) mContext).startActivityForResult(intent, 2);
2130 1137
    }
2131 1138
2132
//    public void photo() {
2133
//        Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
2134
//        startActivityForResult(openCameraIntent, TAKE_PICTURE);
2135
////        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
2136
////        File file = new File(Environment.getExternalStorageDirectory() + "/myimage/", String.valueOf(System
2137
////                .currentTimeMillis()) + ".jpg");
2138
////        camePath = file.getPath();
2139
////        Uri imageUri = Uri.fromFile(file);
2140
////        intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
2141
////        startActivityForResult(intent, TAKE_PICTURE);
2142
//    }
2143
2144
//    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
2145
//        System.out.println("--------data------->"+data);
2146
//        //���ѡȡ
2147
//        if(requestCode == PHOTO_REQUEST_CAMERA && resultCode == Activity.RESULT_OK ){
2148
//            //��������ͼƬ�ͽ�ȡ���ͼƬ�ļ���д����ͬһ���ļ���photo.jpg
2149
//            crop(Uri.fromFile(tempFile),Uri.fromFile(tempFile));
2150
//        }
2151
//        //���ؽ�ȡ��ͼƬ
2152
//        else if(requestCode == PHOTO_REQUEST_CUT ){
2153
//            //���д�ͼʹ��Uri
2154
//            Bitmap bitmap = decodeUriAsBitmap(Uri.fromFile(tempFile));//decode bitmap
2155
////            mFace.setImageBitmap(bitmap);
2156
//            String fileName = String.valueOf(System.currentTimeMillis());
2157
//            ImageItem takePhoto = new ImageItem();
2158
//            takePhoto.setBitmap(bitmap);
2159
//            takePhoto.setImagePath(FileUtils.SDPATH + fileName + ".JPEG");
2160
//            Bimp.tempSelectBitmap.add(takePhoto);
2161
//        }else {
2162
////            Toast.makeText(getApplicationContext(), "��ȡͼƬʧ��", Toast.LENGTH_SHORT).show();
2163
//        }
2164
//        super.onActivityResult(requestCode, resultCode, data);
2165
//        if (resultCode != Activity.RESULT_OK) {
2166
//            return;
2167
//        }
2168
//        switch (requestCode) {
2169
//            // 如果是直接从相册获取
2170
//            case REQUSET:
2171
//                poi_jing = data.getStringExtra("poi_jing");
2172
//                Log.e("返回==poi_jing",poi_jing);
2173
//                poi_wei = data.getStringExtra("poi_wei");
2174
//                Log.e("返回==poi_wei",poi_wei);
2175
//                et_share_address.setText(data.getStringExtra("address"));
2176
//            default:
2177
//                break;
2178
//        }
2179
//    }
2180
2181
//    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
2182
//        switch (requestCode) {
2183
//            case TAKE_PICTURE:
2184
//                if (Bimp.tempSelectBitmap.size() < 3 && resultCode == RESULT_OK) {
2185
//
2186
////                    String fileName = String.valueOf(System.currentTimeMillis());
2187
////                    Bundle bundle = data.getExtras("data");
2188
////                    Bitmap bm = (Bitmap) data.getExtras().get("data");
2189
////                    FileUtils.saveBitmap(bm, fileName);
2190
////
2191
////                    ImageItem takePhoto = new ImageItem();
2192
////                    takePhoto.setBitmap(bm);
2193
////                    takePhoto.setImagePath(FileUtils.SDPATH + fileName + ".JPEG");
2194
////                    Bimp.tempSelectBitmap.add(takePhoto);
2195
//
2196
////                    SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmssSSS");
2197
//
2198
//                    Bitmap bitmap = BitmapFactory.decodeFile(camePath);
2199
//                    File file = new File(String.valueOf(Environment.getDataDirectory()));
2200
//                    file.mkdirs();
2201
//                    String fileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "/myimage/" + System.currentTimeMillis()
2202
//                            + ".jpg";
2203
//                    try {
2204
//                        FileOutputStream b = new FileOutputStream(fileName);
2205
//                        bitmap.compress(Bitmap.CompressFormat.JPEG, 50, b);
2206
//                        b.flush();
2207
//                        b.close();
2208
//                        bitmap = Bimp.revitionImageSize(fileName);
2209
//                        FileUtils.saveBitmap(bitmap,
2210
//                                "" + fileName.substring(fileName.lastIndexOf("/") + 1, fileName.lastIndexOf(".")));
2211
//                    ImageItem takePhoto = new ImageItem();
2212
//                    takePhoto.setBitmap(bitmap);
2213
//                    takePhoto.setImagePath(fileName);
2214
//                    Bimp.tempSelectBitmap.add(takePhoto);
2215
//                        if (null != adapter) {
2216
//                            adapter.notifyDataSetChanged();
2217
//                        }
2218
//                    File refile = new File(camePath);
2219
//                        if (refile.exists()) {
2220
//                            refile.delete();
2221
//                        }
2222
//                    } catch (Exception e) {
2223
//                        e.printStackTrace();
2224
//                    }
2225
//
2226
//
2227
////                    Bitmap bitmap = BitmapFactory.decodeFile(camePath);
2228
////                    File file = new File(Environment.getExternalStorageDirectory() + "/myImage/");
2229
////                    file.mkdirs();
2230
////                    String fileName = Environment.getExternalStorageDirectory() + "/myImage/" + System.currentTimeMillis()
2231
////                            + ".jpg";
2232
////                    try {
2233
////                        FileOutputStream b = new FileOutputStream(fileName);
2234
////                        bitmap.compress(Bitmap.CompressFormat.JPEG, 50, b);
2235
////                        b.flush();
2236
////                        b.close();
2237
////                        bitmap = Bimp.revitionImageSize(fileName);
2238
////                        FileUtils.saveBitmap(bitmap,
2239
////                                "" + fileName.substring(fileName.lastIndexOf("/") + 1, fileName.lastIndexOf(".")));
2240
////                        ImageItem takePhoto = new ImageItem();
2241
////                        takePhoto.setBitmap(bitmap);
2242
////                        takePhoto.setImagePath(fileName);
2243
////                        Bimp.tempSelectBitmap.add(takePhoto);
2244
////                        if (null != adapter) {
2245
////                            adapter.notifyDataSetChanged();
2246
////                        }
2247
////                        File refile = new File(camePath);
2248
////                        if (refile.exists()) {
2249
////                            refile.delete();
2250
////                        }
2251
////                    } catch (Exception e) {
2252
////                        e.printStackTrace();
2253
////                    }
2254
//                }
2255
//
2256
//                break;
2257
////            case 1:
2258
////                if (data != null) {
2259
////                    startPhotoZoom(data.getData());
2260
////                    Toast.makeText(mContext, "拖动正方形角可调整剪切大小",
2261
////                            android.widget.Toast.LENGTH_SHORT).show();
2262
////                }
2263
////                break;
2264
////            // 如果是调用相机拍照时
2265
////            case 2:
2266
////                File temp = new File(Environment.getExternalStorageDirectory()
2267
////                        + "/androidapp.jpg");
2268
////                startPhotoZoom(Uri.fromFile(temp));
2269
////                break;
2270
//        }
2271
//    }
2272
2273
//    private void cameraCamera(Intent data) {
2274
//        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmssSSS");
2275
//        String name = formatter.format(System.currentTimeMillis()) + ".jpg";
2276
//        Log.i("zhiwei.zhao", "image name:" + name);
2277
//        Toast.makeText(this, name, Toast.LENGTH_LONG).show();
2278
//        Bundle bundle = data.getExtras();
2279
//		/* 获取相机返回的数据,并转换为Bitmap图片格式 */
2280
//        Bitmap bitmap = (Bitmap) bundle.get("data");
2281
//        FileOutputStream b = null;
2282
//
2283
//        String path = Environment.getExternalStorageDirectory().getPath();
2284
//        File file = new File(path + "/myImage/");
2285
//        /** 检测文件夹是否存在,不存在则创建文件夹 **/
2286
//        if (!file.exists() && !file.isDirectory())
2287
//            file.mkdirs();
2288
//        String fileName = file.getPath() + "/" + name;
2289
//        Log.i("zhiwei.zhao", "camera file path:" + fileName);
2290
//        try {
2291
//            b = new FileOutputStream(fileName);
2292
//			/* 把数据写入文件 */
2293
//            bitmap.compress(Bitmap.CompressFormat.JPEG, 100, b);
2294
//        } catch (FileNotFoundException e) {
2295
//            e.printStackTrace();
2296
//        } finally {
2297
//            try {
2298
//                if (b == null)
2299
//                    return;
2300
//                b.flush();
2301
//                b.close();
2302
//            } catch (IOException e) {
2303
//                e.printStackTrace();
2304
//            }
2305
//        }
2306
//        showImgs(bitmap, true);
2307
//    }
2308
2309
2310
//    public class MyLocationListenner implements BDLocationListener {
2311
//
2312
//
2313
//        @Override
2314
//        public void onReceiveLocation(BDLocation location) {
2315
//            if (location == null || mMapView == null)
2316
//                return;
2317
//            MyLocationData locData = new MyLocationData.Builder()
2318
//                    .accuracy(location.getRadius()).direction(1000)
2319
//                    .latitude(location.getLatitude())
2320
//                    .longitude(location.getLongitude()).build();
2321
//            mBaiduMap.setMyLocationData(locData);
2322
//            if (isFirstLoc) {
2323
//                isFirstLoc = false;
2324
//                mLocClient.stop();
2325
//                mBaiduMap.setMyLocationEnabled(true);
2326
//                LatLng ll = new LatLng(location.getLatitude(),
2327
//                        location.getLongitude());
2328
//                if (TextUtils.isEmpty(location.getCity())) {
2329
////                        mSearch.reverseGeoCode(new ReverseGeoCodeOption()
2330
////                                .location(ll));
2331
//                } else {
2332
//                    city = location.getCity();
2333
//                }
2334
//                MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
2335
//                mBaiduMap.animateMapStatus(u);
2336
//                getPoint();
2337
//            }
2338
//        }
2339
//
2340
//        public void onReceivePoi(BDLocation poiLocation) {
2341
//        }
2342
//    }
2343
2344
2345 1139
    @Override
2346 1140
    protected void onDestroy() {
2347 1141
        Bimp.tempSelectBitmap.clear();
@ -2366,18 +1160,9 @@ public class PrivateZhuangInfoActivity extends Activity implements View.OnClickL
2366 1160
2367 1161
2368 1162
    private void crop(Uri uri, Uri cutImgUri) {
2369
        // �ü�ͼƬ��ͼ
2370 1163
        Intent intent = new Intent("com.android.camera.action.CROP");
2371 1164
        intent.setDataAndType(uri, "image/*");
2372 1165
        intent.putExtra("crop", "true");
2373
        // �ü���ı�����1��1
2374
//        intent.putExtra("aspectX", 4);
2375
//        intent.putExtra("aspectY", 3);
2376
        // �ü������ͼƬ�ijߴ��С
2377
//        intent.putExtra("outputX", 400);
2378
//        intent.putExtra("outputY", 300);
2379
2380
        // ͼƬ��ʽ
2381 1166
        intent.putExtra("outputFormat", "JPEG");
2382 1167
        intent.putExtra("noFaceDetection", true);// ȡ������ʶ��
2383 1168
        intent.putExtra("return-data", false);// true:������uri��false������uri
@ -2512,26 +1297,12 @@ public class PrivateZhuangInfoActivity extends Activity implements View.OnClickL
2512 1297
        matrix.postScale(scaleWidth, scaleHeight);
2513 1298
        Bitmap bitmap = Bitmap.createBitmap(bgimage, 0, 0, (int) width,
2514 1299
                (int) height, matrix, true);
2515
//        iv_2.setImageBitmap(bitmap);
2516
//        tv_2.setText(bitmap.getRowBytes() * bitmap.getHeight() + "");
2517 1300
        return bitmap;
2518 1301
    }
2519 1302
2520 1303
    @Override
2521 1304
    protected void onResume() {
2522 1305
        super.onResume();
2523
//        SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
2524
//        sharedPreferencesUtil.setFileName("shareInfo");
2525
//        String address =sharedPreferencesUtil.getString("address", "");
2526
//        String costway =sharedPreferencesUtil.getString("costWay", "");
2527
//        jing =sharedPreferencesUtil.getString("poi_jing", "");
2528
//        wei =sharedPreferencesUtil.getString("poi_wei", "");
2529
////        String tel =sharedPreferencesUtil.getString("tel", "");
2530
//////        String car =sharedPreferencesUtil.getString("car", "");
2531
////        String alipay =sharedPreferencesUtil.getString("alipay", "");
2532
////        carType.setText(car);
2533
//        et_share_address.setText(address);
2534
//        costWay.setText(costway);
2535 1306
    }
2536 1307
2537 1308
    public Bitmap getHttpBitmap(String url) {

+ 0 - 1
app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java

@ -1007,7 +1007,6 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1007 1007
                    MobclickAgent.onEvent(getApplicationContext(), "0813");
1008 1008
                    startActivity(new Intent(this, PrivateZhaungListActivity.class));
1009 1009
                }
1010
1011 1010
                break;
1012 1011
        }
1013 1012
    }

+ 0 - 3
app/src/main/java/com/electric/chargingpile/adapter/PrivateZhuangListAdapter.java

@ -97,11 +97,8 @@ public class PrivateZhuangListAdapter extends BaseAdapter {
97 97
            holder.item_edit = (TextView) convertView.findViewById(R.id.item_edit);
98 98
            holder.item_zhan_address = (TextView) convertView
99 99
                    .findViewById(R.id.item_zhan_address);
100
//            holder.slideShowView = (SlideShowView) convertView.findViewById(R.id.rl_img);
101 100
            holder.item_picnum = (TextView) convertView.findViewById(R.id.item_picnum);
102 101
            holder.item_pic = (ImageView) convertView.findViewById(R.id.item_pic);
103
//            holder.tv_claimState = (TextView) convertView
104
//                    .findViewById(R.id.tv_claimState);
105 102
        }
106 103
107 104
        if (holder != null && convertView != null) {

Adrianne Luckett - Gogs: Go Git Service
adriannelucket (Adrianne Luckett)

Followers