修改bug,添加保存本地刪除功能
This commit is contained in:
parent
327da2a8d0
commit
f241b5e877
@ -194,7 +194,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
initGetUserInfo();//获取用户信息
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
@ -122,7 +122,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
private CheckBox cbMapType;
|
||||
private boolean isMapSlide = false;
|
||||
private int pageNum = 0;
|
||||
|
||||
private Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(@NonNull Message msg) {
|
||||
@ -147,21 +146,20 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
if (getIntent() != null) {
|
||||
|
||||
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||
poiEntity = (PoiEntity) getIntent().getSerializableExtra("poiEntity");
|
||||
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
|
||||
}
|
||||
videoChronometer = findViewById(R.id.video_chronometer);
|
||||
// if (finalVideoPath == null) {
|
||||
//// finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
|
||||
//// }
|
||||
// finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
|
||||
// }
|
||||
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
ivZoomAdd = findViewById(R.id.iv_zoom_add);
|
||||
ivZoomAdd.setOnClickListener(this);
|
||||
ivZoomDel = findViewById(R.id.iv_zoom_del);
|
||||
ivZoomDel.setOnClickListener(this);
|
||||
/* cbMapType = findViewById(R.id.cb_map_type);
|
||||
/* cbMapType = findViewById(R.id.cb_map_type);
|
||||
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
@ -175,8 +173,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
ivMap = (TextureMapView) findViewById(R.id.iv_map);
|
||||
btnSwitch = (Button) findViewById(R.id.btn_switch);
|
||||
btnSwitch.setOnClickListener(this);
|
||||
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||
// capturePicture.setOnClickListener(this::onClick);
|
||||
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||
// capturePicture.setOnClickListener(this::onClick);
|
||||
ivPic = findViewById(R.id.iv_pic);
|
||||
//相机记录器
|
||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||
@ -196,12 +194,12 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
}
|
||||
|
||||
captureVideo.setText("暂停采集");
|
||||
// stopVideo.setEnabled(false);// 开始采集视频后,禁用停止采集的按钮,必须暂停采集后才可点击停止采集
|
||||
// stopVideo.setEnabled(false);// 开始采集视频后,禁用停止采集的按钮,必须暂停采集后才可点击停止采集
|
||||
startTakenVideo(); // 开始采集视频
|
||||
} else {
|
||||
stopTakenVideo();
|
||||
captureVideo.setText("开始采集");
|
||||
// stopVideoAndFinish();
|
||||
// stopVideoAndFinish();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -226,9 +224,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势.
|
||||
uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势.
|
||||
|
||||
// uiSettings.setAllGesturesEnabled(false);
|
||||
// uiSettings.setAllGesturesEnabled(false);
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
|
||||
|
||||
initLine();
|
||||
// camera.addFrameProcessor(new FrameProcessor() {
|
||||
// @Override
|
||||
@ -258,12 +255,12 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
@Override
|
||||
public void onCameraOpened(@NonNull @NotNull CameraOptions options) {
|
||||
super.onCameraOpened(options);
|
||||
// List<Size> sizeList = (List<Size>) options.getSupportedVideoSizes();
|
||||
// List<Size> sizeList = (List<Size>) options.getSupportedVideoSizes();
|
||||
//
|
||||
// Size size = null;
|
||||
// SizeSelector maxWidthSizeSelector = SizeSelectors.maxWidth(size.getWidth());
|
||||
// SizeSelector maxHeightSizeSelector = SizeSelectors.maxHeight(size.getHeight());
|
||||
// camera.setVideoSize(SizeSelectors.and(maxHeightSizeSelector, maxWidthSizeSelector));
|
||||
// Size size = null;
|
||||
// SizeSelector maxWidthSizeSelector = SizeSelectors.maxWidth(size.getWidth());
|
||||
// SizeSelector maxHeightSizeSelector = SizeSelectors.maxHeight(size.getHeight());
|
||||
// camera.setVideoSize(SizeSelectors.and(maxHeightSizeSelector, maxWidthSizeSelector));
|
||||
Collection<Size> supportedPictureSizes = options.getSupportedPictureSizes();
|
||||
camera.setVideoBitRate(2000000);
|
||||
}
|
||||
@ -407,7 +404,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
|
||||
// 构造 PolylineOnions
|
||||
PolylineOptions polylineOptions
|
||||
= new PolylineOptions().addAll(latLineString)
|
||||
@ -462,9 +458,9 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
handler.sendEmptyMessageDelayed(0, 2000); // 利用handler延迟发送更改状态信息
|
||||
benSwitch();
|
||||
break;
|
||||
// case R.id.capuletVideo:
|
||||
// startTakenVideo(); // 开始拍摄视频
|
||||
// break;
|
||||
// case R.id.capuletVideo:
|
||||
// startTakenVideo(); // 开始拍摄视频
|
||||
// break;
|
||||
case R.id.btn_stop_video:
|
||||
stopVideoAndFinish();
|
||||
break;
|
||||
@ -528,7 +524,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
// String formatVideoName = formatter.format(calendar.getTime());
|
||||
//文件
|
||||
// 文件
|
||||
// String path = finalVideoPath.substring(finalVideoPath.length()-20);
|
||||
if (finalVideoPath != null) {
|
||||
File file = new File(finalVideoPath);
|
||||
|
@ -90,9 +90,9 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private Polyline polyline;
|
||||
private String finalVideoPath; // 摄像后最终保存的文件名
|
||||
private ViewGroup layerChange; // 切换地图和相机的父控件
|
||||
private CheckBox capturePicture,cbMapType;//拍照
|
||||
private CheckBox capturePicture, cbMapType;//拍照
|
||||
private boolean isMapSlide = false;
|
||||
private boolean isOration= false;
|
||||
private boolean isOration = false;
|
||||
private SimpleDateFormat formatter;
|
||||
private File paperFile;
|
||||
private int poi_video_type;
|
||||
@ -120,10 +120,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private Timer timer;
|
||||
private TimerTask timerTask;
|
||||
private int videoIndex = -1;
|
||||
private int oration=0;
|
||||
private ImageView ivPicImage;
|
||||
private int oration = 0;
|
||||
private ImageView ivPicImage, ivPicVideoImage;
|
||||
private SystemTTS systemTTS;
|
||||
private boolean isBack=false ;
|
||||
private boolean isBack = false;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -142,7 +142,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
poi_video_type = getIntent().getIntExtra(Constant.INTENT_POI_VIDEO_TYPE, -1);
|
||||
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
|
||||
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_JPG_PATH);
|
||||
if (finalVideoPath!=null){
|
||||
if (finalVideoPath != null) {
|
||||
File file = new File(finalVideoPath);
|
||||
paperFile = new File(Objects.requireNonNull(file.getParentFile()).getAbsoluteFile() + "/" + "paper.txt");
|
||||
}
|
||||
@ -153,10 +153,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
ivMap = findViewById(R.id.iv_map);
|
||||
ivMap.setOnClickListener(this);
|
||||
ivPicImage = findViewById(R.id.iv_pic);
|
||||
ivPicVideoImage = findViewById(R.id.iv_pic_video);
|
||||
|
||||
if (poi_video_type == 1 || poi_video_type == 2) {
|
||||
ivPicImage.setImageResource(R.mipmap.take_poi_video_arrow);
|
||||
ivPicVideoImage.setVisibility(View.VISIBLE);
|
||||
ivPicImage.setVisibility(View.GONE);
|
||||
} else if (poi_video_type == 3) {
|
||||
ivPicImage.setImageResource(R.mipmap.take_pic_arrow);
|
||||
ivPicImage.setVisibility(View.VISIBLE);
|
||||
ivPicVideoImage.setVisibility(View.GONE);
|
||||
}
|
||||
btnSwitch = findViewById(R.id.btn_switch);
|
||||
btnSwitch.setOnClickListener(this);
|
||||
@ -182,14 +186,16 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
isOration=true;
|
||||
isOration = true;
|
||||
if (poi_video_type != 2) {
|
||||
capturePicture.setText("暂停采集"); }
|
||||
capturePicture.setText("暂停采集");
|
||||
}
|
||||
startTimer();
|
||||
} else {
|
||||
isOration=false;
|
||||
isOration = false;
|
||||
if (poi_video_type != 2) {
|
||||
capturePicture.setText("开始采集"); }
|
||||
capturePicture.setText("开始采集");
|
||||
}
|
||||
stopTimer();
|
||||
}
|
||||
}
|
||||
@ -228,7 +234,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
super.onPictureTaken(result);
|
||||
if (oration == 0) { // oblation为0时,拍摄视频必须为横屏
|
||||
// 如果当前手机是竖向,则不
|
||||
if (isOration){
|
||||
if (isOration) {
|
||||
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
|
||||
Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
||||
stopTimer();
|
||||
@ -238,8 +244,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
capturePicture.setChecked(false);
|
||||
}
|
||||
return;
|
||||
}else {
|
||||
isOration=false;
|
||||
} else {
|
||||
isOration = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,7 +327,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_stop_picture:
|
||||
if (isOration){
|
||||
if (isOration) {
|
||||
stopTimer();
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
@ -351,11 +357,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
if (Constant.currentLocation != null) {
|
||||
CameraUpdate cameraSigma = CameraUpdateFactory
|
||||
.newCameraPosition(new CameraPosition(new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
|
||||
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||
0)); //目标旋转角 0~360° (正北方为0)
|
||||
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||
0)); //目标旋转角 0~360° (正北方为0)
|
||||
tencentMap.animateCamera(cameraSigma);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@ -411,7 +418,13 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
layerChange.addView(camera);
|
||||
layerChange.addView(ivMap);
|
||||
initMapBig();
|
||||
ivPicImage.setVisibility(View.VISIBLE);
|
||||
if (poi_video_type == 1 || poi_video_type == 2) {
|
||||
ivPicVideoImage.setVisibility(View.VISIBLE);
|
||||
ivPicImage.setVisibility(View.GONE);
|
||||
} else if (poi_video_type == 3) {
|
||||
ivPicImage.setVisibility(View.VISIBLE);
|
||||
ivPicVideoImage.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
layoutParamsMap.height = heightCamera;
|
||||
layoutParamsMap.width = widthCamera;
|
||||
@ -423,8 +436,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
layerChange.addView(camera);
|
||||
initMapShort();
|
||||
ivPicImage.setVisibility(View.GONE);
|
||||
ivPicVideoImage.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
//小图
|
||||
private void initMapBig() {
|
||||
isMapSlide = false;
|
||||
@ -433,6 +448,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
ivLocation.setVisibility(View.GONE);
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
|
||||
}
|
||||
|
||||
//大图
|
||||
private void initMapShort() {
|
||||
isMapSlide = true;
|
||||
@ -526,7 +542,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
sb.append("\r\n");
|
||||
FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true);
|
||||
float speed = Constant.currentLocation.getSpeed();//米/秒
|
||||
|
||||
/*float speed = Constant.currentLocation.getSpeed();//米/秒
|
||||
if (speed != 0) {
|
||||
float a = (speed * 3600 / 1000);//km/h
|
||||
if (poi_video_type == 1) {
|
||||
@ -556,23 +573,25 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
oldCurrentLocation = Constant.currentLocation;
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (!isBack) {
|
||||
if (isOration){
|
||||
if (isOration) {
|
||||
stopTimer();
|
||||
}
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show(this, "提示", "当前路段已拍摄的自动保存,可以在选择继续拍摄", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
isBack=true;
|
||||
isBack = true;
|
||||
finish();
|
||||
return false;
|
||||
}
|
||||
}).setStyle(DialogSettings.STYLE.STYLE_MIUI);
|
||||
});
|
||||
} else {
|
||||
this.finish();
|
||||
}
|
||||
@ -584,10 +603,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
.fromResource(R.drawable.circle);
|
||||
Marker marker = tencentMap
|
||||
.addMarker(new MarkerOptions(latLng)
|
||||
.icon(pileDescriptor)
|
||||
.alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
.icon(pileDescriptor)
|
||||
.alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(marker);
|
||||
}
|
||||
|
||||
|
@ -19,35 +19,42 @@ import java.io.File;
|
||||
* 常量
|
||||
*/
|
||||
public class Constant {
|
||||
/**
|
||||
* 当前网络不可用
|
||||
/*当前网络不可用
|
||||
*/
|
||||
public static final CharSequence NETWORK_UNAVAILABLE = "当前网络不可用,请检查网络设置";
|
||||
|
||||
/*
|
||||
* 位置权限
|
||||
/*位置权限
|
||||
*/
|
||||
public static final String SET_LOCATION_PERMISSION = "请在“设置”中给予“TengXunMap”位置权限,否则当前功能将不可使用";
|
||||
|
||||
public static final String SET_LOCATION = "请在“设置”中给予权限否则当前功能将不可使用";
|
||||
|
||||
|
||||
public static final String GET_ERR_MESSAGE1 = "设备缺少使用腾讯定位服务需要的基本条件";
|
||||
|
||||
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
|
||||
|
||||
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
|
||||
|
||||
public static final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
|
||||
|
||||
public static final String INTENT_POI_ROAD = "poi_road";
|
||||
|
||||
public static String BASE_FOLDER = ROOT_FOLDER;
|
||||
// 保存图片的目录
|
||||
public static String PICTURE_FOLDER;
|
||||
|
||||
public static String VIDEOS_;
|
||||
|
||||
public static String POI_DAO;
|
||||
|
||||
public static String SHARED_PREFERENCES = "navInfo";
|
||||
|
||||
public static String MESSAGE_TYPE="messageType";
|
||||
|
||||
public static String DATA_FILE = "dataFile";
|
||||
//下载文件
|
||||
public static final String NABISCO_APk = ROOT_FOLDER + "/apk/";
|
||||
|
||||
public static int TelLength=0;
|
||||
|
||||
public static void initRootFolder(String userId) {
|
||||
@ -61,7 +68,6 @@ public class Constant {
|
||||
if (!baseFolder.exists()) {
|
||||
SdkFolderCreate.mkdirs(baseFolder.getAbsolutePath());
|
||||
}
|
||||
|
||||
File picFolder = new File(PICTURE_FOLDER); // 视频照片文件夹路径
|
||||
if (!picFolder.exists()) {
|
||||
SdkFolderCreate.mkdirs(picFolder.getAbsolutePath());
|
||||
@ -140,11 +146,11 @@ public class Constant {
|
||||
public static final int PILE_MARKER_SHOW = 33;//刷新充电桩的显示
|
||||
public static final int JOB_WORD_MONITOR = 34;//寻宝界面和删选的刷新
|
||||
public static final int EVENT_WHAT_LOCATION_CHANGE = 35; // 定位位置更新的Event的What值
|
||||
// public static final int CHARGING_PILE_BODY = 36;//充电装的body
|
||||
// public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片
|
||||
// public static final int CHARGING_PILE_BODY = 36;//充电装的body
|
||||
// public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片
|
||||
public static final int Filter_WhAT_RECYCLER = 39;//刪選適配器的刷新
|
||||
public static final int EVENT_WHAT_CURRENT_MARKER = 41; // 显示当前正在编辑的POI类型数据的Event的What值
|
||||
//CompleteTask
|
||||
// CompleteTask
|
||||
public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集
|
||||
public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面
|
||||
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
||||
@ -154,7 +160,6 @@ public class Constant {
|
||||
public static final int PHOTO_FINISH_VIDEO = 49;//拍照列表的返回
|
||||
public static final int NEST_WORD_SUBMIT =50;//所有的提交/上传
|
||||
|
||||
|
||||
public static final String INTENT_POI_VIDEO_TYPE ="poi_video_type";
|
||||
public static int NUMBER = 200; //任务个数
|
||||
public static int LIMIT_TYPE = -1; //权限类型,普通任务-0,专属任务-1
|
||||
@ -175,22 +180,28 @@ public class Constant {
|
||||
|
||||
|
||||
public static JobSearchBean jobSearchBean;//数据
|
||||
|
||||
public static MapView treasureMap;
|
||||
|
||||
public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
|
||||
|
||||
public static final String INTENT_JPG_PATH = "INTENT_JPG_PATH"; // 拍照界面指定的图片保存位置
|
||||
|
||||
public static final String INTENT_PHOTO_PATH = "INTENT_PHOTO_PATH"; // 拍照界面指定的图片保存位置
|
||||
|
||||
public static final String INTENT_PICTURES_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
|
||||
|
||||
public static final String INTENT_VIDEO_OBLATION = "INTENT_VIDEO_OBLATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意
|
||||
|
||||
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
|
||||
|
||||
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
|
||||
|
||||
public static TencentMap.OnMarkerClickListener markerClickListener=null;
|
||||
|
||||
public static final String NAVIN_FO="9.27";//版本
|
||||
|
||||
/**
|
||||
* 联系我们的QQ群名称和QQ群号
|
||||
* */
|
||||
public static final String NAVIN_FO="9.28";//版本
|
||||
/*联系我们的QQ群名称和QQ群号
|
||||
*/
|
||||
public static String REGION_JIG_NAME = "京津冀晋蒙-地图寻宝群";
|
||||
public static String REGION_JIG_PHONE = "9721810";
|
||||
public static String REGION_HEI_NAME = "黑吉辽-地图寻宝群";
|
||||
|
@ -842,14 +842,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
chargingStationList.add(new File(tagScutcheon));
|
||||
}
|
||||
}
|
||||
if (Constant.isPresent){
|
||||
if (Constant.isPresent) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity==null){
|
||||
showPoiEntity=new PoiEntity();
|
||||
if (showPoiEntity == null) {
|
||||
showPoiEntity = new PoiEntity();
|
||||
}
|
||||
if ( showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 5) {
|
||||
if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 5) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -871,7 +871,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
}).start();
|
||||
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
@ -1363,38 +1363,34 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskStatus() == 5) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||
} else if (showPoiEntity.getTaskStatus() == 0 | showPoiEntity.getTaskStatus() == 1) {
|
||||
initList();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||
List<File> chargingPileFileList = new ArrayList<>();
|
||||
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
|
||||
for (String photoPath : chargingPileEntity.getPhotos()) {
|
||||
chargingPileFileList.add(new File(photoPath));
|
||||
}
|
||||
}
|
||||
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||
chargingPileFileList.get(i).delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
if (showPoiEntity.getId() != null) {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity.getTaskStatus() == 5 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 1) {
|
||||
initList();
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||
List<File> chargingPileFileList = new ArrayList<>();
|
||||
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
|
||||
for (String photoPath : chargingPileEntity.getPhotos()) {
|
||||
chargingPileFileList.add(new File(photoPath));
|
||||
}
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||
chargingPileFileList.get(i).delete();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1463,10 +1459,26 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||
List<File> chargingPileFileList = new ArrayList<>();
|
||||
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
|
||||
for (String photoPath : chargingPileEntity.getPhotos()) {
|
||||
chargingPileFileList.add(new File(photoPath));
|
||||
}
|
||||
}
|
||||
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||
chargingPileFileList.get(i).delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
chargingPileDao.deleteChargingFidPileEntity(poiEntity.getId());
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
|
@ -40,6 +40,7 @@ import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.PhotographActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||
import com.navinfo.outdoor.util.UploadUtils;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||
@ -690,18 +691,14 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskStatus() == 5) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||
}else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||
initList();
|
||||
} else {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
if (showPoiEntity.getId() != null) {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity.getTaskStatus() == 5 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 1) {
|
||||
initList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -757,6 +754,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
|
@ -189,6 +189,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
checkBoxLife.setTextColor(Color.WHITE);
|
||||
checkBoxLife.setChecked(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
||||
@ -266,8 +267,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) { }
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
});
|
||||
//数据展示
|
||||
initShowPoi();
|
||||
@ -277,78 +280,78 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
|
||||
//拍照长按删除
|
||||
private void onLongDel() {
|
||||
rlPanorama.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivPanorama.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
rlName.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivName.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
rlElse.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivElse.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
rlInternalPhotos.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivInternal.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
rlPanorama.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivPanorama.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
rlName.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivName.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
rlElse.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivElse.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
rlInternalPhotos.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivInternal.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
rlCard.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivCard.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
rlCard.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
ivCard.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void initShowPoi() {
|
||||
@ -370,7 +373,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
editSiteContent.setText(address);
|
||||
}
|
||||
String geoWkt = showPoiEntity.getGeoWkt();
|
||||
if (geoWkt!=null){
|
||||
if (geoWkt != null) {
|
||||
String geo = Geohash.getInstance().decode(geoWkt);
|
||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||
switch (geometry.getGeometryType()) {
|
||||
@ -388,7 +391,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).anchor(0.5f, 1.0f));
|
||||
markerPoi.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
}else {
|
||||
} else {
|
||||
String x = showPoiEntity.getX();
|
||||
String y = showPoiEntity.getY();
|
||||
if (x != null && y != null) {
|
||||
@ -537,6 +540,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
@ -592,7 +596,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_uploading:
|
||||
if (poiPicList!=null){
|
||||
if (poiPicList != null) {
|
||||
poiPicList.clear();
|
||||
}
|
||||
String name = editNameContent.getText().toString().trim();//名称
|
||||
@ -630,14 +634,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (tagCard != null) {
|
||||
poiPicList.add(new File(tagCard));
|
||||
}
|
||||
if (Constant.isPresent){
|
||||
if (Constant.isPresent) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity==null){
|
||||
showPoiEntity=new PoiEntity();
|
||||
if (showPoiEntity == null) {
|
||||
showPoiEntity = new PoiEntity();
|
||||
}
|
||||
if ( showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
|
||||
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -650,13 +654,13 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void run() {
|
||||
poiUploadByNetWork(poiDaoPoiEntity.getBodyId(), poiPicList);
|
||||
Constant.isPresent=false;
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@ -813,7 +817,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.fileList(poiPicList)
|
||||
.params(httpParams)
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(),showPoiEntity,poiPicList));
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(), showPoiEntity, poiPicList));
|
||||
Objects.requireNonNull(getActivity()).onBackPressed();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||
WaitDialog.dismiss(3000);
|
||||
@ -855,7 +859,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
poiUploadByNetWork(body, poiPicList);//上传
|
||||
Constant.isPresent=false;
|
||||
Constant.isPresent = false;
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
Message obtain = Message.obtain();
|
||||
@ -910,8 +914,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode==0x104){
|
||||
if (requestCode==101){
|
||||
if (resultCode == 0x104) {
|
||||
if (requestCode == 101) {
|
||||
assert data != null;
|
||||
String file = data.getStringExtra("file");
|
||||
assert file != null;
|
||||
@ -920,7 +924,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
|
||||
tvPanorama.setTag(andGetPath);
|
||||
}
|
||||
}else if (requestCode==102){
|
||||
} else if (requestCode == 102) {
|
||||
assert data != null;
|
||||
String file = data.getStringExtra("file");
|
||||
assert file != null;
|
||||
@ -929,7 +933,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName);
|
||||
tvPoiNamePic.setTag(andGetPath);
|
||||
}
|
||||
}else if (requestCode==103){
|
||||
} else if (requestCode == 103) {
|
||||
assert data != null;
|
||||
String file = data.getStringExtra("file");
|
||||
assert file != null;
|
||||
@ -938,7 +942,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal);
|
||||
tvInternal.setTag(andGetPath);
|
||||
}
|
||||
}else if (requestCode==104){
|
||||
} else if (requestCode == 104) {
|
||||
assert data != null;
|
||||
String file = data.getStringExtra("file");
|
||||
assert file != null;
|
||||
@ -947,7 +951,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCard);
|
||||
tvCard.setTag(andGetPath);
|
||||
}
|
||||
}else if (requestCode==105){
|
||||
} else if (requestCode == 105) {
|
||||
assert data != null;
|
||||
String file = data.getStringExtra("file");
|
||||
assert file != null;
|
||||
@ -972,23 +976,20 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskStatus() == 5) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||
} else if (showPoiEntity.getTaskStatus() == 0 | showPoiEntity.getTaskStatus() == 1) {
|
||||
initList();
|
||||
} else {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
if (showPoiEntity.getId()!=null){
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5||poiDaoPoiEntity.getTaskStatus()==0||poiDaoPoiEntity.getTaskStatus()==1){
|
||||
initList();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void initList() {
|
||||
if (poiPicList!=null){
|
||||
if (poiPicList != null) {
|
||||
poiPicList.clear();
|
||||
}
|
||||
String tagPanorama = (String) tvPanorama.getTag();
|
||||
@ -1052,6 +1053,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
|
@ -37,7 +37,6 @@ import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.PicturesActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.util.UploadUtils;
|
||||
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
||||
import com.navinfo.outdoor.bean.PoiVideoBean;
|
||||
import com.navinfo.outdoor.bean.UnPolygonTaskBean;
|
||||
@ -52,6 +51,7 @@ import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.navinfo.outdoor.util.UploadUtils;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
@ -558,21 +558,17 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskStatus() == 5) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);//结束领取
|
||||
}else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
} else {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
if (showPoiEntity.getId()!=null){
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5||poiDaoPoiEntity.getTaskStatus()==0||poiDaoPoiEntity.getTaskStatus()==1){
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -611,6 +607,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
|
@ -568,21 +568,17 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskStatus() == 5) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
|
||||
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
} else {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
if (showPoiEntity.getId()!=null){
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity.getTaskStatus()==5||poiDaoPoiEntity.getTaskStatus()==0||poiDaoPoiEntity.getTaskStatus()==1){
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -621,6 +617,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
|
@ -55,6 +55,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
private ArrayList<PoiEntity> newEntities;
|
||||
private ArrayList<PoiEntity> poiEntities;
|
||||
private CheckBox cbSelect;
|
||||
private MessageDialog messageDialog;
|
||||
|
||||
|
||||
public static StaySubmitFragment newInstance(Bundle bundle) {
|
||||
@ -126,6 +127,8 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
if (data.what == Constant.EVENT_STAY_REFRESH) {
|
||||
cbSelect.setChecked(false);
|
||||
refreshData();
|
||||
}else if (data.what==Constant.NEST_WORD_SUBMIT){
|
||||
messageDialog.doDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -218,8 +221,14 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
if (poiEntities.size() > 0) {
|
||||
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
||||
Constant.isPresent = false;
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在提交中,无需重复提交");
|
||||
WaitDialog.dismiss(2000);
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
messageDialog = MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "任务正在提交中,无需重复提交", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
baseDialog.doDismiss();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "请选择要提交的数据", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
@ -149,6 +149,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private final int MARKER_LINE = 2;
|
||||
private final int MARKER_FACE = 1;
|
||||
private final int MARKER_BIG = 4;
|
||||
private boolean isBack = false;
|
||||
private HashMap<String, List<Marker>> removableHashMap;
|
||||
private ArrayList<LatLng> latList;
|
||||
private ArrayList<PoiEntity> poiEntityArrayList;
|
||||
@ -840,6 +841,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
int taskStatus = Constant.TASK_STARTUP;
|
||||
int type = Constant.TASK_TYPE;
|
||||
int limit = Constant.LIMIT_TYPE;
|
||||
if (poiDao==null){
|
||||
return;
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -1817,19 +1821,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*@Override
|
||||
public boolean onBackPressed() {
|
||||
if (!isBack) {
|
||||
isBack = true;
|
||||
Toast.makeText(getActivity(), "双击退出程序", Toast.LENGTH_SHORT).show();
|
||||
handler.sendEmptyMessageDelayed(0x100, 2000);
|
||||
} else {
|
||||
Objects.requireNonNull(getActivity()).finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* 获取屏幕中心点位置
|
||||
*/
|
||||
|
@ -57,53 +57,51 @@ public class PoiSaveUtils {
|
||||
* 批量上传数据到服务端
|
||||
*/
|
||||
public void uploadPoiEntityBatch(List<PoiEntity> poiEntityList) {
|
||||
if (poiEntityList == null) {
|
||||
return;
|
||||
}
|
||||
if (poiEntityList.size()==0){
|
||||
return;
|
||||
}
|
||||
anInt = 0;
|
||||
bInt = 0;
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (PoiEntity poiEntity : poiEntityList) {
|
||||
if (poiEntity.getType() == 2) { // 如果是充电站数据,首先检查子充电桩的状态
|
||||
if (saveChargingPileByChargingStation(poiEntity)) {
|
||||
if (savePoiNet(poiEntity) == 200) { // 网络保存成功
|
||||
// 开始上传流程
|
||||
if (saveChargingPileUploadChargingStation(poiEntity)) {
|
||||
uploadPoiNet(poiEntity);
|
||||
if (poiEntityList != null) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
anInt = 0;
|
||||
bInt = 0;
|
||||
for (int i = 0; i < poiEntityList.size(); i++) {
|
||||
PoiEntity poiEntity = poiEntityList.get(i);
|
||||
if (poiEntity.getType() == 2) { // 如果是充电站数据,首先检查子充电桩的状态
|
||||
if (saveChargingPileByChargingStation(poiEntity)) {
|
||||
if (savePoiNet(poiEntity) == 200) { // 网络保存成功
|
||||
// 开始上传流程
|
||||
if (saveChargingPileUploadChargingStation(poiEntity)) {
|
||||
uploadPoiNet(poiEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {//其他类型
|
||||
if (savePoiNet(poiEntity) == 200) { // 网络保存成功
|
||||
//走上传流程:
|
||||
uploadPoiNet(poiEntity);
|
||||
} else {//其他类型
|
||||
if (savePoiNet(poiEntity) == 200) { // 网络保存成功
|
||||
//走上传流程:
|
||||
uploadPoiNet(poiEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mContext.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_STAY_REFRESH;
|
||||
EventBus.getDefault().post(obtain);
|
||||
if (anInt+bInt>0){
|
||||
Message obtain1 = Message.obtain();
|
||||
obtain1.what = Constant.NEST_WORD_SUBMIT;
|
||||
obtain1.obj = "批量提交 成功:" + anInt + ", 失败:" + bInt;
|
||||
EventBus.getDefault().post(obtain1);
|
||||
}else {
|
||||
Constant.isPresent=true;
|
||||
}
|
||||
mContext.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_STAY_REFRESH;
|
||||
EventBus.getDefault().post(obtain);
|
||||
if (anInt + bInt > 0) {
|
||||
Message obtain1 = Message.obtain();
|
||||
obtain1.what = Constant.NEST_WORD_SUBMIT;
|
||||
obtain1.obj = "批量提交 成功:" + anInt + ", 失败:" + bInt;
|
||||
EventBus.getDefault().post(obtain1);
|
||||
} else {
|
||||
Constant.isPresent = true;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
// /**
|
||||
|
@ -116,11 +116,22 @@
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/take_pic_arrow"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_pic_video"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/take_poi_video_arrow"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/capture_picture"
|
||||
style="@style/user_data_style"
|
||||
|
Loading…
x
Reference in New Issue
Block a user