1.解决删除照片,传到后台不显示,2.除了待提交,或者作业界面中的提交按钮需要在数据库纪录一份数据,其他的删除都要删除照片,并且删除本地数据库数据。3.给纪录中待提交添加一个状态。4.给待提交添加一个条数显示。
This commit is contained in:
parent
47035ae146
commit
b2f1b21b09
@ -9,8 +9,8 @@ android {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 30
|
||||
versionCode 8
|
||||
versionName "6.1118"
|
||||
versionCode 9
|
||||
versionName "6.1125"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
lintOptions {
|
||||
|
@ -306,7 +306,7 @@ public class GuidanceActivity extends BaseActivity {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(GuidanceActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(GuidanceActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -243,7 +243,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
Toast.makeText(LoginActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
@ -327,7 +327,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out") || message.equals("read time out")||message.equals("TimeOut")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
Toast.makeText(LoginActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -338,7 +338,7 @@ public class MainActivity extends BaseActivity {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
Toast.makeText(MainActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
@ -398,7 +398,7 @@ public class MainActivity extends BaseActivity {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
Toast.makeText(MainActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -732,6 +732,20 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
} else {
|
||||
sb.append(Constant.currentLocation.getDirection());
|
||||
}
|
||||
int gpsRssi = Constant.currentLocation.getGPSRssi();
|
||||
if (gpsRssi == 0) {
|
||||
sb.append("无信号");
|
||||
sb.append(",");
|
||||
} else if (gpsRssi == 1) {
|
||||
sb.append("弱");
|
||||
sb.append(",");
|
||||
} else if (gpsRssi == 2) {
|
||||
sb.append("中");
|
||||
sb.append(",");
|
||||
} else if (gpsRssi == 3) {
|
||||
sb.append("强");
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append("\r\n");
|
||||
if (isBack) {
|
||||
//快到终点的语音播报
|
||||
|
@ -282,7 +282,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(UserActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(UserActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -94,7 +94,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(WebActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(WebActivity.this, message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -29,7 +29,6 @@ public class ImagePagerAdapter extends PagerAdapter {
|
||||
this.context = context;
|
||||
this.impsUrl = imusUrl;
|
||||
inflater = LayoutInflater.from(context);
|
||||
|
||||
}
|
||||
|
||||
/** 动态加载数据 */
|
||||
|
@ -36,8 +36,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
/* String[] split = fileBeans.get(i).getFile().getName().split(".webp");
|
||||
SearchUpdateTxt.initTxt(file.getAbsolutePath(),split[0]);*/
|
||||
|
||||
|
||||
/**
|
||||
* 查看拍照成果的activity
|
||||
@ -70,6 +69,8 @@ public class PhotoAdapter extends RecyclerView.Adapter<PhotoAdapter.ViewHolder>
|
||||
FileBean fileBean = (FileBean) iterator.next();
|
||||
boolean check = fileBean.isCheck();
|
||||
if (check) {
|
||||
String[] split = fileBean.getFile().getName().split(".webp");
|
||||
SearchUpdateTxt.initTxt(file.getAbsolutePath(), split[0]);
|
||||
fileBean.getFile().delete();
|
||||
iterator.remove();
|
||||
}
|
||||
@ -122,12 +123,14 @@ public class PhotoAdapter extends RecyclerView.Adapter<PhotoAdapter.ViewHolder>
|
||||
}
|
||||
});
|
||||
holder.cbPhoto.setChecked(fileBean.isCheck());
|
||||
holder.cbPhoto.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
holder.cbPhoto.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
fileBean.setCheck(isChecked);
|
||||
public void onClick(View v) {
|
||||
holder.cbPhoto.setChecked(!fileBean.isCheck());
|
||||
fileBean.setCheck(!fileBean.isCheck());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,10 +14,12 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.PoiEntityDeleteUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Iterator;
|
||||
@ -42,6 +44,26 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setUpdateWork(){
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (allRoad) {
|
||||
for (PoiEntity poiEntity : allRoad) {
|
||||
if (poiEntity.isChecked()) {
|
||||
poiEntity.setWork_type(1);
|
||||
poiEntity.setChecked(true);
|
||||
} else {
|
||||
poiEntity.setWork_type(0);
|
||||
poiEntity.setChecked(false);
|
||||
}
|
||||
PoiDatabase.getInstance(context).getPoiDao().updatePoiEntity(poiEntity);
|
||||
}
|
||||
handler.sendEmptyMessage(0x105);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
//全选
|
||||
public void setAllDataChecked(boolean isChecked) {
|
||||
@ -69,7 +91,12 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
}
|
||||
handler.sendEmptyMessage(0x105);
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.STAY_SUBMIT_ITEM;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
}).start();
|
||||
}
|
||||
|
||||
@ -94,6 +121,15 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
poiEntity.setChecked(!poiEntity.isChecked());
|
||||
}
|
||||
});
|
||||
if (allRoad.get(position).isChecked()){
|
||||
if (poiEntity.getWork_type()==0){
|
||||
holder.tvText.setText("待提交");
|
||||
}else if (poiEntity.getWork_type()==1){
|
||||
holder.tvText.setText("提交中");
|
||||
}
|
||||
}else {
|
||||
holder.tvText.setText("待提交");
|
||||
}
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -110,12 +146,13 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView tvName, tvDay;
|
||||
private TextView tvName,tvText,tvDay;
|
||||
private CheckBox cbUnSubmit;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvName = itemView.findViewById(R.id.tv_road_name);
|
||||
tvText = itemView.findViewById(R.id.tv_text);
|
||||
tvDay = itemView.findViewById(R.id.tv_road_day);
|
||||
cbUnSubmit = itemView.findViewById(R.id.cb_unSubmit);
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ public class Constant {
|
||||
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 = "11.25";//版本日期
|
||||
public static final String NAVIN_FO = "11.26";//版本日期
|
||||
|
||||
//marker
|
||||
public static final BitmapDescriptor MARKER_POI_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
|
@ -163,7 +163,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -114,7 +114,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -176,7 +176,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -272,7 +272,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -809,7 +809,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1386,7 +1386,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1478,7 +1478,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -1736,9 +1736,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
if (showPoiEntity != null) {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
@ -1782,7 +1780,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout")|| message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1856,6 +1854,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
poiEntity.setPhotoInfo(infoPhoto);
|
||||
poiEntity.setStation_type(station_type);
|
||||
poiEntity.setChecked(false);
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
|
@ -126,7 +126,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -591,7 +591,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -206,7 +206,7 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -276,7 +276,7 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")|| message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -272,7 +272,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
case R.id.btn_gather://立即采集
|
||||
gatherGetBuilder.append(TimestampUtil.time()).append(",").append("点击了立即采集的按钮 ,");
|
||||
//如果是领取的任务或者是新得任务就只能在当前用户位置方圆5000以内才可以使用
|
||||
if (poiEntity.getType()== 3 || poiEntity.getType() == 4) {
|
||||
if (poiEntity.getType() == 3 || poiEntity.getType() == 4) {
|
||||
//判断当前的信号强度
|
||||
int gpsRssi = Constant.currentLocation.getGPSRssi();
|
||||
if (gpsRssi == 0) {//无信号
|
||||
@ -320,9 +320,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -384,7 +382,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity taskIdPoiEntity = PoiDatabase.getInstance(getContext()).getPoiDao().getPoiEntity(poiEntity.getId());
|
||||
PoiEntity taskIdPoiEntity = PoiDatabase.getInstance(getContext()).getPoiDao().getTaskIdPoiEntity(poiEntity.getTaskId());
|
||||
if (taskIdPoiEntity == null) {
|
||||
PoiEntity chargingStationEntity = new PoiEntity();
|
||||
chargingStationEntity.setTaskId(poiEntity.getTaskId());
|
||||
@ -484,12 +482,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -498,7 +491,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -582,12 +575,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -596,7 +584,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -634,12 +622,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
/* if (poiEntity.getType() == 2) {
|
||||
chargingPileDao.deleteChargingFidPileEntity(poiEntity.getId());
|
||||
}*/
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
if (poiEntity.getType() == 2) {
|
||||
PoiDatabase.getInstance(getContext()).getChargingPileDao().deleteChargingFidPileEntity(poiEntity.getId());
|
||||
}
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -658,12 +644,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -672,7 +653,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -730,12 +711,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -744,7 +720,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -779,20 +755,13 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,7 +770,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -836,7 +805,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity taskIdPoiEntity = PoiDatabase.getInstance(getContext()).getPoiDao().getPoiEntity(poiEntity.getId());
|
||||
PoiEntity taskIdPoiEntity = PoiDatabase.getInstance(getContext()).getPoiDao().getTaskIdPoiEntity(poiEntity.getTaskId());
|
||||
if (taskIdPoiEntity == null) {//数据库没有这条数据
|
||||
ReceivedPoiBean.BodyBean listBean = response.getBody();
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
@ -924,12 +893,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -938,7 +902,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -979,7 +943,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity taskIdPoiEntity = PoiDatabase.getInstance(getContext()).getPoiDao().getPoiEntity(poiEntity.getId());
|
||||
PoiEntity taskIdPoiEntity = PoiDatabase.getInstance(getContext()).getPoiDao().getTaskIdPoiEntity(poiEntity.getTaskId());
|
||||
if (taskIdPoiEntity == null) {//数据库没有这条数据
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
poiListEntity.setTaskId(poiEntity.getTaskId());
|
||||
@ -1059,13 +1023,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
} else if (response.getCode() == 230) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1074,7 +1032,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -316,7 +316,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -185,7 +185,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -258,7 +258,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -325,12 +325,13 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -404,7 +405,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -473,12 +474,13 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
|
@ -94,7 +94,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -130,7 +130,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -178,7 +178,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
if (getActivity()!=null){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
|
@ -931,9 +931,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
@ -1010,6 +1008,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
poiEntity.setPhotoInfo(arrayList);
|
||||
poiEntity.setStation_type(station_type);
|
||||
poiEntity.setChecked(false);
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
@ -27,6 +27,8 @@ import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.FileBean;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||
import com.navinfo.outdoor.util.ImageUtils;
|
||||
import com.navinfo.outdoor.util.SearchUpdateTxt;
|
||||
import com.navinfo.outdoor.util.TimestampUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@ -111,11 +113,11 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
||||
fileBeans = new ArrayList<>();
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(id);
|
||||
List<File> fileArrayList = new ArrayList<>();
|
||||
if (fileListByUUID.size() > 2) {
|
||||
if (fileListByUUID.size() >= 2) {
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
if (!fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
fileArrayList.add(fileListByUUID.get(i));
|
||||
}else {
|
||||
} else {
|
||||
fileTxt = fileListByUUID.get(i);
|
||||
}
|
||||
}
|
||||
|
@ -940,7 +940,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1130,7 +1130,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1337,9 +1337,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
initList();
|
||||
@ -1366,7 +1364,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1441,6 +1439,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setExistence(existence);
|
||||
poiEntity.setType(1);
|
||||
|
@ -389,7 +389,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
if (fileListByUUID.size() == 1) {
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
ivPoiVideoPicture.setImageDrawable(null);
|
||||
@ -408,6 +407,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
}
|
||||
fmPoiVideoPic.setTag(fileListByUUID);
|
||||
}
|
||||
initPoiVideoSharePre();
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
intents.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
|
||||
intents.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
|
||||
intents.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
|
||||
startActivityForResult(intents, 0x102);
|
||||
startActivityForResult(intents, 0x101);
|
||||
break;
|
||||
case R.id.tv_combo://自动连拍:
|
||||
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了自动连拍的按钮 ,");
|
||||
@ -478,7 +478,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
intent.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
|
||||
intent.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
|
||||
intent.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
|
||||
startActivityForResult(intent, 0x101);
|
||||
startActivityForResult(intent, 0x102);
|
||||
break;
|
||||
case R.id.btn_poi_video_upload:
|
||||
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了上传的按钮 ,");
|
||||
@ -587,7 +587,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("workType", poiEntity.getWork_type());
|
||||
httpParams.put("workType", 1);
|
||||
httpParams.put("memo", poiEntity.getMemo());
|
||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||
.time(30)
|
||||
@ -639,7 +639,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("workType", poiEntity.getWork_type());
|
||||
httpParams.put("workType", 1);
|
||||
httpParams.put("memo", poiEntity.getMemo());
|
||||
showLoadingDialog();
|
||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||
@ -702,7 +702,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -728,21 +728,19 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
/* if (requestCode == 0x101 && resultCode == 0x111) {
|
||||
tvShort.setEnabled(false);
|
||||
} else if (requestCode == 0x102 && resultCode == 0x111) {
|
||||
tvCombo.setEnabled(false);
|
||||
}*/
|
||||
if (data != null && data.hasExtra(Constant.INTENT_PICTURES_PATH)) {
|
||||
String videoPath = data.getStringExtra(Constant.INTENT_PICTURES_PATH);
|
||||
assert videoPath != null;
|
||||
File videoFile = new File(videoPath);
|
||||
if (videoFile.exists()) {
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
fmPoiVideoPic.setTag(fileListByUUID);
|
||||
if (requestCode == 0x101 && resultCode == 0x111) {
|
||||
if (data != null && data.hasExtra(Constant.INTENT_PICTURES_PATH)) {
|
||||
String videoPath = data.getStringExtra(Constant.INTENT_PICTURES_PATH);
|
||||
assert videoPath != null;
|
||||
File videoFile = new File(videoPath);
|
||||
if (videoFile.exists()) {
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
fmPoiVideoPic.setTag(fileListByUUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -818,9 +816,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getActivity()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
@ -854,7 +850,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -917,6 +913,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setType(3);
|
||||
if (showPoiEntity.getId() != null) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
|
@ -281,7 +281,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -405,10 +405,14 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if ((boolean) data.obj) {
|
||||
initRoadSharePre();
|
||||
}
|
||||
} else if (data.what == Constant.VIDEO_FINISH_ROAD) {
|
||||
} else if (data.what == Constant.PHOTO_FINISH_VIDEO) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
if (fileListByUUID.size() == 0) {
|
||||
if (fileListByUUID.size() == 1) {
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
ivRoadPicture.setImageDrawable(null);
|
||||
fmRoadPic.setTag(null);
|
||||
} else {
|
||||
boolean isImageLoad = false;
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
@ -423,6 +427,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
fmRoadPic.setTag(fileListByUUID);
|
||||
}
|
||||
initRoadSharePre();
|
||||
}
|
||||
}
|
||||
|
||||
@ -576,7 +581,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("workType", poiEntity.getWork_type());
|
||||
httpParams.put("workType", 0);
|
||||
httpParams.put("memo", poiEntity.getMemo());
|
||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||
.time(30)
|
||||
@ -585,7 +590,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
.cls(RoadSaveBean.class)
|
||||
.params(httpParams)
|
||||
.token(Constant.ACCESS_TOKEN);
|
||||
if (getActivity()!=null){
|
||||
if (getActivity() != null) {
|
||||
okGoBuilder.getRequest(PreserveUtils.getInstance().getRoadPreserveCallback(getActivity(), poiEntity));
|
||||
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务已保存本地,请稍后");
|
||||
@ -616,7 +621,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
.params(httpParams)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.cls(OtherUploadPicBean.class);
|
||||
if (getActivity()!=null){
|
||||
if (getActivity() != null) {
|
||||
okGoBuilder.postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity, fileZip));
|
||||
getActivity().getSupportFragmentManager().popBackStack();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||
@ -631,7 +636,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("workType", poiEntity.getWork_type());
|
||||
httpParams.put("workType", 0);
|
||||
httpParams.put("memo", poiEntity.getMemo());
|
||||
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
|
||||
.time(30)
|
||||
@ -693,7 +698,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -811,9 +816,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setTaskStatus(100);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().updatePoiEntity(poiEntity);
|
||||
PoiDatabase.getInstance(getContext()).getPoiDao().deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
if (poiEntity.getId() != null) {
|
||||
@ -912,6 +915,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(4);
|
||||
poiEntity.setChecked(false);
|
||||
if (showPoiEntity.getId() != null) {
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
if (fileListByUUID != null) {
|
||||
|
@ -63,12 +63,12 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
private StaySubmitAdapter staySubmitAdapter;
|
||||
private TextView tvStayType;
|
||||
private List<PoiEntity> roadEntities;
|
||||
private ArrayList<PoiEntity> newEntities;
|
||||
private ArrayList<PoiEntity> poiEntities;
|
||||
private CheckBox cbSelect;
|
||||
private File logFile;
|
||||
private StringBuilder staySubmitBuilder;
|
||||
private TextView tvNumber;
|
||||
private int anInt=0;
|
||||
|
||||
public static StaySubmitFragment newInstance(Bundle bundle) {
|
||||
StaySubmitFragment fragment = new StaySubmitFragment();
|
||||
@ -202,19 +202,59 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
staySubmitBuilder.append(TimestampUtil.time()).append(",").append("onStop ,");
|
||||
}
|
||||
|
||||
public List<PoiEntity> initRoadWord(int type) {
|
||||
newEntities.clear();
|
||||
for (int i = 0; i < roadEntities.size(); i++) {
|
||||
PoiEntity poiEntity = roadEntities.get(i);
|
||||
if (type == 0) {
|
||||
newEntities.add(poiEntity);
|
||||
} else {
|
||||
if (poiEntity.getType() == type) {
|
||||
newEntities.add(poiEntity);
|
||||
}
|
||||
}
|
||||
public void initRoadWord(int type) {
|
||||
if (roadEntities == null) {
|
||||
roadEntities = new ArrayList<>();
|
||||
} else {
|
||||
roadEntities.clear();
|
||||
}
|
||||
PoiDatabase roadDatabase = PoiDatabase.getInstance(getContext());
|
||||
if (roadDatabase != null) {
|
||||
PoiDao roadDao = roadDatabase.getPoiDao();
|
||||
staySubmitBuilder.append(TimestampUtil.time()).append(",").append("refreshData ,");
|
||||
if (roadDao != null) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
List<PoiEntity> roadAll = null;
|
||||
if (type == 0) {
|
||||
roadAll = roadDao.getAllPoiByRecoded();
|
||||
} else {
|
||||
roadAll = roadDao.getAllPoiType(type);
|
||||
}
|
||||
|
||||
if (getActivity() != null) {
|
||||
List<PoiEntity> finalRoadAll = roadAll;
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void run() {
|
||||
if (Constant.USHERED != null) {
|
||||
staySubmitBuilder.append("refreshData - userId:").append(Constant.USHERED).append(" path:").append(PoiDatabase.getDbName).append(",");
|
||||
}
|
||||
roadEntities.clear();
|
||||
roadEntities.addAll(finalRoadAll);
|
||||
staySubmitAdapter.setAllRoad(roadEntities);
|
||||
staySubmitAdapter.notifyDataSetChanged();
|
||||
if (tvNumber != null) {
|
||||
tvNumber.setText(staySubmitAdapter.getAllRoad().size() + "条");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
UMCrash.generateCustomLog(e, "自定义");
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "无法读取数据库,请尝试重启程序!", Toast.LENGTH_SHORT).show();
|
||||
UMCrash.generateCustomLog("无法读取数据库", "自定义");
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "数据库创建失败,请关闭程序重新进入", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return newEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -222,40 +262,35 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
switch (v.getId()) {
|
||||
case R.id.cl_stay_type://1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
staySubmitBuilder.append(TimestampUtil.time()).append(",").append("点击了待提交的类型 ,");
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "poi", "充电站", "poi录像", "道路录像", "其他"}, new OnMenuItemClickListener() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onClick(String text, int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
List<PoiEntity> entities = initRoadWord(0);
|
||||
staySubmitAdapter.setAllRoad(entities);
|
||||
tvNumber.setText(String.valueOf(staySubmitAdapter.getAllRoad().size()));
|
||||
initRoadWord(0);
|
||||
anInt=0;
|
||||
break;
|
||||
case 1:
|
||||
List<PoiEntity> poiEntities = initRoadWord(1);
|
||||
staySubmitAdapter.setAllRoad(poiEntities);
|
||||
tvNumber.setText(String.valueOf(staySubmitAdapter.getAllRoad().size()));
|
||||
initRoadWord(1);
|
||||
anInt=1;
|
||||
break;
|
||||
case 2:
|
||||
List<PoiEntity> stationEntities = initRoadWord(2);
|
||||
staySubmitAdapter.setAllRoad(stationEntities);
|
||||
tvNumber.setText(String.valueOf(staySubmitAdapter.getAllRoad().size()));
|
||||
initRoadWord(2);
|
||||
anInt=2;
|
||||
break;
|
||||
case 3:
|
||||
List<PoiEntity> poiVideoEntities = initRoadWord(3);
|
||||
staySubmitAdapter.setAllRoad(poiVideoEntities);
|
||||
tvNumber.setText(String.valueOf(staySubmitAdapter.getAllRoad().size()));
|
||||
initRoadWord(3);
|
||||
anInt=3;
|
||||
break;
|
||||
case 4:
|
||||
List<PoiEntity> roadEntities = initRoadWord(4);
|
||||
staySubmitAdapter.setAllRoad(roadEntities);
|
||||
tvNumber.setText(String.valueOf(staySubmitAdapter.getAllRoad().size()));
|
||||
initRoadWord(4);
|
||||
anInt=4;
|
||||
break;
|
||||
case 5:
|
||||
List<PoiEntity> otherEntities = initRoadWord(5);
|
||||
staySubmitAdapter.setAllRoad(otherEntities);
|
||||
tvNumber.setText(String.valueOf(staySubmitAdapter.getAllRoad().size()));
|
||||
initRoadWord(5);
|
||||
anInt=5;
|
||||
break;
|
||||
}
|
||||
tvStayType.setText(text);
|
||||
@ -267,6 +302,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
if (Constant.isPresent) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
initRequest(staySubmitAdapter.getAllRoad());
|
||||
@ -276,6 +312,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
break;
|
||||
case R.id.btn_stay_submit://提交
|
||||
staySubmitBuilder.append(TimestampUtil.time()).append(",").append("点击了提交的按钮 ,");
|
||||
@ -293,6 +330,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
if (poiEntities.size() > 0) {
|
||||
Constant.isPresent = false;
|
||||
staySubmitAdapter.setUpdateWork();
|
||||
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "请选择要提交的数据", Toast.LENGTH_SHORT).show();
|
||||
@ -364,7 +402,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -384,13 +422,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
} else {
|
||||
roadEntities.clear();
|
||||
}
|
||||
|
||||
if (newEntities == null) {
|
||||
newEntities = new ArrayList<>();
|
||||
} else {
|
||||
newEntities.clear();
|
||||
}
|
||||
|
||||
PoiDatabase roadDatabase = PoiDatabase.getInstance(getContext());
|
||||
if (roadDatabase != null) {
|
||||
PoiDao roadDao = roadDatabase.getPoiDao();
|
||||
@ -403,6 +434,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
List<PoiEntity> roadAll = roadDao.getAllPoiByRecoded();
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void run() {
|
||||
if (Constant.USHERED != null) {
|
||||
@ -412,8 +444,8 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
roadEntities.addAll(roadAll);
|
||||
staySubmitAdapter.setAllRoad(roadEntities);
|
||||
staySubmitAdapter.notifyDataSetChanged();
|
||||
if (tvNumber!=null){
|
||||
tvNumber.setText(String.valueOf(staySubmitAdapter.getAllRoad().size()));
|
||||
if (tvNumber != null) {
|
||||
tvNumber.setText(staySubmitAdapter.getAllRoad().size() + "条");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -169,7 +169,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -168,7 +168,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -153,7 +153,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -68,6 +68,7 @@ import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||
import com.navinfo.outdoor.util.GPSUtils;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.navinfo.outdoor.util.MapManager;
|
||||
@ -166,8 +167,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
TextView tvGps;
|
||||
private TextView tvTenantGaps;
|
||||
private StringBuilder gpsBuilder;
|
||||
private File gpsLogFile;
|
||||
|
||||
public static TreasureFragment newInstance(Bundle bundle) {
|
||||
TreasureFragment fragment = new TreasureFragment();
|
||||
@ -498,7 +497,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -606,7 +605,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -902,7 +901,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1542,19 +1541,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else if (data.what == Constant.EVENT_WHAT_LOCATION_CHANGE) { // 用户位置更新
|
||||
if (tencentMap != null) {
|
||||
TencentLocation tencentLocation = (TencentLocation) data.obj;
|
||||
// gpsBuilder.append("腾讯:定位坐标").append("y:").append(tencentLocation.getLatitude()).append(",").append("x:").append(tencentLocation.getLongitude()).append(";");
|
||||
int gpsRssi = tencentLocation.getGPSRssi();
|
||||
if (gpsRssi == 0) {
|
||||
//gpsBuilder.append(TimestampUtil.time()).append(";").append("信号强度:").append("无信号").append(";").append("\r\n");
|
||||
tvTenantGaps.setText("信号强度:无信号");
|
||||
} else if (gpsRssi == 1) {
|
||||
//gpsBuilder.append(TimestampUtil.time()).append(";").append("信号强度:").append("弱").append(";").append("\r\n");
|
||||
tvTenantGaps.setText("信号强度:弱");
|
||||
} else if (gpsRssi == 2) {
|
||||
//gpsBuilder.append(TimestampUtil.time()).append(";").append("信号强度:").append("中").append(";").append("\r\n");
|
||||
tvTenantGaps.setText("信号强度:中");
|
||||
} else if (gpsRssi == 3) {
|
||||
//gpsBuilder.append(TimestampUtil.time()).append(";").append("信号强度:").append("强").append(";").append("\r\n");
|
||||
tvTenantGaps.setText("信号强度:强");
|
||||
}
|
||||
}
|
||||
@ -1738,12 +1732,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
super.onDestroy();
|
||||
mapView.onDestroy();
|
||||
// new GPSUtils(Objects.requireNonNull(getActivity())).Remove();
|
||||
treasureBuilder.append(TimestampUtil.time()).append(",").append("onDestroy");
|
||||
treasureBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), treasureBuilder.toString(), true);
|
||||
/* gpsBuilder.append("\r\n");
|
||||
FileUtils.writeFile(gpsLogFile.getAbsolutePath(), gpsBuilder.toString(), true);*/
|
||||
if (bigMarker != null) {
|
||||
bigMarker.remove();
|
||||
}
|
||||
@ -1869,7 +1860,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
treasureBuilder.append(TimestampUtil.time()).append("点击弹窗上的充电站,");
|
||||
} else if (item.getText().equals("POI录像")) {
|
||||
poiEntity.setWork_type(1);
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiVideoFragment);
|
||||
@ -1973,27 +1963,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
/* SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String GPS_time = sharedPreferences.getString("GPS_time", null);
|
||||
if (GPS_time == null) {
|
||||
sharedEdit.putString("GPS_time", newFormat);
|
||||
sharedEdit.apply();
|
||||
gpsLogFile = new File(Constant.GPS_LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (GPS_time.equals(newFormat)) {
|
||||
gpsLogFile = new File(Constant.GPS_LOG_FOLDER + "/" + GPS_time + ".txt");
|
||||
} else {
|
||||
gpsLogFile = new File(Constant.GPS_LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
gpsBuilder = new StringBuilder();*/
|
||||
//建立定位
|
||||
initLocation();
|
||||
// initGpsLocation();
|
||||
} else {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), "申请权限失败", Toast.LENGTH_SHORT).show();
|
||||
@ -2019,25 +1990,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
}
|
||||
|
||||
//获取gps定位
|
||||
private void initGpsLocation() {
|
||||
/* GPSUtils gpsUtils = new GPSUtils(Objects.requireNonNull(getActivity()));
|
||||
gpsUtils.setOnClickGPSStatus(new GPSUtils.OnClickGPSStatus() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onGpsCount(int count) {
|
||||
tvGps.setText("卫星颗数:" + count);
|
||||
gpsBuilder.append(TimestampUtil.time()).append(";").append("GPS:卫星颗数:").append(count).append(" ;");
|
||||
Location location = GPSUtils.getLocation();
|
||||
if (location != null) {
|
||||
gpsBuilder.append(TimestampUtil.time()).append(";").append("GPS:坐标").append("y: ").append(location.getLatitude()).append(" ,").append("x: ").append(location.getLongitude()).append(" ;").append("\r\n");
|
||||
} else {
|
||||
gpsBuilder.append(TimestampUtil.time()).append(";").append("GPS:").append("获取当前位置信息为空;").append("\r\n");
|
||||
}
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
/*设置定位图标样式*/
|
||||
private void setLocMarkerStyle() {
|
||||
locationStyle = new MyLocationStyle();
|
||||
|
@ -349,7 +349,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -191,7 +191,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
@ -297,7 +297,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -156,7 +156,7 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout")||message.equals("Read time out")){
|
||||
if (message.contains("timeout")||message.contains("Read time out")){
|
||||
Toast.makeText(getActivity(), "请求超时", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
|
@ -2,7 +2,7 @@ package com.navinfo.outdoor.http;
|
||||
|
||||
public class HttpInterface {
|
||||
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 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/";//登录
|
||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||
*/
|
||||
@Dao
|
||||
public interface PoiDao {
|
||||
/**
|
||||
/*
|
||||
* 查询
|
||||
*/
|
||||
@Query("SELECT * FROM poi")
|
||||
@ -23,7 +23,7 @@ public interface PoiDao {
|
||||
@Query("SELECT * FROM poi where taskStatus > 1 and taskStatus!=100 and type!=6 ")
|
||||
List<PoiEntity> getAllPoiByRecoded();
|
||||
|
||||
@Query("SELECT * FROM poi where type=:type")
|
||||
@Query("SELECT * FROM poi where type=:type and taskStatus > 1 and taskStatus!=100")
|
||||
List<PoiEntity> getAllPoiType(int type);
|
||||
|
||||
@Query("SELECT * FROM poi where taskStatus =5")
|
||||
|
@ -42,14 +42,15 @@ public class PoiEntity implements Serializable {
|
||||
private String y;//纬度
|
||||
private String detail;//需要保存的数据的wkt
|
||||
private String dist;//距离用户位置
|
||||
private int taskStatus;//任务状态 0.未领取 1.已领取,5 立即采集,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集)
|
||||
private int taskStatus;//任务状态 0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集).5 立即采集,100 上传成功
|
||||
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
private int station_type;//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 "门牌", "公交:6 情报:7
|
||||
private int isLocalData;//是否是本地数据 0,服务 1,本地
|
||||
private int isExclusive;//任务类型 0.普通任务,1.专属任务 2挑战任务, 3奖励任务
|
||||
private int bodyId;//保存本地的bodyId
|
||||
private int work_type;//0."车行" 1."自行车" 2."步行"
|
||||
private int work_type;//0,待提交 1,提交中
|
||||
private int record_way; //等同于 canReceived : 1是可领取 0是不可领取
|
||||
|
||||
public int getRecord_way() {
|
||||
return record_way;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class FlushTokenUtil {
|
||||
public void onError(Throwable e, int id) {
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(activity, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(activity, message, Toast.LENGTH_SHORT).show();
|
||||
@ -178,7 +178,7 @@ public class FlushTokenUtil {
|
||||
public void onError(Throwable e, int id) {
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
if (message.contains("timeout") || message.contains("Read time out")) {
|
||||
Toast.makeText(activity, "请求超时", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(activity, message, Toast.LENGTH_SHORT).show();
|
||||
|
26
app/src/main/java/com/navinfo/outdoor/util/ImageUtils.java
Normal file
26
app/src/main/java/com/navinfo/outdoor/util/ImageUtils.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.navinfo.outdoor.util;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
||||
/**
|
||||
* 检查图片是否损坏
|
||||
*/
|
||||
public class ImageUtils {
|
||||
/**
|
||||
*
|
||||
* @param filePath 图片的决对路径
|
||||
*/
|
||||
public static boolean checkImgDamage(String filePath) {
|
||||
BitmapFactory.Options options=null;
|
||||
if (options==null){
|
||||
options=new BitmapFactory.Options();
|
||||
}
|
||||
options.inJustDecodeBounds =true;
|
||||
BitmapFactory.decodeFile(filePath, options);
|
||||
if (options.mCancel || options.outWidth == -1 || options.outHeight == -1){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -138,14 +138,14 @@ public class PoiSaveUtils {
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("workType", poiEntity.getWork_type());
|
||||
httpParams.put("workType", 1);
|
||||
httpParams.put("memo", poiEntity.getMemo());
|
||||
url = HttpInterface.INSIDE_API_LIST;
|
||||
} else if (poiEntity.getType() == 4) {
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("workType", poiEntity.getWork_type());
|
||||
httpParams.put("workType", 0);
|
||||
httpParams.put("memo", poiEntity.getMemo());
|
||||
url = HttpInterface.ROAD_TASK_SUBMIT;
|
||||
} else if (poiEntity.getType() == 5) {
|
||||
@ -312,6 +312,9 @@ public class PoiSaveUtils {
|
||||
anInt++;
|
||||
return;
|
||||
} else {
|
||||
poiEntity.setChecked(false);
|
||||
poiEntity.setWork_type(0);
|
||||
PoiDatabase.getInstance(mContext).getPoiDao().updatePoiEntity(poiEntity);
|
||||
Log.d("TAGSS", "uploadPoiNet: 失败" + bInt);
|
||||
bInt++;
|
||||
return;
|
||||
|
@ -45,7 +45,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/cb_unSubmit"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cb_unSubmit"
|
||||
app:layout_constraintTop_toTopOf="@+id/cb_unSubmit" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user