[6.7.0][启自驾] feat: 增加启自驾父容器 View;
feat: 增驾调用 Och 自定义 view 接口&provider ;
This commit is contained in:
@@ -5,12 +5,16 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchCustomViewManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.bone.status.StartAutoPilotStatusView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.SpeedStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import kotlinx.android.synthetic.main.view_bone_top_status.view.speed_custom
|
||||
import kotlinx.android.synthetic.main.view_bone_top_status.view.startAutoPilotContainer
|
||||
import kotlinx.android.synthetic.main.view_bone_top_status.view.topStatusContainer
|
||||
|
||||
class BoneTopStatusLayout @JvmOverloads constructor(
|
||||
@@ -24,6 +28,24 @@ class BoneTopStatusLayout @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_bone_top_status, this, true)
|
||||
addStartAutoPilotView()
|
||||
}
|
||||
|
||||
private fun addStartAutoPilotView() {
|
||||
if (context == null) {
|
||||
CallerLogger.e(TAG, "addStartAutoPilotView context==null")
|
||||
return
|
||||
}
|
||||
kotlin.runCatching {
|
||||
startAutoPilotContainer?.also { container ->
|
||||
container.removeAllViews()
|
||||
val view = CallerOchCustomViewManager.getAutopilotView(context)
|
||||
Logger.d(TAG, "$view ${Thread.currentThread().name}")
|
||||
view?.also {
|
||||
container.addView(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchCustomViewManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager.initStageTwo
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -80,6 +81,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
window.setBackgroundDrawable(null)
|
||||
initConnectInfoRV()
|
||||
CallerHmiManager.init(this)
|
||||
CallerOchCustomViewManager.init(this)
|
||||
|
||||
// 检查是否有悬浮窗权限
|
||||
if (Settings.canDrawOverlays(this)) {
|
||||
|
||||
@@ -18,9 +18,18 @@
|
||||
<com.mogo.eagle.core.function.hmi.bone.status.StartAutoPilotStatusView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_59"
|
||||
android:layout_marginStart="@dimen/dp_39"
|
||||
android:layout_marginBottom="@dimen/dp_59"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/startAutoPilotContainer"
|
||||
android:layout_width="@dimen/dp_226"
|
||||
android:layout_height="@dimen/dp_226"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:layout_marginRight="@dimen/dp_68"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user