fix ui problem and wait to addnew ui
This commit is contained in:
@@ -84,6 +84,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.MaskView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -134,6 +135,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
private var mSOPSettingViewFloat: WarningFloat.Builder? = null
|
||||
private var mSOPSettingView: SOPSettingView? = null
|
||||
|
||||
//StatusView
|
||||
private var statusBarViewFloat: WarningFloat.Builder? = null
|
||||
private var statusBarView: StatusBarView? = null
|
||||
|
||||
private var mNoticeFloat: WarningFloat.Builder? = null
|
||||
|
||||
// 超视距、路侧、前车直播
|
||||
@@ -193,13 +198,15 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
toggleStatusBarView()
|
||||
|
||||
initViewShowWithConfig()
|
||||
|
||||
//设置StatusBar初始状态
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
viewStatusBar.updateRightView(true, "demoMode", DemoModeView(requireContext()))
|
||||
statusBarView?.updateRightView(true, "demoMode", DemoModeView(requireContext()))
|
||||
} else {
|
||||
viewStatusBar.updateRightView(false, "demoMode", DemoModeView(requireContext()))
|
||||
statusBarView?.updateRightView(false, "demoMode", DemoModeView(requireContext()))
|
||||
}
|
||||
|
||||
ivCameraIcon?.setOnClickListener {
|
||||
@@ -424,11 +431,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
|
||||
override fun setStatusBarDarkOrLight(light: Boolean) {
|
||||
viewStatusBar.setStatusBarDarkOrLight(light)
|
||||
statusBarView?.setStatusBarDarkOrLight(light)
|
||||
}
|
||||
|
||||
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
viewStatusBar.updateRightView(insert, tag, viewGroup)
|
||||
statusBarView?.updateRightView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -686,7 +693,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun toggleSOPView() {
|
||||
activity?.let{
|
||||
if(mSOPSettingViewFloat!= null){
|
||||
@@ -738,6 +744,52 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
private fun toggleStatusBarView() {
|
||||
activity?.let{
|
||||
if(statusBarViewFloat!= null){
|
||||
WarningFloat.dismiss(statusBarViewFloat!!.config.floatTag, false)
|
||||
statusBarViewFloat = null
|
||||
statusBarView = null
|
||||
}else{
|
||||
if (statusBarView == null){
|
||||
statusBarView = StatusBarView(it)
|
||||
}
|
||||
val side = TOP
|
||||
val gravity = Gravity.TOP
|
||||
statusBarViewFloat = WarningFloat.with(it)
|
||||
.setTag("statusBarView")
|
||||
.setLayout(statusBarView!!)
|
||||
.setSidePattern(side)
|
||||
.setWindowWidth(ScreenUtils.getScreenWidth())
|
||||
.setWindowHeight(BarUtils.getStatusBarHeight())
|
||||
.setGravity(gravity, 0)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = LinearInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示VR下V2X预警
|
||||
*
|
||||
|
||||
@@ -8,11 +8,17 @@ import android.graphics.Paint
|
||||
import android.graphics.RectF
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
class BatteryView : View {
|
||||
class BatteryView : View , IMoGoSkinModeChangeListener {
|
||||
|
||||
companion object{
|
||||
const val TAG = "BatteryView"
|
||||
}
|
||||
|
||||
private val radius = context.resources.getDimension(R.dimen.dp_4) // 圆角角度
|
||||
private val border = context.resources.getDimension(R.dimen.dp_3) // 外边缘宽度
|
||||
@@ -23,8 +29,8 @@ class BatteryView : View {
|
||||
private val headHeight = context.resources.getDimension(R.dimen.dp_8) // 电池头高度
|
||||
private val headRadius = context.resources.getDimension(R.dimen.dp_1) // 电池头圆角角度
|
||||
private val batteryNumSize = context.resources.getDimension(R.dimen.dp_20) // 电量显示文字大小
|
||||
private val batteryColor = context.resources.getColor(R.color.color_7FECECEC) // 电量内部颜色
|
||||
private val powerColor = Color.WHITE
|
||||
private var batteryColor = context.resources.getColor(R.color.color_27FFFFFF) // 电量内部颜色
|
||||
private var powerColor = Color.WHITE
|
||||
|
||||
//默认满电
|
||||
private var mPower = 100
|
||||
@@ -132,4 +138,28 @@ class BatteryView : View {
|
||||
invalidate()
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
when (skinMode) {
|
||||
0 -> {
|
||||
batteryColor = resources.getColor(R.color.color_27FFFFFF)
|
||||
powerColor = Color.WHITE
|
||||
}
|
||||
1 -> {
|
||||
batteryColor = resources.getColor(R.color.color_1E111111)
|
||||
powerColor = resources.getColor(R.color.color_2C2E30)
|
||||
}
|
||||
}
|
||||
invalidate()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ class StatusBarView @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_status_bar, this, true)
|
||||
setOnClickListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private val rightViewList = CopyOnWriteArrayList<String>()
|
||||
|
||||
@@ -6,14 +6,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
android:id="@+id/viewStatusBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewShowDebugView"
|
||||
android:layout_width="@dimen/dp_400"
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
<color name="color_FFFFFF">#FFFFFF</color>
|
||||
<color name="color_2C2E30">#2C2E30</color>
|
||||
<color name="color_D4D8DC">#D4D8DC</color>
|
||||
<color name="color_7FECECEC">#7FECECEC</color>
|
||||
<color name="color_27FFFFFF">#27FFFFFF</color>
|
||||
<color name="color_1E111111">#1E111111</color>
|
||||
|
||||
<color name="background_wtf">#FF999900</color>
|
||||
<color name="background_error">#FFCC0000</color>
|
||||
|
||||
Reference in New Issue
Block a user