This commit is contained in:
liujing
2022-05-31 20:14:08 +08:00
parent f4a3747ac3
commit efa5295360

View File

@@ -79,12 +79,15 @@ public class SteeringWheelView extends ConstraintLayout {
steeringCircularV.setBackWidth(8);
steeringCircularV.setBackColor(R.color.hmi_light_back_bg);
steeringCircularV.setProgColor(R.color.hmi_light_blue, R.color.hmi_dark_blue);
steeringCircularV.setProgress((int) (180 * 100) / 360, 1000);
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
steeringCircularVAlpha = findViewById(R.id.steering_circular_alpha);
steeringCircularV.setProgColor(R.color.hmi_dark_blue, R.color.hmi_light_blue);
steeringCircularVAlpha.setBackWidth(8);
steeringCircularVAlpha.setBackColor(R.color.hmi_clear_00);
steeringCircularVAlpha.setProgColor(R.color.hmi_light_blue_alpha_ff, R.color.hmi_light_blue_alpha_00);
steeringCircularVAlpha.setBlurMaskFilter(BlurMaskFilter.Blur.NORMAL, 12);
steeringCircularVAlpha.setProgress((int) (180 * 100) / 360, 1000);
}
}
@@ -189,7 +192,7 @@ public class SteeringWheelView extends ConstraintLayout {
} else {
Log.d(TAG, "onAutopilotSteeringData error");
}
animationWithSteeringData(steering);
animationWithSteeringData(-steering);
if (steeringCircularV != null) {
steeringCircularV.setProgress((int) (-steering * 100) / 360, 1000);
}
@@ -239,14 +242,14 @@ public class SteeringWheelView extends ConstraintLayout {
*/
private void animationWithSteeringData(float steering) {
Log.d(TAG, "方向盘转动" + String.valueOf(steering));
rotateAnimation = new RotateAnimation(fromDegrees, -steering,
rotateAnimation = new RotateAnimation(fromDegrees, steering,
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
RotateAnimation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(1000);//旋转时长
rotateAnimation.setFillAfter(true);//旋转后保持原状
autopilotIV.clearAnimation();
autopilotIV.startAnimation(rotateAnimation);
fromDegrees = -steering;
fromDegrees = steering;
}
}