From 3f8ee9123053b69142671f2dab5d54dc5123add9 Mon Sep 17 00:00:00 2001 From: xiaoyan Date: Fri, 3 Feb 2023 13:44:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=85=A7=E7=89=87=E5=9D=90=E6=A0=87=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=9D=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=82=B9=E5=87=BB=E5=AE=8C=E6=88=90=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/ChargingPileFragment.java | 21 ++++---- .../fragment/ChargingStationFragment.java | 11 ++-- .../outdoor/fragment/GatherGetFragment.java | 14 +++++- .../outdoor/fragment/OtherFragment.java | 5 +- .../navinfo/outdoor/fragment/PoiFragment.java | 11 ++-- .../outdoor/fragment/TreasureFragment.java | 50 ++++++++++--------- 6 files changed, 65 insertions(+), 47 deletions(-) diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java index af32607..6bc3614 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java @@ -50,6 +50,7 @@ import com.navinfo.outdoor.room.PoiDatabase; import com.navinfo.outdoor.room.PoiEntity; import com.navinfo.outdoor.util.Geohash; import com.navinfo.outdoor.util.GeometryTools; +import com.navinfo.outdoor.util.LocationLifeCycle; import com.navinfo.outdoor.util.PhotoUtils; import com.navinfo.outdoor.util.TimestampUtil; import com.navinfo.outdoor.util.ToastUtils; @@ -1046,70 +1047,70 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC case R.id.rl_panorama: chargingPileBuilder.append("点击了全景照片进行拍照,"); Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class); - File panoramaFile = PhotoUtils.showPhotoFile("a", latLng); + File panoramaFile = PhotoUtils.showPhotoFile("a", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, panoramaFile.getPath()); startActivityForResult(intentPanorama, 101); break; case R.id.rl_coding: chargingPileBuilder.append("点击了充电桩编码进行拍照,"); Intent intentCoding = new Intent(getActivity(), PhotographActivity.class); - File codingFile = PhotoUtils.showPhotoFile("b", latLng); + File codingFile = PhotoUtils.showPhotoFile("b", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentCoding.putExtra(Constant.INTENT_PHOTO_PATH, codingFile.getPath()); startActivityForResult(intentCoding, 102); break; case R.id.rl_equipment: chargingPileBuilder.append("点击了设备标牌进行拍照,"); Intent intentEquipment = new Intent(getActivity(), PhotographActivity.class); - File equipmentFile = PhotoUtils.showPhotoFile("c", latLng); + File equipmentFile = PhotoUtils.showPhotoFile("c", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentEquipment.putExtra(Constant.INTENT_PHOTO_PATH, equipmentFile.getPath()); startActivityForResult(intentEquipment, 103); break; case R.id.rl_facility: chargingPileBuilder.append("点击了设备标牌进行拍照,"); Intent intentFacility = new Intent(getActivity(), PhotographActivity.class); - File facilityFile = PhotoUtils.showPhotoFile("c", latLng); + File facilityFile = PhotoUtils.showPhotoFile("c", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentFacility.putExtra(Constant.INTENT_PHOTO_PATH, facilityFile.getPath()); startActivityForResult(intentFacility, 104); break; case R.id.rl_scutcheon: chargingPileBuilder.append("点击了设备标牌进行拍照,"); Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class); - File scutcheonFile = PhotoUtils.showPhotoFile("c", latLng); + File scutcheonFile = PhotoUtils.showPhotoFile("c", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath()); startActivityForResult(intentScutcheon, 105); break; case R.id.rl_device: chargingPileBuilder.append("点击了设备标牌进行拍照,"); Intent intentDevice = new Intent(getActivity(), PhotographActivity.class); - File deviceFile = PhotoUtils.showPhotoFile("c", latLng); + File deviceFile = PhotoUtils.showPhotoFile("c", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentDevice.putExtra(Constant.INTENT_PHOTO_PATH, deviceFile.getPath()); startActivityForResult(intentDevice, 106); break; case R.id.rl_usable: chargingPileBuilder.append("点击了可用状态进行拍照,"); Intent intentUsable = new Intent(getActivity(), PhotographActivity.class); - File usableFile = PhotoUtils.showPhotoFile("d", latLng); + File usableFile = PhotoUtils.showPhotoFile("d", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentUsable.putExtra(Constant.INTENT_PHOTO_PATH, usableFile.getPath()); startActivityForResult(intentUsable, 107); break; case R.id.rl_available: chargingPileBuilder.append("点击了可用专题进行拍照,"); Intent intentAvailable = new Intent(getActivity(), PhotographActivity.class); - File availableFile = PhotoUtils.showPhotoFile("d", latLng); + File availableFile = PhotoUtils.showPhotoFile("d", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentAvailable.putExtra(Constant.INTENT_PHOTO_PATH, availableFile.getPath()); startActivityForResult(intentAvailable, 108); break; case R.id.rl_parking: chargingPileBuilder.append("点击了停车位编号进行拍照,"); Intent intentParking = new Intent(getActivity(), PhotographActivity.class); - File parkingFile = PhotoUtils.showPhotoFile("e", latLng); + File parkingFile = PhotoUtils.showPhotoFile("e", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentParking.putExtra(Constant.INTENT_PHOTO_PATH, parkingFile.getPath()); startActivityForResult(intentParking, 109); break; case R.id.rl_number: chargingPileBuilder.append("点击了停车位编号进行拍照,"); Intent intentNumber = new Intent(getActivity(), PhotographActivity.class); - File numberFile = PhotoUtils.showPhotoFile("e", latLng); + File numberFile = PhotoUtils.showPhotoFile("e", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentNumber.putExtra(Constant.INTENT_PHOTO_PATH, numberFile.getPath()); startActivityForResult(intentNumber, 110); break; diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java index 3a3dae7..18815d8 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java @@ -52,6 +52,7 @@ import com.navinfo.outdoor.adapter.ChargingPileAdapter; import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.base.BaseDrawerFragment; import com.navinfo.outdoor.util.FlushTokenUtil; +import com.navinfo.outdoor.util.LocationLifeCycle; import com.navinfo.outdoor.util.PreserveUtils; import com.navinfo.outdoor.util.TimestampUtil; import com.navinfo.outdoor.util.ToastUtils; @@ -1052,35 +1053,35 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. case R.id.rl_panorama: chargingStationBuilder.append(TimestampUtil.time()).append("点击了全景照片进行拍照 ,"); Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class); - File PanoramaFile = PhotoUtils.showPhotoFile("a", latLng); + File PanoramaFile = PhotoUtils.showPhotoFile("a", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, PanoramaFile.getPath()); startActivityForResult(intentPanorama, 101); break; case R.id.rl_name: chargingStationBuilder.append(TimestampUtil.time()).append("点击了名称照片进行拍照 ,"); Intent intentName = new Intent(getActivity(), PhotographActivity.class); - File nameFile = PhotoUtils.showPhotoFile("b", latLng); + File nameFile = PhotoUtils.showPhotoFile("b", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentName.putExtra(Constant.INTENT_PHOTO_PATH, nameFile.getPath()); startActivityForResult(intentName, 102); break; case R.id.rl_internal_photos: chargingStationBuilder.append(TimestampUtil.time()).append("点击了服务说明进行拍照 ,"); Intent intentInternal = new Intent(getActivity(), PhotographActivity.class); - File internalFile = PhotoUtils.showPhotoFile("c", latLng); + File internalFile = PhotoUtils.showPhotoFile("c", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, internalFile.getPath()); startActivityForResult(intentInternal, 103); break; case R.id.rl_else: chargingStationBuilder.append(TimestampUtil.time()).append("点击了充电站指引牌进行拍照 ,"); Intent intentElse = new Intent(getActivity(), PhotographActivity.class); - File elseFile = PhotoUtils.showPhotoFile("d", latLng); + File elseFile = PhotoUtils.showPhotoFile("d", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentElse.putExtra(Constant.INTENT_PHOTO_PATH, elseFile.getPath()); startActivityForResult(intentElse, 104); break; case R.id.rl_scutcheon: chargingStationBuilder.append(TimestampUtil.time()).append("点击了停车收费标牌进行拍照 ,"); Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class); - File scutcheonFile = PhotoUtils.showPhotoFile("e", latLng); + File scutcheonFile = PhotoUtils.showPhotoFile("e", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath()); startActivityForResult(intentScutcheon, 105); break; diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java index be15c82..b71ff9c 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java @@ -343,7 +343,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe if (poiEntity != null) { int type = poiEntity.getType(); if (type == 6) { - initSubmitPolygonTask(HttpInterface.COMPLETE, poiEntity); + initSubmitPolygonTask(HttpInterface.COMPLETE+"/"+poiEntity.getTaskId(), poiEntity); } else { new Thread(new Runnable() { @Override @@ -752,10 +752,22 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe public void onSuccess(UnPolygonTaskBean response, int id) { dismissLoadingDialog(); if (response.getCode() == 200) { + ToastUtils.Message(getActivity(), "结束采集成功!"); new Thread(new Runnable() { @Override public void run() { PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity); + // 隐藏半框弹出界面 + Message obtain = Message.obtain(); + obtain.what = Constant.GATHER_GET_RETURN; + obtain.obj = false; + EventBus.getDefault().post(obtain); + // 刷新地图 + Message obtains = Message.obtain(); + obtains.what = Constant.JOB_WORD_MONITOR; + obtains.obj = true; + EventBus.getDefault().post(obtains); + onBackPressed(); } }).start(); } else if (response.getCode() == 230) { diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java index 1998b28..51dbfd6 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java @@ -44,6 +44,7 @@ import com.navinfo.outdoor.activity.PhotographActivity; import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.base.BaseDrawerFragment; import com.navinfo.outdoor.util.FlushTokenUtil; +import com.navinfo.outdoor.util.LocationLifeCycle; import com.navinfo.outdoor.util.PreserveUtils; import com.navinfo.outdoor.util.TimestampUtil; import com.navinfo.outdoor.util.ToastUtils; @@ -512,14 +513,14 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis case R.id.rl_picture: otherBuilder.append(TimestampUtil.time()).append(",").append("点击了第一个照片进行拍照 ,"); Intent intentPicture = new Intent(getActivity(), PhotographActivity.class); - File file = PhotoUtils.showPhotoFile("a", latLng); + File file = PhotoUtils.showPhotoFile("a", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentPicture.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath()); startActivityForResult(intentPicture, 101); break; case R.id.rl_pictures: otherBuilder.append(TimestampUtil.time()).append(",").append("点击了第二个照片进行拍照 ,"); Intent intentPictures = new Intent(getActivity(), PhotographActivity.class); - File files = PhotoUtils.showPhotoFile("b", latLng); + File files = PhotoUtils.showPhotoFile("b", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentPictures.putExtra(Constant.INTENT_PHOTO_PATH, files.getPath()); startActivityForResult(intentPictures, 102); break; diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java index fee084a..135119f 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/PoiFragment.java @@ -48,6 +48,7 @@ import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.base.BaseDrawerFragment; import com.navinfo.outdoor.util.AWMp4ParserHelper; import com.navinfo.outdoor.util.FlushTokenUtil; +import com.navinfo.outdoor.util.LocationLifeCycle; import com.navinfo.outdoor.util.PreserveUtils; import com.navinfo.outdoor.util.TimestampUtil; import com.navinfo.outdoor.util.ToastUtils; @@ -815,35 +816,35 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe case R.id.rl_panorama: poiBuilder.append(TimestampUtil.time()).append(",").append("点击了全景图的进行拍照,"); Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class); - File filePanorama = PhotoUtils.showPhotoFile("a", latLng); + File filePanorama = PhotoUtils.showPhotoFile("a", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, filePanorama.getPath()); startActivityForResult(intentPanorama, 101); break; case R.id.rl_name: poiBuilder.append(TimestampUtil.time()).append(",").append("点击了名称的进行拍照,"); Intent intentName = new Intent(getActivity(), PhotographActivity.class); - File fileName = PhotoUtils.showPhotoFile("b", latLng); + File fileName = PhotoUtils.showPhotoFile("b", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentName.putExtra(Constant.INTENT_PHOTO_PATH, fileName.getPath()); startActivityForResult(intentName, 102); break; case R.id.rl_internal_photos: poiBuilder.append(TimestampUtil.time()).append(",").append("点击了内部照片的进行拍照,"); Intent intentInternal = new Intent(getActivity(), PhotographActivity.class); - File fileInternal = PhotoUtils.showPhotoFile("c", latLng); + File fileInternal = PhotoUtils.showPhotoFile("c", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, fileInternal.getPath()); startActivityForResult(intentInternal, 103); break; case R.id.rl_card: poiBuilder.append(TimestampUtil.time()).append(",").append("点击了名片的进行拍照,"); Intent intentCard = new Intent(getActivity(), PhotographActivity.class); - File fileCard = PhotoUtils.showPhotoFile("d", latLng); + File fileCard = PhotoUtils.showPhotoFile("d", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentCard.putExtra(Constant.INTENT_PHOTO_PATH, fileCard.getPath()); startActivityForResult(intentCard, 104); break; case R.id.rl_else: poiBuilder.append(TimestampUtil.time()).append(",").append("点击了其他的进行拍照,"); Intent intentElse = new Intent(getActivity(), PhotographActivity.class); - File fileElse = PhotoUtils.showPhotoFile("e", latLng); + File fileElse = PhotoUtils.showPhotoFile("e", new LatLng(LocationLifeCycle.getInstance().getTencentLocation().getLatitude(), LocationLifeCycle.getInstance().getTencentLocation().getLongitude())); intentElse.putExtra(Constant.INTENT_PHOTO_PATH, fileElse.getPath()); startActivityForResult(intentElse, 105); break; diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java index 2386c6b..205d902 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java @@ -970,30 +970,32 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen gatherMarker.setVisible(false); } PoiEntity poiEntity = (PoiEntity) data.obj; - Bundle bundle = new Bundle(); - bundle.putSerializable("poiEntity", poiEntity); - bundle.putBoolean("isSliding", true); // 通知抽屉不收回 - switch (poiEntity.getType()) { - case 1: - PoiFragment poiFragment = PoiFragment.newInstance(bundle); - showSlidingFragment(poiFragment); - break; - case 2: - ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle); - showSlidingFragment(chargingStationFragment); - break; - case 3: - PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle); - showSlidingFragment(poiVideoFragment); - break; - case 4: - RoadFragment roadFragment = RoadFragment.newInstance(bundle); - showSlidingFragment(roadFragment); - break; - case 5: - OtherFragment otherFragment = OtherFragment.newInstance(bundle); - showSlidingFragment(otherFragment); - break; + if (poiEntity!=null) { + Bundle bundle = new Bundle(); + bundle.putSerializable("poiEntity", poiEntity); + bundle.putBoolean("isSliding", true); // 通知抽屉不收回 + switch (poiEntity.getType()) { + case 1: + PoiFragment poiFragment = PoiFragment.newInstance(bundle); + showSlidingFragment(poiFragment); + break; + case 2: + ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle); + showSlidingFragment(chargingStationFragment); + break; + case 3: + PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle); + showSlidingFragment(poiVideoFragment); + break; + case 4: + RoadFragment roadFragment = RoadFragment.newInstance(bundle); + showSlidingFragment(roadFragment); + break; + case 5: + OtherFragment otherFragment = OtherFragment.newInstance(bundle); + showSlidingFragment(otherFragment); + break; + } } frameLayout.setVisibility(View.GONE); if (gatherGetFragment != null) {