new#Vr模式车速仪表盘

This commit is contained in:
wujifei
2021-03-29 16:05:23 +08:00
parent a65758b8cf
commit 4d8c4c091c
25 changed files with 480 additions and 217 deletions

View File

@@ -200,6 +200,13 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private FrameLayout flSpeed;
private ArcView mouduleArc;
private ConstraintLayout clTrafficLight;
private TextView tvYellow;
private TextView tvRed;
private TextView tvGreen;
private ImageView ivBg;
/**
@@ -360,6 +367,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
MyLocationUtil.setMyLocationIconUrl(getContext());
flSpeed = (FrameLayout) findViewById(R.id.fl_speed);
mouduleArc = (ArcView) findViewById(R.id.moudule_arc);
clTrafficLight = (ConstraintLayout) findViewById(R.id.cl_traffic_light);
tvYellow = (TextView) findViewById(R.id.tv_yellow);
tvRed = (TextView) findViewById(R.id.tv_red);
tvGreen = (TextView) findViewById(R.id.tv_green);
ivBg = (ImageView) findViewById(R.id.iv_bg);
// GlideApp.with(getContext()).load(R.drawable.yun_bg).into(ivBg);
}
private int debugPanelClickCount = 0;
@@ -391,6 +404,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
localIsVrMode = true;
flSpeed.setVisibility(View.VISIBLE);
clTrafficLight.setVisibility(View.VISIBLE);
}
}
@@ -417,6 +431,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoLocationListener(TAG);
localIsVrMode = false;
flSpeed.setVisibility(View.GONE);
clTrafficLight.setVisibility(View.GONE);
}
}
@@ -1324,6 +1339,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
int speed = (int) (location.getSpeed() * 3.6F);
mouduleArc.setArcColor(Color.parseColor(speed > 40 ? "#DB3137" : "#3E77F6"));
mouduleArc.setValues(speed);
flSpeed.setBackgroundResource(speed > 40 ? R.drawable.yi_biao_pan_bg_speeding : R.drawable.yi_biao_pan_bg_nor);
}
@Override