[3.4.0]调整Taxi乘客屏红绿灯
This commit is contained in:
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
@@ -46,6 +45,17 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
private var mLightSourceDivider: View? = null
|
||||
private var mCurrentLightId = TrafficLightEnum.BLACK
|
||||
|
||||
private var trafficLightUser = 0 //0:默认;1:Taxi乘客屏肤色
|
||||
|
||||
init{
|
||||
context?.let {
|
||||
val typedArray = it.obtainStyledAttributes(attrs, R.styleable.TrafficLightView)
|
||||
trafficLightUser = typedArray.getInt(R.styleable.TrafficLightView_traffic_light_user,0)
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
||||
@@ -55,6 +65,12 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
mLightSourceTV = findViewById(R.id.hmi_traffic_light_source)
|
||||
mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider)
|
||||
|
||||
if(trafficLightUser==1){
|
||||
hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg_taxi_p)
|
||||
hmi_traffic_light_source.setTextColor(resources.getColor(R.color.color_2D3E5F))
|
||||
hmi_traffic_light_divider.setBackgroundColor(resources.getColor(R.color.color_2D3E5F))
|
||||
}
|
||||
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(TrafficLightView_TAG, this)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FFCEDCF7"/>
|
||||
<corners android:radius="@dimen/hmi_traffic_light_layout_corner"/>
|
||||
</shape>
|
||||
@@ -77,6 +77,12 @@
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TrafficLightView">
|
||||
<attr name="traffic_light_user">
|
||||
<enum name="taxi_p" value="1" />
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PncActionsView">
|
||||
<attr name="background_resource" format="reference"/>
|
||||
<attr name="pnc_top_margin" format="dimension"/>
|
||||
|
||||
Reference in New Issue
Block a user