[3.4.0]调整Taxi乘客屏红绿灯
This commit is contained in:
@@ -85,11 +85,13 @@
|
|||||||
android:id="@+id/traffic_light_view"
|
android:id="@+id/traffic_light_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_100"
|
android:layout_marginTop="@dimen/dp_83"
|
||||||
android:layout_marginRight="@dimen/taxi_p_traffic_light_layout_margin_right"
|
android:layout_marginRight="@dimen/taxi_p_traffic_light_layout_margin_right"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:traffic_light_user="taxi_p"
|
||||||
|
/>
|
||||||
|
|
||||||
<!--转向灯-->
|
<!--转向灯-->
|
||||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.util.Log
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
@@ -46,6 +45,17 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
|||||||
private var mLightSourceDivider: View? = null
|
private var mLightSourceDivider: View? = null
|
||||||
private var mCurrentLightId = TrafficLightEnum.BLACK
|
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() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
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)
|
mLightSourceTV = findViewById(R.id.hmi_traffic_light_source)
|
||||||
mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider)
|
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)
|
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||||
CallerHmiViewControlListenerManager.addListener(TrafficLightView_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>
|
</attr>
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
|
<declare-styleable name="TrafficLightView">
|
||||||
|
<attr name="traffic_light_user">
|
||||||
|
<enum name="taxi_p" value="1" />
|
||||||
|
</attr>
|
||||||
|
</declare-styleable>
|
||||||
|
|
||||||
<declare-styleable name="PncActionsView">
|
<declare-styleable name="PncActionsView">
|
||||||
<attr name="background_resource" format="reference"/>
|
<attr name="background_resource" format="reference"/>
|
||||||
<attr name="pnc_top_margin" format="dimension"/>
|
<attr name="pnc_top_margin" format="dimension"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user