增加了提交成功,删除本地文件,图片查看顺序排序,拍摄返回加个弹窗

This commit is contained in:
wangdongsheng 2021-09-27 18:36:24 +08:00
parent c86f94cc94
commit 327da2a8d0
21 changed files with 379 additions and 163 deletions

View File

@ -38,15 +38,17 @@ import java.util.Objects;
* 首页
*/
public class HomeActivity extends BaseActivity{
private boolean isExit=false;//标识是否退出
private TabLayout mTab;
private final String[] names = {"寻宝", "记录", "发现", "我的"};
private final int[] pic = {R.drawable.selector_map,R.drawable.selector_task,R.drawable.selector_article,R.drawable.selector_mine};
private RecordFragment recordFragment;
private boolean isBack=false;
private Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(@NonNull Message msg) {
isExit=false;
if (msg.what == 0x100) {
isBack = false;
}
return false;
}
});
@ -153,22 +155,19 @@ public class HomeActivity extends BaseActivity{
}
}
private void exit() {
if (!isExit) {
isExit = true;
Toast.makeText(this, "再按一次后退键退出程序", Toast.LENGTH_SHORT).show();
handler.sendEmptyMessageDelayed(0, 2000); // 利用handler延迟发送更改状态信息
@Override
public void onBackPressed() {
if (!BackHandlerHelper.handleBackPress(this)) {
if (!isBack) {
isBack = true;
Toast.makeText(this, "双击退出程序", Toast.LENGTH_SHORT).show();
handler.sendEmptyMessageDelayed(0x100, 2000);
} else {
this.finish();
}
}
@Override
public void onBackPressed() {
if (!BackHandlerHelper.handleBackPress(this)) {
super.onBackPressed();
}
}
}
@Override
protected void onDestroy() {
if (EventBus.getDefault().isRegistered(this))//加上判断

View File

@ -25,11 +25,16 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.github.lazylibrary.util.FileUtils;
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
import com.kongzue.dialog.util.BaseDialog;
import com.kongzue.dialog.util.DialogSettings;
import com.kongzue.dialog.v3.MessageDialog;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseActivity;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.BackHandlerHelper;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.MyTecentLocationSource;
@ -118,6 +123,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
private int oration=0;
private ImageView ivPicImage;
private SystemTTS systemTTS;
private boolean isBack=false ;
@Override
protected int getLayout() {
@ -315,12 +321,15 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_stop_picture:
if (isOration){
stopTimer();
}
Intent intent = new Intent();
finalVideoPath = Objects.requireNonNull(paperFile.getParentFile()).getAbsolutePath() + "/" + videoIndex + ".jpg";
intent.putExtra(Constant.INTENT_PICTURES_PATH, finalVideoPath);
intent.putExtra("type", poi_video_type);
setResult(0x111, intent);
finish();
this.finish();
break;
case R.id.image_view:
benSwitch();
@ -550,6 +559,25 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
}
}
@Override
public void onBackPressed() {
if (!isBack) {
if (isOration){
stopTimer();
}
MessageDialog.show(this, "提示", "当前路段已拍摄的自动保存,可以在选择继续拍摄", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
isBack=true;
finish();
return false;
}
}).setStyle(DialogSettings.STYLE.STYLE_MIUI);
} else {
this.finish();
}
}
public void initMarker() {
LatLng latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory

View File

@ -186,7 +186,7 @@ public class Constant {
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
public static TencentMap.OnMarkerClickListener markerClickListener=null;
public static final String NAVIN_FO="9.26";//版本
public static final String NAVIN_FO="9.27";//版本
/**
* 联系我们的QQ群名称和QQ群号
@ -218,6 +218,4 @@ public class Constant {
public static String REGION_YUN_NAME = "云贵-地图寻宝群";
public static String REGION_YUN_PHONE = "284447253";
}

View File

@ -62,9 +62,6 @@ public abstract class BaseDrawerFragment extends BaseFragment {
}
public void moveLatlng(LatLng latLng, TencentMap.CancelableCallback cancelableCallback) {
if (tencentMap.getCameraPosition()!=null){
}
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
latLng, //中心点坐标地图目标经纬度
tencentMap.getCameraPosition()==null?0:tencentMap.getCameraPosition().zoom, //目标缩放级别

View File

@ -45,6 +45,7 @@ import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
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.ChargingPileSaveBean;
import com.navinfo.outdoor.bean.ChargingStationBean;
@ -127,6 +128,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
private Marker markerStation;
private Point screenStationPositions;
private List<Removable> removablesLocality;
public static ChargingStationFragment newInstance(Bundle bundle) {
ChargingStationFragment fragment = new ChargingStationFragment();
fragment.setArguments(bundle);
@ -678,6 +680,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -705,6 +708,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
edit.apply();
}
//禁用所有可操作性控件
private void disables() {
checkBoxLife.setEnabled(false);
@ -726,6 +730,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
super.initData();
//存储对象
poiBeans = new ArrayList<>();
chargingStationList = new ArrayList<>();
}
@Subscribe
@ -750,7 +755,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
chargingPileAdapter.notifyDataSetChanged();
} else if (data.what == Constant.PILE_MARKER_SHOW) {
initPileMarkerShow();
}else if (data.what == Constant.PICTURE_VIDEO_WORD) {
} else if (data.what == Constant.PICTURE_VIDEO_WORD) {
if ((boolean) data.obj) {
initStationSharePre();
}
@ -797,7 +802,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
return;
}
chargingStationList = new ArrayList<>();
if (chargingStationList != null) {
chargingStationList.clear();
}
String tagPanorama = (String) tvPanorama.getTag();
if (tagPanorama == null) {
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
@ -835,11 +842,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
chargingStationList.add(new File(tagScutcheon));
}
}
if (Constant.isPresent){
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 5) {
if (showPoiEntity==null){
showPoiEntity=new PoiEntity();
}
if ( showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 5) {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
@ -847,22 +857,24 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
});
} else {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
// 首先批量保存充电站对应的充电桩数据
saveChargingPileByChargingStation(poiDaoPoiEntity);
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
if (Constant.isPresent) {
stationUploadByNetWork(poiDaoPoiEntity, chargingStationList);
Constant.isPresent = false;
} else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
}
}
});
}
}
}).start();
}else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
}
break;
case R.id.tv_station_examine:
findingDuplicateByWork();
@ -934,6 +946,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
}
}
/**
* 上传充电桩数据
*/
@ -974,6 +987,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
e.printStackTrace();
}
}
/*
OkGo
// 请求方式和请求url
@ -1082,7 +1096,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
.token(Constant.ACCESS_TOKEN)
.params(httpParams)
.cls(PoiUploadBean.class)
.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity,chargingStationList));
.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity, chargingStationList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000);
@ -1153,6 +1167,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
Toast.makeText(getActivity(), "" + chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -1205,6 +1220,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
Toast.makeText(getActivity(), taskNameBean.getMessage() + "", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
if (getActivity() == null) {
@ -1353,6 +1369,61 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
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();
}
}
}
}
}
}
private void initList() {
if (chargingStationList != null) {
chargingStationList.clear();
}
String tagPanorama = (String) tvPanorama.getTag();
if (tagPanorama != null) {
chargingStationList.add(new File(tagPanorama));
}
String tagName = (String) tvNamePic.getTag();
if (tagName != null) {
chargingStationList.add(new File(tagName));
}
String tagInternal = (String) tvInternal.getTag();
if (tagInternal != null) {
chargingStationList.add(new File(tagInternal));
}
String tagElse = (String) tvElse.getTag();
if (tagElse != null) {
chargingStationList.add(new File(tagElse));
}
String tagScutcheon = (String) tvScutcheon.getTag();
if (tagScutcheon != null) {
chargingStationList.add(new File(tagScutcheon));
}
for (int i = 0; i < chargingStationList.size(); i++) {
chargingStationList.get(i).delete();
}
}

View File

@ -71,12 +71,12 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
Objects.requireNonNull(getActivity()).finish();
break;
case R.id.forgetPaw_get_note:
if (!RegexUtil.isPhone(etForgetPawPhone.getText().toString())){
if (!RegexUtil.isPhone(etForgetPawPhone.getText().toString())) {
Toast.makeText(getActivity(), "手机号错误,请重新输入", Toast.LENGTH_SHORT).show();
}else {
registerNote();
initGetNote();
return;
}
initGetNote();
break;
case R.id.btn_forgetPaw:
initForgetPaw();
@ -125,8 +125,8 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
} else {
httpParams.put("sessionId", sessionId);
}
long time=System.currentTimeMillis();
httpParams.put("datetime",time);
long time = System.currentTimeMillis();
httpParams.put("datetime", time);
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
@ -138,18 +138,18 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
@Override
public void onSuccess(UserBean response, int id) {
dismissLoadingDialog();
if (response.getCode()==200){
if (response.getCode() == 200) {
Toast.makeText(getActivity(), "修改成功", Toast.LENGTH_SHORT).show();
Constant.USER_NAME = mobile;
Constant.PASS_WORD = password;
Message obtain = Message.obtain();
obtain.what=Constant.REGISTER_WORD;
obtain.what = Constant.REGISTER_WORD;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Objects.requireNonNull(getActivity()).finish();
}else {
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
}
}
@ -160,6 +160,7 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
}
});
}
private void registerNote() {
if (timer != null) {
timer.cancel();
@ -180,10 +181,15 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
};
timer.start();
}
private void initGetNote() {
HttpParams httpParams = new HttpParams();
String mobile = etForgetPawPhone.getText().toString().trim();
if (mobile.equals("")) {
if (timer != null) {
timer.cancel();
timer = null;
}
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
return;
} else {
@ -196,14 +202,16 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
.url(HttpInterface.USER_MESSAGE)
.cls(MessageCodeBean.class)
.params(httpParams)
.token(null)
.getRequest(new Callback<MessageCodeBean>() {
@Override
public void onSuccess(MessageCodeBean response, int id) {
dismissLoadingDialog();
if (response.getCode() == 200) {
sessionId = response.getBody();
registerNote();
Toast.makeText(getActivity(), "验证码已发送", Toast.LENGTH_SHORT).show();
}else {
} else {
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
}
}

View File

@ -86,7 +86,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
private RelativeLayout linearExist;
private Spinner spinnerExist;
private int existence=0;
private int existence = 0;
private EditText editTaskName, editOtherDescribe;
private RelativeLayout rlPicture;
private ImageView ivPicture;
@ -332,6 +332,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override
protected void initData() {
super.initData();
otherUploadList = new ArrayList<>();
}
private void initShowPoi() {
@ -345,7 +346,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
}
String geoWkt = showPoiEntity.getGeoWkt();
if (geoWkt!=null){
if (geoWkt != null) {
String geo = Geohash.getInstance().decode(geoWkt);
Geometry geometry = GeometryTools.createGeometry(geo);
switch (geometry.getGeometryType()) {
@ -363,7 +364,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
markerOther = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).anchor(0.5f, 1.0f));
markerOther.setZIndex(4);
moveLatlng(latLng, null);
}else {
} else {
String x = showPoiEntity.getX();
String y = showPoiEntity.getY();
if (x != null && y != null) {
@ -433,7 +434,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
initPoiSaveLocal(false);
break;
case R.id.btn_other_uploading:
otherUploadList = new ArrayList<>();
if (otherUploadList != null) {
otherUploadList.clear();
}
String name = editTaskName.getText().toString().trim();//名称
if (name.equals("")) {
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
@ -457,11 +460,14 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} else {
otherUploadList.add(new File(tagPictures));
}
if (Constant.isPresent) {
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 5) {
if (showPoiEntity==null){
showPoiEntity=new PoiEntity();
}
if ( showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
@ -470,21 +476,23 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
});
} else {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
if (Constant.isPresent){
otherUploadByNet(poiDaoPoiEntity.getBodyId(), otherUploadList);
Constant.isPresent=false;
}else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
}
Constant.isPresent = false;
}
});
}
}
}).start();
} else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
}
break;
}
}
@ -551,7 +559,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
.token(Constant.ACCESS_TOKEN)
.params(httpParams)
.cls(PoiUploadBean.class)
.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(),showPoiEntity,otherUploadList));
.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(), showPoiEntity, otherUploadList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000);
@ -592,7 +600,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
public void run() {
if (isLocal) {
otherUploadByNet(body, otherUploadList);
Constant.isPresent=false;
Constant.isPresent = false;
} else {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain();
@ -688,6 +696,29 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
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 (otherUploadList != null) {
otherUploadList.clear();
}
String tagPicture = (String) tvPicture.getTag();
if (tagPicture != null) {
otherUploadList.add(new File(tagPicture));
}
String tagPictures = (String) tvPictures.getTag();
if (tagPictures != null) {
otherUploadList.add(new File(tagPictures));
}
for (int i = 0; i < otherUploadList.size(); i++) {
otherUploadList.get(i).delete();
}
}

View File

@ -91,9 +91,11 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
String id = showPoiEntity.getId();
fileBeans = new ArrayList<>();
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(id);
for (int i = 0; i < fileListByUUID.size(); i++) {
if (!fileListByUUID.get(i).getPath().contains(".txt")) {
fileBeans.add(new FileBean(fileListByUUID.get(i), false));
if (fileListByUUID.size()>=2){
File parentFile = fileListByUUID.get(0).getParentFile();
for (int i = 0; i < fileListByUUID.size()-1; i++) {
File file = new File(parentFile+"/" + i + ".jpg");
fileBeans.add(new FileBean(file, false));
}
}
}

View File

@ -572,6 +572,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
super.initData();
//存储手机号对象
poiBeans = new ArrayList<>();
//存储
poiPicList = new ArrayList<>();
}
@Subscribe
@ -590,7 +592,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
initPoiSaveLocal(false);
break;
case R.id.btn_uploading:
poiPicList = new ArrayList<>();
if (poiPicList!=null){
poiPicList.clear();
}
String name = editNameContent.getText().toString().trim();//名称
if (name.equals("")) {
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
@ -626,11 +630,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (tagCard != null) {
poiPicList.add(new File(tagCard));
}
if (Constant.isPresent){
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 5) {
if (showPoiEntity==null){
showPoiEntity=new PoiEntity();
}
if ( showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
@ -638,20 +645,21 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
}
});
} else {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override
public void run() {
if (Constant.isPresent){
poiUploadByNetWork(poiDaoPoiEntity.getBodyId(), poiPicList);
Constant.isPresent=false;
}else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
}
}
});
}
}
}).start();
}else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
}
break;
case R.id.tv_poi_examine:
findingDuplicateByWork();
@ -970,7 +978,41 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
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){
poiPicList.clear();
}
String tagPanorama = (String) tvPanorama.getTag();
if (tagPanorama != null) {
poiPicList.add(new File(tagPanorama));
}
String tagName = (String) tvPoiNamePic.getTag();
if (tagName != null) {
poiPicList.add(new File(tagName));
}
String tagInternal = (String) tvInternal.getTag();
if (tagInternal != null) {
poiPicList.add(new File(tagInternal));
}
String tagElse = (String) tvElse.getTag();
if (tagElse != null) {
poiPicList.add(new File(tagElse));
}
String tagCard = (String) tvCard.getTag();
if (tagCard != null) {
poiPicList.add(new File(tagCard));
}
for (int i = 0; i < poiPicList.size(); i++) {
poiPicList.get(i).delete();
}
}

View File

@ -103,17 +103,19 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
assert getArguments() != null;
type = getArguments().getInt("type", 0);
listBeans = new ArrayList<>();
if (Constant.currentLocation!=null){
if (Constant.USHERED!=null){
initWork(type,true);
}
}
}
private void initWork(int type, boolean aBoolean) {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("type", type);
httpParams.put("pageSize", "20");
httpParams.put("pageNum", page);
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)

View File

@ -564,6 +564,15 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
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();
}
}
}
}
}
@ -624,8 +633,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
String roadName = etRoadName.getText().toString().trim();
if (!roadName.equals("")) {
poiEntity.setName(roadName + "");
poiEntity.setName(roadName);
} else {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
Calendar calendars = Calendar.getInstance();
calendars.setTimeInMillis(System.currentTimeMillis());

View File

@ -11,6 +11,7 @@ import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.LoginActivity;
@ -93,13 +94,11 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
initRegister();
break;
case R.id.register_get_note:
if (!RegexUtil.isPhone(etRegisterPhone.getText().toString())){
if (!RegexUtil.isPhone(etRegisterPhone.getText().toString())) {
Toast.makeText(getActivity(), "手机号错误,请重新输入", Toast.LENGTH_SHORT).show();
return;
}else {
registerNote();
initGetNote();
}
initGetNote();
break;
}
}
@ -107,7 +106,11 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
private void initGetNote() {
HttpParams httpParams = new HttpParams();
String mobile = etRegisterPhone.getText().toString().trim();
if (!RegexUtil.isPhone(mobile)) {
if (mobile.equals("")) {
if (timer != null) {
timer.cancel();
timer = null;
}
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
return;
} else {
@ -119,6 +122,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
.Builder(getActivity())
.url(HttpInterface.USER_MESSAGE)
.cls(MessageCodeBean.class)
.token(null)
.params(httpParams)
.getRequest(new Callback<MessageCodeBean>() {
@Override
@ -126,13 +130,15 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
dismissLoadingDialog();
if (response.getCode() == 200) {
sessionId = response.getBody();
registerNote();
Toast.makeText(getActivity(), "验证码已发送", Toast.LENGTH_SHORT).show();
}else {
if (response.getMessage()!=null){
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
} else {
if (response.getMessage() != null) {
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
}
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -183,7 +189,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
} else {
httpParams.put("sessionId", sessionId);
}
if (!ivRegisterCheck.isChecked()){
if (!ivRegisterCheck.isChecked()) {
Toast.makeText(getActivity(), "请先同意用户协议", Toast.LENGTH_SHORT).show();
return;
}
@ -209,12 +215,13 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
obtain.obj = true;
EventBus.getDefault().post(obtain);
Objects.requireNonNull(getActivity()).finish();
}else {
if (response.getMessage()!=null){
} else {
if (response.getMessage() != null) {
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
}
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();

View File

@ -574,6 +574,15 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
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();
}
}
}
}
}

View File

@ -135,15 +135,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private List<Removable> removables;
private List<Removable> removableScreenMarker;
private List<Removable> removablesLocality;
private Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(@NonNull Message msg) {
if (msg.what == 0x100) {
isBack = false;
}
return false;
}
});
/**
@ -157,7 +149,6 @@ 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;
@ -1827,7 +1818,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
@Override
/*@Override
public boolean onBackPressed() {
if (!isBack) {
isBack = true;
@ -1838,7 +1829,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
return true;
}
*/
/**
* 获取屏幕中心点位置
*/

View File

@ -3,25 +3,33 @@ package com.navinfo.outdoor.http;
import com.navinfo.outdoor.api.Constant;
public class HttpInterface {
public static final String IP_TEX = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
public static final String IP= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String IP_ = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
public static final String USER_PATH ="/user/";//我的
public static final String MSG_LIST_PATH ="/msgList/";//发现
public static final String USER_LOGIN_PATH ="/userlogin/";//登录
public static final String PRICE_PATH ="/price/";//提现
public static final String TASK_PATH ="/task/";//任务
/* public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
/*
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
public static final String APKIP = "http://172.23.139.4:8001/";
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口*/
/* 用户版本升级
/*
*用户版本升级
*/
// dtxbmaps.navinfo.com/dtxb/m4/user/appVersion/checkVersion?version=155&operationType=android
// 172.23.139.4:8001/appVersion/checkVersion?version=155&operationType=android version是版本 operationType固定值 安卓 get
public static String APP_CHECK_VERSION; //版本升级
public static void initAppPath(String userId) {
APP_CHECK_VERSION = IP + USER_PATH + "appVersion/" + userId + "/checkVersion"; //版本升级
}
/* 我的
* Path=/m4/user/*
*/
@ -63,7 +71,9 @@ public class HttpInterface {
///m4/user/user/forgetPassword
public static String USER_FORGET_PASSWORD = IP + USER_PATH + "user/forgetPassword";//忘记密码
//Flat
//dtxbmaps.navinfo.com/dtxb/m4/user/phone/message?mobile=18811794839&type=2
/*提现 金额
* Path=/m4/price/**
*/
@ -119,13 +129,13 @@ public class HttpInterface {
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
public static String TASK_NAME;//poi-查重
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
public static String GET_COMMIT_LIST;//紀錄已提交
public static String GET_COMMIT_LIST;//纪录已提交
public static String RECEIVED_POLYGON_TASK; //面状任务任务领取
//172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278 取消领取的接口
public static String UNRECEIVED_POLYGON_TASK;//所有類型结束领取
public static String COMPLETE;//面状任务结束领取
public static String SUBMIT_POLYGON_TASK;//面状任务开始采集
//http://dtxbmaps.navinfo.com/dtxb_test/m4/msgList/InfoPush/28/push?type=0
//dtxbmaps.navinfo.com/dtxb_test/m4/msgList/InfoPush/28/push?type=0
public static String MESSAGE_INFO_PUSH;//消息通知
public static void initHttpInter(String USERID) {
@ -205,7 +215,7 @@ public class HttpInterface {
ROAD_TASK_SUBMIT = IP + TASK_PATH + "roadtask/" + USERID + "/submitRoadtask";//道路录像-保存本地
//172.23.139.4:8003/roadtask/1/uploadpic
ROAD_TASK_UPLOAD_PIC = IP + TASK_PATH + "roadtask/" + USERID + "/uploadpic";//道路录像上传
//http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
//172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
GET_PHONES = IP + TASK_PATH + "task/" + USERID + "/getPhone";//电话区号和电话位数
//172.23.139.4:8003/cstask/1/uploadpic
CS_TASK_UP_LOAD_PIC = IP + TASK_PATH + "cstask/" + USERID + "/uploadpic";//充电桩-上传
@ -221,7 +231,12 @@ public class HttpInterface {
COMPLETE = IP + TASK_PATH + "polygonTask/" + USERID + "/complete";//面状任务结束领取
SUBMIT_POLYGON_TASK = IP + TASK_PATH + "polygonTask/" + USERID + "/submitPolygontask";//面状任务开始采集
}
/**
public static String CONTACT_US = "";//联系我们
public static String ABOUT_MAP = "";//关于 -关于地图寻宝
public static String MAP_AGREEMENT = "";//地图寻宝服务协议
public static String MAP_PRIVACY = "";//地图寻宝隐私
/*
* public static String IPm8 = "http://172.23.139.4:8003/m4/";
* http://172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278
* public static String UN_RECEIVED_TASK = + "task/1/unReceivedTask";//所以类型的结束领取
@ -387,9 +402,6 @@ public class HttpInterface {
* public static String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
*/
public static String CONTACT_US = "";//联系我们
public static String ABOUT_MAP = "";//关于 -关于地图寻宝
public static String MAP_AGREEMENT = "";//地图寻宝服务协议
public static String MAP_PRIVACY = "";//地图寻宝隐私
}

View File

@ -96,11 +96,12 @@ public class PoiSaveUtils {
obtain1.what = Constant.NEST_WORD_SUBMIT;
obtain1.obj = "批量提交 成功:" + anInt + ", 失败:" + bInt;
EventBus.getDefault().post(obtain1);
}else {
Constant.isPresent=true;
}
}
});
}
}).start();
}

View File

@ -8,6 +8,7 @@ import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.bean.OtherUploadPicBean;
import com.navinfo.outdoor.bean.PoiUploadBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.room.ChargingPileEntity;
import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;

View File

@ -0,0 +1,5 @@
<vector android:alpha="0.47" android:height="24dp"
android:tint="#333333" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M16,13h-3V3h-2v10H8l4,4 4,-4zM4,19v2h16v-2H4z"/>
</vector>

View File

@ -216,6 +216,7 @@
android:id="@+id/rl_draw"
android:layout_width="match_parent"
android:layout_height="50dp"
android:visibility="gone"
android:background="@drawable/road_shape"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -437,7 +437,7 @@
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/iv_other"
app:layout_constraintLeft_toLeftOf="@id/tv_other"
>
app:layout_constraintTop_toBottomOf="@+id/tv_other">
<TextView
android:layout_width="wrap_content"

View File

@ -115,6 +115,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_del" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>