[merge] 合并接驳车代码
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
android:id="@+id/module_carchatting_call_head"
|
||||
android:layout_width="@dimen/module_call_chat_calling_iv_hawk_eye_width_height"
|
||||
android:layout_height="@dimen/module_call_chat_calling_iv_hawk_eye_width_height"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@mipmap/module_carchatting_hawk_eye_default_head_img"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -25,7 +24,6 @@
|
||||
android:layout_width="@dimen/module_call_chat_hawk_eye_circle_btn_size"
|
||||
android:layout_height="@dimen/module_call_chat_hawk_eye_circle_btn_size"
|
||||
android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@mipmap/module_carchatting_launcher_calling_hangup"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
android:id="@+id/module_carchatting_call_head"
|
||||
android:layout_width="@dimen/module_call_chat_incoming_aisdk_tag_width"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/module_carchatting_aicloud_incoming"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -26,7 +25,6 @@
|
||||
android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right"
|
||||
android:layout_marginRight="@dimen/module_call_chat_state_incoming_hawk_eye_call_margin_right"
|
||||
android:clickable="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@mipmap/module_callchatting_launcher_incoming_answer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/module_carchatting_incoming_hangUp"
|
||||
@@ -39,7 +37,6 @@
|
||||
android:layout_height="@dimen/module_call_chat_hawk_eye_incoming_circle_btn_size"
|
||||
android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right"
|
||||
android:clickable="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@mipmap/module_callchatting_launcher_incoming_hangup"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -9,9 +9,11 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb
|
||||
import com.mogo.eagle.core.function.msgbox.db.MsgBoxInfo
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@@ -139,7 +141,11 @@ object DataManager {
|
||||
fun queryAllMessages(context: Context) {
|
||||
scope.launch {
|
||||
initCache()
|
||||
getCacheMessages(context)
|
||||
try {
|
||||
getCacheMessages(context)
|
||||
} catch (e: Exception) {
|
||||
CallerLogger.e("DataManager", e.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +162,7 @@ object DataManager {
|
||||
}
|
||||
|
||||
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> = withContext(Dispatchers.IO) {
|
||||
delay(2000)
|
||||
return@withContext MsgBoxDb.getDb(context)
|
||||
.monitorDao()
|
||||
.getAllCachedMessages()
|
||||
|
||||
@@ -3,17 +3,21 @@ package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
public abstract class DispatchBaseDialog extends Dialog {
|
||||
|
||||
public DispatchBaseDialog(@NonNull Context context) {
|
||||
super(context, R.style.Base_AlertDialog_AppCompat);
|
||||
super(context,R.style.BaseFloatDialogStyle);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||
} else {
|
||||
@@ -26,4 +30,22 @@ public abstract class DispatchBaseDialog extends Dialog {
|
||||
|
||||
public abstract void showDialog(DispatchAdasAutoPilotLocReceiverBean dispatchContent);
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
setWindowSize();
|
||||
}
|
||||
private void setWindowSize(){
|
||||
WindowManager.LayoutParams attributes = getWindow().getAttributes();
|
||||
attributes.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
attributes.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
FrameLayout content = (FrameLayout)findViewById(android.R.id.content);
|
||||
if(content!=null){
|
||||
ViewGroup rootView = (ViewGroup) content.getChildAt(0);
|
||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) rootView.getLayoutParams();
|
||||
layoutParams.gravity = Gravity.CENTER;
|
||||
rootView.setLayoutParams(layoutParams);
|
||||
}
|
||||
getWindow().setAttributes(attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,9 +60,13 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.rousetime.android_startup.StartupManager;
|
||||
import com.rousetime.android_startup.model.LoggerLevel;
|
||||
import com.rousetime.android_startup.model.StartupConfig;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -264,6 +268,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
// 启动Native内存泄漏监测
|
||||
startLeakMonitor();
|
||||
}
|
||||
checkMonitorDb();
|
||||
}
|
||||
|
||||
private void startLeakMonitor() {
|
||||
@@ -290,6 +295,25 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
LeakMonitor.INSTANCE.start();
|
||||
}
|
||||
|
||||
private void checkMonitorDb() {
|
||||
new Thread(() -> {
|
||||
long limitId = 50001;
|
||||
File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME);
|
||||
try {
|
||||
if (file != null && file.exists()) {
|
||||
List<CpuInfo> cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId);
|
||||
List<MemInfo> memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId);
|
||||
// 大于5w条清除
|
||||
if (cpuList.size() > 0 || memList.size() > 0) {
|
||||
this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(TAG, e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_NATIVE_LEAK,
|
||||
linkCode = CHAIN_LINK_LEAK,
|
||||
|
||||
Reference in New Issue
Block a user