修改导航界面为横向
This commit is contained in:
commit
8b8866d3fb
@ -11,9 +11,9 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 32
|
||||
versionCode 40
|
||||
versionName "8.221219"
|
||||
targetSdkVersion 30
|
||||
versionCode 41
|
||||
versionName "8.230109"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
lintOptions {
|
||||
|
@ -150,13 +150,13 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.NaviCarActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="landscape" />
|
||||
<activity
|
||||
android:name=".activity.NaviRideActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="landscape" />
|
||||
<activity
|
||||
android:name=".activity.NaviWalkActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="landscape" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
@ -157,12 +157,14 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@ -1301,9 +1303,12 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
/**
|
||||
* 结束采集,对照片归档
|
||||
* */
|
||||
private boolean hasFinishTask = false; // 当前是否包含已完成任务未处理完
|
||||
private int finishTaskCount = 0;
|
||||
private boolean wantBack = false; // 用户是否想要退出当前界面,如果当前有正在处理的图片转移任务,会阻挡用户退出,此时该值状态置为true,当照片处理完后,可以对话框提示用户退出
|
||||
private void finishRoadTask(Map<Integer, RoadMatchEntity> finishEntityMap) {
|
||||
hasFinishTask = true;
|
||||
if (finishEntityMap!=null&&!finishEntityMap.isEmpty()) {
|
||||
finishTaskCount++;
|
||||
|
||||
Observable.fromIterable(finishEntityMap.values())
|
||||
.subscribeOn(Schedulers.io()).observeOn(Schedulers.computation())
|
||||
.filter(roadMatchEntity -> roadMatchEntity!=null)
|
||||
@ -1343,15 +1348,11 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
roadSaveWork(poiEntity);
|
||||
/*poiEntity.setTaskStatus(3);
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(AutoTakePictureActivity.this, poiEntity);*/
|
||||
finishEntityMap.remove(poiEntity.getTaskId());
|
||||
}
|
||||
})
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.onErrorResumeNext(new Function<Throwable, ObservableSource<? extends PoiEntity>>() {
|
||||
@Override
|
||||
public ObservableSource<? extends PoiEntity> apply(Throwable throwable) throws Exception {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.onErrorResumeNext(Observable.empty())
|
||||
.subscribe(new Consumer<PoiEntity>() {
|
||||
@Override
|
||||
public void accept(PoiEntity poiEntity) {
|
||||
@ -1359,6 +1360,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
// if (poiEntity!=null) {
|
||||
// finishEntityMap.remove(poiEntity.getTaskId());
|
||||
// }
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
@ -1367,18 +1369,48 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
systemTTS.playText("注意,领取任务失败!");
|
||||
XLog.e("完成失败:"+throwable.getMessage());
|
||||
ToastUtils.Message(AutoTakePictureActivity.this, throwable.getMessage());
|
||||
hasFinishTask = false;
|
||||
finishTaskCount--;
|
||||
if (finishTaskCount == 0) {
|
||||
showExitDialog(true);
|
||||
}
|
||||
}
|
||||
}, new Action() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
// 重新绘制网络任务和本地任务
|
||||
initRoadLine2Map();
|
||||
// finishEntityMap.clear();
|
||||
hasFinishTask = false;
|
||||
finishTaskCount--;
|
||||
if (finishTaskCount == 0) {
|
||||
showExitDialog(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void showExitDialog(boolean hasError) {
|
||||
StringBuilder dialogMessage = new StringBuilder("任务数据处理完成,是否退出当前界面");
|
||||
if (hasError) {
|
||||
dialogMessage.append("(注意,其中有部分任务处理失败)");
|
||||
}
|
||||
MessageDialog.show(AutoTakePictureActivity.this, "退出当前界面", dialogMessage)
|
||||
.setOkButton("确定", new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
AutoTakePictureActivity.this.finish();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.setCancelButton("取消", new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
baseDialog.doDismiss();
|
||||
wantBack = false;
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
private void roadSaveWork(PoiEntity poiEntity) throws IOException {
|
||||
// 设置当前数据状态为本地保存
|
||||
@ -1681,8 +1713,9 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||
if (hasFinishTask) {
|
||||
if (finishTaskCount>0) {
|
||||
MessageDialog.show(this, "提示", "后台正在处理已拍摄完成的任务,请稍后再退出当前界面");
|
||||
wantBack = true;
|
||||
return;
|
||||
}
|
||||
MessageDialog.show(this, "提示", "退出自动采集模式?", "是", "否").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user