1。修改了超时 2.修改拍照页面的bug 3.修改登录页面的逻辑,修改retfit_token 4.token 登录已过期,是否重新登录 5.添加了已领取(网络本地)列表 6.退出拍摄界面(点击退出)弹窗显示 照片自动保存 7.作业列表的返回 弹窗显示。

This commit is contained in:
wangdongsheng 2021-11-09 17:10:37 +08:00
parent 6267161ec6
commit 873e671de9
61 changed files with 2297 additions and 1419 deletions

View File

@ -22,6 +22,7 @@ import com.navinfo.outdoor.bean.BaseBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import java.io.File;
import java.text.DateFormat;
@ -271,6 +272,7 @@ public class GuidanceActivity extends BaseActivity {
long time = System.currentTimeMillis();
httpParams.put("datetime", time);*/
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.INSERT_USER_GUIDE)
.cls(BaseBean.class)
@ -283,6 +285,10 @@ public class GuidanceActivity extends BaseActivity {
startActivity(new Intent(GuidanceActivity.this, HomeActivity.class));
GuidanceActivity.this.finish();
Toast.makeText(GuidanceActivity.this, "可以在发现版块的任务说明中,进行再次学习哦", Toast.LENGTH_LONG).show();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(GuidanceActivity.this);
}else {
Toast.makeText(GuidanceActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override

View File

@ -197,6 +197,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
httpParams.put("datetime", time);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.USER_LOGIN_OAUTH_TOKEN)
.cls(LoginOauthTokenBean.class)
@ -242,6 +243,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
private void initGetUserInfo() {
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.USER_DETAIL_BY_USER_ID)
.token(Constant.ACCESS_TOKEN)
@ -268,9 +270,9 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
Constant.LEVEL = body.getLevel();
UserDetailBean.BodyBean.UserBankcardBean userBankcard = body.getUserBankcard();
if (userBankcard != null) {//存储银行卡信息
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡
Constant.BACKGROUND = userBankcard.getBankAccount();
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//银行卡账
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//身份证
Constant.ID_NUMBER = userBankcard.getIdNumber();
navInfoEditor.putString("bankName", userBankcard.getBankName());//銀行姓名
Constant.BACKGROUND_NAME = userBankcard.getBankName();

View File

@ -99,7 +99,6 @@ public class MainActivity extends BaseActivity {
}
private void initPermission() {
XXPermissions.with(this)
// 申请安装包权限
@ -135,7 +134,7 @@ public class MainActivity extends BaseActivity {
Constant.initRootFolder(Constant.USHERED);
HttpInterface.initHttpInter(Constant.USHERED);
initCheckVersion();
}else {
} else {
initTime();
}
//initTime();
@ -143,11 +142,12 @@ public class MainActivity extends BaseActivity {
initPermission();
}
}
@Override
public void onDenied(List<String> permissions, boolean never) {
if (never) {
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
DialogSettings.cancelable=false;
DialogSettings.cancelable = false;
MessageDialog.show(MainActivity.this, "提示", permissions.toString() + " 被永久拒绝授权请手动授权,", "确定").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
@ -168,6 +168,7 @@ public class MainActivity extends BaseActivity {
httpParams.put("operationType", "android");
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.APP_CHECK_VERSION)
.params(httpParams)
@ -179,7 +180,7 @@ public class MainActivity extends BaseActivity {
dismissLoadingDialog();
if (response.getCode() == 200) {
int version = response.getBody().getVersion();
if (versionCode <version) {//TODO 改成
if (versionCode < version) {//TODO 改成
//升级
ApkVersionBean.bodyBean body = response.getBody();
showUpdateDialog(body);
@ -194,7 +195,7 @@ public class MainActivity extends BaseActivity {
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
Toast.makeText(MainActivity.this, e.getMessage()+"", Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this, e.getMessage() + "", Toast.LENGTH_SHORT).show();
initTime();
}
});
@ -208,7 +209,7 @@ public class MainActivity extends BaseActivity {
builder.setIcon(android.R.drawable.ic_dialog_info);
builder.setMessage("请升级APP版本至" + bodyBean.getVersion());
builder.setCancelable(false);
if (bodyBean.getUpdateState()==0){//非必须更新
if (bodyBean.getUpdateState() == 0) {//非必须更新
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@ -226,7 +227,7 @@ public class MainActivity extends BaseActivity {
initTime();
}
});
}else{//强制更新
} else {//强制更新
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@ -243,34 +244,34 @@ public class MainActivity extends BaseActivity {
}
public void initTime() {
if (Constant.USHERED!=null){
if (Constant.USHERED != null) {
HttpInterface.initAppPath(Constant.USHERED);
Constant.initRootFolder(Constant.USHERED);
HttpInterface.initHttpInter(Constant.USHERED);
if (Constant.ACCESS_TOKEN!=null){
initGetUserInfo();
}else {
if (Constant.ACCESS_TOKEN != null) {
if (Constant.REFRESH_TOKEN != null) {
initLogIn();
} else {
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
} else {
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}else {
} else {
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
/*
new CountDownTimer(3000, 1000) {
@Override
public void onTick(long l) {}
@Override
public void onFinish() {
}
}.start();
*/
}
private void initGetUserInfo() {
OkGoBuilder.getInstance().Builder(this)
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.USER_DETAIL_BY_USER_ID)
.token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
@ -296,9 +297,9 @@ public class MainActivity extends BaseActivity {
Constant.LEVEL = body.getLevel();
UserDetailBean.BodyBean.UserBankcardBean userBankcard = body.getUserBankcard();
if (userBankcard != null) {//存储银行卡信息
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡
Constant.BACKGROUND = userBankcard.getBankAccount();
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//银行卡账
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//身份证
Constant.ID_NUMBER = userBankcard.getIdNumber();
navInfoEditor.putString("bankName", userBankcard.getBankName());//銀行姓名
Constant.BACKGROUND_NAME = userBankcard.getBankName();
@ -326,16 +327,13 @@ public class MainActivity extends BaseActivity {
}
}
} else {
if (Constant.REFRESH_TOKEN!=null){
initLogIn();
}else {
Intent intent = new Intent(MainActivity.this, HomeActivity.class);
startActivity(intent);
finish();
}
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -349,10 +347,11 @@ public class MainActivity extends BaseActivity {
HttpParams httpParams = new HttpParams();
long time = System.currentTimeMillis();
httpParams.put("grant_type", "refresh_token");
httpParams.put("datetime", time);
httpParams.put("refresh_token", Constant.REFRESH_TOKEN);
httpParams.put("datetime", time);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.USER_LOGIN_OAUTH_TOKEN)
.cls(LoginOauthTokenBean.class)
@ -380,7 +379,6 @@ public class MainActivity extends BaseActivity {
startActivity(intent);
finish();
}
}
@Override
@ -419,7 +417,7 @@ public class MainActivity extends BaseActivity {
con.connect();
if (con.getResponseCode() == 200) {
File files = new File(Constant.NABISCO_APk);
if (!files.exists()){
if (!files.exists()) {
files.mkdir();
}
int length = con.getContentLength();// 获取文件大小
@ -428,7 +426,7 @@ public class MainActivity extends BaseActivity {
FileOutputStream fileOutputStream = null;
if (is != null) {
//对apk进行保存
File file = new File(Constant.NABISCO_APk +"DTXB.apk");
File file = new File(Constant.NABISCO_APk + "DTXB.apk");
fileOutputStream = new FileOutputStream(file);
byte[] buf = new byte[1024];
int ch;
@ -463,7 +461,5 @@ public class MainActivity extends BaseActivity {
Constant.REFRESH_TOKEN = navInfo.getString("refresh_token", null);
Constant.ACCESS_TOKEN = navInfo.getString("access_token", null);
initPermission();
}
}

View File

@ -246,7 +246,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
public void onCameraOpened(@NonNull @NotNull CameraOptions options) {
super.onCameraOpened(options);
// List<Size> sizeList = (List<Size>) options.getSupportedVideoSizes();
//
// Size size = null;
// SizeSelector maxWidthSizeSelector = SizeSelectors.maxWidth(size.getWidth());
// SizeSelector maxHeightSizeSelector = SizeSelectors.maxHeight(size.getHeight());

View File

@ -42,6 +42,7 @@ import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.MyTecentLocationSource;
import com.navinfo.outdoor.util.SystemTTS;
import com.navinfo.outdoor.util.ToastUtil;
import com.otaliastudios.cameraview.CameraListener;
import com.otaliastudios.cameraview.CameraLogger;
import com.otaliastudios.cameraview.CameraView;
@ -64,6 +65,7 @@ import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
import com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle;
import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
import com.umeng.umcrash.UMCrash;
import com.vividsolutions.jts.geom.Geometry;
import com.wanghong.webpnative.WebPNative;
@ -88,28 +90,26 @@ import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_
public class PicturesActivity extends BaseActivity implements View.OnClickListener {
private static final CameraLogger LOG = CameraLogger.create("Picture");
private CameraView camera;
private Button btnSwitch;
private TencentMap tencentMap;
private TextureMapView ivMap;
private List<Removable> removables;
private PoiEntity poiEntity;
private Polyline polyline;
private String finalVideoPath; // 摄像后最终保存的文件名
private ViewGroup layerChange; // 切换地图和相机的父控件
private CheckBox capturePicture, cbMapType; //拍照
private boolean isMapSlide=false;
private boolean isMapSlide = false;
private boolean isOration = false;
private SimpleDateFormat formatter;
private File paperFile,logFile;
private File paperFile, logFile;
private int poi_video_type;
private ImageView ivZoomAdd, ivZoomDel, ivLocation,ivPicImage, ivPicVideoImage;
private ImageView ivZoomAdd, ivZoomDel, ivLocation, ivPicImage, ivPicVideoImage, imageView;
private TencentLocation oldCurrentLocation = null;
private Timer timer;
private TimerTask timerTask;
private int videoIndex = -1;
private int oration = 0;
private SystemTTS systemTTS;
private boolean isBack = false;
private boolean isBack = true;
private StringBuilder picturesBuilder;
private Handler handler = new Handler(new Handler.Callback() {
@Override
@ -117,8 +117,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
if (msg.what == 0x101) {
camera.takePicture();
} else if (msg.what == 0x102) {
if (btnSwitch != null) {
btnSwitch.setEnabled(true);
if (imageView != null) {
imageView.setEnabled(true);
}
} else if (msg.what == 0x103) {
if (poi_video_type != 2) {
@ -130,6 +130,13 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
return false;
}
});
private LatLng startLatLine;
private LatLng endLatLine;
private TextView tvTitle;
private String geoWkt;
private String detail;
private String type;
@Override
protected int getLayout() {
@ -144,10 +151,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
removables = new ArrayList<>();//存储轨迹的marker
layerChange = findViewById(R.id.layer_change);
if (getIntent() != null) {
poiEntity = (PoiEntity) getIntent().getSerializableExtra("poiEntity");
poi_video_type = getIntent().getIntExtra(Constant.INTENT_POI_VIDEO_TYPE, -1);
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_JPG_PATH);
type = getIntent().getStringExtra(Constant.INTENT_TYPE);
geoWkt = getIntent().getStringExtra(Constant.INTENT_GEO_WKT);
detail = getIntent().getStringExtra(Constant.INTENT_DETAIL);
if (finalVideoPath != null) {
File file = new File(finalVideoPath);
paperFile = new File(Objects.requireNonNull(file.getParentFile()).getAbsoluteFile() + "/" + "paper.txt");
@ -167,7 +176,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
ivPicImage.setVisibility(View.VISIBLE);
ivPicVideoImage.setVisibility(View.GONE);
}
btnSwitch = findViewById(R.id.btn_switch);
Button btnSwitch = findViewById(R.id.btn_switch);
btnSwitch.setOnClickListener(this);
//相机记录器
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
@ -179,7 +188,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
ivLocation.setOnClickListener(this);
camera = findViewById(R.id.camera);
camera.setOnClickListener(this);
ImageView imageView = findViewById(R.id.image_view);
imageView = findViewById(R.id.image_view);
tvTitle = findViewById(R.id.tv_title);
imageView.setOnClickListener(this);
capturePicture = findViewById(R.id.capture_picture);
if (poi_video_type == 2) {
@ -196,7 +206,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
isOration = true;
capturePicture.setText("暂停采集");
picturesBuilder.append("capturePicture 点击了开始采集 ,");
}else {
} else {
picturesBuilder.append("capturePicture 点击了拍摄 ,");
}
startTimer();
@ -222,64 +232,53 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势.
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
initLine();
if (poiEntity!=null){
if (poiEntity.getId() != null) {
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
if (fileListByUUID != null) {
List<LatLng> lineStringByFileList = AWMp4ParserHelper.getInstance().getLinePhotoByList(fileListByUUID);
for (int i = 0; i < lineStringByFileList.size(); i++) {
LatLng latLng = lineStringByFileList.get(i);
if (latLng != null) {
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_baseline);
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
removables.add(marker);
}
}
}
}
}
camera.addCameraListener(new CameraListener() {
@Override
public void onPictureTaken(@NonNull PictureResult result) {
super.onPictureTaken(result);
if (oration == 0) { // oblation为0时拍摄视频必须为横屏
// 如果当前手机是竖向则不
if (isOration) {
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
picturesBuilder.append("camera 用户竖屏拍照 ,");
stopTimer();
capturePicture.setChecked(false);
if (poi_video_type != 2) {
capturePicture.setText("开始采集");
if (result != null && result.getData() != null && result.getData().length > 0) {
super.onPictureTaken(result);
isBack = true;
if (oration == 0) { // oblation为0时拍摄视频必须为横屏
// 如果当前手机是竖向则不
if (isOration) {
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
picturesBuilder.append("camera 用户竖屏拍照 ,");
stopTimer();
capturePicture.setChecked(false);
if (poi_video_type != 2) {
capturePicture.setText("开始采集");
capturePicture.setChecked(false);
}
return;
} else {
isOration = false;
}
return;
} else {
isOration = false;
}
}
}
File file = new File(finalVideoPath);
initMarkerPaper();
result.toFile(file, new FileCallback() {
@Override
public void onFileReady(@Nullable File file) {
if (file.exists()) {
initMarker();
videoIndex = Integer.parseInt(file.getName().replace(".jpg", ""));
finalVideoPath = Objects.requireNonNull(file.getParentFile()).getAbsolutePath() + "/" + (videoIndex + 1) + ".jpg";
Toast.makeText(PicturesActivity.this, "保存成功:" + (videoIndex + 1), Toast.LENGTH_SHORT).show();
}
if (poi_video_type == 2) {
Message message = new Message();
message.what = 0x103;
handler.sendMessage(message);
}
File file = new File(finalVideoPath);
initMarkerPaper();
result.toFile(file, new FileCallback() {
@Override
public void onFileReady(@Nullable File file) {
if (file.exists()) {
initMarker();
videoIndex = Integer.parseInt(file.getName().replace(".jpg", ""));
finalVideoPath = Objects.requireNonNull(file.getParentFile()).getAbsolutePath() + "/" + (videoIndex + 1) + ".jpg";
runOnUiThread(new Runnable() {
@SuppressLint("SetTextI18n")
@Override
public void run() {
//Toast.makeText(PicturesActivity.this, "保存成功:" + (videoIndex + 1), Toast.LENGTH_SHORT).show();
tvTitle.setText("保存成功:" + (videoIndex + 1));
}
});
}
if (poi_video_type == 2) {
Message message = new Message();
message.what = 0x103;
handler.sendMessage(message);
}
/* if (file.exists()) {
WebPNative webPNative = new WebPNative();
new Thread(new Runnable() {
@ -316,8 +315,11 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
} else {
Toast.makeText(PicturesActivity.this, "源文件不存在", Toast.LENGTH_SHORT).show();
}*/
}
});
}
});
} else {
isBack = false;
}
}
});
DisplayMetrics dm = new DisplayMetrics();
@ -334,33 +336,53 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
}
private void initLine() {
if (poiEntity!=null){
String geoWkt = poiEntity.getGeoWkt();
if (geoWkt != null) {
String geo = Geohash.getInstance().decode(geoWkt);
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("LineString")) {//线
BitmapDescriptor bitmapLine = null;
if (poiEntity.getType() == 3) {//poi录像
if (geoWkt != null) {
String geo = Geohash.getInstance().decode(geoWkt);
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("LineString")) {//线
BitmapDescriptor bitmapLine = null;
if (type != null) {
if (type.equals("3")) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
} else if (poiEntity.getType() == 4) {//道路录像
} else if (type.equals("4")) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
}
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
// 构造 PolylineOnions
PolylineOptions polylineOptions = new PolylineOptions().addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
// 折线的颜色为绿色
.color(Color.parseColor("#0096FF"))
// 折线宽度为5像素
.width(20)
.arrow(true)
.arrowSpacing(150)
.arrowTexture(bitmapLine);
// 绘制折线
polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(2);
}
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)
// 折线设置圆形线头
.lineCap(true)
// 折线的颜色为绿色
.color(Color.parseColor("#0096FF"))
// 折线宽度为5像素
.width(20)
.arrow(true)
.arrowSpacing(150)
.arrowTexture(bitmapLine);
// 绘制折线
polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(2);
}
}
if (detail != null) {
String geo = Geohash.getInstance().decode(detail);
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("LineString")) {//线
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
assert latLineString != null;
for (int i = 0; i < latLineString.size(); i++) {
LatLng latLng = latLineString.get(i);
if (latLng != null) {
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_baseline);
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
removables.add(marker);
}
}
}
}
@ -375,20 +397,20 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
String pictures_time = sharedPreferences.getString("pictures_time", null);
if (pictures_time==null){
sharedEdit.putString("pictures_time",newFormat);
if (pictures_time == null) {
sharedEdit.putString("pictures_time", newFormat);
sharedEdit.apply();
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
}else {
if (pictures_time.equals(newFormat)){
} else {
if (pictures_time.equals(newFormat)) {
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
}else {
} else {
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
}
}
picturesBuilder = new StringBuilder();
picturesBuilder.append("PicturesActivity-onCreate-initData ,");
if (Constant.USHERED!=null){
if (Constant.USHERED != null) {
picturesBuilder.append("userId:").append(Constant.USHERED).append(",");
}
camera.setMode(Mode.PICTURE);
@ -411,8 +433,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
break;
case R.id.image_view:
picturesBuilder.append("onClick 点击了切换的窗口 ,");
v.setEnabled(false);
benSwitch();
break;
handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息
break;
case R.id.btn_switch:
picturesBuilder.append("onClick 点击了切换按钮 ,");
v.setEnabled(false);
@ -602,7 +626,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
TencentLocation tencentLocation = (TencentLocation) msg.obj;
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
new LatLng(tencentLocation.getLatitude(), tencentLocation.getLongitude()), //中心点坐标地图目标经纬度
tencentMap.getCameraPosition().zoom, //目标缩放级别
20, //目标缩放级别
0, //目标倾斜角
tencentLocation.getBearing())); //目标旋转角 0~360° (正北方为0)
tencentMap.animateCamera(cameraSigma);
@ -612,23 +636,35 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
@SuppressLint("SetTextI18n")
public void initMarkerPaper() {
// 记录当前时间视频时间以及当前经纬度信息
StringBuilder sb = new StringBuilder();
sb.append(formatter.format(new Date())); // 记录当前时
sb.append(",");
sb.append(videoIndex == -1 ? 0 : (videoIndex + 1));//個數
sb.append(",");
sb.append(Constant.currentLocation.getLatitude());
sb.append(",");
sb.append(Constant.currentLocation.getLongitude());
sb.append(",");
if (Constant.currentLocation.getBearing() != 0) {
sb.append(Constant.currentLocation.getBearing());
} else {
sb.append(Constant.currentLocation.getDirection());
try {
// 记录当前时间视频时间以及当前经纬度信息
StringBuilder sb = new StringBuilder();
sb.append(formatter.format(new Date())); // 记录当前时
sb.append(",");
sb.append(videoIndex == -1 ? 0 : (videoIndex + 1));//個數
sb.append(",");
sb.append(Constant.currentLocation.getLatitude());
sb.append(",");
sb.append(Constant.currentLocation.getLongitude());
sb.append(",");
if (Constant.currentLocation.getBearing() != 0) {
sb.append(Constant.currentLocation.getBearing());
} else {
sb.append(Constant.currentLocation.getDirection());
}
sb.append("\r\n");
if (isBack) {
FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true);
}
} catch (Exception e) {
UMCrash.generateCustomLog(e, "自定义");
handler.postDelayed(new Runnable() {
@Override
public void run() {
initMarkerPaper();
}
}, 100);
}
sb.append("\r\n");
FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true);
/* float speed = Constant.currentLocation.getSpeed();///
if (speed != 0) {
float a = (speed * 3600 / 1000);//km/h
@ -660,26 +696,50 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
}
oldCurrentLocation = Constant.currentLocation;
}*/
//快到终点的语音播报
/*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){
systemTTS.playText("即将到达任务终点");
}
}else {
if (endDistance==50){
systemTTS.playText("即将到达任务终点");
}
}
}
}*/
}
@Override
public void onBackPressed() {
if (!isBack) {
if (isOration) {
stopTimer();
}
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show(this, "提示", "当前路段已拍摄的自动保存,可以在选择继续拍摄", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
isBack = true;
finish();
return false;
}
});
} else {
this.finish();
if (isOration) {
stopTimer();
}
String tvIndex = tvTitle.getText().toString();
String message = null;
if (tvIndex.equals("")) {
message = "您还没有对当前路段进行拍摄作业,是否退出";
} else {
message = "当前作业路段已拍摄的自动保存,是否退出";
}
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show(this, "提示", message, "", "").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
picturesBuilder.append("onClick 点击了结束采集 ,");
Intent intent = new Intent();
finalVideoPath = Objects.requireNonNull(paperFile.getParentFile()).getAbsolutePath() + "/" + videoIndex + ".jpg";
intent.putExtra(Constant.INTENT_PICTURES_PATH, finalVideoPath);
setResult(0x111, intent);
finish();
return false;
}
});
}
public void initMarker() {

View File

@ -124,6 +124,7 @@ public class TestActivity extends BaseActivity {
httpParams.put("type", task_type);
httpParams.put("isExclusive", limit_type);
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.TASK_LIST)
.cls(JobSearchBean.class)

View File

@ -241,6 +241,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
}
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(HttpInterface.USER_UPDATE)
.cls(UserBean.class)
@ -304,9 +305,10 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
&& options3Items.get(options1).get(options2).size() > 0 ?
options3Items.get(options1).get(options2).get(options3) : "";
region_id = cityItems.get(options1).get(options2).get(options3).getRegion_id();
Toast.makeText(UserActivity.this, region_id, Toast.LENGTH_SHORT).show();
Log.d("TAG", "onOptionsSelect: "+region_id);
region_text = opt1tx + " " + opt2tx + " " + opt3tx;
region.setText(region_text);
Log.d("TAG", "onOptionsSelect: "+region_text);
}
}).setSubmitText("确定")//确定按钮文字
.setCancelText("取消")//取消按钮文字

View File

@ -63,6 +63,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
}
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(this)
.url(url)
.cls(RichTextBean.class)

View File

@ -56,7 +56,6 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
final boolean single = measureList.get(position).isSingle();//是否多选
// holder.tvMeasure.setText((position + 1)+"" + measureList.get(position).getQuestion());
if (single) {
holder.tvMeasure.setText((position + 1)+"" + measureList.get(position).getQuestion()+"(单选)");
RadioGroup radioGroup = new RadioGroup(context);

View File

@ -33,7 +33,6 @@ public class TaskExplainAdapter extends RecyclerView.Adapter<TaskExplainAdapter.
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
final View inflate = LayoutInflater.from(context).inflate(R.layout.tas_explain_item, parent, false);
return new ViewHolder(inflate);
}
@ -49,7 +48,6 @@ public class TaskExplainAdapter extends RecyclerView.Adapter<TaskExplainAdapter.
}
}
});
}
@Override

View File

@ -38,6 +38,7 @@ public class Constant {
//下载文件
public static final String NABISCO_APk = ROOT_FOLDER + "/apk";
public static int TelLength = 0;
public static void initRootFolder(String userId) {
BASE_FOLDER = ROOT_FOLDER + "/" + userId;
PICTURE_FOLDER = BASE_FOLDER + "/picture";
@ -57,6 +58,7 @@ public class Constant {
SdkFolderCreate.mkdirs(logFolder.getAbsolutePath());
}
}
// 申请权限的RequestCode
public static final int PERMISSION_REQUEST_CODE = 0x100;
public static final int ROAD_PICTURE = 101;
@ -78,8 +80,8 @@ public class Constant {
public static int AUDIOTAPES = -1;//身份证审核状态 //0不通過1通過-1待审核
public static String ID_NUM = null;//身份证号
public static String NAME = null;//身份证姓名
public static String ID_NUMBER = null;//银行卡
public static String BACKGROUND = null;//银行卡编码
public static String ID_NUMBER = null;//身份证
public static String BACKGROUND = null;//银行卡
public static String BACKGROUND_NAME = null;//银行卡名称
public static int SEX = -1;//性别
public static String QQ = null;
@ -153,32 +155,41 @@ 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.02";//版本日期
public static final String NAVIN_FO = "11.08";//版本日期
//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);
public static final BitmapDescriptor MARKER_CHARGE_PILE_SHOW=BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
public static final BitmapDescriptor MARKER_CHARGE_PILE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
public static final BitmapDescriptor MARKER_POI_VIDEO_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
public static final BitmapDescriptor MARKER_ROOD_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_show);
public static final BitmapDescriptor MARKER_OTHER_SHOW= BitmapDescriptorFactory.fromResource(R.drawable.marker_other_show);
public static final BitmapDescriptor MARKER_FACET_SHOW= BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_show);
public static final BitmapDescriptor MARKER_OTHER_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_show);
public static final BitmapDescriptor MARKER_FACET_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_show);
public static final BitmapDescriptor MARKER_POI = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
public static final BitmapDescriptor MARKER_CHARGE_PILE=BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile);
public static final BitmapDescriptor MARKER_CHARGE_PILE = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile);
public static final BitmapDescriptor MARKER_POI_VIDEO = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
public static final BitmapDescriptor MARKER_ROOD = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
public static final BitmapDescriptor MARKER_OTHER= BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
public static final BitmapDescriptor MARKER_FACET= BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
public static final BitmapDescriptor MARKER_OTHER = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
public static final BitmapDescriptor MARKER_FACET = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
public static final BitmapDescriptor GRAY_POI = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
public static final BitmapDescriptor GRAY_CHARGE = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
public static final BitmapDescriptor GRAY_CHARGE_PILE=BitmapDescriptorFactory.fromResource(R.drawable.graychargepile);
public static final BitmapDescriptor GRAY_CHARGE_PILE = BitmapDescriptorFactory.fromResource(R.drawable.graychargepile);
public static final BitmapDescriptor GRAY_POI_VIDEO = BitmapDescriptorFactory.fromResource(R.drawable.graypoivideo);
public static final BitmapDescriptor GRAY_ROOD = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
public static final BitmapDescriptor GRAY_OTHER= BitmapDescriptorFactory.fromResource(R.drawable.grayother);
public static final BitmapDescriptor GRAY_FACET= BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
public static final BitmapDescriptor ICON_OPERATION=BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
public static final BitmapDescriptor GRAY_OTHER = BitmapDescriptorFactory.fromResource(R.drawable.grayother);
public static final BitmapDescriptor GRAY_FACET = BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
public static final BitmapDescriptor ICON_OPERATION = BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
/*
*联系我们的QQ群名称和QQ群号
*/

View File

@ -14,6 +14,7 @@ import com.navinfo.outdoor.util.SystemTTS;
import com.navinfo.outdoor.util.TalentLocationUtils;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.umcrash.UMCrash;
import com.umeng.umcrash.UMCrashCallback;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
@ -35,8 +36,15 @@ public class UserApplication extends Application {
*参数: boolean 默认为false如需查看LOG设置为true
*/
UMConfigure.setLogEnabled(true);
String e ="测试自定义异常代码是否运行!!!!!!";
UMCrash.generateCustomLog(e,"UmengException");
// String e ="测试自定义异常代码是否运行!!!!!!";
// UMCrash.generateCustomLog(e,"UmengException");
UMCrash.registerUMCrashCallback(new UMCrashCallback(){
@Override
public String onCallback(){
return"注册友盟异常查看功能";
}
});
initOkGo();
TalentLocationUtils.getInstance(this).startLocation(this);
}

View File

@ -72,8 +72,7 @@ public abstract class BaseDrawerFragment extends BaseFragment {
@Override
public boolean onBackPressed() {
getActivity().getSupportFragmentManager().popBackStack();
return true;
return false;
}

View File

@ -28,6 +28,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.umeng.umcrash.UMCrash;
import org.json.JSONObject;
@ -127,7 +128,6 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
if (Constant.USHERED != null) {
capacityEvaluationBuilder.append("userId:").append(Constant.USHERED).append(",");
}
}
private void initNewWork(boolean aNet) {
@ -135,8 +135,9 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
HttpParams httpParams = new HttpParams();
httpParams.put("fid", 4);
httpParams.put("pageNum", capacityPage);
httpParams.put("pageSize", 10);
httpParams.put("pageSize", 20);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class)
@ -148,6 +149,8 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
dismissLoadingDialog();
if (response.getCode() == 200){
initTaskPrefectureBean(response,aNet);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -165,6 +168,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
}
});
}
private void initTaskPrefectureBean(TaskPrefectureBean taskPrefectureBean, boolean aBoolean) {
if (taskPrefectureBean.getCode() == 200) {
if (aBoolean) {
@ -194,6 +198,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
Log.d("TAG", "" + taskPrefectureBean.getMessage());
}
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.iv_evaluation_task_finish) {

View File

@ -20,6 +20,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.util.FlushTokenUtil;
import org.json.JSONObject;
@ -88,6 +89,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
private void initNetWorks(boolean aBoolean) {
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)
.token(Constant.ACCESS_TOKEN)
@ -99,6 +101,8 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
dismissLoadingDialog();
if (response.getCode() == 200){
capacityItemAdapter.setCapItemList(response.getBody().getList());
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
}

View File

@ -8,6 +8,7 @@ import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
@ -61,6 +62,8 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
private Gson gson;
private File logFile;
private StringBuilder capacityMeasureBuilder;
private Button btnSubmit;
private TextView tvCapacity;
public static CapacityMeasurementFragment newInstance(Bundle bundle) {
@ -78,13 +81,14 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
protected void initView() {
super.initView();
ImageView ivMeasurementFinish = findViewById(R.id.iv_measurement_finish);
RecyclerView capacityMeasurementRel = findViewById(R.id.capacity_measurementRel);
ivMeasurementFinish.setOnClickListener(this);
tvCapacity = findViewById(R.id.tv_capacity_measurement);
RecyclerView capacityMeasurementRel = findViewById(R.id.capacity_measurementRel);
capacityMeasurementRel.setLayoutManager(new LinearLayoutManager(getActivity()));
capacityMeasureAdapter = new CapacityMeasureAdapter(getActivity());
capacityMeasurementRel.setAdapter(capacityMeasureAdapter);
Button btn = findViewById(R.id.btn);
btn.setOnClickListener(this);
btnSubmit = findViewById(R.id.btn);
btnSubmit.setOnClickListener(this);
gson = new Gson();
}
@ -116,15 +120,19 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
if (Constant.USHERED != null) {
capacityMeasureBuilder.append("userId:").append(Constant.USHERED).append(",");
}
}
private void initNetWorks() {
showLoadingDialog();
String id = Objects.requireNonNull(getActivity()).getIntent().getStringExtra("id");
if (id==null){
return;
}
HttpParams httpParams = new HttpParams();
httpParams.put("id", id);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.EXAM_CONTENT)
.cls(MeasureBean.class)
@ -151,8 +159,14 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
}
}
if (baleen != null) {
capacityMeasureAdapter.setMeasureList(baleen);
if (baleen.size()>0){
capacityMeasureAdapter.setMeasureList(baleen);
}else {
btnSubmit.setVisibility(View.GONE);
tvCapacity.setVisibility(View.GONE);
}
}
Log.d("TAG", "onSuccess: " + response.toString());
}
@ -213,6 +227,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
examBeans.clear();
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.EXAM_SUBMIT)
.cls(ExamSubmitBean.class)

View File

@ -169,6 +169,12 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
moveLatlng(latLng, null);
}
@Override
public boolean onBackPressed() {
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
return true;
}
@Override
protected void initView() {
super.initView();
@ -234,6 +240,8 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
checkButton3.setChecked(false);
checkButton4.setChecked(false);
checkButton5.setChecked(false);
}else {
buffer1 = "";
}
}
});
@ -678,6 +686,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
if (station != null) {
PoiEntity showPoiEntity = new Gson().fromJson(station, PoiEntity.class);
pid = showPoiEntity.getId();
if (showPoiEntity.getTaskStatus()==3){
disables();
}
}
// 添加信息
chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");
@ -804,6 +815,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
setDList(dList);
setEList(eList);
}
}
}

View File

@ -48,6 +48,7 @@ import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.UploadUtils;
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
import com.navinfo.outdoor.bean.ChargingStationBean;
@ -159,19 +160,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
header.findViewById(R.id.iv_charging_station_final).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
Log.d("TAG", "onCaresses: " + isSliding);
}
if (isSliding) {
// 监听到返回按钮点击事件
Message obtain = Message.obtain();
obtain.what = Constant.TREASURE_FRAGMENT;
obtain.obj = isSliding;
EventBus.getDefault().post(obtain);
}
onBackPressed();
initBack();
}
});
header.findViewById(R.id.tv_charging_station_explain).setOnClickListener(new View.OnClickListener() {
@ -184,6 +173,89 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
});
}
@Override
public boolean onBackPressed() {
initBack();
return true;
}
private void initBack() {
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
initList();
new Thread(new Runnable() {
@Override
public void run() {
if (showPoiEntity != null) {
if (showPoiEntity.getId() != null) {
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
List<File> chargingPileFileList = new ArrayList<>();
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
for (String photoPath : chargingPileEntity.getPhotos()) {
chargingPileFileList.add(new File(photoPath));
}
}
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
for (int i = 0; i < chargingPileFileList.size(); i++) {
chargingPileFileList.get(i).delete();
}
}
}
}
}
}
}).start();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
}
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
return false;
}
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
return false;
}
});
}
@Override
public void onStart() {
super.onStart();
@ -680,6 +752,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_PHONES)
.params(new HttpParams("geo", encode))
@ -703,6 +776,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
});
}
}else if (getPhoneBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), getPhoneBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -1018,7 +1095,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
try {
HttpParams httpParams = new HttpParams();
httpParams.put("auditId", chargingPileEntity.getBodyId());
Response execute = OkGoBuilder.getInstance().url(HttpInterface.CS_TASK_UP_LOAD_PIC)
Response execute = OkGoBuilder.getInstance()
.time(0)
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
.params(httpParams)
.token(Constant.ACCESS_TOKEN)
.fileList(chargingPileFileList)
@ -1142,6 +1221,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
HttpParams httpParams = new HttpParams();
httpParams.put("auditId", poiEntity.getBodyId());
OkGoBuilder.getInstance()
.time(0)
.Builder(getActivity())
.url(HttpInterface.C_TASK_UP_LOAD_PIC)
.fileList(chargingStationList)
@ -1149,7 +1229,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
.params(httpParams)
.cls(PoiUploadBean.class)
.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity, chargingStationList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000);
}
@ -1172,6 +1252,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
httpParams.put("geo", poiEntity.getGeoWkt());
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.SUBMIT_CTASK)
.cls(ChargingStationBean.class)
@ -1205,7 +1286,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
}
});
@ -1216,6 +1297,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} else {
Toast.makeText(getActivity(), "" + chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}else if (chargingStationBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -1244,9 +1327,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
.getRequest(new Callback<TaskNameBean>() {
@Override
public void onSuccess(TaskNameBean taskNameBean, int id) {
if (getActivity() == null) {
return;
}
dismissLoadingDialog();
if (taskNameBean.getCode() == 200) {
editNameContent.setTextColor(Color.BLACK);
@ -1263,6 +1343,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} else {
Toast.makeText(getActivity(), "没有类似名称可以作业", Toast.LENGTH_SHORT).show();
}
}else if (taskNameBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
editNameContent.setTextColor(Color.RED);
btnSaveLocal.setEnabled(false);
@ -1435,52 +1517,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 | showPoiEntity.getTaskStatus() == 1) {
initList();
new Thread(new Runnable() {
@Override
public void run() {
if (showPoiEntity != null) {
if (showPoiEntity.getId() != null) {
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
List<File> chargingPileFileList = new ArrayList<>();
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
for (String photoPath : chargingPileEntity.getPhotos()) {
chargingPileFileList.add(new File(photoPath));
}
}
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
for (int i = 0; i < chargingPileFileList.size(); i++) {
chargingPileFileList.get(i).delete();
}
}
}
}
}
}
}).start();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}
}
}
private void initList() {
if (chargingStationList != null) {
chargingStationList.clear();
@ -1549,6 +1585,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
httpParams.put("taskIds", poiEntity.getTaskId());
httpParams.put("auditIds", "");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.params(httpParams)
@ -1587,6 +1624,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}

View File

@ -28,6 +28,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.util.FlushTokenUtil;
import org.json.JSONObject;
@ -99,6 +100,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
httpParams.put("pageNum", eventPage);
httpParams.put("pageSize", "20");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.LIST_EVENT)
.cls(TaskPrefectureBean.class)
@ -110,6 +112,8 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
dismissLoadingDialog();
if (taskPrefectureBean.getCode() == 200){
initTaskPrefectureBean(taskPrefectureBean,aNet);
}else if (taskPrefectureBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), taskPrefectureBean.getMessage()+"", Toast.LENGTH_SHORT).show();
}

View File

@ -45,6 +45,7 @@ import com.navinfo.outdoor.room.InsertAndUpdateUtils;
import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
@ -116,6 +117,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
});
}
@Override
public boolean onBackPressed() {
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
return true;
}
@Override
public void onStart() {
super.onStart();
@ -269,6 +276,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
tvType.setText("未领取");
} else if (Constant.TASK_STARTUP == 1) {
tvType.setText("已领取");
}else if (Constant.TASK_STARTUP ==2){
tvType.setText("已领取(网络)");
}
/* else if (Constant.TASK_STATUS == 2) {
tvType.setText("未保存");
@ -499,7 +508,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
break;
case R.id.cl_type://任务状态 0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
filterBuilder.append("点击了任务状态的按钮 ,");
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "未领取", "已领取"/*, "未保存", "已保存"*/}, new OnMenuItemClickListener() {
BottomMenu.show((AppCompatActivity) Objects.requireNonNull(getContext()), new String[]{"全部", "未领取", "已领取","已领取(网络)"/*, "未保存", "已保存"*/}, new OnMenuItemClickListener() {
@Override
public void onClick(String text, int index) {
tvType.setText(text);
@ -513,6 +522,9 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
case 2:
Constant.TASK_STARTUP = 1;
break;
case 3:
Constant.TASK_STARTUP = 2;
break;
/*
case 3:
Constant.TASK_STATUS = 2;
@ -540,6 +552,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
httpParams.put("taskIds", taskId);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(60)
.Builder(getActivity())
.token(Constant.ACCESS_TOKEN)
.params(httpParams)
@ -549,19 +562,26 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
@Override
public void onSuccess(FilterBatchBean response, int id) {
dismissLoadingDialog();
List<FilterBatchBean.BodyBean.SuccessBean> success = response.getBody().getSuccess();
for (int i = 0; i < success.size(); i++) {
initType(success.get(i));
if (response.getCode()==200){
List<FilterBatchBean.BodyBean.SuccessBean> success = response.getBody().getSuccess();
for (int i = 0; i < success.size(); i++) {
initType(success.get(i));
}
filterAdapter.setAddFilter(false);
filterAdapter.notifyDataSetChanged();
btnChock.clear();
checkOk.setChecked(false);
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Toast.makeText(getContext(), "领取成功", Toast.LENGTH_SHORT).show();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
}
filterAdapter.setAddFilter(false);
filterAdapter.notifyDataSetChanged();
btnChock.clear();
checkOk.setChecked(false);
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Toast.makeText(getContext(), "领取成功", Toast.LENGTH_SHORT).show();
}
@Override

View File

@ -27,7 +27,7 @@ import java.util.Objects;
* 发现的Fragment
* 2021-5-25
*/
public class FindFragment extends BaseFragment implements View.OnClickListener{
public class FindFragment extends BaseFragment implements View.OnClickListener {
private File logFile;
private StringBuilder findBuilder;
@ -103,13 +103,13 @@ public class FindFragment extends BaseFragment implements View.OnClickListener{
case R.id.linear_event_prefecture:
findBuilder.append("点击了最新公告:活动专区 跳转 ,");
Intent eventIntent = new Intent(getActivity(), FragmentManagement.class);
eventIntent.putExtra("tag",9);
eventIntent.putExtra("tag", 9);
startActivity(eventIntent);
break;
case R.id.linear_end:
findBuilder.append("点击了帮助中心:能力测评 ,");
Toast.makeText(getContext(), "该功能以后上新,敬请期待", Toast.LENGTH_SHORT).show();
/* Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
/*Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
endIntent.putExtra("tag", 11);
startActivity(endIntent);*/
break;

View File

@ -169,6 +169,7 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
httpParams.put("datetime", time);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.USER_FORGET_PASSWORD)
.token(null)
@ -238,6 +239,7 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
httpParams.put("type", 2);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.USER_MESSAGE)
.cls(MessageCodeBean.class)

View File

@ -37,6 +37,7 @@ import com.navinfo.outdoor.room.InsertAndUpdateUtils;
import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
@ -110,7 +111,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
getView().setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
assert getArguments() != null;
boolean aBoolean = getArguments().getBoolean("boolean", false);
@ -358,6 +358,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
private void chargingTaskByWork(String url, PoiEntity poiEntity, boolean isSaver, int statusId) {
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url + "/" + poiEntity.getTaskId())
.cls(ReceivedBean.class)
@ -471,6 +472,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}).start();
}
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), response.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -495,6 +498,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url + "/" + poiEntity.getTaskId())
.cls(PolygonTaskBean.class)
@ -555,6 +559,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -583,6 +589,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
httpParams.put("taskIds", poiEntity.getTaskId());
httpParams.put("auditIds", "");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.params(httpParams)
@ -615,12 +622,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -629,7 +636,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
});
}
/**
/*
* @param url 面妆任务立即采集
*/
private void initCompleteTask(String url, PoiEntity poiEntity) {
@ -641,6 +648,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
HttpParams httpParams = new HttpParams();
httpParams.put("id", poiEntity.getTaskId());
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.cls(UnPolygonTaskBean.class)
@ -674,11 +682,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -700,6 +709,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
httpParams.put("id",poiEntity.getTaskId());
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.params(httpParams)
@ -716,11 +726,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
poiDao.deletePoiEntity(poiEntity);
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -740,6 +751,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url + "/" + poiEntity.getTaskId())
.cls(ReceivedPoiBean.class)
@ -837,11 +849,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
});
}
}
}
}).start();
}
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -871,6 +884,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
private void taskByNet(String url, PoiEntity poiEntity, boolean isSaver, int statusId) {
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url + "/" + poiEntity.getTaskId())
.cls(TaskByNetBean.class)
@ -964,6 +978,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}).start();
}
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}

View File

@ -44,6 +44,7 @@ import com.navinfo.outdoor.bean.BankPhoneBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.GetJsonDataUtil;
import com.navinfo.outdoor.util.PhotoUtils;
import org.json.JSONArray;
@ -62,7 +63,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
private EditText etBankNum;
private ImageView gatheringCamera;
private ArrayList<BankPathBean> jsonBean;
private String value;
private SharedPreferences.Editor navInfoEditor;
private File logFile;
private StringBuilder gatheringBuilder;
@ -99,8 +99,8 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
if (Constant.NAME != null) {
tvName.setText(Constant.NAME);
}
if (Constant.ID_NUMBER != null && Constant.BACKGROUND != null) {
etBankNum.setText(Constant.ID_NUMBER);
if (Constant.BACKGROUND != null) {
etBankNum.setText(Constant.BACKGROUND);
if (Constant.BACKGROUND_NAME==null){
String bank = navInfo.getString("bankName", null);
if (bank!=null&&!bank.equals("")){
@ -109,7 +109,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
}else {
tvBank.setText(Constant.BACKGROUND_NAME);
}
value = Constant.BACKGROUND;
btnBank.setText("重新绑定");
}
}
@ -171,7 +171,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
@Override
public void onClick(BankPathBean bankPathBean) {
tvBank.setText(bankPathBean.getLabel());
value = bankPathBean.getValue();
dialog.dismiss();
}
});
@ -239,6 +238,9 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
}
private void gatheringNetWork() {
if (Constant.USHERED==null){
return;
}
ArrayList<File> gatheringList = new ArrayList<>();
if (gatheringCamera.getTag() == null) {
if (Constant.ID_NUMBER == null) {
@ -257,17 +259,14 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
return;
}
}
if (value == null) {
Toast.makeText(getActivity(), "请选择所属银行", Toast.LENGTH_SHORT).show();
return;
}
String bank = tvBank.getText().toString().trim();
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("userid", Constant.USHERED);
httpParams.put("bankAccount", value);//银行id
httpParams.put("idNumber", etBankAccount);//银行卡号
httpParams.put("bankAccount",etBankAccount);//银行卡号
httpParams.put("bankName", bank);//银行id
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.USER_BANKCARD_UP_DATA)
.cls(BankPhoneBean.class)
@ -285,17 +284,17 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
gatheringBuilder.append("绑定成功 ,");
Constant.BACKGROUND = value;
Constant.BACKGROUND_NAME = bank;
Constant.ID_NUMBER = etBankAccount;
navInfoEditor.putString("bankAccount", value);
navInfoEditor.putString("idNumber", etBankAccount);
Constant.BACKGROUND = etBankAccount;
navInfoEditor.putString("bankAccount", etBankAccount);
navInfoEditor.putString("bankName",bank);
navInfoEditor.commit();
getActivity().finish();
return false;
}
});
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "绑定失败!", Toast.LENGTH_SHORT).show();
}
@ -327,16 +326,19 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
if (bankCardBean == null) {
Toast.makeText(getContext(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
} else {
if (bankCardBean.getResult() != null && bankCardBean.getResult().getBank_card_number() != null) {
String bankCardNumber = bankCardBean.getResult().getBank_card_number().trim();
String bank_card_number = bankCardNumber.replace(" ", "");
if (StringUtils.isEmpty(bank_card_number)) {
if (bankCardBean.getResult()!=null){
if (bankCardBean.getResult().getBank_card_number()!=null){
String bankCardNumber = bankCardBean.getResult().getBank_card_number().trim();
String bank_card_number = bankCardNumber.replace(" ", "");
if (StringUtils.isEmpty(bank_card_number)) {
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
return;
}
etBankNum.setText(bank_card_number);
}else {
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
return;
}
etBankNum.setText(bank_card_number);
// String bankName = bankCardBean.getResult().getBank_name();
} else {
}else {
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
}
}

View File

@ -5,15 +5,23 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.github.lazylibrary.util.FileUtils;
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
import com.kongzue.dialog.util.BaseDialog;
import com.kongzue.dialog.util.DialogSettings;
import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
@ -23,6 +31,9 @@ import com.navinfo.outdoor.bean.HasSubmitBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.ToastUtil;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -116,6 +127,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
public void initRequest() {
if (Constant.USHERED!=null){
HttpInterface.initHttpInter(Constant.USHERED);
if (HttpInterface.GET_COMMIT_LIST!=null){
initPoiSubMitWork();//poi
initCaningSubMitWork();//充电站
@ -124,7 +136,6 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
initOtherSubMitWork();//其他
}
}
}
private void initOtherSubMitWork() {
@ -133,6 +144,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
httpParams.put("pageSize", 10);
httpParams.put("pageNum", 1);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)
.cls(HasSubmitBean.class)
@ -158,6 +170,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
}
}
}else if (hasSubmitBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -175,6 +191,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
httpParams.put("pageSize", 10);
httpParams.put("pageNum", 1);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)
.cls(HasSubmitBean.class)
@ -199,6 +216,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
});
}
}
}else if (hasSubmitBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -216,6 +237,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
httpParams.put("pageSize", 10);
httpParams.put("pageNum", 1);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)
.cls(HasSubmitBean.class)
@ -239,8 +261,11 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
}
});
}
}
}else if (hasSubmitBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -257,6 +282,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
httpParams.put("pageSize", 10);
httpParams.put("pageNum", 1);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)
.cls(HasSubmitBean.class)
@ -280,14 +306,17 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
}
});
}
}
}else if (hasSubmitBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
ToastUtil.show(getContext(),"请求失败",1000);
}
});
}
@ -297,7 +326,9 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
httpParams.put("type", 1);
httpParams.put("pageSize", 10);
httpParams.put("pageNum", 1);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)
.cls(HasSubmitBean.class)
@ -323,6 +354,10 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
}
}
}else if (hasSubmitBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}

View File

@ -26,6 +26,7 @@ import com.navinfo.outdoor.bean.TaskPrefectureBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.umeng.umcrash.UMCrash;
import org.json.JSONObject;
@ -67,6 +68,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
httpParams.put("pageNum", issuePage);
httpParams.put("pageSize", 10);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class)
@ -79,6 +81,8 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
if (response.getCode() == 200){
issueProblemAdapter.setExplainList(response.getBody().getList());
issuePage++;
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
}

View File

@ -28,6 +28,7 @@ import com.navinfo.outdoor.bean.TaskPrefectureBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import java.io.File;
import java.text.DateFormat;
@ -97,6 +98,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListen
httpParams.put("pageNum", messagePage);
httpParams.put("pageSize", 10);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class)
@ -109,6 +111,8 @@ public class MessageFragment extends BaseFragment implements View.OnClickListen
if (taskPrefectureBean.getCode() == 200){
messageAdapter.setMessageList(taskPrefectureBean.getBody().getList());
messagePage++;
}else if (taskPrefectureBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), taskPrefectureBean.getMessage()+"", Toast.LENGTH_SHORT).show();
}

View File

@ -30,6 +30,7 @@ import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.DoubleUtil;
import com.navinfo.outdoor.util.FlushTokenUtil;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -47,7 +48,6 @@ import java.util.Objects;
* 2021-5-25
*/
public class MineFragment extends BaseFragment implements View.OnClickListener {
private TextView tvMoney;
private File logFile;
private StringBuilder mainBuilder;
@ -104,11 +104,12 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
rlAbout.setOnClickListener(this);
Button btnQuit = findViewById(R.id.btn_quit);
btnQuit.setOnClickListener(this);
TextView mainGrade = (TextView) findViewById(R.id.main_grade);
TextView mainGrade = findViewById(R.id.main_grade);
if (Constant.LEVEL != 0) {
mainGrade.setText("LV." + Constant.LEVEL);
}
if (Constant.USHERED != null) {
HttpInterface.initHttpInter(Constant.USHERED);
if (HttpInterface.GET_PRICE!=null){
initNetWork();
}
@ -119,8 +120,11 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
public void onEvent(Message data) {
if (data.what == Constant.HOME_MINE) {
if ((boolean) data.obj) {
if (HttpInterface.GET_PRICE!=null){
initNetWork();
if (Constant.USHERED!=null){
HttpInterface.initHttpInter(Constant.USHERED);
if (HttpInterface.GET_PRICE!=null){
initNetWork();
}
}
}
}
@ -129,6 +133,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
private void initNetWork() {
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_PRICE)
.cls(GetPriceBean.class)
@ -152,6 +157,10 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
});
}
}
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
}
Log.d("TAG", "onSuccess: " + response.toString());
}
@ -271,10 +280,8 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
mainBuilder.append("onDestroy ");
mainBuilder.append("onDestroy");
mainBuilder.append("\r\n");
FileUtils.writeFile(logFile.getAbsolutePath(), mainBuilder.toString(), true);
}
}

View File

@ -43,6 +43,7 @@ import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.UploadUtils;
import com.navinfo.outdoor.bean.Info;
import com.navinfo.outdoor.bean.PoiSaveBean;
@ -135,19 +136,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
Log.d("TAG", "onCaresses: " + isSliding);
}
if (isSliding) {
// 监听到返回按钮点击事件
Message obtain = Message.obtain();
obtain.what = Constant.TREASURE_FRAGMENT;
obtain.obj = isSliding;
EventBus.getDefault().post(obtain);
}
onBackPressed();
initBack();
}
});
header.findViewById(R.id.tv_explain).setOnClickListener(new View.OnClickListener() {
@ -161,6 +150,64 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
moveLatlng(latLng, null);
}
@Override
public boolean onBackPressed() {
initBack();
return true;
}
private void initBack() {
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
initList();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
}
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
return false;
}
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
return false;
}
});
}
@Override
protected void initView() {
super.initView();
@ -185,7 +232,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
@ -289,7 +335,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
ivPicture.setImageDrawable(null);
if (tvPicture.getTag()!=null){
if (tvPicture.getTag() != null) {
File file = new File((String) tvPicture.getTag());
file.delete();
tvPicture.setTag(null);
@ -309,7 +355,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
ivPictures.setImageDrawable(null);
if (tvPictures.getTag()!=null){
if (tvPictures.getTag() != null) {
File file = new File((String) tvPictures.getTag());
file.delete();
tvPictures.setTag(null);
@ -353,21 +399,20 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
String pictures_time = sharedPreferences.getString("pictures_time", null);
if (pictures_time==null){
sharedEdit.putString("pictures_time",newFormat);
if (pictures_time == null) {
sharedEdit.putString("pictures_time", newFormat);
sharedEdit.apply();
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
}else {
if (pictures_time.equals(newFormat)){
} else {
if (pictures_time.equals(newFormat)) {
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
}else {
} else {
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
}
}
otherBuilder = new StringBuilder();
otherBuilder.append("OtherActivity-onCreate-initData ,");
if (Constant.USHERED!=null){
if (Constant.USHERED != null) {
otherBuilder.append("userId:").append(Constant.USHERED).append(",");
}
}
@ -546,7 +591,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
});
}
}).start();
// onBackPressed();
} else {
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
}
@ -572,6 +616,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
HttpParams httpParams = new HttpParams();
httpParams.put("auditId", body);
OkGoBuilder.getInstance()
.time(0)
.Builder(getActivity())
.url(HttpInterface.OTHER_TASK_UPLOAD_PIC)
.fileList(otherUploadList)
@ -579,7 +624,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
.params(httpParams)
.cls(PoiUploadBean.class)
.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(), showPoiEntity, otherUploadList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000);
}
@ -595,6 +640,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
httpParams.put("geo", poiEntity.getGeoWkt());
httpParams.put("memo", poiEntity.getMemo());
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.SUBMIT_OTHER_TASK)
.cls(PoiSaveBean.class)
@ -613,7 +659,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override
public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
if (getActivity()!=null){
if (getActivity() != null) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
@ -626,7 +672,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
}
});
@ -636,7 +682,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} else {
Toast.makeText(getActivity(), "" + poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} else {
} else if (poiSaveBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), "" + poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -687,7 +735,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
if (tvPicture.getTag()!=null){
if (tvPicture.getTag() != null) {
File filePicture = new File(String.valueOf(tvPicture.getTag()));
filePicture.delete();
tvPicture.setTag(null);
@ -701,7 +749,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
if (tvPictures.getTag()!=null){
if (tvPictures.getTag() != null) {
File filePictures = new File(String.valueOf(tvPictures.getTag()));
filePictures.delete();
tvPictures.setTag(null);
@ -713,26 +761,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
initList();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}
}
}
private void initList() {
if (otherUploadList != null) {
@ -785,6 +813,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
httpParams.put("taskIds", poiEntity.getTaskId());
httpParams.put("auditIds", "");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.params(httpParams)
@ -806,6 +835,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}

View File

@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
@ -11,6 +12,7 @@ import android.widget.Toast;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.adapter.PhotoAdapter;
@ -25,6 +27,9 @@ import org.greenrobot.eventbus.Subscribe;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
@ -84,23 +89,30 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
protected void initView() {
super.initView();
PoiEntity showPoiEntity = (PoiEntity) Objects.requireNonNull(getActivity()).getIntent().getSerializableExtra("showPoiEntity");
deleteFiles = new ArrayList<>();
if (showPoiEntity != null) {
String id = showPoiEntity.getId();
fileBeans = new ArrayList<>();
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(id);
if (fileListByUUID.size()>=2){
File parentFile = fileListByUUID.get(0).getParentFile();
for (int i = 0; i < fileListByUUID.size()-1; i++) {
File file = new File(parentFile+"/" + i + ".jpg");
fileBeans.add(new FileBean(file, false));
}
}
}
ImageView ivPhotoFinal = (ImageView) findViewById(R.id.iv_photo_final);
ivPhotoFinal.setOnClickListener(this);
TextView tvPhotoAlbumDelete = (TextView) findViewById(R.id.tv_photo_album_delete);
tvPhotoAlbumDelete.setOnClickListener(this);
deleteFiles = new ArrayList<>();
deleteFiles.clear();
if (showPoiEntity != null) {
String id = showPoiEntity.getId();
fileBeans = new ArrayList<>();
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(id);
Collections.sort(fileListByUUID);
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 (showPoiEntity.getTaskStatus()==3){
tvPhotoAlbumDelete.setVisibility(View.GONE);
}
}
RecyclerView photoRecycler = findViewById(R.id.photo_album_recycler);
photoRecycler.setLayoutManager(new GridLayoutManager(getContext(), 2));
photoAdapter = new PhotoAdapter(fileBeans, getContext());
@ -161,4 +173,5 @@ public class PhotoFragment extends BaseFragment implements View.OnClickListener
EventBus.getDefault().unregister(this);
super.onDestroy();
}
}

View File

@ -46,6 +46,8 @@ import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.UploadUtils;
import com.navinfo.outdoor.bean.GetPhoneBean;
import com.navinfo.outdoor.bean.Info;
@ -119,8 +121,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
private RelativeLayout relativePhone;
public static PoiFragment newInstance(Bundle bundle) {
PoiFragment fragment = new PoiFragment();
fragment.setArguments(bundle);
@ -147,19 +147,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
Log.d("TAG", "onCaresses: " + isSliding);
}
if (isSliding) {
// 监听到返回按钮点击事件
Message obtain = Message.obtain();
obtain.what = Constant.TREASURE_FRAGMENT;
obtain.obj = isSliding;
EventBus.getDefault().post(obtain);
}
onBackPressed();
initBack();
}
});
header.findViewById(R.id.tv_explain).setOnClickListener(new View.OnClickListener() {
@ -173,6 +161,64 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
moveLatlng(latLng, null);
}
@Override
public boolean onBackPressed() {
initBack();
return true;
}
private void initBack() {
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定", "取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
initList();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
}
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
return false;
}
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
return false;
}
});
}
@Override
protected void initView() {
super.initView();
@ -199,6 +245,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
checkBoxLife.setTextColor(Color.WHITE);
checkBoxLife.setChecked(true);
}
@Override
public void onCancel() {
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
@ -298,7 +345,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
ivPanorama.setImageDrawable(null);
if (tvPanorama.getTag()!=null){
if (tvPanorama.getTag() != null) {
File file = new File((String) tvPanorama.getTag());
file.delete();
tvPanorama.setTag(null);
@ -317,7 +364,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
ivName.setImageDrawable(null);
if (tvPoiNamePic.getTag()!=null){
if (tvPoiNamePic.getTag() != null) {
File file = new File((String) tvPoiNamePic.getTag());
file.delete();
tvPoiNamePic.setTag(null);
@ -336,7 +383,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
ivElse.setImageDrawable(null);
if (tvElse.getTag()!=null){
if (tvElse.getTag() != null) {
File file = new File((String) tvElse.getTag());
file.delete();
tvElse.setTag(null);
@ -355,7 +402,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
ivInternal.setImageDrawable(null);
if (tvInternal.getTag()!=null){
if (tvInternal.getTag() != null) {
File file = new File((String) tvInternal.getTag());
file.delete();
tvInternal.setTag(null);
@ -375,7 +422,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
ivCard.setImageDrawable(null);
if (tvCard.getTag()!=null){
if (tvCard.getTag() != null) {
File file = new File((String) tvCard.getTag());
file.delete();
tvCard.setTag(null);
@ -547,6 +594,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
}
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_PHONES)
.params(new HttpParams("geo", encode))
@ -570,6 +618,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
}
});
}
}else if (getPhoneBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), getPhoneBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -618,20 +670,20 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
String pictures_time = sharedPreferences.getString("pictures_time", null);
if (pictures_time==null){
sharedEdit.putString("pictures_time",newFormat);
if (pictures_time == null) {
sharedEdit.putString("pictures_time", newFormat);
sharedEdit.apply();
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
}else {
if (pictures_time.equals(newFormat)){
} else {
if (pictures_time.equals(newFormat)) {
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
}else {
} else {
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
}
}
poiBuilder = new StringBuilder();
poiBuilder.append("PoiActivity-onCreate-initData ,");
if (Constant.USHERED!=null){
if (Constant.USHERED != null) {
poiBuilder.append("userId:").append(Constant.USHERED).append(",");
}
}
@ -759,6 +811,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
httpParams.put("geo", encode);
httpParams.put("name", editNameContent.getText().toString());
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.TASK_NAME)
.cls(TaskNameBean.class)
@ -767,9 +820,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
.getRequest(new Callback<TaskNameBean>() {
@Override
public void onSuccess(TaskNameBean taskNameBean, int id) {
if (getActivity() == null) {
return;
}
dismissLoadingDialog();
if (taskNameBean.getCode() == 200) {
btnUploading.setEnabled(true);
@ -789,7 +839,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} else {
Toast.makeText(getActivity(), "没有类似名称,可以作业", Toast.LENGTH_SHORT).show();
}
} else {
} else if (taskNameBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
editNameContent.setTextColor(Color.RED);
btnUploading.setEnabled(false);
btnSaveLocal.setEnabled(false);
@ -799,9 +851,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public void onError(Throwable e, int id) {
if (getActivity() == null) {
return;
}
dismissLoadingDialog();
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
@ -863,6 +912,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
HttpParams httpParams = new HttpParams();
httpParams.put("auditId", body);
OkGoBuilder.getInstance()
.time(0)
.Builder(getActivity())
.url(HttpInterface.POI_TASK_UPLOAD_PIC)
.cls(OtherUploadPicBean.class)
@ -870,7 +920,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
.fileList(poiPicList)
.params(httpParams)
.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(), showPoiEntity, poiPicList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000);
@ -888,6 +938,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
showLoadingDialog();
setLoadingDialogText("保存中...");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.SUBMIT_POI_TASK)
.cls(PoiSaveBean.class)
@ -918,7 +969,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
}
});
@ -927,6 +978,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} else {
Toast.makeText(getActivity(), "" + poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}else if (poiSaveBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -973,7 +1026,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
if (tvPanorama.getTag()!=null){
if (tvPanorama.getTag() != null) {
File filePanorama = new File((String) tvPanorama.getTag());
filePanorama.delete();
tvPanorama.setTag(null);
@ -987,7 +1040,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
if (tvPoiNamePic.getTag()!=null){
if (tvPoiNamePic.getTag() != null) {
File fileName = new File((String) tvPoiNamePic.getTag());
fileName.delete();
tvPoiNamePic.setTag(null);
@ -1001,7 +1054,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
if (tvInternal.getTag()!=null){
if (tvInternal.getTag() != null) {
File fileInternal = new File((String) tvInternal.getTag());
fileInternal.delete();
tvInternal.setTag(null);
@ -1015,7 +1068,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
if (tvCard.getTag()!=null){
if (tvCard.getTag() != null) {
File fileCard = new File((String) tvCard.getTag());
fileCard.delete();
tvCard.setTag(null);
@ -1029,7 +1082,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
if (tvElse.getTag()!=null){
if (tvElse.getTag() != null) {
File fileElse = new File((String) tvElse.getTag());
fileElse.delete();
tvElse.setTag(null);
@ -1047,27 +1100,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
initPoiSharePre();
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 | showPoiEntity.getTaskStatus() == 1) {
initList();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}
}
}
private void initList() {
if (poiPicList != null) {
@ -1133,6 +1165,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
httpParams.put("taskIds", poiEntity.getTaskId());
httpParams.put("auditIds", "");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.params(httpParams)
@ -1154,6 +1187,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}

View File

@ -26,6 +26,7 @@ import com.navinfo.outdoor.bean.TaskPrefectureBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.umeng.commonsdk.debug.D;
import java.util.ArrayList;
@ -116,6 +117,7 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
httpParams.put("pageNum", page);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)
.cls(HasSubmitBean.class)
@ -129,6 +131,8 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
if (hasSubmitBean.getBody()!=null){
initHasSubmitBean(hasSubmitBean,aBoolean);
}
}else if (hasSubmitBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), hasSubmitBean.getMessage()+"", Toast.LENGTH_SHORT).show();
}

View File

@ -52,6 +52,7 @@ import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.UploadUtils;
@ -120,19 +121,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
Log.d("TAG", "onCaresses: " + isSliding);
}
if (isSliding) {
// 监听到返回按钮点击事件
Message obtain = Message.obtain();
obtain.what = Constant.TREASURE_FRAGMENT;
obtain.obj = isSliding;
EventBus.getDefault().post(obtain);
}
onBackPressed();
initBack();
}
});
header.findViewById(R.id.tv_explain).setOnClickListener(new View.OnClickListener() {
@ -146,6 +135,71 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
moveLatlng(latLng, null);
}
@Override
public boolean onBackPressed() {
initBack();
return true;
}
private void initBack() {
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定","取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
if (showPoiEntity.getId() != null) {
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
File filePath = AWMp4ParserHelper.getInstance().getFilePath(showPoiEntity.getId());
filePath.delete();
}
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
}
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
return false;
}
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
return false;
}
});
}
@Override
protected void initView() {
super.initView();
@ -251,17 +305,40 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
markerPoiVideo.setZIndex(4);
moveLatlng(latLng, null);
} else {
String x = showPoiEntity.getX();
String y = showPoiEntity.getY();
if (x != null && y != null) {
latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(x));
latLng.setLatitude(Double.parseDouble(y));
String detail = showPoiEntity.getDetail();
if (detail!=null){
String geo = Geohash.getInstance().decode(detail);
Geometry geometry = GeometryTools.createGeometry(geo);
switch (geometry.getGeometryType()) {
case "Point": //
latLng = GeometryTools.createLatLng(geo);
break;
case "LineString": //线
case "Polygon": //
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);
markerPoiVideo = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).anchor(0.5f, 1.0f));
markerPoiVideo.setZIndex(4);
moveLatlng(latLng, null);
}else {
String x = showPoiEntity.getX();
String y = showPoiEntity.getY();
if (x != null && y != null) {
latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(x));
latLng.setLatitude(Double.parseDouble(y));
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
markerPoiVideo = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).anchor(0.5f, 1.0f));
markerPoiVideo.setZIndex(4);
moveLatlng(latLng, null);
}
}
}
String describe = showPoiEntity.getMemo();//任务描述
if (describe != null && !describe.equals("")) {
@ -291,7 +368,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
}
private void disables() {
fmPoiVideoPic.setEnabled(false);
etRoadName.setEnabled(false);
ivPoiVideoPicture.setEnabled(false);
tvShort.setEnabled(false);
@ -364,9 +440,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
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("poiEntity", showPoiEntity);
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;
@ -382,9 +460,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
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("poiEntity", showPoiEntity);
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;
@ -501,13 +581,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
httpParams.put("datetime", time);
httpParams.put("file", fileZip);
OkGoBuilder.getInstance()
.time(0)
.Builder(getActivity())
.url(HttpInterface.POI_VIDEO_UPLOAD_PIC)
.cls(OtherUploadPicBean.class)
.params(httpParams)
.token(Constant.ACCESS_TOKEN)
.postRequest(UploadUtils.getInstance().getPoiVideoUploadCallback(getActivity(), showPoiEntity, fileZip));
Objects.requireNonNull(getActivity()).onBackPressed();//回退
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000);
}
@ -521,6 +602,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
httpParams.put("memo", poiEntity.getMemo());
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.INSIDE_API_LIST)
.cls(PoiVideoBean.class)
@ -551,26 +633,26 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
getActivity().getSupportFragmentManager().popBackStack();
}
}
});
}
}
}).start();
} else {
Toast.makeText(getActivity(), "" + poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
Toast.makeText(getContext(), "" + poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(getActivity(), "" + poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
}else if (poiVideoBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
}
});
@ -623,33 +705,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
Log.d("TAG", "initRoadSharePre: " + newPoiEntity);
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);//结束领取
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
if (showPoiEntity.getId() != null) {
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
File filePath = AWMp4ParserHelper.getInstance().getFilePath(showPoiEntity.getId());
filePath.delete();
}
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}
}
}
@Override
public void onPause() {
@ -685,6 +740,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
httpParams.put("taskIds", poiEntity.getTaskId());
httpParams.put("auditIds", "");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.params(httpParams)
@ -713,6 +769,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -776,7 +834,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmPoiVideoPic.getTag());
poiEntity.setPhoto(photoStr);
if (lineString != null) {
poiEntity.setGeoWkt(lineString);
poiEntity.setDetail(lineString);
}
}

View File

@ -157,6 +157,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
httpParams.put("type", 1);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.USER_MESSAGE)
.cls(MessageCodeBean.class)
@ -235,6 +236,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
httpParams.put("datetime", time);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.USER_REGISTER)
.token(null)

View File

@ -40,6 +40,7 @@ import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PicturesActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.UploadUtils;
import com.navinfo.outdoor.bean.OtherUploadPicBean;
import com.navinfo.outdoor.bean.RoadSaveBean;
@ -69,6 +70,7 @@ import org.greenrobot.eventbus.Subscribe;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@ -80,9 +82,8 @@ import java.util.Objects;
public class RoadFragment extends BaseDrawerFragment implements View.OnClickListener {
private TextView tvPictures;
private EditText etRoadName;
private EditText etRoadName, etDesc;
private ImageView ivRoadPicture;
private EditText etDesc;
private Button btnRoadSave;
private PoiDao poiDao;
private File fileZip;
@ -119,17 +120,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain = Message.obtain();
obtain.what = Constant.TREASURE_FRAGMENT;
obtain.obj = isSliding;
EventBus.getDefault().post(obtain);
}
onBackPressed();
initBack();
}
});
header.findViewById(R.id.tv_road_explain).setOnClickListener(new View.OnClickListener() {
@ -143,6 +134,70 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
moveLatlng(latLng, null);
}
private void initBack() {
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "当前在任务作业中,是否退出", "确定","取消").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
if (showPoiEntity.getId() != null) {
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
File filePath = AWMp4ParserHelper.getInstance().getFilePath(showPoiEntity.getId());
filePath.delete();
}
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
Bundle arguments = getArguments();
if (arguments != null) {
isSliding = arguments.getBoolean("isSliding", true);
}
if (isSliding) {
Message obtain1 = Message.obtain();
obtain1.what = Constant.TREASURE_FRAGMENT;
obtain1.obj = isSliding;
EventBus.getDefault().post(obtain1);
}
}
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();
}
return false;
}
}).setOnCancelButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
return false;
}
});
}
@Override
public boolean onBackPressed() {
initBack();
return true;
}
@Override
protected void initView() {
@ -247,17 +302,40 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
markerRoad.setZIndex(4);
moveLatlng(latLng, null);
} else {
String x = showPoiEntity.getX();
String y = showPoiEntity.getY();
if (x != null && y != null) {
latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(x));
latLng.setLatitude(Double.parseDouble(y));
String detail = showPoiEntity.getDetail();
if (detail!=null){
String geo = Geohash.getInstance().decode(detail);
Geometry geometry = GeometryTools.createGeometry(geo);
switch (geometry.getGeometryType()) {
case "Point": //
latLng = GeometryTools.createLatLng(geo);
break;
case "LineString": //线
case "Polygon": //
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);
markerRoad = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).anchor(0.5f, 1.0f));
markerRoad.setZIndex(4);
moveLatlng(latLng, null);
}else {
String x = showPoiEntity.getX();
String y = showPoiEntity.getY();
if (x != null && y != null) {
latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(x));
latLng.setLatitude(Double.parseDouble(y));
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_show);
markerRoad = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).anchor(0.5f, 1.0f));
markerRoad.setZIndex(4);
moveLatlng(latLng, null);
}
}
}
String describe = showPoiEntity.getMemo();//任务描述
if (describe != null && !describe.equals("")) {
@ -278,25 +356,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
}
fmRoadPic.setTag(fileListByUUID);
}
/* String[] photos = photoList.split(",");
List<File> videoFileList = new ArrayList<>();
boolean isImageLoad = false;
if (photos.length > 0) {
for (String photo : photos) {
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.exists() && !isImageLoad) {
// 使用glide加载视频的第一帧
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
isImageLoad = true;
}
}
}
}
fmRoadPic.setTag(videoFileList);
}*/
}
assert showPoiEntity != null;
if (showPoiEntity.getTaskStatus() == 3) {
@ -304,9 +363,31 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
}
}
private void initPhoto(String photoList) {
String[] photos = photoList.split(",");
List<File> videoFileList = new ArrayList<>();
boolean isImageLoad = false;
if (photos.length > 0) {
for (String photo : photos) {
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.exists() && !isImageLoad) {
// 使用glide加载视频的第一帧
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
isImageLoad = true;
}
}
}
}
fmRoadPic.setTag(videoFileList);
}
}
//禁用控件
private void disables() {
fmRoadPic.setEnabled(false);
etRoadName.setEnabled(false);
ivRoadPicture.setEnabled(false);
tvPictures.setEnabled(false);
@ -375,7 +456,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
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("poiEntity", showPoiEntity);
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;
@ -459,7 +542,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
});
}
}).start();
//onBackPressed();
} else {
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
}
@ -492,13 +574,14 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
httpParams.put("datetime", time);
httpParams.put("file", fileZip);
OkGoBuilder.getInstance()
.time(0)
.Builder(getActivity())
.url(HttpInterface.ROAD_TASK_UPLOAD_PIC)
.params(httpParams)
.token(Constant.ACCESS_TOKEN)
.cls(OtherUploadPicBean.class)
.postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity, fileZip));
Objects.requireNonNull(getActivity()).onBackPressed();//回退
Objects.requireNonNull(getActivity()).getSupportFragmentManager().popBackStack();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000);
@ -514,6 +597,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
httpParams.put("workType", poiEntity.getWork_type());
httpParams.put("memo", poiEntity.getMemo());
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.ROAD_TASK_SUBMIT)
.cls(RoadSaveBean.class)
@ -544,8 +628,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
EventBus.getDefault().post(obtain);
getActivity().getSupportFragmentManager().popBackStack();
}
}
});
@ -555,6 +639,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
} else {
Toast.makeText(getActivity(), "" + roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}else if (roadSaveBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -618,34 +704,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
Log.d("TAG", "initRoadSharePre: " + newPoiEntity);
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);
} else if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
if (showPoiEntity.getId() != null) {
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
File filePath = AWMp4ParserHelper.getInstance().getFilePath(showPoiEntity.getId());
filePath.delete();
}
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
} else {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}
}
}
@Override
public void onPause() {
super.onPause();
@ -666,7 +724,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
if (markerRoad != null) {
markerRoad.remove();
}
roadBuilder.append("onDestroy ,");
roadBuilder.append("onDestroy ");
roadBuilder.append("\r\n");
FileUtils.writeFile(logFile.getAbsolutePath(), roadBuilder.toString(), true);
}
@ -680,6 +738,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
httpParams.put("taskIds", poiEntity.getTaskId());
httpParams.put("auditIds", "");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(url)
.params(httpParams)
@ -708,6 +767,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
@ -772,10 +833,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmRoadPic.getTag());
poiEntity.setPhoto(photoStr);
if (encodeList != null) {
poiEntity.setGeoWkt(encodeList);
poiEntity.setDetail(encodeList);
}
}
return poiEntity;
}

View File

@ -39,6 +39,7 @@ import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.PoiSaveUtils;
import org.greenrobot.eventbus.EventBus;
@ -335,6 +336,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
httpParams.put("taskIds", taskIds.toString());
httpParams.put("auditIds", auditIds.toString());
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.UNRECEIVED_POLYGON_TASK)
.params(httpParams)
@ -346,7 +348,9 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
dismissLoadingDialog();
if (response.getCode() == 200) {
staySubmitAdapter.setAllCheckedDelete();
} else {
} else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
}
}

View File

@ -28,6 +28,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.util.FlushTokenUtil;
import org.json.JSONObject;
@ -143,6 +144,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
httpParams.put("pageNum", taskPage);
httpParams.put("pageSize", 20);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.LIST_TASK_EXPLAIN)
.cls(TaskPrefectureBean.class)
@ -154,6 +156,8 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
dismissLoadingDialog();
if (response.getCode() == 200){
initTaskPrefectureBean(response,aNet);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
}

View File

@ -28,6 +28,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.util.FlushTokenUtil;
import org.json.JSONObject;
@ -141,6 +142,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
httpParams.put("pageSize", 20);
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.LIST_TASK)
.cls(TaskPrefectureBean.class)
@ -152,6 +154,8 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
dismissLoadingDialog();
if (response.getCode() == 200){
initTaskPrefectureBean(response,aBoolean);
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
}

View File

@ -28,6 +28,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.navinfo.outdoor.util.FlushTokenUtil;
import org.json.JSONObject;
@ -133,6 +134,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
httpParams.put("pageNum", taskPage);
httpParams.put("pageSize", "20");
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.LIST_TASK)
.cls(TaskPrefectureBean.class)
@ -177,6 +179,8 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
taskPage++;
}
}
}else if (taskPrefectureBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), taskPrefectureBean.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "" + taskPrefectureBean.getMessage());

View File

@ -36,6 +36,7 @@ import com.navinfo.outdoor.bean.NameAuthenticationBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.PhotoUtils;
import java.io.File;
@ -65,7 +66,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
private TextView tvCard2;
private ImageView ivHera3;
private TextView tvCard3;
/* private LinearLayout linearHint;
/*private LinearLayout linearHint;
private TextView tvTitle;
private LinearLayout linearLayout;
private View userAttestView;*/
@ -73,7 +74,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
private File logFile;
private StringBuilder userAttestationBuilder;
public static UserAttestationFragment newInstance(Bundle bundle) {
UserAttestationFragment fragment = new UserAttestationFragment();
fragment.setArguments(bundle);
@ -85,7 +85,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
return R.layout.user_attestation_fragment;
}
@Override
protected void initData() {
super.initData();
@ -106,14 +105,11 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
}
}
userAttestationBuilder = new StringBuilder();
userAttestationBuilder.append("UserAttestationFragment-onCreate-initData ,");
if (Constant.USHERED!=null){
userAttestationBuilder.append("userId:").append(Constant.USHERED).append(",");
}
}
@Override
@ -238,9 +234,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
}
}
/***
*
*/
public boolean checkNumber(String text) {
Pattern patternSachs1 = Pattern
.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
@ -252,7 +245,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
}
/**
/*
* 中文姓名效验
*/
static boolean chineseNameTest(String name) {
@ -263,7 +256,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
}
private void nameAuthentication() {
if (etAttestationName.getText().toString().equals("")) {
Toast.makeText(getActivity(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
return;
@ -284,7 +276,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
Toast.makeText(getActivity(), "请拍照 手持身份证", Toast.LENGTH_SHORT).show();
return;
}
ArrayList<File> takePhoneList = new ArrayList<>();
String takePhotoPath1 = (String) tvCard1.getTag();
takePhoneList.add(new File(takePhotoPath1));
@ -300,7 +291,9 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
httpParams.put("userid", Constant.USHERED);
httpParams.put("name", attestationName);
httpParams.put("idnum", namePhone);
OkGoBuilder.getInstance().Builder(getActivity())
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.USER_AUTH_ADD)
.cls(NameAuthenticationBean.class)
.token(Constant.ACCESS_TOKEN)
@ -324,11 +317,12 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
return false;
}
});
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), "提交失败!", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@ -394,10 +388,18 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
if (idCardNumberBean.getWords_result().get公民身份号码() != null) {
String words = idCardNumberBean.getWords_result().get公民身份号码().getWords();
etNamePhone.setText(words);
userAttestationBuilder.append("识别成功 ,");
userAttestationBuilder.append("身份号识别成功 ,");
} else {
Toast.makeText(getActivity(), "识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
userAttestationBuilder.append("识别失败,可以重新识别或则进行手动输入 ,");
Toast.makeText(getActivity(), "身份号识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
userAttestationBuilder.append("身份号识别失败,可以重新识别或则进行手动输入 ,");
}
if (idCardNumberBean.getWords_result().get姓名()!=null){
String words = idCardNumberBean.getWords_result().get姓名().getWords();
etAttestationName.setText(words);
userAttestationBuilder.append("姓名识别成功 ,");
}else {
Toast.makeText(getActivity(), "姓名识别失败,可以重新识别或则进行手动输入", Toast.LENGTH_SHORT).show();
userAttestationBuilder.append("姓名识别失败,可以重新识别或则进行手动输入 ,");
}
}
} else {
@ -410,7 +412,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
Toast.makeText(getContext(), "请先拍照", Toast.LENGTH_SHORT).show();
}
}
}
@Override
@ -432,4 +433,5 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
userAttestationBuilder.append("\r\n");
FileUtils.writeFile(logFile.getAbsolutePath(), userAttestationBuilder.toString(), true);
}
}

View File

@ -31,7 +31,6 @@ import java.util.Objects;
* 视频-fragment
*/
public class VideoFragment extends BaseFragment implements View.OnClickListener {
private ArrayList<FileBean> fileBeans;
private ArrayList<FileBean> deleteFiles;
private VideoAdapter videoAdapter;
@ -89,7 +88,6 @@ public class VideoFragment extends BaseFragment implements View.OnClickListener
} else {
textFile.add(fileListByUUID.get(i));
}
}
}
ImageView ivPhotoFinal = (ImageView) findViewById(R.id.iv_video_final);

View File

@ -32,6 +32,7 @@ import com.navinfo.outdoor.bean.UserPriceExchangeBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import java.io.File;
import java.text.DateFormat;
@ -43,28 +44,12 @@ import java.util.Objects;
* 提现页面的fragment
*/
public class WithdrawFragment extends BaseFragment implements View.OnClickListener {
private TextView tvUnit;
private TextView tvAlready;
private TextView tvTotal;
private double canExchangePrice;
private TextView tvUnit, tvAlready, tvTotal, poiPushMoney, poiReportMoney, poiVideoPushMoney, poiVideoReportMoney, roadPushMoney, roadReportMoney, chargingPushMoney, chargingReportMoney, otherPushMoney, otherReportMoney;
private StringBuilder withdrawBuilder;
private EditText etAllPrice;
private TextView poiPushMoney;
private TextView poiReportMoney;
private TextView poiVideoPushMoney;
private TextView poiVideoReportMoney;
private TextView roadPushMoney;
private TextView roadReportMoney;
private TextView chargingPushMoney;
private TextView chargingReportMoney;
private TextView otherPushMoney;
private TextView otherReportMoney;
private CheckBox checkBox;
private File logFile;
private StringBuilder withdrawBuilder;
private TextView tvAll;
private ImageView ivWithDraw;
private TextView tvText;
private Button btWithdraw;
private double canExchangePrice;
public static WithdrawFragment newInstance(Bundle bundle) {
WithdrawFragment fragment = new WithdrawFragment();
@ -110,19 +95,19 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
tvUnit = findViewById(R.id.tv_unit);//可提现
tvAlready = findViewById(R.id.tv_already);//已提现
tvTotal = findViewById(R.id.tv_total);//总资产
tvAll = findViewById(R.id.tv_all);
TextView tvAll = findViewById(R.id.tv_all);
tvAll.setOnClickListener(this);
etAllPrice = findViewById(R.id.et_allPrice);
ivWithDraw = findViewById(R.id.iv_withdraw);
ImageView ivWithDraw = findViewById(R.id.iv_withdraw);
ivWithDraw.setOnClickListener(this);
tvText = findViewById(R.id.tv_text);
TextView tvText = findViewById(R.id.tv_text);
tvText.setOnClickListener(this);
checkBox = findViewById(R.id.checkBox);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
if (Constant.ID_NUMBER == null || Constant.BACKGROUND == null) {
if (Constant.BACKGROUND == null) {
Toast.makeText(getActivity(), "没有绑定银行卡,请先绑定银行卡", Toast.LENGTH_SHORT).show();
checkBox.setChecked(false);
withdrawBuilder.append("点击了银行卡的勾选,");
@ -133,7 +118,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
}
}
});
btWithdraw = findViewById(R.id.button);
Button btWithdraw = findViewById(R.id.button);
btWithdraw.setOnClickListener(this);
poiPushMoney = findViewById(R.id.poi_push_money);
poiReportMoney = findViewById(R.id.poi_report_money);
@ -145,12 +130,15 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
chargingReportMoney = findViewById(R.id.charging_report_money);
otherPushMoney = findViewById(R.id.other_push_money);
otherReportMoney = findViewById(R.id.other_report_money);
initNetWork();
if (Constant.USHERED != null) {
initNetWork();
}
}
private void initNetWork() {
showLoadingDialog();
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.GET_PRICE)
.cls(GetPriceBean.class)
@ -162,7 +150,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
dismissLoadingDialog();
if (response.getCode() == 200) {
GetPriceBean.BodyBean body = response.getBody();
if (getActivity()!=null){
if (getActivity() != null) {
getActivity().runOnUiThread(new Runnable() {
@SuppressLint("SetTextI18n")
@Override
@ -170,13 +158,13 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
tvTotal.setText(body.getUserPrice() + "");
canExchangePrice = body.getCanExchangePrice();
tvUnit.setText(canExchangePrice + "");
tvAlready.setText(body.getHaveExchangePrice()+"");
poiPushMoney.setText(body.getPoiPushPrice()+"");
poiReportMoney.setText(body.getPoiNonepushPrice()+"");
poiVideoPushMoney.setText(body.getPoivideoPushPrice()+"");
poiVideoReportMoney.setText(body.getPoivideoNonepushPrice()+"");
roadPushMoney.setText(body.getRoadPushPrice()+"");
roadReportMoney.setText(body.getRoadNonepushPrice()+"");
tvAlready.setText(body.getHaveExchangePrice() + "");
poiPushMoney.setText(body.getPoiPushPrice() + "");
poiReportMoney.setText(body.getPoiNonepushPrice() + "");
poiVideoPushMoney.setText(body.getPoivideoPushPrice() + "");
poiVideoReportMoney.setText(body.getPoivideoNonepushPrice() + "");
roadPushMoney.setText(body.getRoadPushPrice() + "");
roadReportMoney.setText(body.getRoadNonepushPrice() + "");
chargingPushMoney.setText(body.getCsPushPrice() + "");
chargingReportMoney.setText(body.getCsNonepushPrice() + "");
otherPushMoney.setText(body.getOtherPushPrice() + "");
@ -184,6 +172,10 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
}
});
}
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
}else {
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
}
Log.d("TAG", "onSuccess: " + response.toString());
}
@ -243,7 +235,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
break;
case R.id.tv_all:
withdrawBuilder.append("点击了全部 ,");
if (canExchangePrice!=0){
if (canExchangePrice != 0) {
etAllPrice.setText(canExchangePrice + "");
}
break;
@ -257,6 +249,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
httpParams.put("exchangeMoney", etAllPrice.getText().toString());
httpParams.put("payType", 1);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.USER_PRICE_EXCHANGE)
.cls(UserPriceExchangeBean.class)
@ -268,7 +261,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
dismissLoadingDialog();
if (response.getCode() == 200) {
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
DialogSettings.cancelable=false;
DialogSettings.cancelable = false;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "该提现申请已提交", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
@ -277,12 +270,14 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
return false;
}
});
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
withdrawBuilder.append("提现了失败 ");
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
}
etAllPrice.getText().clear();
Log.d("TAG", "onSuccess: " + response.getMessage()+response.getCode());
Log.d("TAG", "onSuccess: " + response.getMessage() + response.getCode());
}
@Override

View File

@ -22,6 +22,7 @@ import com.navinfo.outdoor.bean.WithdrawalBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
import java.util.ArrayList;
import java.util.Objects;
@ -90,6 +91,7 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
httpParams.put("pageNum", withPage);
OkGoBuilder.getInstance()
.time(30)
.Builder(getActivity())
.url(HttpInterface.PRICE_EXCHANGE)
.cls(WithdrawalBean.class)
@ -102,7 +104,9 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
if (withdrawalBean.getCode() == 200){
withdrawalAdapter.setDataBeans(withdrawalBean.getBody().getList());
withPage++;
}else {
}else if (withdrawalBean.getCode()==203){
FlushTokenUtil.flushToken(getActivity());
} else {
Toast.makeText(getActivity(), withdrawalBean.getMessage()+"", Toast.LENGTH_SHORT).show();
}
rxlWithdraw.loadMoreComplete();

View File

@ -4,14 +4,13 @@ import com.navinfo.outdoor.api.Constant;
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 USER_PATH ="/user/";//我的
public static final String MSG_LIST_PATH ="/msgList/";//发现
public static final String USER_LOGIN_PATH ="/userlogin/";//登录
public static final String PRICE_PATH ="/price/";//提现
public static final String TASK_PATH ="/task/";//任务
/*
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
public static final String APK_IP = "http://172.23.139.4:8001/";
@ -72,65 +71,65 @@ public class HttpInterface {
* Path=/m4/price/**
*/
//172.23.139.4:8004/userPrice/1/getPrice
public static String GET_PRICE;//我的-总资产
public static String GET_PRICE=null;//我的-总资产
//172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
public static String USER_PRICE_EXCHANGE;//我的-财务信息-提现
public static String USER_PRICE_EXCHANGE=null;//我的-财务信息-提现
//dtxbmaps.navinfo.com/dtxb/m4/price/priceExchange/1/getList?datetime=1628647356815
public static String PRICE_EXCHANGE;//提现记录
public static String PRICE_EXCHANGE=null;//提现记录
/*任务
* Path=/m4/task/**
*/
///m4/task/task/10/receiveTasks 参数taskIds
public static String RECEIVE_TASK;//批量领取
public static String RECEIVE_TASK=null;//批量领取
//172.23.139.4:8003/m4/task/1/getList
public static String TASK_LIST; //任务搜索
public static String TASK_LIST=null; //任务搜索
//172.23.139.4:8003/othertask/1/receivedOthertask
public static String RECEIVED_OTHER_TASK;//其他-领取任务
public static String RECEIVED_OTHER_TASK=null;//其他-领取任务
//172.23.139.4:8003/poitask/1/receivedPoitask/1
public static String RECEIVED_POI_TASK;//poi-领取任务
public static String RECEIVED_POI_TASK=null;//poi-领取任务
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注...33.
public static String SUBMIT_POI_TASK;//poi-保存本地
public static String SUBMIT_POI_TASK=null;//poi-保存本地
//172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
public static String SUBMIT_OTHER_TASK;//其他-保存本地
public static String SUBMIT_OTHER_TASK=null;//其他-保存本地
//172.23.139.4:8003/othertask/1/uploadpic
public static String OTHER_TASK_UPLOAD_PIC;//其他-上传
public static String OTHER_TASK_UPLOAD_PIC=null;//其他-上传
//172.23.139.4:8003/ctask/1/receivedCtask/8608
public static String RECEIVED_CTASK;//充电站-领取任务
public static String RECEIVED_CTASK=null;//充电站-领取任务
//172.23.139.4:8003/ctask/1/submitCtask?id=8608&name=充电站&address=地址&telephone=18812345678|14712345678&geo=1rn7exd5uhxy&memo=测试备注&sptype=1
public static String SUBMIT_CTASK;//充电站-保存本地
public static String SUBMIT_CTASK=null;//充电站-保存本地
//172.23.139.4:8003/cstask/1/submitCstask?taskId=0&name=充电站&geo=1rn7exd5uhxy&memo=测试备注&sptype=1&ffid=104&existence=1&detail={"cp_openType":"1,2","cp_floor":1,"cp_availableState":0,"sign_exist":0}
public static String SUBMIT_CSTASK;//充电桩保存
public static String SUBMIT_CSTASK=null;//充电桩保存
//172.23.139.4:8003/poitask/1/uploadpic
public static String POI_TASK_UPLOAD_PIC;//poi-上传
public static String POI_TASK_UPLOAD_PIC=null;//poi-上传
//172.23.139.4:8003/roadtask/1/receivedRoadtask/8569
public static String RECEIVED_ROAD_TASK;//道路任务获取
public static String RECEIVED_ROAD_TASK=null;//道路任务获取
//172.23.139.4:8003/poivideotask/1/receivedPoivideotask/8569
public static String RECEIVED_POI_VIDEO_TASK;//poi录像任务获取
public static String RECEIVED_POI_VIDEO_TASK=null;//poi录像任务获取
// 172.23.139.4:8003/poivideotask/1/submitPoivideotask
public static String INSIDE_API_LIST;//poi录像 保存
public static String INSIDE_API_LIST=null;//poi录像 保存
//172.23.139.4:8003/poivideotask/1/uploadpic
public static String POI_VIDEO_UPLOAD_PIC;//poi录像-上传
public static String POI_VIDEO_UPLOAD_PIC=null;//poi录像-上传
//172.23.139.4:8003/roadtask/1/submitRoadtask?taskId=0&name=段哥&address=二娃&memo=1rn7exd5uhxy&workType=2
public static String ROAD_TASK_SUBMIT;//道路录像-保存本地
public static String ROAD_TASK_SUBMIT=null;//道路录像-保存本地
//172.23.139.4:8003/roadtask/1/uploadpic
public static String ROAD_TASK_UPLOAD_PIC;//道路录像上传
public static String ROAD_TASK_UPLOAD_PIC=null;//道路录像上传
//172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
public static String GET_PHONES;//电话区号和电话位数
public static String GET_PHONES=null;//电话区号和电话位数
//172.23.139.4:8003/cstask/1/uploadpic
public static String CS_TASK_UP_LOAD_PIC;//充电桩-上传
public static String CS_TASK_UP_LOAD_PIC=null;//充电桩-上传
//172.23.139.4:8003/ctask/1/uploadpic
public static String C_TASK_UP_LOAD_PIC;//充电站-上传
public static String C_TASK_UP_LOAD_PIC=null;//充电站-上传
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
public static String TASK_NAME;//poi-查重
public static String TASK_NAME=null;//poi-查重
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
public static String GET_COMMIT_LIST;//纪录已提交
public static String RECEIVED_POLYGON_TASK; //面状任务任务领取
public static String GET_COMMIT_LIST=null;//纪录已提交
public static String RECEIVED_POLYGON_TASK=null; //面状任务任务领取
//172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278 取消领取的接口
public static String UNRECEIVED_POLYGON_TASK;//所有類型结束领取
public static String COMPLETE;//面状任务结束领取
public static String SUBMIT_POLYGON_TASK;//面状任务开始采集
public static String UNRECEIVED_POLYGON_TASK=null;//所有類型结束领取
public static String COMPLETE=null;//面状任务结束领取
public static String SUBMIT_POLYGON_TASK=null;//面状任务开始采集
//dtxbmaps.navinfo.com/dtxb_test/m4/msgList/InfoPush/28/push?type=0
public static String MESSAGE_INFO_PUSH;//消息通知
public static String MESSAGE_INFO_PUSH=null;//消息通知
public static void initHttpInter(String USERID) {
/* 我的

View File

@ -8,6 +8,8 @@ import com.github.lazylibrary.util.MD5;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.model.HttpHeaders;
import com.lzy.okgo.model.HttpParams;
import com.lzy.okgo.model.Response;
@ -25,9 +27,11 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
/**
@ -41,6 +45,8 @@ public class OkGoBuilder<T> {
*/
private String url;
private String file;
private int time;
/**
* 参数
*/
@ -55,6 +61,7 @@ public class OkGoBuilder<T> {
private String token;
private String upString;
/**
* 单列模式
**/
@ -91,6 +98,11 @@ public class OkGoBuilder<T> {
return this;
}
public OkGoBuilder time(int time) {
this.time = time;
return this;
}
public OkGoBuilder file(String file) {
this.file = file;
return this;
@ -122,14 +134,33 @@ public class OkGoBuilder<T> {
this.clazz = clazz;
return this;
}
public void initTimeOut(int time) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.readTimeout(time, TimeUnit.SECONDS);
//全局的写入超时时间
builder.writeTimeout(time, TimeUnit.SECONDS);
//全局的连接超时时间
builder.connectTimeout(time, TimeUnit.SECONDS);
OkGo.getInstance().init(UserApplication.getUserApplication()).setOkHttpClient(builder.build())
//全局统一缓存模式默认不使用缓存可以不传
.setCacheMode(CacheMode.NO_CACHE)
//全局统一缓存时间默认永不过期可以不传
.setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE)
.setRetryCount(0);
}
/**
* post 发现-能力测评
*/
public void postCapacity(Callback<T> callback){
public void postCapacity(Callback<T> callback) {
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
callback.onError(new Throwable("网络不可用"),2);
callback.onError(new Throwable("网络不可用"), 2);
return;
}
initTimeOut(time);
long time = System.currentTimeMillis();
params.put("datetime", time);
OkGo
@ -146,7 +177,8 @@ public class OkGoBuilder<T> {
callback.onSuccess(response.body(), 1);
} else {
Toast.makeText(activity, response.message(), Toast.LENGTH_SHORT).show();
} }
}
}
@Override
public void onError(Response<T> response) {
@ -170,48 +202,48 @@ public class OkGoBuilder<T> {
*/
public void postRequest(Callback<T> callback) {
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
callback.onError(new Throwable("网络不可用"),2);
callback.onError(new Throwable("网络不可用"), 2);
return;
}
OkGo
// 请求方式和请求url
.<T>post(url)
.isMultipart(true)
.headers(getHeader())
.params(params)
initTimeOut(time);
OkGo
// 请求方式和请求url
.<T>post(url)
.isMultipart(true)
.headers(getHeader())
.params(params)
// .upJson(json)
// 请求的 tag, 主要用于取消对应的请求
.tag(this)
// 设置当前请求的缓存key,建议每个不同功能的请求设置一个
// 请求的 tag, 主要用于取消对应的请求
.tag(this)
// 设置当前请求的缓存key,建议每个不同功能的请求设置一个
// .cacheKey("cacheKey")
// 缓存模式详细请看缓存介绍
// 缓存模式详细请看缓存介绍
// .cacheMode(CacheMode.DEFAULT)
.execute(new DialogCallback<T>(clazz) {
@Override
public void onSuccess(Response<T> response) {
if (response.code() == 200) {
callback.onSuccess(response.body(), 1);
} else {
Toast.makeText(activity, response.message(), Toast.LENGTH_SHORT).show();
}
.execute(new DialogCallback<T>(clazz) {
@Override
public void onSuccess(Response<T> response) {
if (response.code() == 200) {
callback.onSuccess(response.body(), 1);
} else {
Toast.makeText(activity, response.message(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Response<T> response) {
super.onError(response);
Throwable throwable = response.getException();
if (throwable != null) {
throwable.printStackTrace();
callback.onError(throwable, 2);
/*
* 友盟+
* 使用自定义错误查看时请在错误列表页面选择自定义异常
*/
UMCrash.generateCustomLog("网络请求报错-位置OKGOBuilder" + throwable, "UmengException");
}
@Override
public void onError(Response<T> response) {
super.onError(response);
Throwable throwable = response.getException();
if (throwable != null) {
throwable.printStackTrace();
callback.onError(throwable, 2);
/*
* 友盟+
* 使用自定义错误查看时请在错误列表页面选择自定义异常
*/
UMCrash.generateCustomLog("网络请求报错-位置OKGOBuilder" + throwable, "UmengException");
}
});
}
});
}
public HttpHeaders getHeader() {
@ -251,6 +283,7 @@ public class OkGoBuilder<T> {
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
return null;
}
initTimeOut(time);
long time = System.currentTimeMillis();
params.put("datetime", time);
try {
@ -280,9 +313,10 @@ public class OkGoBuilder<T> {
*/
public void postFileAsynchronous(Callback callback) {
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
callback.onError(new Throwable("网络不可用"),2);
callback.onError(new Throwable("网络不可用"), 2);
return;
}
initTimeOut(time);
long time = System.currentTimeMillis();
params.put("datetime", time);
OkGo
@ -331,12 +365,12 @@ public class OkGoBuilder<T> {
*/
public void getRequest(Callback<T> callback) {
if (!NetWorkUtils.iConnected(UserApplication.userApplication)) { // 当前网络不可用
callback.onError(new Throwable("网络不可用"),2);
callback.onError(new Throwable("网络不可用"), 2);
return;
}
initTimeOut(time);
long time = System.currentTimeMillis();
params.put("datetime", time);
OkGo
// 请求方式和请求url
.<T>get(url)
@ -356,7 +390,6 @@ public class OkGoBuilder<T> {
} else {
Toast.makeText(activity, response.message(), Toast.LENGTH_SHORT).show();
}
}
@Override
@ -382,6 +415,7 @@ public class OkGoBuilder<T> {
Toast.makeText(activity, "网络不可用,请检查网络", Toast.LENGTH_SHORT).show();
return null;
}
initTimeOut(time);
long time = System.currentTimeMillis();
params.put("datetime", time);
try {

View File

@ -37,7 +37,7 @@ public abstract class PoiDatabase extends RoomDatabase {
return instance;
}
private static PoiDatabase create(final Context context) {
File dbFolder = new File(Constant.POI_DAO); // 数据库文件夹路径
File dbFolder = new File(Constant.POI_DAO+""); // 数据库文件夹路径
if (!dbFolder.exists()) {
SdkFolderCreate.mkdirs(dbFolder.getAbsolutePath());
}

View File

@ -33,14 +33,14 @@ public class PoiEntity implements Serializable {
private String precision;//金额
private String photo;//照片信息
private boolean checked;
private String geoWkt; // 数据的wkt
private String geoWkt; //原先的数据的wkt
//ROOM不支持直接存储集合
@TypeConverters(PhotoInfoConverter.class)
private List<Info> photoInfo;//照片信息
private int existence;//是否存在 不存在对应 0 存在对应 1 无法验证对应 2
private String x;//经度
private String y;//纬度
private String detail;//深度信息
private String detail;//需要保存的数据的wkt
private String dist;//距离用户位置
private int taskStatus;//任务状态 0.未领取 1.已领取5 立即采集2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"

View File

@ -0,0 +1,167 @@
package com.navinfo.outdoor.util;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
import com.kongzue.dialog.util.BaseDialog;
import com.kongzue.dialog.util.DialogSettings;
import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.bean.LoginOauthTokenBean;
import com.navinfo.outdoor.bean.UserDetailBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import java.util.Objects;
/**
* 刷新token 203
*/
public class FlushTokenUtil {
private static SharedPreferences.Editor navInfoEditor;
public static void flushToken(Activity activity) {
Constant.isPresent=true;
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(activity), "提示", "登录已过期,是否重新登录", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
initLogin(activity);
return false;
}
});
}
private static void initLogin(Activity activity){
SharedPreferences navInfo = activity.getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
navInfoEditor = navInfo.edit();
if (Constant.USHERED == null) {
return;
}else {
if (HttpInterface.USER_LOGIN_OAUTH_TOKEN == null) {
return;
}
}
try {
HttpParams httpParams = new HttpParams();
long time = System.currentTimeMillis();
httpParams.put("grant_type", "refresh_token");
httpParams.put("refresh_token", Constant.REFRESH_TOKEN);
httpParams.put("datetime", time);
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
.time(30)
.Builder(activity)
.url(HttpInterface.USER_LOGIN_OAUTH_TOKEN)
.cls(LoginOauthTokenBean.class)
.params(httpParams);
okGoBuilder.postRequest(new Callback<LoginOauthTokenBean>() {
@Override
public void onSuccess(LoginOauthTokenBean response, int id) {
if (response.getCode() == 200) {
LoginOauthTokenBean.BodyBean body = response.getBody();
if (body.getUserId() != null && !body.getUserId().equals("")) {
Constant.initRootFolder(body.getUserId());
HttpInterface.initHttpInter(body.getUserId());
}
navInfoEditor.putString("access_token", body.getAccess_token());
Constant.ACCESS_TOKEN = body.getAccess_token();
navInfoEditor.putString("refresh_token", body.getRefresh_token());
Constant.REFRESH_TOKEN = body.getRefresh_token();
navInfoEditor.putString("user_id", body.getUserId());
Constant.USHERED = body.getUserId();
navInfoEditor.apply();
if (HttpInterface.USER_DETAIL_BY_USER_ID == null) {
Toast.makeText(activity, "token :更新成功", Toast.LENGTH_SHORT).show();
} else {
initGetUserInfo(activity);//获取用户信息
}
} else {
Toast.makeText(activity, response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
Toast.makeText(activity, e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
private static void initGetUserInfo(Activity activity) {
OkGoBuilder okGoBuilder = OkGoBuilder.getInstance()
.time(30)
.Builder(activity)
.url(HttpInterface.USER_DETAIL_BY_USER_ID)
.token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
.cls(UserDetailBean.class);
okGoBuilder.getRequest(new Callback<UserDetailBean>() {
@Override
public void onSuccess(UserDetailBean response, int id) {
if (response.getCode() == 200) {
UserDetailBean.BodyBean body = response.getBody();
if (body != null) {
navInfoEditor.putString("username", body.getUsername());
Constant.USER_NAME = body.getUsername();
navInfoEditor.putString("mobile", body.getMobile());
Constant.MOBILE = body.getMobile();
navInfoEditor.putInt("sex", body.getSex());//0: 1
Constant.SEX = body.getSex();
navInfoEditor.putString("qq", body.getQq());
Constant.QQ = body.getQq();
navInfoEditor.putString("wechat", body.getWechat());
Constant.WCHAR = body.getWechat();
navInfoEditor.putInt("level", body.getLevel());
Constant.LEVEL = body.getLevel();
UserDetailBean.BodyBean.UserBankcardBean userBankcard = body.getUserBankcard();
if (userBankcard != null) {//存储银行卡信息
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡号
Constant.BACKGROUND = userBankcard.getBankAccount();
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//身份证号
Constant.ID_NUMBER = userBankcard.getIdNumber();
navInfoEditor.putString("bankName", userBankcard.getBankName());//銀行姓名
Constant.BACKGROUND_NAME = userBankcard.getBankName();
}
UserDetailBean.BodyBean.UserAuthBean userAuth = body.getUserAuth();
if (userAuth != null) {//存储身份证信息
navInfoEditor.putString("name", userAuth.getName());//身份证姓名
Constant.NAME = userAuth.getName();
navInfoEditor.putString("idnum", userAuth.getIdnum());//身份证号码
Constant.ID_NUM = userAuth.getIdnum();
navInfoEditor.putInt("auditstatus", userAuth.getAuditstatus());//审核状态
Constant.AUDIOTAPES = userAuth.getAuditstatus();
navInfoEditor.putString("auditmsg", userAuth.getAuditmsg());//审核信息
Constant.AUDITING = userAuth.getAuditmsg();
}
navInfoEditor.commit();
Toast.makeText(activity, "token :更新成功", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(activity, response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
Toast.makeText(activity, e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
}
});
}
}

View File

@ -38,6 +38,8 @@ public class PoiEntityDeleteUtil {
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
File filePath = AWMp4ParserHelper.getInstance().getFilePath(poiEntity.getId());
filePath.delete();
}

View File

@ -182,7 +182,10 @@ public class PoiSaveUtils {
return -1;
}
try {
Response execute = OkGoBuilder.getInstance().url(url)
Response execute = OkGoBuilder
.getInstance()
.url(url)
.time(30)
.Builder(mContext)
.token(Constant.ACCESS_TOKEN).params(httpParams).getSynchronization();
if (execute == null) {
@ -237,23 +240,10 @@ public class PoiSaveUtils {
*/
public void uploadPoiNet(PoiEntity poiEntity) {
if (poiEntity == null) {
mContext.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(mContext, "无法获取POI数据", Toast.LENGTH_SHORT).show();
}
});
return;
}
int bodyId = poiEntity.getBodyId();
if (bodyId == 0) {
mContext.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(mContext, "该数据未保存到服务,无法上传", Toast.LENGTH_SHORT).show();
}
});
return;
}
ArrayList<File> photoFile = new ArrayList<>();
@ -341,6 +331,7 @@ public class PoiSaveUtils {
HttpParams httpParams = new HttpParams();
httpParams.put("auditId", poiEntity.getBodyId());
Response execute = OkGoBuilder.getInstance()
.time(0)
.Builder(mContext)
.url(url)
.params(httpParams)
@ -434,6 +425,7 @@ public class PoiSaveUtils {
httpParams.put("detail", String.valueOf(hashMap));
try {
Response execute = OkGoBuilder.getInstance()
.time(30)
.Builder(mContext)
.url(HttpInterface.SUBMIT_CSTASK)
.token(Constant.ACCESS_TOKEN)
@ -494,12 +486,6 @@ public class PoiSaveUtils {
*/
private int chargingPileUploadNetWork(ChargingPileEntity chargingPileEntity) {
if (chargingPileEntity == null || chargingPileEntity.getBodyId() == 0) {
mContext.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(mContext, "没有保存本地", Toast.LENGTH_SHORT).show();
}
});
return -1;
}
@ -514,6 +500,7 @@ public class PoiSaveUtils {
HttpParams httpParams = new HttpParams();
httpParams.put("auditId", chargingPileEntity.getBodyId());
Response execute = OkGoBuilder.getInstance()
.time(0)
.Builder(mContext)
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
.token(Constant.ACCESS_TOKEN)
@ -555,7 +542,7 @@ public class PoiSaveUtils {
// @Override
// public void onSuccess(Response<PoiUploadBean> poiUploadBeanResponse) {
// dismissLoadingDialog();
// Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
// .makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
// isChargingPoleUploaded = true;
// if (isChargeStationUploaded && isChargingPoleUploaded) {
// getActivity().runOnUiThread(new Runnable() {

View File

@ -72,6 +72,8 @@ public class UploadUtils {
});
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(mContext);
} else {
Message obtain1 = Message.obtain();
obtain1.what = Constant.NEST_WORD_SUBMIT;
@ -127,6 +129,8 @@ public class UploadUtils {
});
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(mContext);
} else {
Message obtain1 = Message.obtain();
obtain1.what = Constant.NEST_WORD_SUBMIT;
@ -188,6 +192,8 @@ public class UploadUtils {
});
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(mContext);
} else {
Message obtain1 = Message.obtain();
obtain1.what = Constant.NEST_WORD_SUBMIT;
@ -243,6 +249,8 @@ public class UploadUtils {
});
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(mContext);
} else {
Message obtain1 = Message.obtain();
obtain1.what = Constant.NEST_WORD_SUBMIT;
@ -299,6 +307,8 @@ public class UploadUtils {
});
}
}).start();
}else if (response.getCode()==203){
FlushTokenUtil.flushToken(mContext);
} else {
Message obtain1 = Message.obtain();
obtain1.what = Constant.NEST_WORD_SUBMIT;

View File

@ -59,15 +59,24 @@
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.4" />
<TextView
android:id="@+id/tv_title"
android:textColor="@color/white"
android:layout_marginTop="25dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_zoom_add"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/zoom_add"
android:visibility="gone"
android:layout_marginEnd="25dp"
app:layout_constraintBottom_toTopOf="@+id/btn_stop_picture"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/btn_switch"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
@ -104,6 +113,7 @@
<Button
android:id="@+id/btn_switch"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"

View File

@ -1,14 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="100dp">
android:background="?android:attr/selectableItemBackground"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_tas_capacity"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
@ -18,26 +22,27 @@
android:id="@+id/tas_capacity_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:text="111111111"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/iv_tas_capacity"
app:layout_constraintLeft_toRightOf="@id/iv_tas_capacity"
app:layout_constraintTop_toTopOf="@id/iv_tas_capacity" />
app:layout_constraintTop_toTopOf="@id/iv_tas_capacity"
/>
<LinearLayout
android:id="@+id/ll_results"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/iv_tas_capacity"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tas_capacity_title">
app:layout_constraintTop_toTopOf="@+id/iv_tas_capacity">
<TextView
android:id="@+id/tv_results"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:text="成绩:"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
@ -47,7 +52,7 @@
android:id="@+id/tv_capacity_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:text="通过"
app:layout_constraintBottom_toBottomOf="@id/tv_results"
app:layout_constraintLeft_toRightOf="@id/tv_results"
@ -57,14 +62,13 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
android:text="去测评>"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_results" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="@color/colormap"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -72,7 +72,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:gravity="center"
android:gravity="center"
android:orientation="horizontal">
<TextView

View File

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
xmlns:app="http://schemas.android.com/apk/res-auto">
@ -39,7 +39,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:layout_marginTop="15dp"
android:background="@color/colormap"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -28,7 +28,7 @@
android:layout_width="wrap_content"
style="@style/text_style_toolbar_title"
android:layout_toRightOf="@id/iv_find_task"
android:text="活动专区" />
android:text="试题测试" />
</LinearLayout>
<androidx.core.widget.NestedScrollView

View File

@ -23,6 +23,8 @@
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:text="众包录像 测试3"
android:ellipsize="end"
android:lines="2"
android:textColor="#333"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"

View File

@ -56,7 +56,7 @@
android:id="@+id/audit_process"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -70,7 +70,7 @@
android:id="@+id/audit_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -84,7 +84,7 @@
android:id="@+id/audit_not_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18"
android:text="0"
android:textSize="12sp" />
</LinearLayout>
@ -157,7 +157,7 @@
android:id="@+id/poiVideo_audit_process"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -171,7 +171,7 @@
android:id="@+id/poiVideo_audit_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -185,7 +185,7 @@
android:id="@+id/poiVideo_audit_process_audit_not_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18"
android:text="0"
android:textSize="12sp" />
</LinearLayout>
@ -257,7 +257,7 @@
android:id="@+id/road_audit_process"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -271,7 +271,7 @@
android:id="@+id/road_audit_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -285,7 +285,7 @@
android:id="@+id/road_audit_not_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18"
android:text="0"
android:textSize="12sp" />
</LinearLayout>
@ -352,7 +352,7 @@
android:id="@+id/charging_audit_process"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -366,7 +366,7 @@
android:id="@+id/charging_audit_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -380,7 +380,7 @@
android:id="@+id/charging_audit_not_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18"
android:text="0"
android:textSize="12sp" />
</LinearLayout>
@ -449,7 +449,7 @@
android:id="@+id/other_audit_process"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -463,7 +463,7 @@
android:id="@+id/other_audit_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:text="0"
android:textSize="12sp" />
<TextView
@ -477,7 +477,7 @@
android:id="@+id/other_audit_not_through"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18"
android:text="0"
android:textSize="12sp" />
</LinearLayout>

View File

@ -12,7 +12,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</include>
<androidx.core.widget.NestedScrollView
android:id="@+id/nested_scroll_view"
@ -361,8 +360,6 @@
android:paddingBottom="30dp"
android:textColor="@color/test_color_selector"
android:textSize="15sp"
/>
</LinearLayout>
@ -400,7 +397,6 @@
android:text="上传" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@ -1,36 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_height="60dp">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/iv_tas_explain"
android:layout_marginLeft="10dp"
android:scaleType="fitCenter"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_tas_explain"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tas_explain_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="111111111"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@id/iv_tas_explain"
app:layout_constraintBottom_toBottomOf="@id/iv_tas_explain"
app:layout_constraintLeft_toRightOf="@id/iv_tas_explain"
android:layout_marginLeft="10dp"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
app:layout_constraintBottom_toBottomOf="parent"
android:background="#C0BFBF"/>
app:layout_constraintTop_toTopOf="@id/iv_tas_explain" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#C0BFBF"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>