Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'
Dev arch opt 3.0 See merge request zhjt/AndroidApp/MoGoEagleEye!667
This commit is contained in:
@@ -72,36 +72,26 @@ class BindingCarNetWorkManager private constructor() {
|
||||
override fun onSubscribe(d: Disposable) {}
|
||||
override fun onNext(info: BindingCarInfo) {
|
||||
if (info != null && info.getData() != null) {
|
||||
d(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingCarInfo data =" + info.getData().toString()
|
||||
d(SceneConstant.M_BINDING + TAG, "getBindingCarInfo data =" + info.getData().toString())
|
||||
SharedPrefsMgr.getInstance(context).putString(
|
||||
SharedPrefsConstants.CAR_INFO,
|
||||
GsonUtils.toJson(info.getData())
|
||||
)
|
||||
updateCarVrIconRes(info.getData().brandId);
|
||||
when (info.getData().compare) {
|
||||
"0" -> showBindingCarDialog()
|
||||
"3" -> showModifyBindingCarDialog()
|
||||
"null" -> TipToast.shortTip("当前工控机没有入库")
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context).putString(
|
||||
SharedPrefsConstants.CAR_INFO,
|
||||
GsonUtils.toJson(info.getData())
|
||||
)
|
||||
updateCarVrIconRes(info.getData().brandId);
|
||||
} else {
|
||||
// SharedPrefsMgr.getInstance(context).putString(
|
||||
// SharedPrefsConstants.CAR_INFO, "null")
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null "
|
||||
)
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
|
||||
e(SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null ")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
// SharedPrefsMgr.getInstance(context).putString(
|
||||
// SharedPrefsConstants.CAR_INFO, e.message.toString())
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
)
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
|
||||
e(SceneConstant.M_BINDING + TAG, "getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message)
|
||||
}
|
||||
|
||||
override fun onComplete() {}
|
||||
@@ -138,19 +128,13 @@ class BindingCarNetWorkManager private constructor() {
|
||||
override fun onNext(info: ModifyBindingcarInfo) {
|
||||
if (info != null) {
|
||||
callBack.invoke(info)
|
||||
d(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"modifyBindingCar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString()
|
||||
)
|
||||
d(SceneConstant.M_BINDING + TAG, "modifyBindingCar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString())
|
||||
updateCarVrIconRes(info.data.brandId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"modifyBindingCar onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
)
|
||||
e(SceneConstant.M_BINDING + TAG, "modifyBindingCar onError e = " + e.toString() + "---e.getMessage = " + e.message)
|
||||
}
|
||||
|
||||
override fun onComplete() {}
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minLines="5" />
|
||||
android:minLines="4" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -132,32 +132,9 @@ final class LoggerPrinter implements Printer {
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void log( String tag, LogLevel logLevel, String msg, Object... args) {
|
||||
private void log( String tag, LogLevel logLevel, String msg, Object... args) {
|
||||
String message = this.createMessage(msg, args);
|
||||
int methodCount = this.getMethodCount();
|
||||
this.logTopBorder(logLevel, tag);
|
||||
this.logHeaderContent(logLevel, tag, methodCount);
|
||||
byte[] bytes = message.getBytes();
|
||||
int length = bytes.length;
|
||||
if (length <= 4000) {
|
||||
if (methodCount > 0) {
|
||||
this.logDivider(logLevel, tag);
|
||||
}
|
||||
|
||||
this.logContent(logLevel, tag, message);
|
||||
this.logBottomBorder(logLevel, tag);
|
||||
} else {
|
||||
if (methodCount > 0) {
|
||||
this.logDivider(logLevel, tag);
|
||||
}
|
||||
|
||||
for (int i = 0; i < length; i += 4000) {
|
||||
int count = Math.min(length - i, 4000);
|
||||
this.logContent(logLevel, tag, new String(bytes, i, count));
|
||||
}
|
||||
|
||||
this.logBottomBorder(logLevel, tag);
|
||||
}
|
||||
logContent(logLevel, tag, message);
|
||||
}
|
||||
|
||||
private void logTopBorder(LogLevel logLevel, String tag) {
|
||||
@@ -198,11 +175,13 @@ final class LoggerPrinter implements Printer {
|
||||
}
|
||||
|
||||
private void logContent( LogLevel logLevel, String tag, String chunk) {
|
||||
String[] lines = chunk.split( System.getProperty("line.separator"));
|
||||
|
||||
for ( String line : lines) {
|
||||
this.logChunk(logLevel, tag, "║ " + line);
|
||||
}
|
||||
// String[] lines = chunk.split( System.getProperty("line.separator"));
|
||||
//
|
||||
// for ( String line : lines) {
|
||||
// this.logChunk(logLevel, tag, "║ " + line);
|
||||
// }
|
||||
//
|
||||
logChunk(logLevel, tag, chunk);
|
||||
}
|
||||
|
||||
private void logChunk( LogLevel logLevel, String tag, String chunk) {
|
||||
|
||||
Reference in New Issue
Block a user