1.修改查看图片的顺序
2.修改保存本地后台逻辑 3.端点间的距离判断
This commit is contained in:
parent
647a24085d
commit
2aef098319
@ -9,8 +9,8 @@ android {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 30
|
||||
versionCode 5
|
||||
versionName "5.1"
|
||||
versionCode 6
|
||||
versionName "6.1112"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
lintOptions {
|
||||
|
@ -149,7 +149,12 @@ public class HomeActivity extends BaseActivity{
|
||||
String dataString = (String) data.obj;
|
||||
if (!dataString.equals("")) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||
Constant.isPresent=true;
|
||||
MessageDialog.show(this, "提示", dataString, "确定");
|
||||
}
|
||||
}else if (data.what==Constant.NEST_WORD_REGISTER){
|
||||
String dataString = (String) data.obj;
|
||||
if (!dataString.equals("")) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||
MessageDialog.show(this, "提示", dataString, "确定");
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 照片对应
|
||||
*/
|
||||
@ -57,7 +56,6 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
private static final CameraLogger LOG = CameraLogger.create("Picture");
|
||||
private CameraView cameraView;
|
||||
private String photo_path;
|
||||
private int oration;
|
||||
private File logFile;
|
||||
private StringBuilder photographBuilder;
|
||||
|
||||
@ -108,7 +106,6 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
super.initView();
|
||||
if (getIntent() != null) {
|
||||
photo_path = getIntent().getStringExtra(Constant.INTENT_PHOTO_PATH);
|
||||
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
|
||||
}
|
||||
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||
@ -120,12 +117,10 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
@Override
|
||||
public void onPictureTaken(@NonNull PictureResult result) {
|
||||
super.onPictureTaken(result);
|
||||
if (oration == 1) {
|
||||
if (Objects.requireNonNull(cameraView.getPictureSize()).getWidth() < cameraView.getPictureSize().getHeight()) {
|
||||
photographBuilder.append("cameraView 用户竖向拍摄 ,");
|
||||
} else {
|
||||
photographBuilder.append("cameraView 用户横屏拍摄 ,");
|
||||
}
|
||||
if (Objects.requireNonNull(cameraView.getPictureSize()).getWidth() < cameraView.getPictureSize().getHeight()) {
|
||||
photographBuilder.append("cameraView 用户竖向拍摄 ,");
|
||||
} else {
|
||||
photographBuilder.append("cameraView 用户横屏拍摄 ,");
|
||||
}
|
||||
File file = new File(photo_path);
|
||||
/*File destFolder = new File(file.getParentFile().getAbsolutePath()+"aaa");
|
||||
@ -135,12 +130,11 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
result.toFile(file, new FileCallback() {
|
||||
@Override
|
||||
public void onFileReady(@Nullable File file) {
|
||||
Intent intent = new Intent();
|
||||
/* Intent intent = new Intent();
|
||||
intent.putExtra("file", file.getAbsolutePath());
|
||||
setResult(0x104, intent);
|
||||
SystemTTS.getInstance(PhotographActivity.this).stopSpeak();
|
||||
PhotographActivity.this.finish();
|
||||
/*
|
||||
PhotographActivity.this.finish();*/
|
||||
if (file.exists()) {
|
||||
WebPNative webPNative = new WebPNative();
|
||||
new Thread(new Runnable() {
|
||||
@ -165,14 +159,17 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("output:", e.toString());
|
||||
Toast.makeText(PhotographActivity.this, "文件转换失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
Toast.makeText(PhotographActivity.this, "源文件不存在", Toast.LENGTH_SHORT).show();
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(PhotographActivity.this, "源文件不存在", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
/* CompressImageTask.get().compressImage(ImageConfig.getDefaultConfig(file.getAbsolutePath(), file.getAbsolutePath()), new AsyncImageTask.OnImageResult(){
|
||||
@Override
|
||||
public void startCompress() {
|
||||
|
@ -94,22 +94,23 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private TextureMapView ivMap;
|
||||
private List<Removable> removables;
|
||||
private Polyline polyline;
|
||||
private String finalVideoPath; // 摄像后最终保存的文件名
|
||||
private String finalVideoPath,geoWkt, detail, type; // 摄像后最终保存的文件名
|
||||
private ViewGroup layerChange; // 切换地图和相机的父控件
|
||||
private CheckBox capturePicture, cbMapType; //拍照
|
||||
private boolean isMapSlide = false;
|
||||
private boolean isOration = false;
|
||||
private boolean isTerminus=false;
|
||||
private boolean isBack = true;
|
||||
private SimpleDateFormat formatter;
|
||||
private File paperFile, logFile;
|
||||
private int poi_video_type;
|
||||
private ImageView ivZoomAdd, ivZoomDel, ivLocation, ivPicImage, ivPicVideoImage, imageView;
|
||||
private TencentLocation oldCurrentLocation = null;
|
||||
private Timer timer;
|
||||
private TimerTask timerTask;
|
||||
private int videoIndex = -1;
|
||||
private int poi_video_type=0;
|
||||
private int oration = 0;
|
||||
private SystemTTS systemTTS;
|
||||
private boolean isBack = true;
|
||||
private StringBuilder picturesBuilder;
|
||||
private Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
@ -130,13 +131,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
return false;
|
||||
}
|
||||
});
|
||||
private LatLng startLatLine;
|
||||
private LatLng endLatLine;
|
||||
private LatLng startLatLine, endLatLine;
|
||||
private TextView tvTitle;
|
||||
private String geoWkt;
|
||||
private String detail;
|
||||
private String type;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -152,7 +148,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
layerChange = findViewById(R.id.layer_change);
|
||||
if (getIntent() != null) {
|
||||
poi_video_type = getIntent().getIntExtra(Constant.INTENT_POI_VIDEO_TYPE, -1);
|
||||
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
|
||||
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, 0);
|
||||
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_JPG_PATH);
|
||||
type = getIntent().getStringExtra(Constant.INTENT_TYPE);
|
||||
geoWkt = getIntent().getStringExtra(Constant.INTENT_GEO_WKT);
|
||||
@ -261,7 +257,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
result.toFile(file, new FileCallback() {
|
||||
@Override
|
||||
public void onFileReady(@Nullable File file) {
|
||||
if (file.exists()) {
|
||||
/* if (file.exists()) {
|
||||
initMarker();
|
||||
videoIndex = Integer.parseInt(file.getName().replace(".jpg", ""));
|
||||
finalVideoPath = Objects.requireNonNull(file.getParentFile()).getAbsolutePath() + "/" + (videoIndex + 1) + ".jpg";
|
||||
@ -277,8 +273,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
Message message = new Message();
|
||||
message.what = 0x103;
|
||||
handler.sendMessage(message);
|
||||
}
|
||||
/* if (file.exists()) {
|
||||
}*/
|
||||
if (file.exists()) {
|
||||
WebPNative webPNative = new WebPNative();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
@ -287,13 +283,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
|
||||
webPNative.encodeRGBA(bitmap, file.getPath(), 90);
|
||||
runOnUiThread(new Runnable() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void run() {
|
||||
if (file.exists()) {
|
||||
initMarker();
|
||||
videoIndex = Integer.parseInt(file.getName().replace(".webp", ""));
|
||||
finalVideoPath = Objects.requireNonNull(file.getParentFile()).getAbsolutePath() + "/" + (videoIndex + 1) + ".webp";
|
||||
Toast.makeText(PicturesActivity.this, "保存成功:" + (videoIndex + 1), Toast.LENGTH_SHORT).show();
|
||||
tvTitle.setText("保存成功:" + (videoIndex + 1));
|
||||
}
|
||||
if (poi_video_type == 2) {
|
||||
Message message = new Message();
|
||||
@ -302,7 +299,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!bitmap.isRecycled()) {
|
||||
bitmap.recycle();
|
||||
}
|
||||
@ -312,17 +308,20 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
Toast.makeText(PicturesActivity.this, "源文件不存在", Toast.LENGTH_SHORT).show();
|
||||
}*/
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(PicturesActivity.this, "源文件不存在", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isBack = false;
|
||||
if (poi_video_type != 2) {
|
||||
capturePicture.setText("开始采集");
|
||||
}
|
||||
capturePicture.setChecked(false);
|
||||
stopTimer();
|
||||
Message message = new Message();
|
||||
message.what = 0x103;
|
||||
handler.sendMessage(message);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -334,11 +333,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
ivMap.setLayoutParams(layoutParamsMap);
|
||||
}
|
||||
|
||||
private void message(String content) {
|
||||
LOG.i(content);
|
||||
Toast.makeText(this, content, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
private void initLine() {
|
||||
if (geoWkt != null) {
|
||||
String geo = Geohash.getInstance().decode(geoWkt);
|
||||
@ -386,8 +380,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
assert latLineString != null;
|
||||
startLatLine = latLineString.get(0);
|
||||
endLatLine = latLineString.get(latLineString.size() - 1);
|
||||
// 构造 PolylineOnions
|
||||
PolylineOptions polylineOptions = new PolylineOptions().addAll(latLineString)
|
||||
// 折线设置圆形线头
|
||||
@ -443,9 +435,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
picturesBuilder.append("onClick 点击了结束采集 ,");
|
||||
Intent intent = new Intent();
|
||||
finalVideoPath = Objects.requireNonNull(paperFile.getParentFile()).getAbsolutePath() + "/" + videoIndex + ".jpg";
|
||||
finalVideoPath = Objects.requireNonNull(paperFile.getParentFile()).getAbsolutePath() + "/" + videoIndex + ".webp";
|
||||
intent.putExtra(Constant.INTENT_PICTURES_PATH, finalVideoPath);
|
||||
intent.putExtra("type", poi_video_type);
|
||||
setResult(0x111, intent);
|
||||
this.finish();
|
||||
break;
|
||||
@ -500,9 +491,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/*
|
||||
设置定位图标样式
|
||||
*/
|
||||
/*设置定位图标样式*/
|
||||
private void setLocMarkerStyle(int type) {
|
||||
tencentMap.setLocationSource(new MyTecentLocationSource(this));
|
||||
tencentMap.setMyLocationEnabled(true);
|
||||
@ -672,7 +661,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
sb.append("\r\n");
|
||||
if (isBack) {
|
||||
FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true);
|
||||
//initSpeed();
|
||||
// initSpeed();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
UMCrash.generateCustomLog(e, "自定义");
|
||||
@ -684,22 +673,28 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}, 100);
|
||||
}
|
||||
//快到终点的语音播报
|
||||
/*if (Constant.currentLocation != null) {
|
||||
// initTerminus();
|
||||
}
|
||||
|
||||
private void initTerminus() {
|
||||
if (Constant.currentLocation != null) {
|
||||
LatLng newLatLine = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||
if (endLatLine != null && startLatLine != null) {
|
||||
double startDistance = GeometryTools.distanceToDouble(newLatLine, startLatLine);
|
||||
double endDistance = GeometryTools.distanceToDouble(newLatLine, endLatLine);
|
||||
if (startDistance > endDistance) {//endDistance: 起点 startDistance:终点
|
||||
if (startDistance == 50) {
|
||||
if (startDistance <50&&!isTerminus) {
|
||||
systemTTS.playText("即将到达任务终点");
|
||||
isTerminus=true;
|
||||
}
|
||||
} else {
|
||||
if (endDistance == 50) {
|
||||
if (endDistance <50&&!isTerminus) {
|
||||
systemTTS.playText("即将到达任务终点");
|
||||
isTerminus=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
private void initSpeed() {
|
||||
@ -754,7 +749,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
picturesBuilder.append("onClick 点击了结束采集 ,");
|
||||
Intent intent = new Intent();
|
||||
finalVideoPath = Objects.requireNonNull(paperFile.getParentFile()).getAbsolutePath() + "/" + videoIndex + ".jpg";
|
||||
finalVideoPath = Objects.requireNonNull(paperFile.getParentFile()).getAbsolutePath() + "/" + videoIndex + ".webp";
|
||||
intent.putExtra(Constant.INTENT_PICTURES_PATH, finalVideoPath);
|
||||
setResult(0x111, intent);
|
||||
finish();
|
||||
|
@ -108,7 +108,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
btnAttestation.setOnClickListener(this);
|
||||
Button btnGathering = findViewById(R.id.btn_gathering);
|
||||
btnGathering.setOnClickListener(this);
|
||||
if (Constant.ID_NUMBER != null) {
|
||||
if (Constant.BACKGROUND != null) {
|
||||
btnGathering.setText("已绑定");
|
||||
}
|
||||
region = findViewById(R.id.region);
|
||||
@ -116,6 +116,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
LinearLayout llRegion = findViewById(R.id.ll_region);
|
||||
llRegion.setOnClickListener(this);
|
||||
etPhone = findViewById(R.id.et_phone);
|
||||
etPhone.setEnabled(false);
|
||||
etPhone.setOnClickListener(this);
|
||||
etQq = findViewById(R.id.edit_qq);
|
||||
etQq.setOnClickListener(this);
|
||||
@ -138,7 +139,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
if (Constant.AUDIOTAPES == 1) {
|
||||
btnAttestation.setText("已认证");
|
||||
}
|
||||
if (Constant.ID_NUMBER != null) {
|
||||
if (Constant.BACKGROUND != null) {
|
||||
btnGathering.setText("已绑定");
|
||||
}
|
||||
}
|
||||
@ -191,13 +192,6 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private void netWork() {
|
||||
userBuilder.append("点击了保存的按钮 ,");
|
||||
if (Constant.ID_NUM == null) {
|
||||
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (Constant.ID_NUMBER == null) {
|
||||
Toast.makeText(this, "请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
String userphone = etPhone.getText().toString().trim();
|
||||
String userqq = etQq.getText().toString().trim();
|
||||
String usermailbox = etMailbox.getText().toString().trim();
|
||||
@ -211,18 +205,17 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
//user.length() < 11 && user.length() > 5
|
||||
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox) || TextUtils.isEmpty(region_id)) {
|
||||
if (region_id == null || region_id.equals("")) {
|
||||
Toast.makeText(this, "所在地区为空,请重新输入", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "所在地区,请重新选择", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
httpParams.put("regionId", region_id);
|
||||
}
|
||||
|
||||
if (!RegexUtil.isPhone(userphone)) {
|
||||
/* if (!RegexUtil.isPhone(userphone)) {
|
||||
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
httpParams.put("mobile", userphone);
|
||||
}
|
||||
}*/
|
||||
if (!userqq.equals("")) {
|
||||
if (!isQQNum_matcher) {
|
||||
Toast.makeText(this, "QQ号输入错误", Toast.LENGTH_SHORT).show();
|
||||
@ -234,10 +227,10 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
if (!usermailbox.equals("")) {
|
||||
if (!isEmail_matcher) {
|
||||
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
httpParams.put("mailbox", usermailbox); //邮箱
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
showLoadingDialog();
|
||||
|
@ -135,6 +135,7 @@ public class Constant {
|
||||
public static final int PICTURE_VIDEO_WORD = 48; //视频页面崩溃后发给poi录像和道路
|
||||
public static final int PHOTO_FINISH_VIDEO = 49;//拍照列表的返回
|
||||
public static final int NEST_WORD_SUBMIT = 50;//所有的提交/上传
|
||||
public static final int NEST_WORD_REGISTER=51;//所有的保存
|
||||
public static final int STAY_SUBMIT_ITEM = 52;//待提交
|
||||
public static final int HAS_SUBMIT_ITEM = 53;//已提交
|
||||
public static final String INTENT_POI_VIDEO_TYPE = "poi_video_type";
|
||||
@ -155,17 +156,14 @@ public class Constant {
|
||||
public static final String INTENT_PHOTO_PATH = "INTENT_PHOTO_PATH"; // 拍照界面指定的图片保存位置
|
||||
public static final String INTENT_PICTURES_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
|
||||
public static final String INTENT_VIDEO_OBLATION = "INTENT_VIDEO_OBLATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意
|
||||
|
||||
public static final String INTENT_ID = "id";//poiEntity 的id
|
||||
public static final String INTENT_TYPE = "type";//poiEntity 的type
|
||||
public static final String INTENT_GEO_WKT = "geowkt";//poiEntity 的geowkt
|
||||
public static final String INTENT_DETAIL = "Detail";//poiEntity 的detail
|
||||
|
||||
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.11";//版本日期
|
||||
public static final String NAVIN_FO = "11.12";//版本日期
|
||||
//marker
|
||||
public static final BitmapDescriptor MARKER_POI_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
public static final BitmapDescriptor MARKER_CHARGE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
|
@ -28,7 +28,7 @@ public class UserApplication extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
userApplication=this;
|
||||
userApplication = this;
|
||||
//友盟 检测bug
|
||||
UMConfigure.init(this, Constant.YOU_MENG_APP_KEY, "navinfo", UMConfigure.DEVICE_TYPE_PHONE, "");
|
||||
/**
|
||||
@ -38,11 +38,10 @@ public class UserApplication extends Application {
|
||||
UMConfigure.setLogEnabled(true);
|
||||
// String e ="测试自定义异常代码是否运行!!!!!!";
|
||||
// UMCrash.generateCustomLog(e,"UmengException");
|
||||
|
||||
UMCrash.registerUMCrashCallback(new UMCrashCallback(){
|
||||
UMCrash.registerUMCrashCallback(new UMCrashCallback() {
|
||||
@Override
|
||||
public String onCallback(){
|
||||
return"注册友盟异常查看功能";
|
||||
public String onCallback() {
|
||||
return "注册友盟异常查看功能";
|
||||
}
|
||||
});
|
||||
initOkGo();
|
||||
@ -79,10 +78,13 @@ public class UserApplication extends Application {
|
||||
//全局的读取超时时间
|
||||
|
||||
builder.readTimeout(0, TimeUnit.MILLISECONDS);
|
||||
|
||||
//全局的写入超时时间
|
||||
builder.writeTimeout(0, TimeUnit.MILLISECONDS);
|
||||
|
||||
//全局的连接超时时间
|
||||
builder.connectTimeout(0, TimeUnit.MILLISECONDS);
|
||||
|
||||
OkGo.getInstance().init(this)
|
||||
.setOkHttpClient(builder.build())
|
||||
//全局统一缓存模式,默认不使用缓存,可以不传
|
||||
|
@ -1082,7 +1082,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了全景照片进行拍照,");
|
||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||
File panoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, panoramaFile.getPath());
|
||||
startActivityForResult(intentPanorama, 101);
|
||||
break;
|
||||
@ -1090,7 +1089,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了充电桩编码进行拍照,");
|
||||
Intent intentCoding = new Intent(getActivity(), PhotographActivity.class);
|
||||
File codingFile = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentCoding.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentCoding.putExtra(Constant.INTENT_PHOTO_PATH, codingFile.getPath());
|
||||
startActivityForResult(intentCoding, 102);
|
||||
break;
|
||||
@ -1098,7 +1096,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentEquipment = new Intent(getActivity(), PhotographActivity.class);
|
||||
File equipmentFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentEquipment.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentEquipment.putExtra(Constant.INTENT_PHOTO_PATH, equipmentFile.getPath());
|
||||
startActivityForResult(intentEquipment, 103);
|
||||
|
||||
@ -1107,7 +1104,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentFacility = new Intent(getActivity(), PhotographActivity.class);
|
||||
File facilityFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentFacility.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentFacility.putExtra(Constant.INTENT_PHOTO_PATH, facilityFile.getPath());
|
||||
startActivityForResult(intentFacility, 104);
|
||||
break;
|
||||
@ -1115,7 +1111,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
||||
File scutcheonFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentScutcheon.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
|
||||
startActivityForResult(intentScutcheon, 105);
|
||||
break;
|
||||
@ -1123,7 +1118,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了设备标牌进行拍照,");
|
||||
Intent intentDevice = new Intent(getActivity(), PhotographActivity.class);
|
||||
File deviceFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentDevice.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentDevice.putExtra(Constant.INTENT_PHOTO_PATH, deviceFile.getPath());
|
||||
startActivityForResult(intentDevice, 106);
|
||||
break;
|
||||
@ -1131,7 +1125,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了可用状态进行拍照,");
|
||||
Intent intentUsable = new Intent(getActivity(), PhotographActivity.class);
|
||||
File usableFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentUsable.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentUsable.putExtra(Constant.INTENT_PHOTO_PATH, usableFile.getPath());
|
||||
startActivityForResult(intentUsable, 107);
|
||||
break;
|
||||
@ -1139,7 +1132,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了可用专题进行拍照,");
|
||||
Intent intentAvailable = new Intent(getActivity(), PhotographActivity.class);
|
||||
File availableFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentAvailable.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentAvailable.putExtra(Constant.INTENT_PHOTO_PATH, availableFile.getPath());
|
||||
startActivityForResult(intentAvailable, 108);
|
||||
break;
|
||||
@ -1147,7 +1139,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了停车位编号进行拍照,");
|
||||
Intent intentParking = new Intent(getActivity(), PhotographActivity.class);
|
||||
File parkingFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentParking.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentParking.putExtra(Constant.INTENT_PHOTO_PATH, parkingFile.getPath());
|
||||
startActivityForResult(intentParking, 109);
|
||||
break;
|
||||
@ -1155,7 +1146,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
chargingPileBuilder.append("点击了停车位编号进行拍照,");
|
||||
Intent intentNumber = new Intent(getActivity(), PhotographActivity.class);
|
||||
File numberFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentNumber.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentNumber.putExtra(Constant.INTENT_PHOTO_PATH, numberFile.getPath());
|
||||
startActivityForResult(intentNumber, 110);
|
||||
break;
|
||||
|
@ -915,9 +915,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_save_local:
|
||||
chargingStationBuilder.append("点击了保存本地的按钮 ,");
|
||||
if (Constant.isPresent) {
|
||||
initRoadSaveLocal(false);
|
||||
}
|
||||
initRoadSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_uploading:
|
||||
chargingStationBuilder.append("点击了上传的按钮 ,");
|
||||
@ -998,7 +996,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}).start();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case R.id.tv_station_examine:
|
||||
@ -1007,9 +1005,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
break;
|
||||
case R.id.rl_panorama:
|
||||
chargingStationBuilder.append("点击了全景照片进行拍照 ,");
|
||||
findingDuplicateByWork();
|
||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||
File PanoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, PanoramaFile.getPath());
|
||||
startActivityForResult(intentPanorama, 101);
|
||||
break;
|
||||
@ -1017,7 +1015,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
chargingStationBuilder.append("点击了名称照片进行拍照 ,");
|
||||
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
||||
File nameFile = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentName.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentName.putExtra(Constant.INTENT_PHOTO_PATH, nameFile.getPath());
|
||||
startActivityForResult(intentName, 102);
|
||||
break;
|
||||
@ -1025,7 +1022,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
chargingStationBuilder.append("点击了服务说明进行拍照 ,");
|
||||
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
||||
File internalFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentInternal.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, internalFile.getPath());
|
||||
startActivityForResult(intentInternal, 103);
|
||||
break;
|
||||
@ -1033,7 +1029,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
chargingStationBuilder.append("点击了充电站指引牌进行拍照 ,");
|
||||
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
||||
File elseFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentElse.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, elseFile.getPath());
|
||||
startActivityForResult(intentElse, 104);
|
||||
break;
|
||||
@ -1041,7 +1036,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
chargingStationBuilder.append("点击了停车收费标牌进行拍照 ,");
|
||||
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
||||
File scutcheonFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentScutcheon.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
|
||||
startActivityForResult(intentScutcheon, 105);
|
||||
break;
|
||||
@ -1156,7 +1150,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
chargingStationSaveByWork(poiEntity);
|
||||
} else {
|
||||
chargingStationSaveWork(poiEntity);
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1184,6 +1177,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("sptype", poiEntity.getStation_type());
|
||||
httpParams.put("existence", poiEntity.getExistence());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("telephone", poiEntity.getTelPhone());
|
||||
@ -1200,6 +1194,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||
WaitDialog.dismiss(1000);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
||||
@ -1249,6 +1247,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("sptype", poiEntity.getStation_type());
|
||||
httpParams.put("existence", poiEntity.getExistence());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("address", poiEntity.getAddress());
|
||||
httpParams.put("telephone", poiEntity.getTelPhone());
|
||||
@ -1329,36 +1328,58 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
public void onSuccess(TaskNameBean taskNameBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (taskNameBean.getCode() == 200) {
|
||||
editNameContent.setTextColor(Color.BLACK);
|
||||
btnSaveLocal.setEnabled(true);
|
||||
btnUploading.setEnabled(true);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<String> body = taskNameBean.getBody();
|
||||
if (body != null) {
|
||||
for (int i = 0; i < body.size(); i++) {
|
||||
stringBuilder.append(body.get(i)).append(";");
|
||||
}
|
||||
Toast.makeText(getActivity(), "不允许新增上报. 存在类似名称--" + stringBuilder.toString(), Toast.LENGTH_SHORT).show();
|
||||
editNameContent.setText(null);
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称可以作业", Toast.LENGTH_SHORT).show();
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
editNameContent.setTextColor(Color.BLACK);
|
||||
btnSaveLocal.setEnabled(true);
|
||||
btnUploading.setEnabled(true);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<String> body = taskNameBean.getBody();
|
||||
if (body != null) {
|
||||
for (int i = 0; i < body.size(); i++) {
|
||||
stringBuilder.append(body.get(i)).append(";");
|
||||
}
|
||||
Toast.makeText(getActivity(), " 存在类似名称--" + stringBuilder.toString(), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
} else if (taskNameBean.getCode() == 203) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
editNameContent.setTextColor(Color.RED);
|
||||
btnSaveLocal.setEnabled(false);
|
||||
btnUploading.setEnabled(false);
|
||||
Toast.makeText(getActivity(), taskNameBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
editNameContent.setTextColor(Color.RED);
|
||||
btnSaveLocal.setEnabled(false);
|
||||
btnUploading.setEnabled(false);
|
||||
Toast.makeText(getActivity(), taskNameBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
dismissLoadingDialog();
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
|
@ -234,7 +234,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
Intent gatheringNumberIntent = new Intent(getActivity(), PhotographActivity.class);
|
||||
File file = PhotoUtils.showPhotoFile("a", null);
|
||||
gatheringNumberIntent.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
||||
gatheringNumberIntent.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
startActivityForResult(gatheringNumberIntent, 131);
|
||||
break;
|
||||
}
|
||||
@ -246,7 +245,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
ArrayList<File> gatheringList = new ArrayList<>();
|
||||
if (gatheringCamera.getTag() == null) {
|
||||
if (Constant.ID_NUMBER == null) {
|
||||
if (Constant.BACKGROUND == null) {
|
||||
Toast.makeText(getActivity(), "请先拍银行卡", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "如果需要重新绑定请先拍照银行卡", Toast.LENGTH_SHORT).show();
|
||||
|
@ -505,7 +505,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Intent intentPicture = new Intent(getActivity(), PhotographActivity.class);
|
||||
File file = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPicture.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
||||
intentPicture.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
startActivityForResult(intentPicture, 101);
|
||||
break;
|
||||
case R.id.rl_pictures:
|
||||
@ -513,14 +512,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Intent intentPictures = new Intent(getActivity(), PhotographActivity.class);
|
||||
File files = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentPictures.putExtra(Constant.INTENT_PHOTO_PATH, files.getPath());
|
||||
intentPictures.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
startActivityForResult(intentPictures, 102);
|
||||
break;
|
||||
case R.id.btn_other_local:
|
||||
otherBuilder.append("点击了保存本地的按钮,");
|
||||
if (Constant.isPresent) {
|
||||
initPoiSaveLocal(false);
|
||||
}
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_other_uploading:
|
||||
otherBuilder.append("点击了上传的按钮,");
|
||||
@ -561,7 +557,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -594,7 +590,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
otherSaveByNetWork(poiEntity);
|
||||
} else {
|
||||
otherSaveNetWork(poiEntity);
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -636,6 +631,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||
WaitDialog.dismiss(1000);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@ -9,6 +10,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@ -85,6 +87,7 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
||||
});
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@ -99,12 +102,33 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
|
||||
String id = showPoiEntity.getId();
|
||||
fileBeans = new ArrayList<>();
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(id);
|
||||
Collections.sort(fileListByUUID);
|
||||
if (fileListByUUID.size()>=2){
|
||||
List<File> fileArrayList = new ArrayList<>();
|
||||
if (fileListByUUID.size()>2){
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
if (fileListByUUID.get(i).getPath().contains(".jpg") && !fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileListByUUID.get(i).exists()) {
|
||||
fileBeans.add(new FileBean(fileListByUUID.get(i), false));
|
||||
if (!fileListByUUID.get(i).getPath().contains("paper.txt")){
|
||||
fileArrayList.add(fileListByUUID.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
Collections.sort(fileArrayList, new Comparator<File>() {
|
||||
@Override
|
||||
public int compare(File o1, File o2) {
|
||||
String[] split = o1.getName().split(".webp");
|
||||
String[] split2 = o2.getName().split(".webp");
|
||||
int i = Integer.parseInt(split[0]);
|
||||
int i2 = Integer.parseInt(split2[0]);
|
||||
if (i>i2){
|
||||
return 1;
|
||||
}else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (fileArrayList.size()>0){
|
||||
for (int i = 0; i < fileArrayList.size(); i++) {
|
||||
if (fileArrayList.get(i).getPath().contains(".webp") && !fileArrayList.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileArrayList.get(i).exists()) {
|
||||
fileBeans.add(new FileBean(fileArrayList.get(i), false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
private int existence = 0;
|
||||
private RelativeLayout linearExist;
|
||||
private Spinner spinnerExist;
|
||||
String poiAddressName = "";
|
||||
//获取的拍照图片
|
||||
private LinearLayout linearContact;
|
||||
private ContactView contactView;
|
||||
@ -703,9 +702,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_save_local:
|
||||
poiBuilder.append("点击了保存本地的按钮,");
|
||||
if (Constant.isPresent) {
|
||||
initPoiSaveLocal(false);
|
||||
}
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_uploading:
|
||||
poiBuilder.append("点击了上传的按钮,");
|
||||
@ -758,7 +755,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case R.id.tv_poi_examine:
|
||||
@ -766,10 +763,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
findingDuplicateByWork();
|
||||
break;
|
||||
case R.id.rl_panorama:
|
||||
findingDuplicateByWork();
|
||||
poiBuilder.append("点击了全景图的进行拍照,");
|
||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||
File filePanorama = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, filePanorama.getPath());
|
||||
startActivityForResult(intentPanorama, 101);
|
||||
break;
|
||||
@ -777,7 +774,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiBuilder.append("点击了名称的进行拍照,");
|
||||
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileName = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentName.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentName.putExtra(Constant.INTENT_PHOTO_PATH, fileName.getPath());
|
||||
startActivityForResult(intentName, 102);
|
||||
break;
|
||||
@ -785,7 +781,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiBuilder.append("点击了内部照片的进行拍照,");
|
||||
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileInternal = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentInternal.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, fileInternal.getPath());
|
||||
startActivityForResult(intentInternal, 103);
|
||||
break;
|
||||
@ -793,7 +788,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiBuilder.append("点击了名片的进行拍照,");
|
||||
Intent intentCard = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileCard = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentCard.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentCard.putExtra(Constant.INTENT_PHOTO_PATH, fileCard.getPath());
|
||||
startActivityForResult(intentCard, 104);
|
||||
break;
|
||||
@ -801,7 +795,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiBuilder.append("点击了其他的进行拍照,");
|
||||
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileElse = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentElse.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, fileElse.getPath());
|
||||
startActivityForResult(intentElse, 105);
|
||||
break;
|
||||
@ -825,33 +818,56 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void onSuccess(TaskNameBean taskNameBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (taskNameBean.getCode() == 200) {
|
||||
btnUploading.setEnabled(true);
|
||||
btnSaveLocal.setEnabled(true);
|
||||
editNameContent.setTextColor(Color.BLACK);
|
||||
List<String> body = taskNameBean.getBody();
|
||||
if (body != null) {
|
||||
for (int i = 0; i < body.size(); i++) {
|
||||
poiAddressName += body.get(i) + ",";
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
btnUploading.setEnabled(true);
|
||||
btnSaveLocal.setEnabled(true);
|
||||
editNameContent.setTextColor(Color.BLACK);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<String> body = taskNameBean.getBody();
|
||||
if (body != null) {
|
||||
for (int i = 0; i < body.size(); i++) {
|
||||
stringBuilder.append(body.get(i)).append(";");
|
||||
}
|
||||
Toast.makeText(getActivity(), "存在类似名称---" + stringBuilder.toString(), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
if (poiAddressName != null) {
|
||||
Toast.makeText(getActivity(), "存在类似名称---" + poiAddressName, Toast.LENGTH_SHORT).show();
|
||||
poiAddressName = "";
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
} else if (taskNameBean.getCode() == 203) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(getActivity(), taskNameBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
if (getActivity() != null) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
btnUploading.setEnabled(false);
|
||||
btnSaveLocal.setEnabled(false);
|
||||
editNameContent.setTextColor(Color.RED);
|
||||
Toast.makeText(getActivity(), taskNameBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
String message = e.getMessage();
|
||||
assert message != null;
|
||||
if (message.equals("timeout") || message.equals("Read time out")) {
|
||||
@ -890,7 +906,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiSaveByNet(poiEntity);
|
||||
} else {
|
||||
poiSaveNet(poiEntity);
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -934,6 +949,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||
WaitDialog.dismiss(1000);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
private void poiUploadByNetWork(int body, ArrayList<File> poiPicList) {
|
||||
|
@ -297,8 +297,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
case "Polygon": //面
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
assert latLineString != null;
|
||||
latLng = latLineString.get(0);
|
||||
rearLatLng = latLineString.get(latLineString.size() - 1);
|
||||
latLng = latLineString.get(0);//起點
|
||||
rearLatLng = latLineString.get(latLineString.size() - 1);//終點
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
||||
@ -319,7 +319,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
assert latLineString != null;
|
||||
latLng = latLineString.get(0);
|
||||
rearLatLng = latLineString.get(latLineString.size() - 1);
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
||||
@ -341,16 +340,16 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
}
|
||||
|
||||
}
|
||||
String describe = showPoiEntity.getMemo();//任务描述
|
||||
if (describe != null && !describe.equals("")) {
|
||||
etDesc.setText(describe);
|
||||
String memo = showPoiEntity.getMemo();//任务描述
|
||||
if (memo != null && !memo.equals("")) {
|
||||
etDesc.setText(memo);
|
||||
}
|
||||
String photoList = showPoiEntity.getPhoto();
|
||||
if (!StringUtils.isEmpty(photoList)) {
|
||||
boolean isImageLoad = false;
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
if (fileListByUUID.get(i).getPath().contains(".jpg") && !fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileListByUUID.get(i).getPath().contains(".webp") && !fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileListByUUID.get(i).exists() && !isImageLoad) {
|
||||
// 使用glide加载视频的第一帧
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(fileListByUUID.get(i)).into(ivPoiVideoPicture);
|
||||
@ -396,7 +395,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
boolean isImageLoad = false;
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
File videoFile = fileListByUUID.get(i);
|
||||
if (videoFile.getPath().contains(".jpg") && !videoFile.getPath().contains("paper.txt")) {
|
||||
if (videoFile.getPath().contains(".webp") && !videoFile.getPath().contains("paper.txt")) {
|
||||
if (videoFile.exists() && !isImageLoad) {
|
||||
// 使用glide加载视频的第一帧
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
||||
@ -425,51 +424,61 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
break;
|
||||
case R.id.btn_poi_video_save:
|
||||
poiVideoBuilder.append("点击了保存本地的按钮 ,");
|
||||
if (Constant.isPresent) {
|
||||
initPoiSaveLocal(false);
|
||||
}
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.tv_short://手动拍摄
|
||||
poiVideoBuilder.append("点击了手动拍摄的按钮 ,");
|
||||
double latitude = Constant.currentLocation.getLatitude();
|
||||
double longitude = Constant.currentLocation.getLongitude();
|
||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);
|
||||
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);
|
||||
if (geometry > 5000 || rearGeometry > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业起点或者终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
Intent intents = new Intent(getActivity(), PicturesActivity.class);
|
||||
File filePath = AWMp4ParserHelper.getInstance().obtainJpgFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intents.putExtra(Constant.INTENT_JPG_PATH, filePath.getAbsolutePath());
|
||||
intents.putExtra(Constant.INTENT_VIDEO_OBLATION, 0);
|
||||
intents.putExtra(Constant.INTENT_POI_VIDEO_TYPE, 2);
|
||||
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);
|
||||
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
|
||||
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);//終點于用戶的距離
|
||||
if (geometry > rearGeometry) {//用戶在终点开始作业
|
||||
if (rearGeometry > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
} else {//用户在起点开始作业
|
||||
if (geometry > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业起点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
Intent intents = new Intent(getActivity(), PicturesActivity.class);
|
||||
File filePath = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intents.putExtra(Constant.INTENT_JPG_PATH, filePath.getAbsolutePath());
|
||||
intents.putExtra(Constant.INTENT_VIDEO_OBLATION, 0);
|
||||
intents.putExtra(Constant.INTENT_POI_VIDEO_TYPE, 2);
|
||||
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);
|
||||
break;
|
||||
case R.id.tv_combo://自动连拍:
|
||||
poiVideoBuilder.append("点击了自动连拍的按钮 ,");
|
||||
LatLng startLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()); //用户当前位置
|
||||
double geom = GeometryTools.distanceToDouble(startLng, latLng);
|
||||
double rearGeom = GeometryTools.distanceToDouble(startLng, rearLatLng);
|
||||
if (geom > 5000 || rearGeom > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业起点或者终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
Intent intent = new Intent(getActivity(), PicturesActivity.class);
|
||||
File fileJpgPath = AWMp4ParserHelper.getInstance().obtainJpgFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_JPG_PATH, fileJpgPath.getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_VIDEO_OBLATION, 0);
|
||||
intent.putExtra(Constant.INTENT_POI_VIDEO_TYPE, 1);
|
||||
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);
|
||||
if (geom > rearGeom) {//用戶在终点开始作业
|
||||
if (rearGeom > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
} else {//用户在起点开始作业
|
||||
if (geom > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业起点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
Intent intent = new Intent(getActivity(), PicturesActivity.class);
|
||||
File fileJpgPath = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_JPG_PATH, fileJpgPath.getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_VIDEO_OBLATION, 0);
|
||||
intent.putExtra(Constant.INTENT_POI_VIDEO_TYPE, 1);
|
||||
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);
|
||||
break;
|
||||
case R.id.btn_poi_video_upload:
|
||||
poiVideoBuilder.append("点击了上传的按钮 ,");
|
||||
@ -518,7 +527,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -550,7 +559,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
poiVideoSave(poiEntity);
|
||||
} else {
|
||||
poiVideoSaveNet(poiEntity);
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -592,6 +600,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||
WaitDialog.dismiss(1000);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
private void poiVideoUpload(int poiVideoBody, File fileZip) {
|
||||
@ -680,6 +692,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
} else {
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -798,7 +811,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
} else if (response.getCode() == 203) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -869,6 +882,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
poiEntity.setDetail(lineString);
|
||||
}
|
||||
}
|
||||
|
||||
return poiEntity;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
/*
|
||||
* 寻宝-点击上传弹窗-道路
|
||||
*/
|
||||
|
||||
@ -316,7 +316,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||
assert latLineString != null;
|
||||
latLng = latLineString.get(0);
|
||||
rearLatLng = latLineString.get(latLineString.size() - 1);
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_show);
|
||||
@ -347,7 +346,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
boolean isImageLoad = false;
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
if (fileListByUUID.get(i).getPath().contains(".jpg") && !fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileListByUUID.get(i).getPath().contains(".webp") && !fileListByUUID.get(i).getPath().contains("paper.txt")) {
|
||||
if (fileListByUUID.get(i).exists() && !isImageLoad) {
|
||||
// 使用glide加载视频的第一帧
|
||||
Glide.with(Objects.requireNonNull(getActivity())).load(fileListByUUID.get(i)).into(ivRoadPicture);
|
||||
@ -373,7 +372,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if (!StringUtils.isEmpty(photo)) {
|
||||
File videoFile = new File(photo);
|
||||
videoFileList.add(new File(photo));
|
||||
if (videoFile.getPath().contains(".jpg") && !videoFile.getPath().contains("paper.txt")) {
|
||||
if (videoFile.getPath().contains(".webp") && !videoFile.getPath().contains("paper.txt")) {
|
||||
if (videoFile.exists() && !isImageLoad) {
|
||||
// 使用glide加载视频的第一帧
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
||||
@ -410,7 +409,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
boolean isImageLoad = false;
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
File videoFile = fileListByUUID.get(i);
|
||||
if (videoFile.getPath().contains(".jpg") && !videoFile.getPath().contains("paper.txt")) {
|
||||
if (videoFile.getPath().contains(".webp") && !videoFile.getPath().contains("paper.txt")) {
|
||||
if (videoFile.exists() && !isImageLoad) {
|
||||
// 使用glide加载视频的第一帧
|
||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
||||
@ -428,9 +427,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_road_save:
|
||||
roadBuilder.append("点击了保存本地的按钮 ,");
|
||||
if (Constant.isPresent) {
|
||||
initPoiSaveLocal(false);
|
||||
}
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.fm_road_picture:
|
||||
roadBuilder.append("点击了图片查看列表 ,");
|
||||
@ -450,20 +447,26 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);
|
||||
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);
|
||||
if (geometry > 5000 || rearGeometry > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业起点或者终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
Intent intent = new Intent(getContext(), PicturesActivity.class);
|
||||
File finalFile = AWMp4ParserHelper.getInstance().obtainJpgFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_JPG_PATH, finalFile.getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_VIDEO_OBLATION, 0);
|
||||
intent.putExtra(Constant.INTENT_POI_VIDEO_TYPE, 3);
|
||||
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);
|
||||
if (geometry > rearGeometry) {//用戶在终点开始作业
|
||||
if (rearGeometry > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业终点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
} else {//用户在起点开始作业
|
||||
if (geometry > 5000) {
|
||||
Toast.makeText(getActivity(), "用户距离作业起点五公里以内才能拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
Intent intent = new Intent(getContext(), PicturesActivity.class);
|
||||
File finalFile = AWMp4ParserHelper.getInstance().obtainWebpFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_JPG_PATH, finalFile.getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_VIDEO_OBLATION, 0);
|
||||
intent.putExtra(Constant.INTENT_POI_VIDEO_TYPE, 3);
|
||||
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);
|
||||
break;
|
||||
case R.id.road_upload:
|
||||
roadBuilder.append("点击了上传的按钮 ,");
|
||||
@ -513,7 +516,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "该任务正在提交中", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -544,7 +547,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
roadSaveBetWork(poiEntity);
|
||||
} else {
|
||||
roadSaveWork(poiEntity);
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -585,6 +587,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台保存中,请稍候...");
|
||||
WaitDialog.dismiss(1000);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
|
||||
|
@ -556,7 +556,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onSuccess(UserBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {//上传用户位置金纬度 寻宝删选接口请求成功
|
||||
Toast.makeText(getActivity(), "上传用户位置成功", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
} else if (response.getCode() == 203) {
|
||||
FlushTokenUtil.flushToken(getActivity());
|
||||
} else {
|
||||
|
@ -186,7 +186,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
userAttestationBuilder.append("点击身份证人像面 进行拍照 ,");
|
||||
Intent ivAttestationIntent1 = new Intent(getActivity(), PhotographActivity.class);
|
||||
File attestationFile1 = PhotoUtils.showPhotoFile("a", null);
|
||||
ivAttestationIntent1.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
ivAttestationIntent1.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile1.getPath());
|
||||
startActivityForResult(ivAttestationIntent1, 121);
|
||||
break;
|
||||
@ -194,7 +193,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
userAttestationBuilder.append("点击身份证国徽面 进行拍照 ,");
|
||||
Intent ivAttestationIntent2 = new Intent(getActivity(), PhotographActivity.class);
|
||||
File attestationFile2 = PhotoUtils.showPhotoFile("b", null);
|
||||
ivAttestationIntent2.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
ivAttestationIntent2.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile2.getPath());
|
||||
startActivityForResult(ivAttestationIntent2, 122);
|
||||
break;
|
||||
@ -202,7 +200,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
userAttestationBuilder.append("点击手持身份证 进行拍照 ,");
|
||||
Intent ivAttestationIntent3 = new Intent(getActivity(), PhotographActivity.class);
|
||||
File attestationFile3 = PhotoUtils.showPhotoFile("c", null);
|
||||
ivAttestationIntent3.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
ivAttestationIntent3.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile3.getPath());
|
||||
startActivityForResult(ivAttestationIntent3, 123);
|
||||
break;
|
||||
@ -225,7 +222,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
userAttestationBuilder.append("点击认证按钮 ,");
|
||||
Intent userCameraIntent = new Intent(getActivity(), PhotographActivity.class);
|
||||
File file = PhotoUtils.showPhotoFile("d", null);
|
||||
userCameraIntent.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
userCameraIntent.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
||||
startActivityForResult(userCameraIntent, 124);
|
||||
break;
|
||||
|
@ -225,9 +225,9 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Toast.makeText(getActivity(), "请勾选银行卡", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (Constant.ID_NUMBER != null) {
|
||||
if (Constant.BACKGROUND != null) {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否提取到" + Constant.ID_NUMBER.substring(Constant.ID_NUMBER.length() - 4) + "的银行卡", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "是否提取到" + Constant.BACKGROUND.substring(Constant.BACKGROUND.length() - 4) + "的银行卡", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
immediatelyPrice();
|
||||
|
@ -14,9 +14,7 @@ public class HttpInterface {
|
||||
public static String IP1 = "http://dtxbmaps.navinfo.com/dtxb/msg/";
|
||||
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; //版本升级
|
||||
|
@ -33,7 +33,7 @@ public class PhotoUtils {
|
||||
lat= initEncode(latLng);
|
||||
}
|
||||
long time = System.currentTimeMillis();
|
||||
return new File(Constant.PICTURE_FOLDER, d + time + "_p" + lat + "_a" + 0 + ".jpg");
|
||||
return new File(Constant.PICTURE_FOLDER, d + time + "_p" + lat + "_a" + 0 + ".webp");
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_default="percent"
|
||||
app:layout_constraintWidth_percent="0.4" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
@ -91,17 +92,17 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add" />
|
||||
|
||||
<!-- <CheckBox-->
|
||||
<!-- android:id="@+id/cb_map_type"-->
|
||||
<!-- android:layout_width="50dp"-->
|
||||
<!-- android:layout_height="50dp"-->
|
||||
<!-- android:layout_marginTop="15dp"-->
|
||||
<!-- android:background="@drawable/atlas_selector"-->
|
||||
<!-- android:button="@null"-->
|
||||
<!-- android:checked="false"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/iv_zoom_del" />-->
|
||||
<!--<CheckBox
|
||||
android:id="@+id/cb_map_type"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@drawable/atlas_selector"
|
||||
android:button="@null"
|
||||
android:checked="false"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del" />-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_location"
|
||||
@ -124,6 +125,46 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group_picture"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="25dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/capture_picture"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/image_view">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_btn_hand"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="手动"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_btn_auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="自动1秒"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_btn_auto_sec"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="自动2秒"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -546,7 +546,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_toEndOf="@id/image_charge_report"
|
||||
android:text="道路上报任务金额"
|
||||
android:text="充电站上报任务金额"
|
||||
android:textColor="#333"
|
||||
android:textSize="18sp" />
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user