ui
This commit is contained in:
@@ -3,13 +3,17 @@ package com.mogo.eagle.core.function.hmi.ui.pnc
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
|
||||
import com.mogo.eagle.core.data.trafficlight.isRed
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -68,7 +72,11 @@ class PncActionsView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
// update view
|
||||
actions?.let {
|
||||
if(actions.isNullOrEmpty() || getAutoPilotStatusInfo().state != STATUS_AUTOPILOT_RUNNING){
|
||||
tvHmiPncActions.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
}else{
|
||||
tvHmiPncActions.background = AppCompatResources.getDrawable(context, R.drawable.pnc_actions_bg)
|
||||
tvHmiPncActions.text = actions
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import static com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
@@ -61,7 +63,7 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
accTextView.setText("- " + accStr);
|
||||
}
|
||||
int state = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
|
||||
if (state < 2) {
|
||||
if (state < STATUS_AUTOPILOT_RUNNING) {
|
||||
if (mBrake > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
} else if (mThrottle >= 0 && mBrake == 0) {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@@ -184,7 +184,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_200"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
<TextView
|
||||
android:id="@+id/tvHmiPncActions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_38"
|
||||
android:layout_height="@dimen/dp_96"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_72"
|
||||
android:paddingEnd="@dimen/dp_72"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_48"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -19,14 +19,17 @@
|
||||
<dimen name="dp_42">42px</dimen>
|
||||
<dimen name="dp_45">45px</dimen>
|
||||
<dimen name="dp_46">46px</dimen>
|
||||
<dimen name="dp_48">48px</dimen>
|
||||
<dimen name="dp_50">50px</dimen>
|
||||
<dimen name="dp_52">52px</dimen>
|
||||
<dimen name="dp_54">54px</dimen>
|
||||
<dimen name="dp_56">56px</dimen>
|
||||
<dimen name="dp_62">62px</dimen>
|
||||
<dimen name="dp_70">70px</dimen>
|
||||
<dimen name="dp_75">80px</dimen>
|
||||
<dimen name="dp_72">72px</dimen>
|
||||
<dimen name="dp_75">75px</dimen>
|
||||
<dimen name="dp_80">80px</dimen>
|
||||
<dimen name="dp_96">96px</dimen>
|
||||
<dimen name="dp_100">100px</dimen>
|
||||
<dimen name="dp_140">140px</dimen>
|
||||
<dimen name="dp_150">150px</dimen>
|
||||
|
||||
Reference in New Issue
Block a user