add func of statusbar and func config wait to update
@@ -11,6 +11,7 @@ import android.text.TextUtils
|
||||
import android.transition.*
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.view.WindowManager.LayoutParams
|
||||
import android.view.animation.*
|
||||
@@ -82,6 +83,7 @@ import com.mogo.eagle.core.function.hmi.ui.setting.SOPSettingView
|
||||
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.V2XNotificationView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -192,6 +194,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
|
||||
override fun initViews() {
|
||||
initViewShowWithConfig()
|
||||
|
||||
//设置StatusBar初始状态
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
viewStatusBar.updateRightView(true, "demoMode", DemoModeView(requireContext()))
|
||||
} else {
|
||||
viewStatusBar.updateRightView(false, "demoMode", DemoModeView(requireContext()))
|
||||
}
|
||||
|
||||
ivCameraIcon?.setOnClickListener {
|
||||
if (cameraViewFloat == null) {
|
||||
showCameraList(CallerMonitorManager.getCameraList())
|
||||
@@ -413,6 +423,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
busOperationStatus?.showBusOperation()
|
||||
}
|
||||
|
||||
override fun setStatusBarDarkOrLight(light: Boolean) {
|
||||
viewStatusBar.setStatusBarDarkOrLight(light)
|
||||
}
|
||||
|
||||
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
viewStatusBar.updateRightView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 红绿灯 代理View
|
||||
*/
|
||||
|
||||
@@ -62,6 +62,7 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
@@ -573,6 +574,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 演示模式
|
||||
tbIsDemoMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerHmiManager.updateStatusBarRightView(isChecked,"demoMode", DemoModeView(context))
|
||||
CallerAutoPilotManager.setDemoMode(isChecked)
|
||||
if (!isChecked) {
|
||||
//关闭美化模式时,通知工控机
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.BatteryManager
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
class BatteryGroupView : LinearLayout {
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : super(context, attrs, defStyleAttr) {
|
||||
}
|
||||
|
||||
private var batteryHandler: BatteryHandler = BatteryHandler(this)
|
||||
private var view: View =
|
||||
LayoutInflater.from(context).inflate(R.layout.view_battery_group, this, true)
|
||||
private var batteryView: BatteryView = (view as BatteryGroupView).findViewById(R.id.viewBattery)
|
||||
private var ivBatteryCharge: ImageView = (view as BatteryGroupView).findViewById(R.id.ivBatteryCharge)
|
||||
|
||||
private val batteryStateReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
when (intent.action) {
|
||||
Intent.ACTION_BATTERY_CHANGED -> {
|
||||
val level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0)
|
||||
val scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, 0)
|
||||
val charge = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1)
|
||||
val percentage = (level * 100) / scale
|
||||
val message = Message.obtain()
|
||||
message.what = 0
|
||||
message.arg1 = percentage
|
||||
message.arg2 = charge
|
||||
batteryHandler.sendMessage(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
class BatteryHandler(batteryGroupView: BatteryGroupView) : Handler() {
|
||||
|
||||
//虚引用
|
||||
private var stateViewWeakReference: WeakReference<BatteryGroupView>? = null
|
||||
|
||||
init {
|
||||
stateViewWeakReference = WeakReference(batteryGroupView)
|
||||
}
|
||||
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
val batteryGroupView = stateViewWeakReference?.get()
|
||||
batteryGroupView?.let {
|
||||
if (msg.what == 0) {
|
||||
it.batteryView.setPower(msg.arg1)
|
||||
val isCharging = msg.arg2 == BatteryManager.BATTERY_STATUS_CHARGING ||
|
||||
msg.arg2 == BatteryManager.BATTERY_STATUS_FULL
|
||||
it.batteryView.setCharging(isCharging)
|
||||
if (isCharging) {
|
||||
it.ivBatteryCharge.visibility = View.VISIBLE
|
||||
} else {
|
||||
it.ivBatteryCharge.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val intentFilter = IntentFilter()
|
||||
intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED)
|
||||
context.registerReceiver(batteryStateReceiver, intentFilter)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
context.unregisterReceiver(batteryStateReceiver)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.Paint
|
||||
import android.graphics.RectF
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
class BatteryView : View {
|
||||
|
||||
private val radius = context.resources.getDimension(R.dimen.dp_4) // 圆角角度
|
||||
private val border = context.resources.getDimension(R.dimen.dp_3) // 外边缘宽度
|
||||
private val margin = context.resources.getDimension(R.dimen.dp_6) // 边框与内部电量距离
|
||||
private val width = context.resources.getDimension(R.dimen.dp_57) // 电池宽度
|
||||
private val height = context.resources.getDimension(R.dimen.dp_28) // 电池高度
|
||||
private val headWidth = context.resources.getDimension(R.dimen.dp_3) // 电池头宽度
|
||||
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 mPower = 100
|
||||
|
||||
//是否充电
|
||||
private var mIsCharging = false
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
) : super(context, attrs, 0) {
|
||||
|
||||
}
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : super(context, attrs, defStyleAttr) {
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
|
||||
setMeasuredDimension(width.toInt(), height.toInt())
|
||||
}
|
||||
|
||||
@SuppressLint("DrawAllocation")
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
//电池头
|
||||
val paint = Paint()
|
||||
paint.style = Paint.Style.FILL
|
||||
paint.strokeWidth = 0f
|
||||
paint.isAntiAlias = true
|
||||
paint.color = powerColor
|
||||
|
||||
val rectHead =
|
||||
RectF(width - headWidth, (height - headHeight) / 2, width, (height + headHeight) / 2)
|
||||
canvas.drawRoundRect(rectHead, headRadius, headRadius, paint)
|
||||
|
||||
//边框
|
||||
paint.strokeWidth = border
|
||||
paint.style = Paint.Style.STROKE
|
||||
val rectF =
|
||||
RectF(radius / 2, radius / 2, width - headWidth - radius / 2, height - radius / 2)
|
||||
canvas.drawRoundRect(rectF, radius, radius, paint)
|
||||
|
||||
//文字画笔
|
||||
val textPaint = Paint()
|
||||
textPaint.color = powerColor
|
||||
textPaint.isAntiAlias = true
|
||||
textPaint.textSize = batteryNumSize
|
||||
textPaint.textAlign = Paint.Align.CENTER
|
||||
//画数字
|
||||
val fontMetrics = textPaint.fontMetrics
|
||||
canvas.drawText(mPower.toString(), rectF.centerX(), abs(fontMetrics.top), textPaint)
|
||||
|
||||
//电池电量
|
||||
val powerValues = mPower / 100.0f
|
||||
val paintPower = Paint(paint)
|
||||
paintPower.style = Paint.Style.FILL
|
||||
|
||||
//低电量
|
||||
val lowerPaint = Paint(paint)
|
||||
lowerPaint.style = Paint.Style.FILL
|
||||
lowerPaint.color = powerColor
|
||||
if (mPower < 20) {
|
||||
lowerPaint.color = Color.RED
|
||||
} else {
|
||||
lowerPaint.color = batteryColor
|
||||
}
|
||||
|
||||
//画电量
|
||||
if (powerValues != 0f) {
|
||||
val right = (width - margin - headWidth) * powerValues
|
||||
val bottom = height - margin
|
||||
val rect = RectF(margin, margin, right, bottom)
|
||||
//画矩形
|
||||
canvas.drawRoundRect(rect, radius, radius, lowerPaint)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前电量
|
||||
*/
|
||||
fun setPower(power: Int) {
|
||||
if (this.mPower < 0) {
|
||||
this.mPower = 0
|
||||
}
|
||||
if (this.mPower > 100) {
|
||||
this.mPower = 100
|
||||
}
|
||||
this.mPower = power
|
||||
if(isAttachedToWindow){
|
||||
invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否充电中
|
||||
*/
|
||||
fun setCharging(charging: Boolean) {
|
||||
this.mIsCharging = charging
|
||||
invalidate()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
*/
|
||||
class BlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RelativeLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_blue_tooth, this, true)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* 演示模式控件
|
||||
* 放置于StatusBar右侧位置
|
||||
*/
|
||||
class DemoModeView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RelativeLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_demo_mode, this, true)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.RelativeLayout
|
||||
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 com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ScreenUtils
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.*
|
||||
|
||||
class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RelativeLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusBarView"
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_status_bar, this, true)
|
||||
}
|
||||
|
||||
private val rightViewList = mutableListOf<String>()
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val layoutParamsLeft =
|
||||
LayoutParams(ScreenUtils.getScreenWidth() / 3, BarUtils.getStatusBarHeight())
|
||||
viewStatusBarLeft.layoutParams = layoutParamsLeft
|
||||
val layoutParamsRight =
|
||||
LayoutParams(ScreenUtils.getScreenWidth() / 3 * 2, BarUtils.getStatusBarHeight())
|
||||
layoutParamsRight.addRule(ALIGN_PARENT_END)
|
||||
layoutParamsRight.addRule(CENTER_HORIZONTAL)
|
||||
layoutParamsRight.addRule(CENTER_IN_PARENT)
|
||||
layoutParamsRight.marginEnd = context.resources.getDimension(R.dimen.dp_44).toInt()
|
||||
viewStatusBarRight.layoutParams = layoutParamsRight
|
||||
viewStatusBarRight.addView(BatteryGroupView(this.context))
|
||||
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
when (skinMode) {
|
||||
0 -> setStatusBarDarkOrLight(false)
|
||||
1 -> setStatusBarDarkOrLight(true)
|
||||
}
|
||||
}
|
||||
|
||||
fun setStatusBarDarkOrLight(light: Boolean) {
|
||||
if (light) {
|
||||
setTextColor(resources.getColor(R.color.color_2C2E30))
|
||||
} else {
|
||||
setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
}
|
||||
}
|
||||
|
||||
fun updateRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
if (insert) {
|
||||
rightViewList.add(0, tag)
|
||||
viewStatusBarRight.addView(viewGroup, 0)
|
||||
} else {
|
||||
rightViewList.forEachIndexed { index, s ->
|
||||
if (s == tag) {
|
||||
rightViewList.removeAt(index)
|
||||
viewStatusBarRight.removeViewAt(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setTextColor(color: Int) {
|
||||
viewTextClock.setTextColor(color)
|
||||
viewStatusBarTag.setTextColor(color)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.net.wifi.WifiManager
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
|
||||
class WifiStateView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : AppCompatImageView(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "WifiStateView"
|
||||
|
||||
class WifiHandler(wifiStateView: WifiStateView) : Handler() {
|
||||
|
||||
//虚引用
|
||||
private var stateViewWeakReference: WeakReference<WifiStateView>? = null
|
||||
|
||||
init {
|
||||
stateViewWeakReference = WeakReference(wifiStateView)
|
||||
}
|
||||
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
val wifiStateView = stateViewWeakReference?.get()
|
||||
wifiStateView?.let {
|
||||
when (msg.what) {
|
||||
-1 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_close)
|
||||
0 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_one)
|
||||
1 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_two)
|
||||
2 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_three)
|
||||
3 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_four)
|
||||
4 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_five)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var wifiManager: WifiManager? = null
|
||||
private var wifiHandler: WifiHandler? = null
|
||||
|
||||
init {
|
||||
wifiManager =
|
||||
context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager?
|
||||
wifiHandler = WifiHandler(this)
|
||||
}
|
||||
|
||||
private val wifiStateReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
when (intent.action) {
|
||||
WifiManager.WIFI_STATE_CHANGED_ACTION, WifiManager.RSSI_CHANGED_ACTION -> {
|
||||
if (wifiManager!!.wifiState == WifiManager.WIFI_STATE_DISABLED
|
||||
|| wifiManager!!.wifiState ==WifiManager.WIFI_STATE_DISABLING) {
|
||||
wifiHandler?.sendEmptyMessage(-1)
|
||||
return
|
||||
}
|
||||
val wifiInfo = wifiManager!!.connectionInfo
|
||||
val level = WifiManager.calculateSignalLevel(wifiInfo.rssi, 5)
|
||||
wifiHandler?.sendEmptyMessage(level)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val intentFilter = IntentFilter()
|
||||
//Wifi连接状态变化
|
||||
intentFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION)
|
||||
//Wifi信号强度变化
|
||||
intentFilter.addAction(WifiManager.RSSI_CHANGED_ACTION)
|
||||
context.registerReceiver(wifiStateReceiver, intentFilter)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
wifiHandler?.removeCallbacksAndMessages(null)
|
||||
context.unregisterReceiver(wifiStateReceiver)
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
|
||||
@@ -34,7 +35,6 @@ import com.mogo.eagle.core.function.main.moujie.ConnectBluetoothEvent;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
@@ -336,11 +336,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
@Override
|
||||
public void onSkinModeChange(int skinMode) {
|
||||
if (skinMode == 0) {
|
||||
BarUtils.setStatusBarLightMode(this, false);
|
||||
} else {
|
||||
BarUtils.setStatusBarLightMode(this, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private synchronized void sendAcc(boolean isSend, double acc) {
|
||||
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
@@ -6,6 +6,14 @@
|
||||
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"
|
||||
@@ -50,10 +58,10 @@
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:id="@+id/clTakeOverView"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.BatteryView
|
||||
android:id="@+id/viewBattery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBatteryCharge"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/battery_charge"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_54">
|
||||
|
||||
<ImageView
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/blue_tooth"
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_54">
|
||||
|
||||
<ImageView
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/demo_mode"
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_72">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/viewTextClock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/viewStatusBarTag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_27"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/status_bar_tag"
|
||||
android:textColor="@color/color_2C2E30"
|
||||
android:textSize="@dimen/dp_35" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:layout_width="@dimen/dp_54"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_18" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/viewStatusBarRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_44"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -9,4 +9,6 @@
|
||||
<color name="acc_default_txt_color">#FF343C63</color>
|
||||
<color name="hmi_check_keyboard_input_field">#FF282F62</color>
|
||||
<color name="bus_autopilot_text_color_normal">#FFFFFF</color>
|
||||
<color name="color_2C2E30">#2C2E30</color>
|
||||
<color name="color_D4D8DC">#D4D8DC</color>
|
||||
</resources>
|
||||
@@ -18,6 +18,9 @@
|
||||
<color name="color_FF0006">#FF0006</color>
|
||||
<color name="color_0099dd">#0099dd</color>
|
||||
<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="background_wtf">#FF999900</color>
|
||||
<color name="background_error">#FFCC0000</color>
|
||||
|
||||
@@ -52,5 +52,5 @@
|
||||
<string name="modify_binding_car">是否修改车机绑定?</string>
|
||||
<string name="to_binding_car">是否绑定车机?</string>
|
||||
|
||||
|
||||
<string name="status_bar_tag">蘑菇星云</string>
|
||||
</resources>
|
||||
|
||||