fix trafficdataview ui logic problem
This commit is contained in:
@@ -14,6 +14,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
@@ -58,15 +59,19 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
} else {
|
||||
accTextView.setText("- " + accStr);
|
||||
}
|
||||
|
||||
if (mBrake > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
} else if (mThrottle >= 0 && mBrake == 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
|
||||
} else {
|
||||
int state = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
|
||||
if (state < 2) {
|
||||
if (mBrake > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
} else if (mThrottle >= 0 && mBrake == 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
|
||||
} else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
}
|
||||
if (state == 2) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
|
||||
}
|
||||
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user