Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0' into dev_robotaxi-d-app-module_2110_yangyakun_2.11.0
# Conflicts: # OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java # OCH/mogo-och-bus/src/main/res/values/colors.xml # OCH/mogo-och-common-module/src/main/res/values/colors.xml # OCH/mogo-och-common-module/src/main/res/values/styles.xml
@@ -8,6 +8,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
@@ -15,6 +16,8 @@ import com.mogo.och.bus.passenger.bean.BusPassengerStation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_ARRIVING;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_LEAVING;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
|
||||
|
||||
/**
|
||||
@@ -25,10 +28,6 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
|
||||
private Context mContext;
|
||||
private List<BusPassengerStation> mStations;
|
||||
private static final int LINE_START_STATION_ITEM = 0;
|
||||
private static final int LINE_END_STATION_ITEM = 1;
|
||||
private static final int LINE_MIDDLE_STATION_ITEM = 2;
|
||||
// private String preArrivingStation = "";
|
||||
|
||||
public BusPassengerLineStationsAdapter(Context context, List<BusPassengerStation> stations){
|
||||
this.mContext = context;
|
||||
@@ -38,78 +37,57 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == LINE_START_STATION_ITEM){
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.bus_p_stations_start_item,parent,false);
|
||||
StartStationViewHolder viewHolder = new StartStationViewHolder(view);
|
||||
return viewHolder;
|
||||
}else if (viewType == LINE_END_STATION_ITEM) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.bus_p_stations_end_item,parent,false);
|
||||
EndStationViewHolder viewHolder = new EndStationViewHolder(view);
|
||||
return viewHolder;
|
||||
}else {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.bus_p_stations_middle_item,parent,false);
|
||||
MiddleStationViewHolder viewHolder = new MiddleStationViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.bus_p_stations_common_item,parent,false);
|
||||
StationViewHolder viewHolder = new StationViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
BusPassengerStation station = mStations.get(position);
|
||||
if (holder instanceof StartStationViewHolder){
|
||||
StartStationViewHolder viewHolder = (StartStationViewHolder)holder;
|
||||
// if (!preArrivingStation.equals(station.getName())){
|
||||
viewHolder.startStationName.setText(station.getName());
|
||||
// }
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//到站
|
||||
viewHolder.curStationBg.setVisibility(View.VISIBLE);
|
||||
viewHolder.stationCircle.setVisibility(View.GONE);
|
||||
viewHolder.startStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.startStationName.setSelected(true);
|
||||
// preArrivingStation = station.getName();
|
||||
StationViewHolder viewHolder = (StationViewHolder)holder;
|
||||
viewHolder.stationName.setText(station.getName());
|
||||
if (position == 0){ //第一个 起点
|
||||
viewHolder.stationTagTxt.setText("起");
|
||||
viewHolder.stationStationTag.setBackground(mContext.getDrawable(R.drawable.bg_bus_p_start_tag_bg));
|
||||
viewHolder.groupStationTagPanel.setVisibility(View.VISIBLE);
|
||||
viewHolder.curArrowBg.setVisibility(View.GONE);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//到达未离开
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_green);
|
||||
}else {
|
||||
viewHolder.curStationBg.setVisibility(View.GONE);
|
||||
viewHolder.stationCircle.setVisibility(View.VISIBLE);
|
||||
viewHolder.startStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.startStationName.setSelected(false);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
|
||||
}
|
||||
}else if (holder instanceof EndStationViewHolder){
|
||||
EndStationViewHolder viewHolder = (EndStationViewHolder)holder;
|
||||
// if (!preArrivingStation.equals(station.getName())){
|
||||
viewHolder.endStationName.setText(station.getName());
|
||||
// }
|
||||
BusPassengerStation preStation = mStations.get(position -1);
|
||||
if ((preStation.getDrivingStatus() == STATION_STATUS_STOPPED && preStation.isLeaving())
|
||||
|| (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving())){//到站
|
||||
viewHolder.curStationBg.setVisibility(View.VISIBLE);
|
||||
viewHolder.stationCircle.setVisibility(View.GONE);
|
||||
viewHolder.endStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.endStationName.setSelected(true);
|
||||
// preArrivingStation = station.getName();
|
||||
}else{
|
||||
if (position == mStations.size() - 1){
|
||||
viewHolder.stationTagTxt.setText("终");
|
||||
viewHolder.stationStationTag.setBackground(mContext.getDrawable(R.drawable.bg_bus_p_end_tag_bg));
|
||||
viewHolder.groupStationTagPanel.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
viewHolder.curStationBg.setVisibility(View.GONE);
|
||||
viewHolder.stationCircle.setVisibility(View.VISIBLE);
|
||||
viewHolder.endStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.endStationName.setSelected(false);
|
||||
viewHolder.groupStationTagPanel.setVisibility(View.GONE);
|
||||
}
|
||||
}else {
|
||||
MiddleStationViewHolder viewHolder = (MiddleStationViewHolder)holder;
|
||||
// if (!preArrivingStation.equals(station.getName())){
|
||||
viewHolder.middleStationName.setText(station.getName());
|
||||
// }
|
||||
viewHolder.curArrowBg.setVisibility(View.VISIBLE);
|
||||
BusPassengerStation preStation = mStations.get(position -1);
|
||||
if ((preStation.getDrivingStatus() == STATION_STATUS_STOPPED && preStation.isLeaving())
|
||||
|| (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving())) {//到站
|
||||
viewHolder.curStationBg.setVisibility(View.VISIBLE);
|
||||
viewHolder.middleStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.stationCircle.setVisibility(View.GONE);
|
||||
viewHolder.middleStationName.setSelected(true);
|
||||
// preArrivingStation = station.getName();
|
||||
}else {
|
||||
viewHolder.curStationBg.setVisibility(View.GONE);
|
||||
viewHolder.middleStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.stationCircle.setVisibility(View.VISIBLE);
|
||||
viewHolder.middleStationName.setSelected(false);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_LEAVING ||
|
||||
(station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving())){ //过站
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_grey);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
|
||||
} else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//刚到站未离开的
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_grey);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_green);
|
||||
}else if (station.getDrivingStatus() == STATION_STATUS_ARRIVING && preStation.isLeaving()){//即将到站
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_green);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_green);
|
||||
}else if (station.getDrivingStatus() == STATION_STATUS_ARRIVING &&
|
||||
(preStation.getDrivingStatus() == STATION_STATUS_ARRIVING
|
||||
|| preStation.getDrivingStatus() == STATION_STATUS_STOPPED)){ //未到站的并且前面也是未到站或者刚到站的
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_blue);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,55 +96,23 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
public int getItemCount() {
|
||||
return mStations.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
//第一个要显示时间
|
||||
if (position == 0){
|
||||
return LINE_START_STATION_ITEM;
|
||||
}else if (position == mStations.size() -1){
|
||||
return LINE_END_STATION_ITEM;
|
||||
}else {
|
||||
return LINE_MIDDLE_STATION_ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class StartStationViewHolder extends RecyclerView.ViewHolder{
|
||||
public TextView startStationName;
|
||||
class StationViewHolder extends RecyclerView.ViewHolder{
|
||||
public TextView stationName;
|
||||
public ImageView stationCircle;
|
||||
public ImageView curStationBg;
|
||||
public StartStationViewHolder(@NonNull View itemView) {
|
||||
public ImageView curArrowBg;
|
||||
public ImageView stationStationTag;
|
||||
public TextView stationTagTxt;
|
||||
public Group groupStationTagPanel;
|
||||
public StationViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
startStationName = itemView.findViewById(R.id.bus_p_start_station);
|
||||
stationCircle = itemView.findViewById(R.id.bus_p_start_circle);
|
||||
curStationBg = itemView.findViewById(R.id.bus_p_cur_start_station_tag);
|
||||
stationName = itemView.findViewById(R.id.bus_p_station);
|
||||
stationCircle = itemView.findViewById(R.id.bus_p_circle);
|
||||
curArrowBg = itemView.findViewById(R.id.bus_p_cur_arrow_bg);
|
||||
stationStationTag = itemView.findViewById(R.id.bus_p_tag);
|
||||
stationTagTxt = itemView.findViewById(R.id.bus_p_tag_txt);
|
||||
groupStationTagPanel = itemView.findViewById(R.id.group_station_tag_panel);
|
||||
}
|
||||
}
|
||||
|
||||
class EndStationViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
public TextView endStationName;
|
||||
public ImageView stationCircle;
|
||||
public ImageView curStationBg;
|
||||
public EndStationViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
endStationName = itemView.findViewById(R.id.bus_p_end_station);
|
||||
stationCircle = itemView.findViewById(R.id.bus_p_end_circle);
|
||||
curStationBg = itemView.findViewById(R.id.bus_p_cur_end_station_tag);
|
||||
}
|
||||
}
|
||||
|
||||
class MiddleStationViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
public TextView middleStationName;
|
||||
public ImageView curStationBg;
|
||||
public ImageView stationCircle;
|
||||
public MiddleStationViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
middleStationName = itemView.findViewById(R.id.bus_p_middle_station);
|
||||
curStationBg = itemView.findViewById(R.id.bus_p_middle_tag);
|
||||
stationCircle = itemView.findViewById(R.id.bus_p_middle_circle);
|
||||
}
|
||||
}
|
||||
@@ -24,4 +24,5 @@ public class BusPassengerRoutesResponse extends BaseData {
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.bean;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口返回接口数据封装
|
||||
@@ -15,6 +16,7 @@ public class BusPassengerRoutesResult {
|
||||
private String description;
|
||||
private int status;
|
||||
private String runningDur; //运营时间
|
||||
private long taskTime; //线路时间班次
|
||||
|
||||
public List<BusPassengerStation> getSites() {
|
||||
return sites;
|
||||
@@ -56,4 +58,22 @@ public class BusPassengerRoutesResult {
|
||||
", runningDur='" + runningDur + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
BusPassengerRoutesResult that = (BusPassengerRoutesResult) o;
|
||||
return lineId == that.lineId
|
||||
&& lineType == that.lineType
|
||||
&& status == that.status
|
||||
&& sites.equals(that.sites)
|
||||
&& name.equals(that.name)
|
||||
&& runningDur.equals(that.runningDur);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sites, lineId, name, lineType, description, status, runningDur);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.bean;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
*
|
||||
@@ -143,4 +145,29 @@ public class BusPassengerStation {
|
||||
", leaving=" + leaving +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
BusPassengerStation that = (BusPassengerStation) o;
|
||||
return Double.compare(that.lon, lon) == 0
|
||||
&& Double.compare(that.lat, lat) == 0
|
||||
&& Double.compare(that.gcjLon, gcjLon) == 0
|
||||
&& Double.compare(that.gcjLat, gcjLat) == 0
|
||||
&& businessType == that.businessType
|
||||
&& status == that.status
|
||||
&& siteId == that.siteId
|
||||
&& seq == that.seq
|
||||
&& drivingStatus == that.drivingStatus
|
||||
&& ifStop == that.ifStop
|
||||
&& leaving == that.leaving
|
||||
&& Objects.equals(name, that.name)
|
||||
&& Objects.equals(cityCode, that.cityCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, description, cityCode, lon, lat, gcjLon, gcjLat, businessType, status, siteId, seq, drivingStatus, ifStop, leaving);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,6 @@ import java.util.List;
|
||||
public interface IBusPassengerRouteLineInfoCallback {
|
||||
void updateLineInfo(String lineName, String lineDurTime);
|
||||
void updateStationsInfo(List<BusPassengerStation> stations,int currentStationIndex,boolean isArrived);
|
||||
void showNoTaskView();
|
||||
void hideNoTaskView();
|
||||
}
|
||||
|
||||
@@ -87,6 +87,8 @@ public class BusPassengerModel {
|
||||
|
||||
private double mLongitude, mLatitude;
|
||||
|
||||
private BusPassengerRoutesResult routesResult = null;
|
||||
|
||||
List<BusPassengerStation> mStations = new ArrayList<>();
|
||||
private int mNextStationIndex = 0;// 要到达站的index
|
||||
private List<LatLng> mTwoStationsRouts = new ArrayList<>();
|
||||
@@ -154,8 +156,16 @@ public class BusPassengerModel {
|
||||
if ( data == null
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null) {
|
||||
routesResult = null;
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.showNoTaskView();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (routesResult != null && routesResult.equals(data.getResult())){
|
||||
return;
|
||||
}
|
||||
routesResult = data.getResult();
|
||||
updatePassengerRouteInfo(data.getResult());
|
||||
}
|
||||
|
||||
@@ -172,6 +182,7 @@ public class BusPassengerModel {
|
||||
private void updatePassengerRouteInfo(BusPassengerRoutesResult result) {
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.updateLineInfo(result.getName(),result.getRunningDur());
|
||||
mRouteLineInfoCallback.hideNoTaskView();
|
||||
if (result.getSites() != null){
|
||||
List<BusPassengerStation> stations = result.getSites();
|
||||
mStations.clear();
|
||||
|
||||
@@ -135,6 +135,16 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
runOnUIThread(() -> mView.updateStationsInfo(stations,currentStationIndex, isArrived));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showNoTaskView() {
|
||||
runOnUIThread(() -> mView.showNoTaskView());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideNoTaskView() {
|
||||
runOnUIThread(() -> mView.hideNoTaskView());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void routeResult(List<LatLng> models, int haveArrivedIndex) {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "routeResult:" + models.size()
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.wigets.OCHBorderShadowLayout;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
@@ -102,6 +103,8 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
|
||||
if (null == station){
|
||||
mCurrentArriveStation.setText("----");
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
}else {
|
||||
mCurrentArriveStation.setText(station);
|
||||
if (currentIndex == 0){
|
||||
|
||||
@@ -58,6 +58,7 @@ public class BusPassengerRouteFragment extends
|
||||
private RotateAnimation rotateAnimation;
|
||||
private float lastBearing = 0;
|
||||
private BusPassengerLineStationsAdapter mAdapter;
|
||||
private TextView emptyTv;
|
||||
|
||||
@Override
|
||||
public int getStationPanelViewId() {
|
||||
@@ -79,6 +80,7 @@ public class BusPassengerRouteFragment extends
|
||||
mSpeedTv = findViewById(R.id.bus_p_speed_tv);
|
||||
|
||||
mNoLineInfoView =findViewById(R.id.bus_p_no_order_data_view);
|
||||
emptyTv = findViewById(R.id.no_order_data_tv);
|
||||
|
||||
mCarPlateNum = findViewById(R.id.bus_p_driver_num_plate_tv);
|
||||
mLineName = findViewById(R.id.bus_p_line_name_tv);
|
||||
@@ -211,8 +213,25 @@ public class BusPassengerRouteFragment extends
|
||||
mNoLineInfoView.setVisibility(View.GONE);
|
||||
mRouteInfoView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
emptyTv.setText(getString(R.string.bus_p_no_out));
|
||||
mNoLineInfoView.setVisibility(View.VISIBLE);
|
||||
mRouteInfoView.setVisibility(View.GONE);
|
||||
updateArrivedStation(null,0,true);
|
||||
}
|
||||
}
|
||||
|
||||
public void showNoTaskView(){
|
||||
if (mNoLineInfoView.getVisibility() == View.GONE){
|
||||
mNoLineInfoView.setVisibility(View.VISIBLE);
|
||||
mRouteInfoView.setVisibility(View.GONE);
|
||||
}
|
||||
emptyTv.setText(getString(R.string.bus_p_no_task));
|
||||
}
|
||||
|
||||
public void hideNoTaskView(){
|
||||
if (mNoLineInfoView.getVisibility() == View.VISIBLE){
|
||||
mNoLineInfoView.setVisibility(View.GONE);
|
||||
mRouteInfoView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 475 B |
|
After Width: | Height: | Size: 494 B |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 632 B |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 475 B |
|
After Width: | Height: | Size: 494 B |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 632 B |
|
After Width: | Height: | Size: 6.0 KiB |
@@ -27,7 +27,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/iv_bg"
|
||||
android:id="@+id/arrive_station_shadow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin_left"
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv"
|
||||
android:text="@string/bus_p_no_data"/>
|
||||
android:text="@string/bus_p_no_out"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -148,7 +148,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_280"
|
||||
android:paddingBottom="@dimen/dp_30"
|
||||
android:paddingLeft="@dimen/bus_p_route_info_margin_left"
|
||||
android:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:requiresFadingEdge="vertical"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<TextView
|
||||
android:id="@+id/bus_p_station"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textSize="@dimen/bus_p_station_txt_size"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding = "false"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:textColor="@color/bus_p_station_txt_color"
|
||||
android:layout_marginLeft="@dimen/dp_90"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_tag"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_arrow_bg"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_circle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bus_p_point_blue"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_station"/>
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_cur_arrow_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bus_p_line_blue"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_circle"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_tag"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:background="@drawable/bg_bus_p_end_tag_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_circle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle"/>
|
||||
<TextView
|
||||
android:id="@+id/bus_p_tag_txt"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:textSize="@dimen/bus_p_station_tag_txt_size"
|
||||
android:textColor="@color/bus_p_end_tag_txt_color"
|
||||
android:text="@string/bus_p_end_station_txt_tag"
|
||||
android:includeFontPadding="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_tag"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_tag"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_tag"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_tag"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_station_tag_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="bus_p_tag,bus_p_tag_txt"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/bus_p_station_item_height"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/bus_p_station_tag_line_width"
|
||||
android:layout_height="@dimen/bus_p_station_tag_line_height1"
|
||||
android:background="@color/bus_p_tag_line_color"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_end_station"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textSize="@dimen/bus_p_station_txt_size"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding = "false"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:textColor="@color/bus_p_station_txt_color"
|
||||
android:layout_marginLeft="@dimen/dp_45"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_end_tag"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_end_circle"
|
||||
android:layout_width="@dimen/bus_p_station_circle_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_circle_width_height"
|
||||
android:background="@drawable/bg_bus_p_end_station_circle"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_end_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_end_station"/>
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_cur_end_station_tag"
|
||||
android:layout_width="@dimen/bus_p_cur_station_circle_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@drawable/bg_bus_p_arrived_station"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_end_station"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_end_station"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_end_tag"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:background="@drawable/bg_bus_p_end_tag_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<TextView
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:textSize="@dimen/bus_p_station_tag_txt_size"
|
||||
android:textColor="@color/bus_p_end_tag_txt_color"
|
||||
android:text="@string/bus_p_end_station_txt_tag"
|
||||
android:includeFontPadding="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_end_tag"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_end_tag"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_end_tag"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_end_tag"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/bus_p_station_item_middle_height"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/bus_p_station_tag_line_width"
|
||||
android:layout_height="@dimen/bus_p_station_tag_line_height"
|
||||
android:background="@color/bus_p_tag_line_color"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/bus_p_station_tag_line_width"
|
||||
android:layout_height="@dimen/bus_p_station_tag_line_height"
|
||||
android:background="@color/bus_p_tag_line_color"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
<TextView
|
||||
android:id="@+id/bus_p_middle_station"
|
||||
android:layout_width="@dimen/bus_p_station_txt_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textSize="@dimen/bus_p_station_txt_size"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:includeFontPadding = "false"
|
||||
android:textColor="@color/bus_p_current_station_txt_color"
|
||||
android:layout_marginLeft="@dimen/dp_45"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_middle_circle"
|
||||
android:layout_width="@dimen/bus_p_station_circle_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_circle_width_height"
|
||||
android:background="@drawable/bg_bus_p_middle_station_circle"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_middle_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_middle_station"/>
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_middle_tag"
|
||||
android:layout_width="@dimen/bus_p_cur_station_circle_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@drawable/bg_bus_p_arrived_station"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_middle_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_middle_station"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/bus_p_station_item_height"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/bus_p_station_tag_line_width"
|
||||
android:layout_height="@dimen/bus_p_station_tag_line_height1"
|
||||
android:background="@color/bus_p_tag_line_color"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_start_station"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_45"
|
||||
android:includeFontPadding="false"
|
||||
android:text="--"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:textColor="@color/bus_p_station_txt_color"
|
||||
android:textSize="@dimen/bus_p_station_txt_size"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_start_tag"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_start_circle"
|
||||
android:layout_width="@dimen/bus_p_station_circle_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_circle_width_height"
|
||||
android:background="@drawable/bg_bus_p_start_station_circle"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_start_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_start_station"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_cur_start_station_tag"
|
||||
android:layout_width="@dimen/bus_p_cur_station_circle_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@drawable/bg_bus_p_arrived_station"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_start_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_start_station"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_start_tag"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:background="@drawable/bg_bus_p_start_tag_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_start_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_start_station"/>
|
||||
<TextView
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:textSize="@dimen/bus_p_station_tag_txt_size"
|
||||
android:textColor="@color/bus_p_end_tag_txt_color"
|
||||
android:text="@string/bus_p_start_station_txt_tag"
|
||||
android:includeFontPadding="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_start_tag"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_start_tag"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_start_tag"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_start_tag"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="bus_p_speed_unit_txt">KM/H</string>
|
||||
<string name="bus_p_no_data">您已收车</string>
|
||||
<string name="bus_p_no_out">您已收车</string>
|
||||
<string name="bus_p_no_task">暂无班次</string>
|
||||
<string name="bus_p_start_station_txt_tag">起</string>
|
||||
<string name="bus_p_end_station_txt_tag">终</string>
|
||||
<string name="bus_p_cur_station_title">到达站:</string>
|
||||
|
||||
@@ -14,6 +14,7 @@ public class BusRoutesResult {
|
||||
private int lineType; //线路类型,0:环形
|
||||
private String description;
|
||||
private int status;
|
||||
private long taskTime; //线路时间班次
|
||||
|
||||
//线路轨迹相关字段
|
||||
public String csvFileUrl = ""; //轨迹文件下载的cos url,默认“”
|
||||
@@ -44,12 +45,17 @@ public class BusRoutesResult {
|
||||
this.sites = sites;
|
||||
}
|
||||
|
||||
public long getTaskTime() {
|
||||
return taskTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusRoutesResult{" +
|
||||
"sites=" + sites +
|
||||
", lineId=" + lineId +
|
||||
", name='" + name + '\'' +
|
||||
", taskTime='" + taskTime + '\'' +
|
||||
", lineType=" + lineType +
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
|
||||
@@ -9,6 +9,12 @@ import java.util.List;
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface IRefreshBusStationsCallback {
|
||||
void refreshBusStations(String lineName,List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
|
||||
void updateBusTaskStatus(String lineName,String lintTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived);
|
||||
|
||||
void clearBusStationsMarkers();
|
||||
|
||||
void updateEmptyUi();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.och.bus.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@@ -9,6 +8,8 @@ import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
@@ -30,11 +31,13 @@ import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.presenter.BusPresenter;
|
||||
import com.mogo.och.bus.ui.BusStationCommonItem;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineActivity;
|
||||
import com.mogo.och.bus.view.SlidePanelView;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@@ -51,18 +54,17 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
implements SlidePanelView.OnSlidePanelMoveToEndListener, View.OnClickListener {
|
||||
private static final String TAG = "BusFragment";
|
||||
|
||||
private TextView mCurrentStationName;
|
||||
private TextView mNextStationName;
|
||||
private TextView mCurrentTag;
|
||||
private TextView mNextTag;
|
||||
private TextView mSwitchLine; //切换路线
|
||||
private TextView mLineName;
|
||||
private int mCurrentStation = 0;
|
||||
|
||||
// private View mBus;
|
||||
private TextView mTaskTime;
|
||||
private Group groupStationsPanel;
|
||||
private ConstraintLayout noDataView;
|
||||
|
||||
private BusStationBean startStation = null;
|
||||
private BusStationBean endStation = null;
|
||||
private BusStationCommonItem firstStationItem;
|
||||
private BusStationCommonItem secondStationItem;
|
||||
private BusStationCommonItem thirdStationItem;
|
||||
|
||||
private LoginService loginService;
|
||||
|
||||
@@ -89,22 +91,17 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
@Override
|
||||
protected void initViews() {
|
||||
super.initViews();
|
||||
// mBus = findViewById(R.id.module_och_bus_tag);
|
||||
mCurrentStationName = findViewById(R.id.module_och_bus_current_station);
|
||||
mCurrentTag = findViewById(R.id.module_och_bus_current_station_anchor);
|
||||
mNextStationName = findViewById(R.id.module_och_bus_order_end_station);
|
||||
mNextTag = findViewById(R.id.module_och_bus_next_station_anchor);
|
||||
|
||||
mSwitchLine = findViewById(R.id.switch_line_btn);
|
||||
mSwitchLine.setTag(0);
|
||||
mLineName = findViewById(R.id.module_och_bus_line_name);
|
||||
|
||||
//调用测试面板
|
||||
mCurrentStationName.setOnLongClickListener(v -> {
|
||||
debugTestBar();
|
||||
showHideTestBar();
|
||||
return true;
|
||||
});
|
||||
// }
|
||||
firstStationItem = findViewById(R.id.bus_panel_first_station);
|
||||
secondStationItem = findViewById(R.id.bus_panel_second_station);
|
||||
thirdStationItem = findViewById(R.id.bus_panel_third_station);
|
||||
mTaskTime = findViewById(R.id.bus_task_time_tv);
|
||||
groupStationsPanel = findViewById(R.id.group_stations_panel);
|
||||
noDataView = findViewById(R.id.no_line_data_view);
|
||||
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
|
||||
// 初始化的时候设置 UI 按钮状态
|
||||
@@ -150,126 +147,228 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据站点列表信息刷新车站面板,滑块面板
|
||||
*
|
||||
* @param stationList 车站列表信息
|
||||
* @param currentStation 当前站点
|
||||
* @param nextStation 下个站点
|
||||
* @param isArrived 是否都站
|
||||
*/
|
||||
public void refreshBusStations(String lineName,List<BusStationBean> stationList
|
||||
, int currentStation, int nextStation, boolean isArrived) {
|
||||
mCurrentStation = currentStation;
|
||||
public void hideStationsPanel(){
|
||||
groupStationsPanel.setVisibility(View.GONE);
|
||||
noDataView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void showStationsPanel(){
|
||||
groupStationsPanel.setVisibility(View.VISIBLE);
|
||||
noDataView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void updateLineEmptyUI(){
|
||||
hideStationsPanel();
|
||||
}
|
||||
|
||||
public void updateBusTaskStatus(String lineName, String lineTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived){
|
||||
|
||||
if (getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (stationList == null) {
|
||||
// 获取小巴数据失败
|
||||
return;
|
||||
}
|
||||
|
||||
showStationsPanel();
|
||||
|
||||
mLineName.setText(lineName);
|
||||
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
|
||||
// 渲染小巴路线数据
|
||||
renderCurrentStationStatus(lineName,stationList, currentStation, nextStation, isArrived);
|
||||
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新刷新站点信息 isArrived 是否到站
|
||||
*/
|
||||
private void renderCurrentStationStatus(String lineName,List<BusStationBean> stationList, int currentStation
|
||||
, int nextStation, boolean isArrived) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "MapMaker ", "currentStation=" + currentStation + ",nextStation=" + nextStation + "isArrived=" + isArrived);
|
||||
String currentStationName = null;
|
||||
String nextStationName = null;
|
||||
|
||||
boolean isArriveEndStation = false;
|
||||
boolean isArriveAtStation = false;
|
||||
boolean isArriveAtStartStation = false;
|
||||
|
||||
mLineName.setText(lineName);
|
||||
|
||||
// 获取当前站点的名称
|
||||
currentStationName = stationList.get(currentStation).getName();
|
||||
private void updateBusStationStatus(List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived) {
|
||||
|
||||
startStation = stationList.get(0);
|
||||
endStation = stationList.get(stationList.size() - 1);
|
||||
|
||||
// 是否到达起点
|
||||
if (currentStation == 0) {
|
||||
isArriveAtStartStation = true;
|
||||
mCurrentTag.setText(getResources().getString(R.string.bus_arrive_to_end_start));
|
||||
if (arrivingOrArrivedIndex == stationList.size() - 1 && isArrived){
|
||||
//切换路线和结束路线按钮切换
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
showSlidePanle("单程结束");
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
} else if (currentStation > 0 && currentStation < stationList.size() - 1) {// 是否到达站点
|
||||
isArriveAtStation = true;
|
||||
mCurrentTag.setText(getResources().getString(R.string.bus_arrive_to_current_tag));
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_next_tag));
|
||||
}else if (arrivingOrArrivedIndex == 0 && isArrived){
|
||||
|
||||
showOrHideSwitchLineBtn(true);
|
||||
|
||||
showSlidePanle("滑动出发");
|
||||
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER,
|
||||
startStation.getLat(), startStation.getLon(),R.raw.star_marker);
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER,
|
||||
endStation.getLat(), endStation.getLon(),R.raw.end_marker);
|
||||
}else{
|
||||
if (isArrived){
|
||||
// 重置滑动按钮文字
|
||||
showSlidePanle("滑动出发");
|
||||
}
|
||||
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
} else if (currentStation == stationList.size() - 1) {// 是否到达终点
|
||||
isArriveEndStation = true;
|
||||
nextStationName = "--";
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_end_end));
|
||||
}
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
if (stationList.size() > 2){ //只有两个站点
|
||||
updateMoreThanTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived);
|
||||
}else {
|
||||
updateTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived);
|
||||
}
|
||||
|
||||
if (isArrived) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
} else {
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
updateBusTestBarInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 有两个以上站点的路线
|
||||
* @param stationList
|
||||
* @param arrivingOrArrivedIndex
|
||||
* @param isArrived
|
||||
*/
|
||||
private void updateMoreThanTwoStationsUI(List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived) {
|
||||
secondStationItem.setStationTag("");
|
||||
secondStationItem.showOrHideStationArrowBg(true);
|
||||
thirdStationItem.setStationTag("");
|
||||
secondStationItem.setVisibility(View.VISIBLE);
|
||||
thirdStationItem.showOrHideStationArrowBg(false);
|
||||
|
||||
if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0){
|
||||
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
|
||||
}else {
|
||||
firstStationItem.setStationTag("");
|
||||
}
|
||||
|
||||
if (arrivingOrArrivedIndex + 1 == stationList.size() - 1 || arrivingOrArrivedIndex == stationList.size() - 1
|
||||
|| (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)){ //确认是否显示 "终"
|
||||
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
|
||||
}else {
|
||||
thirdStationItem.setStationTag("");
|
||||
}
|
||||
|
||||
//圆点: 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站
|
||||
if (arrivingOrArrivedIndex == 0 && isArrived){
|
||||
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
|
||||
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
|
||||
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
|
||||
|
||||
firstStationItem.setStationName(stationList.get(0).getName());
|
||||
secondStationItem.setStationName(stationList.get(1).getName());
|
||||
thirdStationItem.setStationName(stationList.get(2).getName());
|
||||
|
||||
firstStationItem.setStationPointBg(1);
|
||||
secondStationItem.setStationPointBg(2);
|
||||
thirdStationItem.setStationPointBg(2);
|
||||
|
||||
firstStationItem.setStationArrowBg(2);
|
||||
secondStationItem.setStationArrowBg(2);
|
||||
|
||||
}else if (arrivingOrArrivedIndex == stationList.size() - 1){
|
||||
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
|
||||
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
|
||||
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
|
||||
|
||||
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -2).getName());
|
||||
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
|
||||
thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName());
|
||||
|
||||
firstStationItem.setStationPointBg(0);
|
||||
secondStationItem.setStationPointBg(0);
|
||||
thirdStationItem.setStationPointBg(1);
|
||||
|
||||
firstStationItem.setStationArrowBg(0);
|
||||
if (isArrived){
|
||||
secondStationItem.setStationArrowBg(0);
|
||||
}else {
|
||||
secondStationItem.setStationArrowBg(1);
|
||||
}
|
||||
|
||||
}else {
|
||||
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
|
||||
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
|
||||
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
|
||||
|
||||
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
|
||||
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName());
|
||||
thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex + 1).getName());
|
||||
|
||||
firstStationItem.setStationPointBg(0);
|
||||
secondStationItem.setStationPointBg(1);
|
||||
thirdStationItem.setStationPointBg(2);
|
||||
secondStationItem.setStationArrowBg(2);
|
||||
if (isArrived){
|
||||
firstStationItem.setStationArrowBg(0);
|
||||
}else {
|
||||
firstStationItem.setStationArrowBg(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取下一站点名称
|
||||
if (nextStation > currentStation && nextStation <= stationList.size() - 1) {
|
||||
nextStationName = stationList.get(nextStation).getName();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 只有两个站点的路线
|
||||
* @param stationList
|
||||
* @param arrivingOrArrivedIndex
|
||||
* @param isArrived
|
||||
*/
|
||||
private void updateTwoStationsUI(List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived) {
|
||||
|
||||
secondStationItem.setVisibility(View.GONE);
|
||||
secondStationItem.showOrHideStationArrowBg(false);
|
||||
thirdStationItem.showOrHideStationArrowBg(false);
|
||||
|
||||
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
|
||||
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
|
||||
|
||||
firstStationItem.setStationName(stationList.get(0).getName());
|
||||
thirdStationItem.setStationName(stationList.get(1).getName());
|
||||
|
||||
//圆点: 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站
|
||||
if (arrivingOrArrivedIndex == 0 && isArrived){//到站
|
||||
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
|
||||
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
|
||||
firstStationItem.setStationPointBg(1);
|
||||
firstStationItem.setStationArrowBg(2);
|
||||
thirdStationItem.setStationPointBg(0);
|
||||
|
||||
// 是否到达终点
|
||||
if ( nextStation == stationList.size() - 1 || nextStation == -1) {
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_end_end));
|
||||
}else {
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_next_tag));
|
||||
}
|
||||
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
|
||||
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
|
||||
if (isArrived){ //到终点
|
||||
firstStationItem.setStationPointBg(0);
|
||||
firstStationItem.setStationArrowBg(0);
|
||||
thirdStationItem.setStationPointBg(1);
|
||||
|
||||
if (currentStation == 0 && isArrived){
|
||||
showOrHideSwitchLineBtn(true);
|
||||
}else {
|
||||
showOrHideSwitchLineBtn(false);
|
||||
}else { //到终点途中
|
||||
firstStationItem.setStationPointBg(0);
|
||||
firstStationItem.setStationArrowBg(1);
|
||||
thirdStationItem.setStationPointBg(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 重置滑动按钮文字
|
||||
if (isArriveEndStation) {
|
||||
showSlidePanle("单程结束");
|
||||
} else if (isArriveAtStartStation) {
|
||||
showSlidePanle("滑动出发");
|
||||
} else if (isArriveAtStation) {
|
||||
showSlidePanle("滑动出发");
|
||||
}
|
||||
|
||||
mCurrentStationName.setText(currentStationName);
|
||||
mNextStationName.setText(nextStationName);
|
||||
updateBusTestBarInfo();
|
||||
}
|
||||
|
||||
private void showOrHideSwitchLineBtn(boolean isShow) {
|
||||
if (isShow){//显示切换路线
|
||||
// mSwitchLine.setVisibility(View.VISIBLE);
|
||||
mSwitchLine.setTag(0);
|
||||
mSwitchLine.setText(getResources().getString(R.string.bus_switch_line_btn));
|
||||
}else {//显示结束路线
|
||||
// mSwitchLine.setVisibility(View.GONE);
|
||||
mSwitchLine.setTag(1);
|
||||
mSwitchLine.setText(getResources().getString(R.string.bus_close_line_btn));
|
||||
}
|
||||
@@ -335,12 +434,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
if (launch) {
|
||||
// 出车的时候重制站点状态
|
||||
mPresenter.queryBusRoutes();
|
||||
// tvOperationStatus.setText("收车");
|
||||
tvArrived.setVisibility(View.VISIBLE);
|
||||
showPanel();
|
||||
} else {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice("已收车");
|
||||
// tvOperationStatus.setText("出车");
|
||||
tvArrived.setVisibility(View.GONE);
|
||||
hideSlidePanel();
|
||||
hidPanel();
|
||||
@@ -438,7 +535,25 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
Intent intent = new Intent(getContext(), BusSwitchLineActivity.class);
|
||||
startActivity(intent);
|
||||
}else {//结束路线
|
||||
mPresenter.resetCurrentLineStatus();
|
||||
OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder();
|
||||
OCHCommitDialog closeLineConfirmDialog = builder
|
||||
.title(getString(R.string.bus_dialog_title))
|
||||
.tips(getString(R.string.bus_dialog_tips))
|
||||
.confirmStr(getString(R.string.bus_dialog_confirm))
|
||||
.cancelStr(getString(R.string.bus_dialog_cancel))
|
||||
.build(getContext());
|
||||
closeLineConfirmDialog.setClickListener(new OCHCommitDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
mPresenter.resetCurrentLineStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
|
||||
}
|
||||
});
|
||||
closeLineConfirmDialog.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_ARRIVING;
|
||||
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -57,6 +58,7 @@ import com.mogo.och.bus.util.BusTrajectoryManager;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
@@ -410,7 +412,7 @@ public class BusOrderModel {
|
||||
startLon, startLat,
|
||||
location.getLongitude(), location.getLatitude() );
|
||||
|
||||
Logger.i(TAG, "judgeStartStation() distance = " + distance);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"judgeStartStation() distance = " + distance);
|
||||
|
||||
if ( distance > BusConst.ARRIVE_AT_END_STATION_DISTANCE ) {
|
||||
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
|
||||
@@ -436,20 +438,76 @@ public class BusOrderModel {
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null
|
||||
|| data.getResult().getSites().isEmpty() ) {
|
||||
//当为空时,显示无绑定路线图
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 " );
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.updateEmptyUi();
|
||||
}
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data );
|
||||
renderBusStationsStatus( data.getResult());
|
||||
updateBusStatus( data.getResult());
|
||||
}
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
//改为任务,为空不再去一直取
|
||||
// queryBusStationDelay();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新正在运行的任务UI
|
||||
* @param stations
|
||||
*/
|
||||
private void updateBusTaskStatus(List<BusStationBean> stations) {
|
||||
|
||||
int arrivingOrArrivedStationIndex = 0;//已经到站或者即将到站的索引呢
|
||||
|
||||
for (int i =0 ; i< stations.size(); i++){
|
||||
BusStationBean station = stations.get(i);
|
||||
|
||||
if (i == 0){ // 首发站 显示在最上面
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
&& !station.isLeaving()){ //到达第一站
|
||||
arrivingOrArrivedStationIndex = i;
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
BusStationBean preStation = stations.get(i-1);
|
||||
if ((station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving())
|
||||
|| (station.getDrivingStatus() == STATION_STATUS_ARRIVING
|
||||
&& preStation.isLeaving())){
|
||||
//到站未离开 | 即将到站 显示在最中间
|
||||
arrivingOrArrivedStationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BusStationBean arrivingOrArrivedStation = stations.get(arrivingOrArrivedStationIndex);
|
||||
|
||||
String lineTime = DateTimeUtil.formatLongToString(
|
||||
busRoutesResult.getTaskTime(),
|
||||
DateTimeUtil.TAXI_HH_mm);
|
||||
|
||||
if (arrivingOrArrivedStationIndex == 0 ||
|
||||
arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
&& !arrivingOrArrivedStation.isLeaving()){
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(),lineTime,
|
||||
stationList,arrivingOrArrivedStationIndex,true);
|
||||
}
|
||||
}else {
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(),lineTime,
|
||||
stationList,arrivingOrArrivedStationIndex,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置路线站点状态--结束路线,当前路线恢复到始发站
|
||||
*/
|
||||
@@ -524,20 +582,21 @@ public class BusOrderModel {
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private void leaveStationSuccess(BusRoutesResult result, boolean isRestart) {
|
||||
renderBusStationsStatus(result);
|
||||
// if (slidePannelHideCallback != null) {
|
||||
// slidePannelHideCallback.hideSlidePanel();
|
||||
// }
|
||||
|
||||
updateBusStatus(result);
|
||||
|
||||
//开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
|
||||
if (isRestart || CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
|
||||
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
startAutopilot(isRestart);
|
||||
}
|
||||
|
||||
if (isGoingToNextStation) {
|
||||
// 为了避免恢复自动驾驶时重复的接口请求
|
||||
return;
|
||||
}
|
||||
isGoingToNextStation = true;
|
||||
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始" );
|
||||
}
|
||||
|
||||
@@ -553,10 +612,6 @@ public class BusOrderModel {
|
||||
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex + 1);
|
||||
|
||||
// if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE
|
||||
// == CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()) {
|
||||
// ToastUtils.showShort("自动驾驶状态为不可用!");
|
||||
// }
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = !isRestart;
|
||||
parameters.routeID = busRoutesResult.getLineId();
|
||||
@@ -608,7 +663,7 @@ public class BusOrderModel {
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation success");
|
||||
if (!isRestart){
|
||||
renderArriveBusStation();
|
||||
arrivedBusStationSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,13 +679,16 @@ public class BusOrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void renderArriveBusStation() {
|
||||
private void arrivedBusStationSuccess() {
|
||||
List<BusStationBean> site = busRoutesResult.getSites();
|
||||
if (site != null && site.size() > 0){
|
||||
backgroundCurrentStationIndex ++;
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.refreshBusStations(busRoutesResult.getName(),stationList, backgroundCurrentStationIndex
|
||||
, getNextStopStation(),true);
|
||||
String lineTime = DateTimeUtil.formatLongToString(
|
||||
busRoutesResult.getTaskTime(),
|
||||
DateTimeUtil.TAXI_HH_mm);
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(),lineTime,
|
||||
stationList, backgroundCurrentStationIndex ,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -746,7 +804,6 @@ public class BusOrderModel {
|
||||
}else {
|
||||
ToastUtils.showShort("出车收车状态查询:"+failMsg);
|
||||
}
|
||||
// queryOperationStatus();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -766,20 +823,21 @@ public class BusOrderModel {
|
||||
/**
|
||||
* 渲染站点信息
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示 离开站为当前站点,前往站为下一站, 下一站到站后在置为当前站
|
||||
* 车机端展示 三站: 中间为即将到到达或者刚到达的站
|
||||
* @param result
|
||||
*/
|
||||
private void renderBusStationsStatus(BusRoutesResult result) {
|
||||
private void updateBusStatus(BusRoutesResult result) {
|
||||
if (result == null) return;
|
||||
busRoutesResult = result;
|
||||
List<BusStationBean> site = result.getSites();
|
||||
currentLineId = result.getLineId();
|
||||
stationList.clear();
|
||||
stationList.addAll( site );
|
||||
|
||||
for ( int i = 0; i < stationList.size(); i++ ) {
|
||||
BusStationBean s = stationList.get( i );
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + "renderBusStationsStatus--",
|
||||
CallerLogger.INSTANCE.d( M_BUS + "updateBusStationsStatus--",
|
||||
"Index="+ i+" ,name = "+s.getName()+" ,"+s.isLeaving()+","+s.getDrivingStatus());
|
||||
|
||||
// 是否正在开往下一站
|
||||
@@ -797,7 +855,7 @@ public class BusOrderModel {
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG,
|
||||
"渲染站点信息服务端currentStationIndex="+backgroundCurrentStationIndex
|
||||
+" isLeaving()="+currentStation.isLeaving());
|
||||
+" isLeaving()="+currentStation.isLeaving());
|
||||
|
||||
//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态
|
||||
// ,订单开始站下在始发站的状态流转有问题
|
||||
@@ -815,15 +873,13 @@ public class BusOrderModel {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)");
|
||||
}
|
||||
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.refreshBusStations(result.getName(),stationList
|
||||
, backgroundCurrentStationIndex, getNextStopStation(),!currentStation.isLeaving());
|
||||
}
|
||||
|
||||
if ( currentStation.isLeaving() && slidePannelHideCallback != null) {
|
||||
slidePannelHideCallback.hideSlidePanel();
|
||||
}
|
||||
|
||||
//更新bus路线面板
|
||||
updateBusTaskStatus(stationList);
|
||||
|
||||
//需放在currentStationIndex赋值之后
|
||||
BusTrajectoryManager.getInstance().syncTrajectoryInfo();
|
||||
}
|
||||
|
||||
@@ -130,20 +130,44 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void refreshBusStations(String lineName,List<BusStationBean> stationList
|
||||
// , int currentStation, int nextStation, boolean isArrived) {
|
||||
// mStationList.clear();
|
||||
// mStationList.addAll(stationList);
|
||||
// mCurrentStation = currentStation;
|
||||
//// functionDemoModeChange();
|
||||
// CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
|
||||
// if (mView != null) {
|
||||
// runOnUIThread(() -> mView.refreshBusStations(lineName,
|
||||
// stationList, currentStation, nextStation, isArrived));
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void refreshBusStations(String lineName,List<BusStationBean> stationList
|
||||
, int currentStation, int nextStation, boolean isArrived) {
|
||||
public void updateBusTaskStatus(String lineName,String lineTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived) {
|
||||
mStationList.clear();
|
||||
mStationList.addAll(stationList);
|
||||
mCurrentStation = currentStation;
|
||||
// functionDemoModeChange();
|
||||
if (arrivingOrArrivedIndex == 0 || isArrived){
|
||||
mCurrentStation = arrivingOrArrivedIndex;
|
||||
}else {
|
||||
mCurrentStation = arrivingOrArrivedIndex -1;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
|
||||
if (mView != null) {
|
||||
runOnUIThread(() -> mView.refreshBusStations(lineName,
|
||||
stationList, currentStation, nextStation, isArrived));
|
||||
runOnUIThread(() -> mView.updateBusTaskStatus(lineName,lineTime,
|
||||
stationList, arrivingOrArrivedIndex, isArrived));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEmptyUi() {
|
||||
runOnUIThread(() -> mView.updateLineEmptyUI());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearBusStationsMarkers() {
|
||||
runOnUIThread(() -> mView.clearBusStationsMarkers());
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.mogo.och.bus.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.och.bus.R
|
||||
import kotlinx.android.synthetic.main.bus_stations_common_item.view.*
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/9/15
|
||||
*/
|
||||
class BusStationCommonItem @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr){
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.bus_stations_common_item,this,true)
|
||||
}
|
||||
|
||||
fun setStationName(name: String){
|
||||
busStationNameTv.text = name
|
||||
}
|
||||
|
||||
fun setStationNameColor(color: Int){
|
||||
busStationNameTv.setTextColor(color)
|
||||
}
|
||||
|
||||
fun setStationPointBg(type: Int){ // 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站
|
||||
when(type){
|
||||
0 -> busCircleIv.setImageResource(R.drawable.icon_point_grey_bus)
|
||||
1 -> busCircleIv.setImageResource(R.drawable.icon_point_green_bus)
|
||||
2 -> busCircleIv.setImageResource(R.drawable.icon_point_blue_bus)
|
||||
}
|
||||
}
|
||||
|
||||
fun setStationArrowBg(type: Int){// 0:灰色 过站 1:绿色 前往下一站 2:蓝色 未到站
|
||||
when(type){
|
||||
0 -> busArrowBg.setImageResource(R.drawable.icon_arrow_grey_bus)
|
||||
1 -> busArrowBg.setImageResource(R.drawable.icon_arrow_green_bus)
|
||||
2 -> busArrowBg.setImageResource(R.drawable.icon_arrow_blue_bus)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun setStationTag(tag: String){ // 0:起 1:终
|
||||
if (tag.isNullOrEmpty()){
|
||||
busTagTxt.visibility = GONE
|
||||
}else{
|
||||
busTagTxt.text = tag
|
||||
busTagTxt.visibility = VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
fun showOrHideStationArrowBg(isShow:Boolean){
|
||||
if (isShow){
|
||||
busArrowBg.visibility = VISIBLE
|
||||
}else{
|
||||
busArrowBg.visibility = GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_no_line_icon.png
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_arrow_blue_bus.png
Executable file
|
After Width: | Height: | Size: 377 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_arrow_green_bus.png
Executable file
|
After Width: | Height: | Size: 400 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_arrow_grey_bus.png
Executable file
|
After Width: | Height: | Size: 402 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_no_bus_line.png
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_point_blue_bus.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_point_green_bus.png
Executable file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_point_grey_bus.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_no_line_icon.png
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_arrow_blue_bus.png
Executable file
|
After Width: | Height: | Size: 377 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_arrow_green_bus.png
Executable file
|
After Width: | Height: | Size: 400 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_arrow_grey_bus.png
Executable file
|
After Width: | Height: | Size: 402 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_no_bus_line.png
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_point_blue_bus.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_point_green_bus.png
Executable file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_point_grey_bus.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/bus_no_line_icon.png
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_arrow_blue_bus.png
Executable file
|
After Width: | Height: | Size: 377 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_arrow_green_bus.png
Executable file
|
After Width: | Height: | Size: 400 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_arrow_grey_bus.png
Executable file
|
After Width: | Height: | Size: 402 B |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_no_bus_line.png
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_point_blue_bus.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_point_green_bus.png
Executable file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_point_grey_bus.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_20"></corners>
|
||||
<solid android:color="@color/bus_task_time_bg_color"></solid>
|
||||
</shape>
|
||||
28
OCH/mogo-och-bus/src/main/res/layout/bus_no_line_view.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/no_line_data_view">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/no_line_data_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bus_no_line_icon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
<TextView
|
||||
android:id="@+id/no_order_data_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#CAD6FF"
|
||||
android:textSize="34px"
|
||||
android:layout_marginTop="34px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/no_line_data_iv"
|
||||
android:text="@string/bus_no_task_tip"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<TextView
|
||||
android:id="@+id/busStationNameTv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_name_text_size"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/bus_arrived_station_name_text_color"
|
||||
android:includeFontPadding = "false"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:layout_marginRight="@dimen/dp_75"
|
||||
android:layout_marginLeft="@dimen/dp_54"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/busCircleIv"
|
||||
app:layout_constraintRight_toRightOf="@+id/busTagTxt"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/busCircleIv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_point_blue_bus"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/busStationNameTv"/>
|
||||
<ImageView
|
||||
android:id="@+id/busArrowBg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:src="@drawable/icon_arrow_blue_bus"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/busCircleIv"
|
||||
app:layout_constraintRight_toRightOf="@+id/busCircleIv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/busCircleIv"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/busTagTxt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/bus_station_tag_txt_size"
|
||||
android:textColor="@color/bus_station_tag_txt_un_color"
|
||||
android:text="@string/bus_station_txt_tag_start"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/busCircleIv"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/busCircleIv"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_line_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
@@ -24,25 +24,23 @@
|
||||
android:textSize="38px"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/module_och_bus_tag"-->
|
||||
<!-- android:layout_width="@dimen/dp_109"-->
|
||||
<!-- android:layout_height="@dimen/dp_42"-->
|
||||
<!-- android:layout_gravity="right"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_10"-->
|
||||
<!-- android:layout_marginRight="@dimen/dp_60"-->
|
||||
<!-- android:background="@drawable/bus_panel_anchor_bkg"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="小巴车"-->
|
||||
<!-- android:textColor="#FFF"-->
|
||||
<!-- android:textSize="@dimen/module_mogo_och_autopilot_order_tag_height"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_line_name"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="@id/module_och_bus_line_name" />-->
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_task_time_tv"/>
|
||||
<TextView
|
||||
android:id="@+id/bus_task_time_tv"
|
||||
android:layout_width="200px"
|
||||
android:layout_height="42px"
|
||||
android:layout_marginRight="@dimen/dp_68"
|
||||
android:textColor="#FFF"
|
||||
android:text="--: --"
|
||||
android:textSize="28px"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bus_task_time_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_line_name"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_line_name">
|
||||
|
||||
</TextView>
|
||||
<View
|
||||
android:id="@+id/line1"
|
||||
android:layout_width="match_parent"
|
||||
@@ -65,111 +63,63 @@
|
||||
app:layout_constraintRight_toRightOf="@+id/line1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_current_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="14px"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:text="当前站点:"
|
||||
android:textColor="#CAD6FF"
|
||||
android:textSize="@dimen/module_och_bus_order_start_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_current_station"
|
||||
<com.mogo.och.bus.ui.BusStationCommonItem
|
||||
android:id="@+id/bus_panel_first_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_name_text_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_current_station_anchor"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_current_station_anchor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_next_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:text="下一站:"
|
||||
android:textColor="#CAD6FF"
|
||||
android:textSize="@dimen/module_och_bus_order_start_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_current_station"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_current_station" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_order_end_station"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_task_time_tv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line2"/>
|
||||
<com.mogo.och.bus.ui.BusStationCommonItem
|
||||
android:id="@+id/bus_panel_second_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_goneMarginTop="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:layout_marginBottom="@dimen/dp_30"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
app:layout_goneMarginBottom="@dimen/dp_40"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_name_text_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_next_station_anchor"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/switch_line_btn"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_next_station_anchor"
|
||||
tools:text="后路站1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/greenDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_task_time_tv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_panel_first_station"/>
|
||||
<com.mogo.och.bus.ui.BusStationCommonItem
|
||||
android:id="@+id/bus_panel_third_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14px"
|
||||
android:src="@drawable/bus_icon_arrived_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_current_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_line_name"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_current_station" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dotLine"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bus_dot_line"
|
||||
app:layout_constraintBottom_toTopOf="@+id/blueDot"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/greenDot"
|
||||
app:layout_constraintRight_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/greenDot" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/blueDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bus_icon_arriving_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_order_end_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_order_end_station" />
|
||||
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_task_time_tv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_panel_second_station"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch_line_btn"
|
||||
android:layout_width="@dimen/bus_switch_line_btn_width_1"
|
||||
android:layout_height="@dimen/bus_switch_line_btn_height_1"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
app:layout_goneMarginTop="@dimen/dp_600"
|
||||
android:background="@drawable/bus_switch_line_btn"
|
||||
android:gravity="center"
|
||||
android:text="@string/bus_switch_line_btn"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_notice_text_size"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_panel_third_station"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<include layout="@layout/bus_no_line_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_160"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_stations_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="module_och_bus_line_name,bus_task_time_tv,
|
||||
line1,line2,bus_panel_first_station,bus_panel_second_station,bus_panel_third_station"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -86,7 +86,7 @@
|
||||
<dimen name="module_mogo_och_operation_status_padding">92px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_order_m_t">30px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">616px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">618px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">754px</dimen>
|
||||
|
||||
|
||||
@@ -138,4 +138,5 @@
|
||||
<dimen name="bus_traffic_light_icon_size">154px</dimen>
|
||||
<dimen name="bus_traffic_light_time_view_width">130px</dimen>
|
||||
<dimen name="bus_traffic_light_time_size">60px</dimen>
|
||||
<dimen name="bus_station_tag_txt_size">27px</dimen>
|
||||
</resources>
|
||||
@@ -86,7 +86,7 @@
|
||||
<dimen name="module_mogo_och_operation_status_padding">92px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_order_m_t">30px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">616px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">618px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">754px</dimen>
|
||||
|
||||
|
||||
@@ -136,4 +136,5 @@
|
||||
<dimen name="bus_traffic_light_icon_size">154px</dimen>
|
||||
<dimen name="bus_traffic_light_time_view_width">130px</dimen>
|
||||
<dimen name="bus_traffic_light_time_size">60px</dimen>
|
||||
<dimen name="bus_station_tag_txt_size">27px</dimen>
|
||||
</resources>
|
||||
@@ -47,4 +47,8 @@
|
||||
<color name="bus_arrived_btn_un_clickable_color">#59FFFFFF</color>
|
||||
|
||||
<color name="bus_color_b9c3e9">#B9C3E9 </color>
|
||||
|
||||
<color name="bus_station_tag_txt_un_color">#8E9DD4</color>
|
||||
<color name="bus_task_time_bg_color">#2B6EFF</color>
|
||||
<color name="bus_line_station_color_selected">#00FFF8</color>
|
||||
</resources>
|
||||
@@ -152,4 +152,6 @@
|
||||
<dimen name="bus_traffic_light_icon_size">154px</dimen>
|
||||
<dimen name="bus_traffic_light_time_view_width">130px</dimen>
|
||||
<dimen name="bus_traffic_light_time_size">60px</dimen>
|
||||
|
||||
<dimen name="bus_station_tag_txt_size">27px</dimen>
|
||||
</resources>
|
||||
@@ -12,8 +12,8 @@
|
||||
<string name="bus_switch_line_start">起点: </string>
|
||||
<string name="bus_switch_line_end">终点:</string>
|
||||
<string name="bus_switch_line_btn_txt">确认</string>
|
||||
<string name="bus_switch_line_btn">切换路线</string>
|
||||
<string name="bus_close_line_btn">结束路线</string>
|
||||
<string name="bus_switch_line_btn">选择任务</string>
|
||||
<string name="bus_close_line_btn">结束任务</string>
|
||||
<string name="bus_switch_line_btn_warning1">自动驾驶状态中,不可切换或结束路线</string>
|
||||
<string name="bus_switch_line_btn_warning2">当前行程未完成,不可切换路线</string>
|
||||
<string name="bus_no_line_tip">当前车辆无路线\n请联系运营人员绑定</string>
|
||||
@@ -29,4 +29,14 @@
|
||||
<string name="bus_arrive_to_next_tag">下一站:</string>
|
||||
<string name="bus_auto_disable_tip">自动驾驶状态为0不可用</string>
|
||||
<string name="bus_arrived_str">进站</string>
|
||||
<string name="bus_station_txt_tag_start">起</string>
|
||||
<string name="bus_station_txt_tag_end">终</string>
|
||||
<string name="bus_line_time_tag">班次:</string>
|
||||
|
||||
<string name="bus_dialog_title">提示</string>
|
||||
<string name="bus_dialog_tips">您确认要结束任务吗?</string>
|
||||
<string name="bus_dialog_confirm">确认</string>
|
||||
<string name="bus_dialog_cancel">取消</string>
|
||||
|
||||
<string name="bus_no_task_tip">暂无任务</string>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.mogo.och.common.module.wigets
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.och.common.module.R
|
||||
|
||||
/**
|
||||
* 带有title, tip,confirm,cancel的dialog
|
||||
*/
|
||||
class OCHCommitDialog: BaseFloatDialog, LifecycleObserver {
|
||||
|
||||
private var commonConfirm : TextView? = null
|
||||
private var commonCancel : TextView? = null
|
||||
private var commonTitle : TextView? = null
|
||||
private var commonTips : TextView? = null
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
constructor(builder: Builder,context: Context) : super(context) {
|
||||
commonTitle?.text = builder.titleStr
|
||||
commonTips?.text = builder.tipsStr
|
||||
commonCancel?.text = builder.cancelStr
|
||||
commonConfirm?.text = builder.confirmStr
|
||||
}
|
||||
|
||||
init{
|
||||
setContentView(R.layout.dialog_bus_commit)
|
||||
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
commonConfirm = findViewById(R.id.common_confirm)
|
||||
commonCancel = findViewById(R.id.common_cancel)
|
||||
commonTitle = findViewById(R.id.common_title)
|
||||
commonTips = findViewById(R.id.common_tips)
|
||||
|
||||
commonConfirm?.setOnClickListener{
|
||||
clickListener?.confirm()
|
||||
dismiss()
|
||||
}
|
||||
commonCancel?.setOnClickListener {
|
||||
clickListener?.cancel()
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(){
|
||||
if(isShowing){
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun confirm()
|
||||
fun cancel()
|
||||
}
|
||||
|
||||
class Builder{
|
||||
var titleStr:String = ""
|
||||
var tipsStr:String = ""
|
||||
var confirmStr:String = ""
|
||||
var cancelStr:String = ""
|
||||
|
||||
fun title(title: String) : Builder{
|
||||
this.titleStr = title
|
||||
return this
|
||||
}
|
||||
|
||||
fun tips(tips: String) : Builder{
|
||||
this.tipsStr = tips
|
||||
return this
|
||||
}
|
||||
|
||||
fun confirmStr(commit: String) : Builder{
|
||||
this.confirmStr = commit
|
||||
return this
|
||||
}
|
||||
|
||||
fun cancelStr(cancel: String) : Builder{
|
||||
this.cancelStr = cancel
|
||||
return this
|
||||
}
|
||||
|
||||
fun build(context: Context): OCHCommitDialog? {
|
||||
return OCHCommitDialog(this,context)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.mogo.och.common.module.wigets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.och.common.module.R;
|
||||
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/5/27 2:08 PM
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class OCHRoundConstraintLayout extends ConstraintLayout implements GestureDetector.OnGestureListener {
|
||||
|
||||
private float roundLayoutRadius = 14f;
|
||||
private Path roundPath;
|
||||
private RectF rectF;
|
||||
|
||||
// 上次滑动的坐标
|
||||
private int mLastXIntercept;
|
||||
private int mLastYIntercept;
|
||||
|
||||
private IScrollListener mScrollListener;
|
||||
|
||||
private GestureDetector mDetector;
|
||||
|
||||
public OCHRoundConstraintLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public OCHRoundConstraintLayout(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundLayout);
|
||||
roundLayoutRadius = typedArray.getDimensionPixelSize(R.styleable.RoundLayout_roundLayoutRadius, (int) roundLayoutRadius);
|
||||
typedArray.recycle();
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
public OCHRoundConstraintLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
setWillNotDraw(false);//如果你继承的是ViewGroup,注意此行,否则draw方法是不会回调的;
|
||||
roundPath = new Path();
|
||||
rectF = new RectF();
|
||||
mDetector = new GestureDetector(getContext(), this);
|
||||
}
|
||||
|
||||
private void setRoundPath() {
|
||||
//添加一个圆角矩形到path中, 如果要实现任意形状的View, 只需要手动添加path就行
|
||||
roundPath.reset();
|
||||
roundPath.addRoundRect(rectF, roundLayoutRadius, roundLayoutRadius, Path.Direction.CW);
|
||||
}
|
||||
|
||||
|
||||
public void setRoundLayoutRadius(float roundLayoutRadius) {
|
||||
this.roundLayoutRadius = roundLayoutRadius;
|
||||
setRoundPath();
|
||||
postInvalidate();
|
||||
}
|
||||
|
||||
public void setScrollListener(IScrollListener listener) {
|
||||
mScrollListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
super.onLayout(changed, l, t, r, b);
|
||||
rectF.set(0f, 0f, getMeasuredWidth(), getMeasuredHeight());
|
||||
setRoundPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
if (roundLayoutRadius > 0f) {
|
||||
canvas.clipPath(roundPath);
|
||||
}
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
boolean intercepted = false;
|
||||
int x = (int) ev.getX();
|
||||
int y = (int) ev.getY();
|
||||
switch (ev.getAction()) {
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
int deltaX = x - mLastXIntercept;
|
||||
int deltaY = y - mLastYIntercept;
|
||||
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
||||
intercepted = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
mLastXIntercept = x;
|
||||
mLastYIntercept = y;
|
||||
return intercepted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (mDetector != null) {
|
||||
return mDetector.onTouchEvent(event);
|
||||
} else {
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDown(MotionEvent e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowPress(MotionEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLongPress(MotionEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
||||
if (e2 != null) {
|
||||
float deltaX = e2.getX() - (e1 != null ? e1.getX() : 0f);
|
||||
float deltaY = e2.getY() - (e1 != null ? e1.getY() : 0f);
|
||||
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
||||
if (mScrollListener != null) {
|
||||
mScrollListener.onScroll(velocityX < 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public interface IScrollListener {
|
||||
void onScroll(boolean isNextPage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.och.common.module.wigets.OCHRoundConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="840px"
|
||||
android:layout_height="470px"
|
||||
android:background="@color/och_dialog_bg_color"
|
||||
app:roundLayoutRadius="32px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/common_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:textSize="56px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:layout_marginTop="50px"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/common_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/common_title"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="43px"
|
||||
android:layout_marginTop="50px"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_horizontal_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/common_tips"
|
||||
android:layout_marginTop="80px"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_vertical_line"
|
||||
android:layout_width="3px"
|
||||
android:layout_height="0dp"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/common_confirm"
|
||||
android:layout_width="400px"
|
||||
android:layout_height="100px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46px"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/view_vertical_line"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/common_cancel"
|
||||
android:layout_width="400px"
|
||||
android:layout_height="100px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46px"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/view_vertical_line"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHRoundConstraintLayout>
|
||||
@@ -10,4 +10,5 @@
|
||||
<color name="taxi_EF262C">#EF262C</color>
|
||||
<color name="taxi_4D000000">#4D000000</color>
|
||||
|
||||
<color name="och_dialog_bg_color">#3B4577</color>
|
||||
</resources>
|
||||
@@ -18,4 +18,17 @@
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="RoundLayout">
|
||||
<attr name="roundLayoutRadius" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="CustomCircleImageView">
|
||||
<attr name="civ_border_width" format="dimension" />
|
||||
<attr name="civ_border_color" format="color" />
|
||||
<attr name="civ_border_overlay" format="boolean" />
|
||||
<attr name="civ_fill_color" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -29,7 +29,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
@@ -1245,7 +1244,7 @@ public class TaxiModel {
|
||||
public void updateOrderRouteInfo(List<MessagePad.Location> models) {
|
||||
if (null == models || models.size() == 0) return;
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
Logger.d(M_TAXI + TAG, "--------计算出sumLength开始---------- ");
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "--------计算出sumLength开始---------- ");
|
||||
|
||||
//转换成高德坐标系
|
||||
if (mRoutePoints.size() > 0){
|
||||
@@ -1256,12 +1255,12 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
public void startDynamicCalculateRouteInfo() {
|
||||
Logger.d(M_TAXI + TAG, "--------mCurrentOCHOrder---------- " + mCurrentOCHOrder);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "--------mCurrentOCHOrder---------- " + mCurrentOCHOrder);
|
||||
|
||||
if (mCurrentOCHOrder != null && mRoutePoints.size() == 0) {//根据orderNo去查询
|
||||
queryOrderRouteList(mCurrentOCHOrder.orderNo);
|
||||
}
|
||||
Logger.d(M_TAXI + TAG, "--------mRoutePoints.size---------- " + mRoutePoints.size());
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "--------mRoutePoints.size---------- " + mRoutePoints.size());
|
||||
|
||||
if (mRoutePoints.size() > 0){
|
||||
reportTotalDisAndTime();
|
||||
@@ -1301,7 +1300,7 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
double lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6; //秒
|
||||
Logger.d(M_TAXI + "dynamicCalculateRouteInfo"
|
||||
CallerLogger.INSTANCE.d(M_TAXI + "dynamicCalculateRouteInfo"
|
||||
, "---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
|
||||
+ " thread = "+ Thread.currentThread().getName());
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ import com.zhidao.support.adas.high.AdasOptions;
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.OnMultiDeviceListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.ByteUtil;
|
||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
|
||||
@@ -110,6 +111,7 @@ import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import io.netty.channel.Channel;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -164,6 +166,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private ListPopupWindow listPopupWindow;
|
||||
private FloatWindow floatWindow;
|
||||
private View include_title;
|
||||
private boolean isAutopilotAbility = true;
|
||||
private String autopilotAbilityReason;
|
||||
// @Override
|
||||
// protected void onStart() {
|
||||
// super.onStart();
|
||||
@@ -796,6 +800,50 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(AutopilotAbility ability) {
|
||||
isAutopilotAbility = true;
|
||||
autopilotAbilityReason = null;
|
||||
if (ability.gear == null || ability.gear == Chassis.GearPosition.GEAR_P || ability.gear == Chassis.GearPosition.GEAR_R) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "挡位不正常";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.brake > 0) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "制动踏板被踩下";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo == null) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统Topic不正常";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_STARTING) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统正在启动";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_EXITING) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统正在关闭";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
if (ability.statusInfo.getSysState() == SystemStatusInfo.SystemState.SYS_FAULT) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = "系统异常";
|
||||
}
|
||||
if (isAutopilotAbility)
|
||||
for (SystemStatusInfo.HealthInfo healthInfo : ability.statusInfo.getHealthInfoList()) {
|
||||
if (healthInfo.getState() == SystemStatusInfo.HealthState.FAULT) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = healthInfo.getName() + " Topic异常";
|
||||
break;
|
||||
}
|
||||
}
|
||||
Log.i(TAG, "是否可以启动自动驾驶=" + isAutopilotAbility + " 原因=" + autopilotAbilityReason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrajectory(MessagePad.Header header, MessagePad.Trajectory trajectory) {
|
||||
Trajectory base = new Trajectory(header, trajectory, sdf);
|
||||
|
||||
@@ -32,6 +32,7 @@ buildscript {
|
||||
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
|
||||
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
|
||||
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||
classpath "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}"
|
||||
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
|
||||
classpath 'com.mogo.thread.opt:plg:2.2.12'
|
||||
classpath 'com.mogo.cloud:systrace:1.0.1'
|
||||
|
||||
@@ -1,22 +1,6 @@
|
||||
ext {
|
||||
time = ""
|
||||
kotlin_version = "1.4.31"
|
||||
android = [
|
||||
launcherApplicationId : "com.mogo.launcher",
|
||||
independentApplicationId : "com.mogo.launcher.app",
|
||||
fLauncherApplicationId : "com.mogo.launcher.f",
|
||||
bydautoIndependentApplicationId: "com.mogo.launcher.app.bydauto",
|
||||
fLauncherAmapApiValue : "ace34d685cc04836c03905e4d1536125",
|
||||
bydautoIndependentApiValue : "b1e1d527b02a493913c50985827c943a",
|
||||
commonLauncherAmapApiValue : "a36b9f7b086fa3951bb35338a5a06dd3",
|
||||
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
|
||||
compileSdkVersion : 29,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 21,
|
||||
minSdkVersionPadLenovo : 23,
|
||||
targetSdkVersionPadLenovo : 23,
|
||||
]
|
||||
dependencies = [
|
||||
// androidx
|
||||
androidxappcompat : "androidx.appcompat:appcompat:1.3.1",
|
||||
@@ -134,6 +118,8 @@ ext {
|
||||
//plugin
|
||||
mogochainbase : "com.mogo.cloud:service-chain:${SERVICE_CHAIN_VERSION}",
|
||||
mogochainplugin : "com.mogo.cloud:hook:${HOOK_LOG_VERSION}",
|
||||
mogoservicebiz : "com.mogo.cloud:service-biz:${SERVICE_BIZ_VERSION}",
|
||||
mogobizconfig : "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}",
|
||||
|
||||
//========================= 旧版本架构 Maven 版本管理 =========================
|
||||
// modules
|
||||
@@ -253,6 +239,22 @@ ext {
|
||||
//========================= Koom ======================
|
||||
recyclerviewadapterhelper : "io.github.cymchad:BaseRecyclerViewAdapterHelper:3.0.4"
|
||||
]
|
||||
android = [
|
||||
launcherApplicationId : "com.mogo.launcher",
|
||||
independentApplicationId : "com.mogo.launcher.app",
|
||||
fLauncherApplicationId : "com.mogo.launcher.f",
|
||||
bydautoIndependentApplicationId: "com.mogo.launcher.app.bydauto",
|
||||
fLauncherAmapApiValue : "ace34d685cc04836c03905e4d1536125",
|
||||
bydautoIndependentApiValue : "b1e1d527b02a493913c50985827c943a",
|
||||
commonLauncherAmapApiValue : "a36b9f7b086fa3951bb35338a5a06dd3",
|
||||
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
|
||||
compileSdkVersion : 29,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 21,
|
||||
minSdkVersionPadLenovo : 23,
|
||||
targetSdkVersionPadLenovo : 23,
|
||||
]
|
||||
}
|
||||
|
||||
boolean isM1Chip() {
|
||||
|
||||
@@ -570,7 +570,6 @@ class MoGoAutopilotProvider :
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
// 乘客屏才监听
|
||||
AppConfigInfo.plateNumber = carConfigResp.plateNumber
|
||||
CallerBindingcarManager.getBindingcarProvider()
|
||||
.getBindingcarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber},Mac地址为:${carConfigResp.macAddress}")
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateLi
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasListener
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
@@ -206,6 +207,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
autopilotStatusInfo.dockVersion = it.dockVersion
|
||||
AppConfigInfo.dockerVersion = it.dockVersion
|
||||
}
|
||||
AppConfigInfo.isConnectAutopilot = autopilotStatusInfo.connectStatus
|
||||
AppConfigInfo.connectStatusDescribe = autopilotStatusInfo.connectStatusDescribe
|
||||
invokeAutoPilotStatus()
|
||||
}
|
||||
}
|
||||
@@ -306,6 +309,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
carConfigResp: MessagePad.CarConfigResp?
|
||||
) {
|
||||
if (HdMapBuildConfig.isMapLoaded && carConfigResp != null) {
|
||||
AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号
|
||||
AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址
|
||||
AppConfigInfo.protocolVersionNumber = carConfigResp.protocolVersionValue//工控机协议版本
|
||||
invokeAutopilotCarConfigData(carConfigResp)
|
||||
}
|
||||
}
|
||||
@@ -427,4 +433,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
override fun onError(status: ProtocolStatus, bytes: ByteArray) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶
|
||||
* 使用方法查看:app_ipc_monitoring/uiMainActivity/onAutopilotAbility
|
||||
*/
|
||||
override fun onAutopilotAbility(ability: AutopilotAbility?) {
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 绑定车辆
|
||||
* @description 升级
|
||||
* @since: 6/20/22
|
||||
*/
|
||||
public interface UpgradeApiService {
|
||||
@@ -21,7 +21,8 @@ public interface UpgradeApiService {
|
||||
* @return {@link UpgradeAppInfo}
|
||||
*/
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("unify/selectResources")
|
||||
Observable<UpgradeAppInfo> getUpgradeInfo(@Query("resources") String res, @Body RequestBody requestBody);
|
||||
@POST("/eagleEye-mis/config/versionInfo")
|
||||
// Observable<UpgradeAppInfo> getUpgradeInfo(@Query("resources") String res, @Body RequestBody requestBody);
|
||||
Observable<UpgradeAppInfo> getUpgradeInfo(@Body RequestBody requestBody);
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ import okhttp3.RequestBody;
|
||||
public class UpgradeAppNetWorkManager {
|
||||
private static volatile UpgradeAppNetWorkManager requestNoticeManager;
|
||||
private final UpgradeApiService mUpgradeApiService;
|
||||
private static final String TAG = "UpgradeAppNetWorkManager";
|
||||
private static final String TAG = "Upgrade";
|
||||
|
||||
|
||||
private UpgradeAppNetWorkManager() {
|
||||
@@ -58,18 +58,16 @@ public class UpgradeAppNetWorkManager {
|
||||
/**
|
||||
* 获取app升级信息
|
||||
*/
|
||||
public void getAppUpgradeInfo(Context context, String screenType, String carType) {
|
||||
public void getAppUpgradeInfo(Context context, String mac, String screenType) {
|
||||
String sn = "X20202203105S688HZ";
|
||||
// int versionCode = 2070000;
|
||||
// String versionName = "2.7.0";
|
||||
|
||||
// String mac = "48:b0:2d:3a:bc:78";
|
||||
// String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
int versionCode = AppUtils.getAppVersionCode();
|
||||
String versionName = AppUtils.getAppVersionName();
|
||||
|
||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, versionCode, versionName, screenType, carType);
|
||||
//TODO 不能写死
|
||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mUpgradeApiService.getUpgradeInfo("apps_control", requestBody)
|
||||
mUpgradeApiService.getUpgradeInfo(requestBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<UpgradeAppInfo>() {
|
||||
@@ -79,18 +77,20 @@ public class UpgradeAppNetWorkManager {
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull UpgradeAppInfo info) {
|
||||
if (info != null && info.getData() != null && info.getData().size() > 0) {
|
||||
CallerLogger.INSTANCE.d(TAG, "UpgradeAppInfo url = " + info.getData().get(0).getApp_url() + "----code = " + info.getData().get(0).getVersion_code());
|
||||
// if (info.getData().get(0).getVersion_code() > versionCode) {
|
||||
|
||||
CallerHmiManager.INSTANCE.showUpgradeDialog(info.getData().get(0).getApp_url().substring(info.getData().get(0).getApp_url().lastIndexOf("/")+1), info.getData().get(0).getApp_url());
|
||||
// }
|
||||
if (info != null && info.result != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode());
|
||||
Log.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
|
||||
if (info.result.getVersionCode() > versionCode) {
|
||||
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl());
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "onNext info == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "UpgradeAppInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,18 +6,15 @@ package com.mogo.eagle.core.function.appupgrade.network;
|
||||
* @since: 11/15/21
|
||||
*/
|
||||
public class UpgradeAppRequest {
|
||||
private String mac;
|
||||
private String sn;
|
||||
private int version_code;
|
||||
private String version_name;
|
||||
private String screen_type;
|
||||
private String car_type;
|
||||
private String screenType;
|
||||
|
||||
public UpgradeAppRequest( String sn, int versionCode, String versionName, String type, String carType) {
|
||||
|
||||
public UpgradeAppRequest( String sn, String mac, String screenType) {
|
||||
this.sn = sn;
|
||||
this.version_code = versionCode;
|
||||
this.version_name = versionName;
|
||||
this.screen_type = type;
|
||||
this.car_type = carType;
|
||||
this.mac = mac;
|
||||
this.screenType = screenType;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
@@ -28,46 +25,20 @@ public class UpgradeAppRequest {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getVersion_code() {
|
||||
return version_code;
|
||||
public String getMac() {
|
||||
return mac;
|
||||
}
|
||||
|
||||
public void setVersion_code(int version_code) {
|
||||
this.version_code = version_code;
|
||||
public void setMac(String mac) {
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
public String getVersion_name() {
|
||||
return version_name;
|
||||
public String getScreenType() {
|
||||
return screenType;
|
||||
}
|
||||
|
||||
public void setVersion_name(String version_name) {
|
||||
this.version_name = version_name;
|
||||
public void setScreenType(String screenType) {
|
||||
this.screenType = screenType;
|
||||
}
|
||||
|
||||
public String getScreen_type() {
|
||||
return screen_type;
|
||||
}
|
||||
|
||||
public void setScreen_type(String screen_type) {
|
||||
this.screen_type = screen_type;
|
||||
}
|
||||
|
||||
public String getCar_type() {
|
||||
return car_type;
|
||||
}
|
||||
|
||||
public void setCar_type(String car_type) {
|
||||
this.car_type = car_type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UpgradeAppRequest{" +
|
||||
"sn='" + sn + '\'' +
|
||||
", version_code=" + version_code +
|
||||
", version_name='" + version_name + '\'' +
|
||||
", screen_type='" + screen_type + '\'' +
|
||||
", car_type='" + car_type + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +116,10 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 以后可能废弃
|
||||
* @return
|
||||
*/
|
||||
private int getScreenType() {
|
||||
int screenType = -1;
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
@@ -142,12 +146,34 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
|
||||
}
|
||||
|
||||
private String getCarScreenType() {
|
||||
String screenType = "";
|
||||
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
screenType = "1"; //taxi乘客端
|
||||
}
|
||||
|
||||
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
screenType = "2"; //taxi司机端
|
||||
}
|
||||
|
||||
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
screenType = "3"; //bus 乘客端
|
||||
}
|
||||
|
||||
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
screenType = "4"; //bus 司机端
|
||||
}
|
||||
|
||||
return screenType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询app是否需要升级
|
||||
*/
|
||||
@Override
|
||||
public void queryAppUpgrade() {
|
||||
UpgradeAppNetWorkManager.getInstance().getAppUpgradeInfo(mContext, String.valueOf(getScreenType()), String.valueOf(getCarType()));
|
||||
Log.d("Upgrade", "mac = " + mAddress + "---type = " + getCarScreenType() );
|
||||
UpgradeAppNetWorkManager.getInstance().getAppUpgradeInfo(mContext, mAddress, getCarScreenType());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
@@ -30,8 +32,13 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
|
||||
override fun init(context: Context) {
|
||||
mContext = context
|
||||
traceManager.init(context)
|
||||
MogoLogCatchManager.init(context)
|
||||
}
|
||||
|
||||
override fun initBiz() {
|
||||
bizConfigCenter.init(mContext!!)
|
||||
FuncConfigImpl.init()
|
||||
traceManager.init(mContext!!)
|
||||
MogoLogCatchManager.init(mContext!!)
|
||||
}
|
||||
|
||||
override fun startLogCatch() {
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.fft.FftFactory;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.listener.RecordListener;
|
||||
@@ -177,14 +176,14 @@ public class RecordHelper {
|
||||
AudioRecordThread() {
|
||||
bufferSize = AudioRecord.getMinBufferSize(currentConfig.getSampleRate(),
|
||||
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig()) * RECORD_AUDIO_BUFFER_TIMES;
|
||||
Logger.d(TAG, "record buffer size = %s", bufferSize);
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "record buffer size = %s", bufferSize);
|
||||
audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, currentConfig.getSampleRate(),
|
||||
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig(), bufferSize);
|
||||
if (currentConfig.getFormat() == RecordConfig.RecordFormat.MP3) {
|
||||
if (mp3EncodeThread == null) {
|
||||
initMp3EncoderThread(bufferSize);
|
||||
} else {
|
||||
Logger.e(TAG, "mp3EncodeThread != null, 请检查代码");
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,7 +205,7 @@ public class RecordHelper {
|
||||
private void startPcmRecorder() {
|
||||
state = RecordState.RECORDING;
|
||||
notifyState();
|
||||
Logger.d(TAG, "开始录制 Pcm");
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "开始录制 Pcm");
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
fos = new FileOutputStream(tmpFile);
|
||||
@@ -224,7 +223,7 @@ public class RecordHelper {
|
||||
if (state == RecordState.STOP) {
|
||||
makeFile();
|
||||
} else {
|
||||
Logger.i(TAG, "暂停!");
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "暂停!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
notifyError("录音失败");
|
||||
@@ -240,7 +239,7 @@ public class RecordHelper {
|
||||
if (state != RecordState.PAUSE) {
|
||||
state = RecordState.IDLE;
|
||||
notifyState();
|
||||
Logger.d(TAG, "录音结束");
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "录音结束");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +267,7 @@ public class RecordHelper {
|
||||
notifyState();
|
||||
stopMp3Encoded();
|
||||
} else {
|
||||
Logger.d(TAG, "暂停");
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "暂停");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,7 +282,7 @@ public class RecordHelper {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Logger.e(TAG, "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +301,7 @@ public class RecordHelper {
|
||||
break;
|
||||
}
|
||||
notifyFinish();
|
||||
Logger.i(TAG, "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -377,7 +376,7 @@ public class RecordHelper {
|
||||
|
||||
private String getFilePath(String fileName) {
|
||||
if (!FileUtils.createOrExistsDir(ROOT_PATH)) {
|
||||
Logger.w(TAG, "文件夹创建失败:%s", ROOT_PATH);
|
||||
CallerLogger.INSTANCE.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -388,7 +387,7 @@ public class RecordHelper {
|
||||
|
||||
private String getTempFilePath() {
|
||||
if (!FileUtils.createOrExistsDir(TEMP_PATH)) {
|
||||
Logger.e(TAG, "文件夹创建失败:%s", TEMP_PATH);
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "文件夹创建失败:%s", TEMP_PATH);
|
||||
}
|
||||
String fileName = String.format(Locale.getDefault(), "tmp_%s", FileUtils.getNowString(new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.SIMPLIFIED_CHINESE)));
|
||||
return String.format(Locale.getDefault(), "%s%s.pcm", TEMP_PATH, fileName);
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SPUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigConst.Companion.FUNC_CONFIG_TYPE
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigConst.Companion.defaultFuncConfig
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.network.FuncConfigNetWorkModel
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import com.zhjt.service_biz.BizManager
|
||||
import com.zhjt.service_biz.FuncConfig
|
||||
|
||||
class FuncConfigCenter : IMogoOnMessageListener<FuncConfig> {
|
||||
|
||||
companion object {
|
||||
val bizConfigCenter by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
FuncConfigCenter()
|
||||
}
|
||||
}
|
||||
|
||||
private var mContext: Context? = null
|
||||
private val funcConfigNetWorkModel = FuncConfigNetWorkModel()
|
||||
|
||||
fun init(context: Context) {
|
||||
mContext = context
|
||||
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.registerOnMessageListener(FUNC_CONFIG_TYPE, this)
|
||||
UiThreadHandler.postDelayed({
|
||||
funcConfigNetWorkModel.requestFuncConfig({
|
||||
SPUtils.getInstance("biz_config").put("config", GsonUtils.toJson(it))
|
||||
refreshConfig(it)
|
||||
}, {
|
||||
val bizJson = SPUtils.getInstance("biz_config")
|
||||
.getString("config", GsonUtils.toJson(defaultFuncConfig()))
|
||||
refreshConfig(GsonUtils.fromJson(bizJson, FuncConfig::class.java))
|
||||
})
|
||||
}, 1000L * 5)
|
||||
|
||||
}
|
||||
|
||||
override fun target(): Class<FuncConfig> {
|
||||
return FuncConfig::class.java
|
||||
}
|
||||
|
||||
override fun onMsgReceived(obj: FuncConfig?) {
|
||||
obj?.let {
|
||||
refreshConfig(it)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
|
||||
linkCode = CHAIN_LINK_CLOUD_SHOW,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private fun refreshConfig(funcConfig: FuncConfig) {
|
||||
BizManager.updateBizConfigData(funcConfig)
|
||||
funcConfig.business.forEach { business ->
|
||||
CallerDevaToolsFuncConfigListenerManager.invokeDevaToolsFuncConfigBizUpdate(
|
||||
business.biz,
|
||||
business.data
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.unregisterLifecycleListener(FUNC_CONFIG_TYPE)
|
||||
mContext = null
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_AUTOPILOT_LANE_SELECTION
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_AVW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BAG_RECORD
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BEAUTY_MODE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BSW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BYPASS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_CLW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_DNPW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_EBW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FCW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_LOG
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_HLW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_GREEN
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LCW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LIMIT_SPEED_SET
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LTA
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_OPT_LINE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RAIN_MODE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_SLW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_TJW
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_TRACE_LOG
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VRU
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VRU_RI
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_WARNING_UPLOAD
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2V
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.zhjt.mogo_core_function_devatools.BuildConfig
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.service_biz.Business
|
||||
import com.zhjt.service_biz.FuncConfig
|
||||
import com.zhjt.service_biz.SubBiz
|
||||
|
||||
class FuncConfigConst {
|
||||
|
||||
companion object{
|
||||
|
||||
const val FUNC_CONFIG_TYPE = 500001
|
||||
|
||||
fun defaultFuncConfig(): FuncConfig {
|
||||
val businessList = mutableListOf<Business>()
|
||||
|
||||
val v2nSubList = mutableListOf<SubBiz>()
|
||||
v2nSubList.add(SubBiz(BIZ_VIP, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2nSubList.add(SubBiz(BIZ_OPT_LINE, lock = false, state = false, dependNode = "", data = ""))
|
||||
v2nSubList.add(SubBiz(BIZ_VRU, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2nSubList.add(SubBiz(BIZ_VRU_RI, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2nSubList.add(SubBiz(BIZ_HLW, lock = false, state = true, dependNode = "", data = ""))
|
||||
businessList.add(Business(V2N, v2nSubList))
|
||||
|
||||
val v2iSubList = mutableListOf<SubBiz>()
|
||||
v2iSubList.add(SubBiz(BIZ_IVP_GREEN, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2iSubList.add(SubBiz(BIZ_IVP, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2iSubList.add(SubBiz(BIZ_RTS, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2iSubList.add(SubBiz(BIZ_SLW, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2iSubList.add(SubBiz(BIZ_IVS, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2iSubList.add(SubBiz(BIZ_TJW, lock = false, state = true, dependNode = "", data = ""))
|
||||
businessList.add(Business(V2I,v2iSubList))
|
||||
|
||||
val v2vSubList = mutableListOf<SubBiz>()
|
||||
v2vSubList.add(SubBiz(BIZ_AVW, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2vSubList.add(SubBiz(BIZ_LCW, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2vSubList.add(SubBiz(BIZ_BSW, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2vSubList.add(SubBiz(BIZ_EBW, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2vSubList.add(SubBiz(BIZ_FCW, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2vSubList.add(SubBiz(BIZ_LTA, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2vSubList.add(SubBiz(BIZ_CLW, lock = false, state = true, dependNode = "", data = ""))
|
||||
v2vSubList.add(SubBiz(BIZ_DNPW, lock = false, state = true, dependNode = "", data = ""))
|
||||
businessList.add(Business(V2V,v2vSubList))
|
||||
|
||||
val foundationSubList = mutableListOf<SubBiz>()
|
||||
foundationSubList.add(SubBiz(BIZ_BEAUTY_MODE, lock = true, state = false, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_RAIN_MODE, lock = true, state = false, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_FULL_LOG, lock = false, state = false, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_TRACE_LOG, lock = false, state = true, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_BAG_RECORD, lock = true, state = true, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_WARNING_UPLOAD, lock = true, state = true, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_LIMIT_SPEED_SET, lock = false, state = true, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_BYPASS, lock = false, state = true, dependNode = "", data = ""))
|
||||
foundationSubList.add(SubBiz(BIZ_AUTOPILOT_LANE_SELECTION, lock = false, state = true, dependNode = "", data = ""))
|
||||
businessList.add(Business(FOUNDATION,foundationSubList))
|
||||
|
||||
return FuncConfig(0, AppUtils.getAppVersionCode(), getChannelCode(), getEnv(), businessList)
|
||||
}
|
||||
|
||||
private fun getEnv():Int{
|
||||
return if(EnvChangeManager.getEnvConfig()!= null){
|
||||
EnvChangeManager.getEnvConfig()!!.netMode
|
||||
}else {
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
// todo 新增车型需要更新(清扫车)
|
||||
fun getChannelCode(): Int{
|
||||
return when{
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> 1
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> 2
|
||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> 3
|
||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> 4
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BEAUTY_MODE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RAIN_MODE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_WARNING_UPLOAD
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
|
||||
|
||||
object FuncConfigImpl : IMoGoDevaToolsFuncConfigListener {
|
||||
|
||||
private const val TAG = "FuncConfigImpl"
|
||||
|
||||
fun init() {
|
||||
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
|
||||
FOUNDATION,
|
||||
TAG,
|
||||
this
|
||||
)
|
||||
}
|
||||
|
||||
override fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {
|
||||
when (type) {
|
||||
BIZ_BEAUTY_MODE -> FunctionBuildConfig.isDemoMode = state
|
||||
BIZ_RAIN_MODE -> FunctionBuildConfig.isRainMode = state
|
||||
BIZ_WARNING_UPLOAD -> FunctionBuildConfig.isReportWarning = state
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig.network
|
||||
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.zhjt.service_biz.FuncConfig
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.Headers
|
||||
import retrofit2.http.POST
|
||||
|
||||
interface FuncConfigApiService {
|
||||
|
||||
//FuncConfig
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("eagleEye-mis/config/abilityInfo")
|
||||
suspend fun funcConfig(@Body map: MutableMap<String, Any>): BaseResponse<FuncConfig>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig.network
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
class FuncConfigHost {
|
||||
|
||||
companion object{
|
||||
private const val HOST_DEV = "https://eagle-qa.zhidaozhixing.com"
|
||||
private const val HOST_RELEASE = "https://eagle.zhidaozhixing.com"
|
||||
|
||||
fun get(): String{
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV -> HOST_DEV
|
||||
DebugConfig.NET_MODE_QA -> HOST_DEV
|
||||
DebugConfig.NET_MODE_DEMO -> HOST_RELEASE
|
||||
DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE
|
||||
else -> HOST_RELEASE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.zhjt.mogo_core_function_devatools.funcconfig.network
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiCall
|
||||
import com.mogo.eagle.core.network.request
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigConst
|
||||
import com.zhjt.service_biz.FuncConfig
|
||||
|
||||
class FuncConfigNetWorkModel {
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = FuncConfigHost.get()): FuncConfigApiService {
|
||||
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
|
||||
.create(FuncConfigApiService::class.java)
|
||||
}
|
||||
|
||||
private var retryTime = 0
|
||||
private var success: ((FuncConfig) -> Unit)? = null
|
||||
private var error: ((String) -> Unit)? = null
|
||||
|
||||
fun requestFuncConfig(
|
||||
onSuccess: ((FuncConfig) -> Unit)? = null,
|
||||
onError: ((String) -> Unit)? = null
|
||||
) {
|
||||
request<BaseResponse<FuncConfig>> {
|
||||
val map = mutableMapOf<String, Any>()
|
||||
start {
|
||||
if (success == null) {
|
||||
success = onSuccess
|
||||
}
|
||||
if (error == null) {
|
||||
error = onError
|
||||
}
|
||||
//todo test
|
||||
// map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["sn"] = "X20202203105S688HZ"
|
||||
// map["mac"] = DeviceUtils.getMacAddress()
|
||||
map["mac"] = "48:b0:2d:3a:bc:78"
|
||||
// map["channelVersion"] = FuncConfigConst.getChannelCode()
|
||||
map["channelVersion"] = 1
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
getNetWorkApi().funcConfig(map)
|
||||
}
|
||||
}
|
||||
onSuccess {
|
||||
if (it.result != null) {
|
||||
success?.invoke(it.result)
|
||||
} else {
|
||||
if (retryTime < 3) {
|
||||
retryTime += 1
|
||||
requestFuncConfig()
|
||||
} else {
|
||||
error?.invoke("FuncConfig error msg is null")
|
||||
}
|
||||
}
|
||||
}
|
||||
onError {
|
||||
if (retryTime < 3) {
|
||||
retryTime += 1
|
||||
requestFuncConfig()
|
||||
} else if (it.message != null) {
|
||||
error?.invoke(it.message ?: "FuncConfig error msg is null")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModuleTAG
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.Scene.Companion.scene
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
@@ -71,7 +70,6 @@ class SceneManager {
|
||||
|
||||
//默认未创建的,符合scene tag,首次初始化logger=true
|
||||
scene.addChangeListener { change ->
|
||||
Logger.i("emArrow","scene change : $change")
|
||||
sceneModuleTAG.map.iterator().forEach { map ->
|
||||
val sceneModule = map.value
|
||||
sceneModule.name?.let {
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.GpsStatus
|
||||
@@ -50,10 +51,10 @@ object StatusManager {
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
guardianInfo?.code?.takeIf {
|
||||
Logger.d(TAG, "-- onAutopilotGuardian ---: code: $it")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onAutopilotGuardian ---: code: $it")
|
||||
it.contains("RTK_STATUS", true) || it.contains("CAN", true) || it == "ILCT_RTK_OR_SLAM_CHANGE"
|
||||
}?.run {
|
||||
Logger.d(TAG, "-- onAutopilotGuardian trigger req ---: code: $this")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onAutopilotGuardian trigger req ---: code: $this")
|
||||
req()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ import android.content.*
|
||||
import android.util.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RTKStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
import kotlinx.coroutines.*
|
||||
@@ -31,7 +32,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
|
||||
override fun onCreate() {
|
||||
send(RTKStatus(getDesc(), getCode()))
|
||||
Logger.d(TAG, "-- onCreate --")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotCarStatusListenerManager.addListener(TAG, this)
|
||||
if (CallerAutoPilotManager.isConnected()) {
|
||||
@@ -67,7 +68,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||
if (!CallerAutoPilotManager.isConnected()) {
|
||||
Logger.d(TAG, "工控机断开了....")
|
||||
CallerLogger.d("$M_DEVA$TAG", "工控机断开了....")
|
||||
healthInfo.set(null)
|
||||
send(RTKStatus("", -1))
|
||||
}
|
||||
@@ -114,7 +115,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
isOldVersion.set(false)
|
||||
Logger.d(TAG, "-- onDestroy --")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onDestroy --")
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerAutopilotCarStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import androidx.core.content.*
|
||||
import androidx.recyclerview.widget.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.*
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.R.drawable
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.*
|
||||
@@ -16,7 +16,6 @@ import com.zhjt.mogo_core_function_devatools.status.entity.IpcStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.ui.adapter.StatusAdapter.StatusViewHolder
|
||||
import kotlinx.coroutines.*
|
||||
|
||||
internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): RecyclerView.Adapter<StatusViewHolder>() {
|
||||
|
||||
@@ -124,7 +123,7 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
is TracingStatus -> {
|
||||
val extra = status.state.extra
|
||||
val extraDesc = if (extra != null && extra.isNotEmpty()) extra.values.joinToString(",") else ""
|
||||
Logger.d(TAG, "traceing_state: $status -> extra: $extraDesc :: extra: $extra")
|
||||
CallerLogger.d("$M_DEVA$TAG", "traceing_state: $status -> extra: $extraDesc :: extra: $extra")
|
||||
when(status.state) {
|
||||
//"轨迹类型:${ if (status.state == TRACK_LOADED) "循迹" else if (status.state == ROUTE_LOADED) "自主算路" else "暂无轨迹" }"
|
||||
MAP_TRA_TYPE -> {
|
||||
|
||||
@@ -139,6 +139,7 @@ dependencies {
|
||||
api project(':core:mogo-core-function-call')
|
||||
api project(':core:mogo-core-function-api')
|
||||
|
||||
api project(':libraries:mogo-adas')
|
||||
api project(':libraries:map-usbcamera')
|
||||
api project(':libraries:mogo-adas-other')
|
||||
}
|
||||
|
||||
@@ -20,15 +20,22 @@ import androidx.core.view.*
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.kwai.koom.base.postOnMainThread
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.mvp.BaseFragment
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.*
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.data.enums.SidePattern.*
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
@@ -46,6 +53,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
@@ -54,6 +62,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
@@ -81,13 +90,13 @@ import com.mogo.eagle.core.utilcode.reminder.*
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.*
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder.IStateChangeListener
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.impl.*
|
||||
import com.mogo.eagle.core.utilcode.util.SoundUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.module.common.enums.*
|
||||
import com.zhidao.support.adas.high.common.MogoReport.Code.Error.EMAP.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlinx.android.synthetic.main.fragment_hmi.*
|
||||
import kotlinx.android.synthetic.main.view_auto_pilot_check.view.*
|
||||
import kotlinx.android.synthetic.main.view_och_bus_operation.view.*
|
||||
@@ -104,12 +113,12 @@ import java.util.*
|
||||
* 预警图层
|
||||
*/
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
IMoGoWaringProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoHmiContract.View,
|
||||
IMoGoAutopilotRecordListener,
|
||||
IMoGoAutopilotStatusListener, IViewNotificationProvider {
|
||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
IMoGoWaringProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoHmiContract.View,
|
||||
IMoGoAutopilotRecordListener,
|
||||
IMoGoAutopilotStatusListener, IViewNotificationProvider {
|
||||
private val TAG = "MoGoHmiFragment"
|
||||
|
||||
// DebugSettingView
|
||||
@@ -145,11 +154,12 @@ import java.util.*
|
||||
|
||||
//工控机节点上报列表
|
||||
private var reportList = arrayListOf<ReportEntity>()
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow?=null
|
||||
private var ipcReportWindow: IPCReportWindow?=null
|
||||
|
||||
private var adUpgradeDialog: AdUpgradeDialog?=null
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
private var ipcReportWindow: IPCReportWindow? = null
|
||||
|
||||
private var adUpgradeDialog: AdUpgradeDialog? = null
|
||||
|
||||
private var lastSpeakJob: Job? = null
|
||||
|
||||
@@ -183,8 +193,8 @@ import java.util.*
|
||||
}
|
||||
|
||||
/**ivCameraIcon?.setOnLongClickListener {
|
||||
activity?.let { it1 -> CarcorderPreviewView.show(it1) }
|
||||
true
|
||||
activity?.let { it1 -> CarcorderPreviewView.show(it1) }
|
||||
true
|
||||
}*/
|
||||
|
||||
ivToolsIcon?.setOnClickListener {
|
||||
@@ -198,7 +208,50 @@ import java.util.*
|
||||
true
|
||||
}
|
||||
|
||||
// init appConfigInfo
|
||||
AppConfigInfo.appName = AppUtils.getAppName()
|
||||
if (AppConfigInfo.appVersionCode == 0) {
|
||||
AppConfigInfo.appVersionCode = AppUtils.getAppVersionCode()
|
||||
}
|
||||
if (AppConfigInfo.appVersionName.isNullOrEmpty()) {
|
||||
AppConfigInfo.appVersionName = AppUtils.getAppVersionName()
|
||||
}
|
||||
if (AppConfigInfo.appPackageName.isNullOrEmpty()) {
|
||||
AppConfigInfo.appPackageName = AppUtils.getAppPackageName()
|
||||
}
|
||||
if (AppConfigInfo.uniqueDeviceId.isNullOrEmpty()) {
|
||||
AppConfigInfo.uniqueDeviceId = DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp())
|
||||
}
|
||||
if (AppConfigInfo.widevineIDMd5.isNullOrEmpty()) {
|
||||
AppConfigInfo.widevineIDMd5 =
|
||||
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
|
||||
}
|
||||
if (MoGoAiCloudClient.getInstance().aiCloudClientConfig != null) {
|
||||
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
|
||||
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
|
||||
}
|
||||
|
||||
AppConfigInfo.netMode = DebugConfig.getNetMode()
|
||||
if (MogoMap.getInstance().mogoMap != null) {
|
||||
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
|
||||
}
|
||||
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
|
||||
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
|
||||
|
||||
when {
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端
|
||||
AppConfigInfo.isDriver = true
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted()
|
||||
}
|
||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> {
|
||||
AppConfigInfo.isDriver = false
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
|
||||
AppConfigInfo.serverSn = CallerTelematicManager.getServerToken()
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp()
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
@@ -221,45 +274,62 @@ import java.util.*
|
||||
}
|
||||
}
|
||||
|
||||
override fun getNotificationView(): IViewNotification? = context?.let { V2XNotificationView(it) }
|
||||
override fun getNotificationView(): IViewNotification? =
|
||||
context?.let { V2XNotificationView(it) }
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("$M_HMI$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
|
||||
if(BadCaseConfig.recordKeyList.contains(recordPanel.key)){
|
||||
if(recordPanel.stat == 100 || recordPanel.stat == 101){
|
||||
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) {
|
||||
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
|
||||
//成功结束录制
|
||||
TipToast.shortTip("${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())} bag录制成功")
|
||||
TipToast.shortTip(
|
||||
"${
|
||||
millis2String(
|
||||
System.currentTimeMillis(),
|
||||
TimeUtils.getHourMinSecondFormat()
|
||||
)
|
||||
} bag录制成功"
|
||||
)
|
||||
}
|
||||
if(recordPanel.stat == 200){
|
||||
if (recordPanel.stat == 200) {
|
||||
//录制失败
|
||||
TipToast.shortTip("${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())} bag录制失败")
|
||||
TipToast.shortTip(
|
||||
"${
|
||||
millis2String(
|
||||
System.currentTimeMillis(),
|
||||
TimeUtils.getHourMinSecondFormat()
|
||||
)
|
||||
} bag录制失败"
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
//在工控机taxi2.3.0版本和Bus2.4.0版本上不支持被动录包,不进行被动录包的弹窗
|
||||
BadCaseConfig.dockerVersion?.let {
|
||||
if(it.contains("taxi") && it.contains("2.3.0")){
|
||||
if (it.contains("taxi") && it.contains("2.3.0")) {
|
||||
return
|
||||
}
|
||||
if(it.contains("bus") && it.contains("2.4.0")){
|
||||
if (it.contains("bus") && it.contains("2.4.0")) {
|
||||
return
|
||||
}
|
||||
}
|
||||
//处于非美化模式下弹窗;是地图数据采集任务时即type=2时,不弹窗
|
||||
if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type!=2) {
|
||||
if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) {
|
||||
//只在司机屏生效,乘客屏不生效
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
activity?.let { CallerDevaToolsManager.onReceiveBadCaseRecord(recordPanel, it) }
|
||||
}
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && recordPanel.type == 2 && (
|
||||
recordPanel.stat == 101 || //工控机采集完成-被动完成
|
||||
recordPanel.stat == 100 || //工控机采集完成-主动完成
|
||||
recordPanel.stat == 102 || //工控机达到最大采集时长
|
||||
recordPanel.stat == 103) //工控机磁盘满了
|
||||
recordPanel.stat == 101 || //工控机采集完成-被动完成
|
||||
recordPanel.stat == 100 || //工控机采集完成-主动完成
|
||||
recordPanel.stat == 102 || //工控机达到最大采集时长
|
||||
recordPanel.stat == 103) //工控机磁盘满了
|
||||
) {
|
||||
CallerMapDataCollectorManager.finish(recordPanel.id, recordPanel.stat, "", recordPanel.filename
|
||||
?: "", recordPanel.note ?: "")
|
||||
CallerMapDataCollectorManager.finish(
|
||||
recordPanel.id, recordPanel.stat, "", recordPanel.filename
|
||||
?: "", recordPanel.note ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,15 +373,19 @@ import java.util.*
|
||||
* @param warningReportList 提醒级别上报数据列表
|
||||
* @param reportLevel 1:error级别 2:warning级别
|
||||
*/
|
||||
override fun showIPCReportWindow(errorReportList: ArrayList<ReportEntity>,warningReportList: ArrayList<ReportEntity>,reportLevel: Int) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
if(reportLevel == 1){
|
||||
if(ipcReportWindow==null){
|
||||
ipcReportWindow= activity?.let { IPCReportWindow(it) }
|
||||
ipcReportWindow?.setClickListener(object: IPCReportWindow.ClickListener{
|
||||
override fun showIPCReportWindow(
|
||||
errorReportList: ArrayList<ReportEntity>,
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (reportLevel == 1) {
|
||||
if (ipcReportWindow == null) {
|
||||
ipcReportWindow = activity?.let { IPCReportWindow(it) }
|
||||
ipcReportWindow?.setClickListener(object : IPCReportWindow.ClickListener {
|
||||
override fun closeWindow() {
|
||||
ipcReportWindow?.hideFloatWindow()
|
||||
ipcReportWindow =null
|
||||
ipcReportWindow = null
|
||||
}
|
||||
})
|
||||
ipcReportWindow?.let {
|
||||
@@ -320,7 +394,7 @@ import java.util.*
|
||||
}
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
}
|
||||
ipcReportWindow?.refreshData(errorReportList,warningReportList,reportLevel)
|
||||
ipcReportWindow?.refreshData(errorReportList, warningReportList, reportLevel)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,14 +402,6 @@ import java.util.*
|
||||
mViewNotificationProvider = provider
|
||||
}
|
||||
|
||||
override fun showVideoDialog(infList: List<Infrastructure>) {
|
||||
context?.let {
|
||||
if (roadVideoDialog == null) {
|
||||
roadVideoDialog = RoadVideoDialog(it)
|
||||
}
|
||||
roadVideoDialog?.show(infList)
|
||||
}
|
||||
}
|
||||
|
||||
override fun changeBusOperationStatus(isOut: Boolean) {
|
||||
busOperationStatus?.changerOperationStatus(isOut)
|
||||
@@ -387,41 +453,41 @@ import java.util.*
|
||||
})
|
||||
}
|
||||
toolsViewFloat = WarningFloat.with(it)
|
||||
.setTag("ToolsViewFloat")
|
||||
.setLayout(toolsView!!)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.LEFT)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(LayoutParams.MATCH_PARENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag("ToolsViewFloat")
|
||||
.setLayout(toolsView!!)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.LEFT)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(LayoutParams.MATCH_PARENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
// TODO:("")
|
||||
}
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
// TODO:("")
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
toolsViewFloat?.show()
|
||||
}
|
||||
@@ -466,7 +532,7 @@ import java.util.*
|
||||
ivAiCollectTools.visibility = View.VISIBLE
|
||||
CallerDevaToolsManager.initBadCase(ivBadCaseTools)
|
||||
CallerDevaToolsManager.initAiCollect(ivAiCollectTools)
|
||||
}else{
|
||||
} else {
|
||||
ivBadCaseTools.visibility = View.GONE
|
||||
ivAiCollectTools.visibility = View.GONE
|
||||
}
|
||||
@@ -543,20 +609,20 @@ import java.util.*
|
||||
mDebugSettingView = DebugSettingView(it)
|
||||
Log.i("DebugViewSwitchLog", "new DebugSettingView")
|
||||
mDebugSettingView?.reportInit(reportList)
|
||||
mDebugSettingView?.setClickListener(object: DebugSettingView.ClickListener{
|
||||
mDebugSettingView?.setClickListener(object : DebugSettingView.ClickListener {
|
||||
override fun showReportListWindow(show: Boolean) {
|
||||
if(show){
|
||||
if (show) {
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow = ReportListFloatWindow(it)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
}else{
|
||||
} else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
}
|
||||
}
|
||||
})
|
||||
if(mDebugSettingView!=null){
|
||||
if (mDebugSettingView != null) {
|
||||
Log.i("DebugViewSwitchLog", "new DebugSettingView success")
|
||||
}
|
||||
}
|
||||
@@ -564,38 +630,39 @@ import java.util.*
|
||||
var gravity = Gravity.RIGHT
|
||||
//调试窗默认靠右显示,Bus的乘客端右端有视图覆盖,调试窗靠左显示
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
side = SidePattern.LEFT
|
||||
gravity = Gravity.LEFT
|
||||
}
|
||||
mDebugSettingViewFloat = WarningFloat.with(it)
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(mDebugSettingView!!)
|
||||
.setSidePattern(side)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(mDebugSettingView!!)
|
||||
.setSidePattern(side)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -610,15 +677,16 @@ import java.util.*
|
||||
*/
|
||||
@Synchronized
|
||||
override fun showWarningV2X(
|
||||
v2xType: String,
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
tag: String?,
|
||||
listener: IMoGoWarningStatusListener?,
|
||||
playTts: Boolean,
|
||||
expireTime: Long
|
||||
v2xType: String,
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
tag: String?,
|
||||
listener: IMoGoWarningStatusListener?,
|
||||
playTts: Boolean,
|
||||
expireTime: Long
|
||||
) {
|
||||
val playTTS = playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
val playTTS =
|
||||
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
activity?.let {
|
||||
val warningContent = alertContent
|
||||
?: EventTypeEnum.getWarningContent(v2xType)
|
||||
@@ -629,70 +697,87 @@ import java.util.*
|
||||
val content = mViewNotificationProvider?.getNotificationView() ?: return
|
||||
content.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType))
|
||||
content.setWarningContent(warningContent)
|
||||
Log.d("$M_HMI$TAG", "--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime")
|
||||
Reminder.enqueue(this@MoGoHmiFragment, object : PopupWindowReminder(PopupWindow(content, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT).also { itx ->
|
||||
itx.isTouchable = false
|
||||
itx.isFocusable = false
|
||||
itx.isClippingEnabled = false
|
||||
itx.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
val transition = Slide(when(content.sidePattern) {
|
||||
LEFT, RESULT_LEFT-> Gravity.LEFT
|
||||
RIGHT, RESULT_RIGHT -> Gravity.RIGHT
|
||||
TOP, RESULT_TOP -> Gravity.TOP
|
||||
BOTTOM, RESULT_BOTTOM -> Gravity.BOTTOM
|
||||
else -> Gravity.TOP
|
||||
}).also { t ->
|
||||
t.interpolator = AccelerateDecelerateInterpolator()
|
||||
t.duration = 200
|
||||
}
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.M) {
|
||||
itx.enterTransition = transition
|
||||
itx.exitTransition = transition
|
||||
}
|
||||
}) {
|
||||
override fun show() {
|
||||
val parent = it.window.decorView
|
||||
parent.doOnAttach {
|
||||
Log.d("$M_HMI$TAG", "--- show v2x dialog 2 ---: info -> v2x-type: $v2xType : expireTime: $expireTime")
|
||||
popupWindow.showAtLocation(parent, content.layoutGravity, 0, 0)
|
||||
}
|
||||
}
|
||||
override fun isOverride(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun key(): String {
|
||||
return v2xType
|
||||
}
|
||||
}, object : IStateChangeListener {
|
||||
|
||||
override fun onShow(reminder: IReminder) {
|
||||
listener?.onShow()
|
||||
lastShowV2XJob?.safeCancel()
|
||||
lastSpeakJob?.safeCancel()
|
||||
showingV2XTip = reminder
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
reminder.hide()
|
||||
}
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
lifecycleScope.launch {
|
||||
speak(it, ttsContent)
|
||||
}.also { itx ->
|
||||
lastSpeakJob = itx
|
||||
Log.d(
|
||||
"$M_HMI$TAG",
|
||||
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||
)
|
||||
Reminder.enqueue(
|
||||
this@MoGoHmiFragment,
|
||||
object : PopupWindowReminder(
|
||||
PopupWindow(
|
||||
content,
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT
|
||||
).also { itx ->
|
||||
itx.isTouchable = false
|
||||
itx.isFocusable = false
|
||||
itx.isClippingEnabled = false
|
||||
itx.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
val transition = Slide(
|
||||
when (content.sidePattern) {
|
||||
LEFT, RESULT_LEFT -> Gravity.LEFT
|
||||
RIGHT, RESULT_RIGHT -> Gravity.RIGHT
|
||||
TOP, RESULT_TOP -> Gravity.TOP
|
||||
BOTTOM, RESULT_BOTTOM -> Gravity.BOTTOM
|
||||
else -> Gravity.TOP
|
||||
}
|
||||
).also { t ->
|
||||
t.interpolator = AccelerateDecelerateInterpolator()
|
||||
t.duration = 200
|
||||
}
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.M) {
|
||||
itx.enterTransition = transition
|
||||
itx.exitTransition = transition
|
||||
}
|
||||
}) {
|
||||
override fun show() {
|
||||
val parent = it.window.decorView
|
||||
parent.doOnAttach {
|
||||
Log.d(
|
||||
"$M_HMI$TAG",
|
||||
"--- show v2x dialog 2 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||
)
|
||||
popupWindow.showAtLocation(parent, content.layoutGravity, 0, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onHide(reminder: IReminder) {
|
||||
listener?.onDismiss()
|
||||
showingV2XTip = null
|
||||
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
})
|
||||
override fun isOverride(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun key(): String {
|
||||
return v2xType
|
||||
}
|
||||
},
|
||||
object : IStateChangeListener {
|
||||
|
||||
override fun onShow(reminder: IReminder) {
|
||||
listener?.onShow()
|
||||
lastShowV2XJob?.safeCancel()
|
||||
lastSpeakJob?.safeCancel()
|
||||
showingV2XTip = reminder
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
reminder.hide()
|
||||
}
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
lifecycleScope.launch {
|
||||
speak(it, ttsContent)
|
||||
}.also { itx ->
|
||||
lastSpeakJob = itx
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onHide(reminder: IReminder) {
|
||||
listener?.onDismiss()
|
||||
showingV2XTip = null
|
||||
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -739,8 +824,8 @@ import java.util.*
|
||||
* @param checkLightId 0-都是默认不亮起,1-红,2-黄,3-绿
|
||||
* @param lightSource 1:云端下发;2:自车感知
|
||||
*/
|
||||
override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
|
||||
mViewTrafficLight?.showWarningTrafficLight(checkLightId,lightSource)
|
||||
override fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
|
||||
mViewTrafficLight?.showWarningTrafficLight(checkLightId, lightSource)
|
||||
}
|
||||
|
||||
override fun isWarningTrafficLightShow(): Boolean {
|
||||
@@ -814,7 +899,7 @@ import java.util.*
|
||||
* @see WarningDirectionEnum
|
||||
*/
|
||||
override fun showWarning(direction: WarningDirectionEnum) {
|
||||
Log.d(TAG,"showWarning====")
|
||||
Log.d(TAG, "showWarning====")
|
||||
flV2XWarningView?.showWarning(direction)
|
||||
flicker(flV2XWarningView)
|
||||
}
|
||||
@@ -863,42 +948,42 @@ import java.util.*
|
||||
mNoticeFloat = it?.let { it1 ->
|
||||
noticeBannerView?.let { it2 ->
|
||||
WarningFloat.with(it1)
|
||||
.setTag(WaringConst.NOTICE_FOR_TRAFFIC_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(60 * 1000 * 3)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
.setTag(WaringConst.NOTICE_FOR_TRAFFIC_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(60 * 1000 * 3)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -913,41 +998,41 @@ import java.util.*
|
||||
mNoticeFloat = it.let { it1 ->
|
||||
noticeBannerView?.let { it2 ->
|
||||
WarningFloat.with(it1)
|
||||
.setTag(WaringConst.NOTICE_FOR_NORMAL_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(10000)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag(WaringConst.NOTICE_FOR_NORMAL_KEY)
|
||||
.setLayout(it2)
|
||||
.setSidePattern(SidePattern.TOP)
|
||||
.setCountDownTime(10000)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
// 创建弹窗成功才进行TTS播报
|
||||
// AIAssist.getInstance(activity)
|
||||
// .speakTTSVoice("")
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1034,6 +1119,17 @@ import java.util.*
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
|
||||
@BizConfig(V2I, "", BIZ_RTS)
|
||||
override fun showVideoDialog(infList: List<Infrastructure>) {
|
||||
context?.let {
|
||||
if (roadVideoDialog == null) {
|
||||
roadVideoDialog = RoadVideoDialog(it)
|
||||
}
|
||||
roadVideoDialog?.show(infList)
|
||||
}
|
||||
}
|
||||
|
||||
@BizConfig(V2I, "", BIZ_RTS)
|
||||
private fun showCameraList(cameraList: List<CameraEntity>?) {
|
||||
context?.let {
|
||||
if (cameraViewFloat == null) {
|
||||
@@ -1062,40 +1158,40 @@ import java.util.*
|
||||
}
|
||||
})
|
||||
cameraViewFloat = WarningFloat.with(it)
|
||||
.setTag("CameraListFloat")
|
||||
.setLayout(cameraListView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, -40, 255)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
.setTag("CameraListFloat")
|
||||
.setLayout(cameraListView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, -40, 255)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
})
|
||||
.show()
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
cameraViewFloat?.show()
|
||||
}
|
||||
@@ -1126,9 +1222,9 @@ import java.util.*
|
||||
}
|
||||
}
|
||||
|
||||
private var isLeftLight :Boolean = false
|
||||
private var isRightLight :Boolean = false
|
||||
private var isDisappare :Boolean = false
|
||||
private var isLeftLight: Boolean = false
|
||||
private var isRightLight: Boolean = false
|
||||
private var isDisappare: Boolean = false
|
||||
|
||||
/**
|
||||
* 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) {
|
||||
@@ -1233,13 +1329,14 @@ import java.util.*
|
||||
padSn: String,
|
||||
releaseId: String
|
||||
) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
if(adUpgradeDialog == null){
|
||||
adUpgradeDialog = AdUpgradeDialog(requireContext(),images, padSn, releaseId)
|
||||
adUpgradeDialog?.setClickListener(object: AdUpgradeDialog.ClickListener{
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (adUpgradeDialog == null) {
|
||||
adUpgradeDialog = AdUpgradeDialog(requireContext(), images, padSn, releaseId)
|
||||
adUpgradeDialog?.setClickListener(object : AdUpgradeDialog.ClickListener {
|
||||
override fun confirm() {
|
||||
//确认升级
|
||||
CallerBindingcarManager.getBindingcarProvider().upgradeConfirm(images, padSn, releaseId)
|
||||
CallerBindingcarManager.getBindingcarProvider()
|
||||
.upgradeConfirm(images, padSn, releaseId)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(true)
|
||||
ToastUtils.showLong("最新版本下载中...")
|
||||
adUpgradeDialog?.dismiss()
|
||||
@@ -1258,10 +1355,10 @@ import java.util.*
|
||||
}
|
||||
|
||||
override fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
ThreadUtils.runOnUiThread {
|
||||
toolsView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
ipcUpgradeStateInfo.status.let {
|
||||
if(AdUpgradeStateHelper.isUpgradeSuccess(it)){
|
||||
if (AdUpgradeStateHelper.isUpgradeSuccess(it)) {
|
||||
ToastUtils.showLong("升级成功")
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
@@ -1287,17 +1384,45 @@ import java.util.*
|
||||
* 工控机监控节点上报
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
guardianInfo?.let {
|
||||
if(reportList.size>49){
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(0,
|
||||
ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
|
||||
}
|
||||
reportListFloatWindow?.let {
|
||||
ThreadUtils.runOnUiThread{
|
||||
it.refreshData(reportList)
|
||||
ThreadUtils.runOnUiThread {
|
||||
guardianInfo?.let {
|
||||
when (it.code) {
|
||||
EXIT_AUTOPILOT_FOR_PLANNING,
|
||||
EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
showWarningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
clTakeOverView.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
clTakeOverView.visibility = View.GONE
|
||||
}
|
||||
},
|
||||
true,
|
||||
6000L
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1308,12 +1433,16 @@ import java.util.*
|
||||
.navigation() as BaseFragment
|
||||
activity?.supportFragmentManager?.beginTransaction()
|
||||
?.setCustomAnimations(R.anim.slide_in, R.anim.fade_out)?.apply {
|
||||
if (!fragmentOverview.isAdded) {
|
||||
add(R.id.module_main_id_smp_fragment, fragmentOverview, fragmentOverview.tagName)
|
||||
} else {
|
||||
if (!fragmentOverview.isAdded) {
|
||||
add(
|
||||
R.id.module_main_id_smp_fragment,
|
||||
fragmentOverview,
|
||||
fragmentOverview.tagName
|
||||
)
|
||||
} else {
|
||||
show(fragmentOverview)
|
||||
}.commitAllowingStateLoss()
|
||||
}
|
||||
}.commitAllowingStateLoss()
|
||||
}
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,11 @@ import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.*
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BAG_RECORD
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BEAUTY_MODE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RAIN_MODE
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_WARNING_UPLOAD
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
@@ -36,10 +41,12 @@ import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.upgrade.UpgradeVersionEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
@@ -93,8 +100,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
|
||||
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
|
||||
IMoGoAutopilotPlanningListener, IMoGoAutopilotCarConfigListener,
|
||||
IMoGoAutopilotVehicleStateListener {
|
||||
IMoGoAutopilotPlanningListener,
|
||||
IMoGoAutopilotVehicleStateListener, IMoGoDevaToolsFuncConfigListener {
|
||||
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
@@ -185,10 +192,16 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
// 添加 规划路径相关回调 监听
|
||||
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
|
||||
// 添加 工控机基础信息回调 监听
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
//添加 车辆底盘数据回调 监听
|
||||
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
|
||||
|
||||
//添加 业务配置监听
|
||||
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
|
||||
FuncBizConfig.FOUNDATION,
|
||||
TAG,
|
||||
this
|
||||
)
|
||||
|
||||
if (logInfoView != null) {
|
||||
logInfoView!!.onEnterForeground()
|
||||
}
|
||||
@@ -214,11 +227,12 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
// 移除 规划路径相关回调 监听
|
||||
CallerAutopilotPlanningListenerManager.removeListener(TAG)
|
||||
// 移除 工控机基础信息回调 监听
|
||||
CallerAutopilotCarConfigListenerManager.removeListener(TAG)
|
||||
//移除 车辆底盘数据回调 监听
|
||||
// 移除 车辆底盘数据回调 监听
|
||||
CallerAutopilotVehicleStateListenerManager.removeListener(TAG)
|
||||
|
||||
// 移除 业务配置监听
|
||||
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(this)
|
||||
|
||||
if (logInfoView != null) {
|
||||
logInfoView!!.onEnterBackground()
|
||||
}
|
||||
@@ -561,7 +575,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 演示模式
|
||||
tbIsDemoMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerAutoPilotManager.setDemoMode(isChecked)
|
||||
if(!isChecked){
|
||||
if (!isChecked) {
|
||||
//关闭美化模式时,通知工控机
|
||||
CallerAutoPilotManager.setIPCDemoMode(isChecked)
|
||||
}
|
||||
@@ -574,7 +588,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//只在司机端设置美化模式开关功能
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbIsDemoMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
@@ -652,12 +666,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 初始化 tracker感知数据源 数据
|
||||
trackerProvider.check(
|
||||
when (FunctionBuildConfig.debugTrackerProvider) {
|
||||
0 -> {
|
||||
R.id.trackerProviderOrigin
|
||||
}
|
||||
1 -> {
|
||||
R.id.trackerProviderObu
|
||||
}
|
||||
0 -> R.id.trackerProviderOrigin
|
||||
1 -> R.id.trackerProviderObu
|
||||
else -> R.id.trackerProviderOrigin
|
||||
}
|
||||
)
|
||||
@@ -666,14 +676,38 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
R.id.trackerProviderOrigin -> {
|
||||
FunctionBuildConfig.debugTrackerProvider = 0
|
||||
// update tracker provider view
|
||||
trackerIPCProvider.visibility = View.VISIBLE
|
||||
}
|
||||
R.id.trackerProviderObu -> {
|
||||
FunctionBuildConfig.debugTrackerProvider = 1
|
||||
// update tracker provider view
|
||||
trackerIPCProvider.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化 trackerIPC 感知数据源 数据
|
||||
trackerIPCProvider.check(
|
||||
when (FunctionBuildConfig.trackerIPCProvider) {
|
||||
0 -> R.id.trackerIPCUnion
|
||||
1 -> R.id.trackerIPCObu
|
||||
2 -> R.id.trackerIPCV2N
|
||||
else -> R.id.trackerIPCUnion
|
||||
}
|
||||
)
|
||||
trackerProvider.setOnCheckedChangeListener{ _, checkedId ->
|
||||
when(checkedId){
|
||||
R.id.trackerIPCUnion -> {
|
||||
FunctionBuildConfig.trackerIPCProvider = 0
|
||||
}
|
||||
R.id.trackerIPCObu -> {
|
||||
FunctionBuildConfig.trackerIPCProvider = 1
|
||||
}
|
||||
R.id.trackerIPCV2N -> {
|
||||
FunctionBuildConfig.trackerIPCProvider = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化 ADAS感知数据是否绘制 选择情况
|
||||
tbIsDrawIdentifyData.isChecked = FunctionBuildConfig.isDrawIdentifyData
|
||||
@@ -810,20 +844,21 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//状态中心-后台优化状态
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
val backgroundStatus = "后台运行:" + if (BackgrounderPermission.getInstance()
|
||||
.isPermissionLongBackgroundRunning(context)
|
||||
) "<font color='green'>已优化</font>" else "<font color='red'>未优化</font>"
|
||||
tvBackgroundOperation.text = Html.fromHtml(backgroundStatus, Html.FROM_HTML_MODE_LEGACY)
|
||||
tvBackgroundOperation.setOnClickListener {
|
||||
BackgrounderPermission.getInstance().showPermissionLongBackgroundRunningDialog(context)
|
||||
BackgrounderPermission.getInstance()
|
||||
.showPermissionLongBackgroundRunningDialog(context)
|
||||
}
|
||||
BackgrounderPermission.getInstance().setListener {
|
||||
val str =
|
||||
"后台运行:" + if (it) "<font color='green'>已优化</font>" else "<font color='red'>未优化</font>"
|
||||
tvBackgroundOperation.text = Html.fromHtml(str, Html.FROM_HTML_MODE_LEGACY)
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
tvBackgroundOperation.visibility = GONE
|
||||
}
|
||||
//设置工控机连接状态
|
||||
@@ -833,7 +868,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* 设置鹰眼本地参数配置监听
|
||||
*/
|
||||
@SuppressLint("SetTextI18n") private fun setEagleEyeConfigListener() {
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun setEagleEyeConfigListener() {
|
||||
//初始化刹车加速度阈值信息
|
||||
val brakeThreshold = SharedPrefsMgr.getInstance(context)
|
||||
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5F)
|
||||
@@ -885,7 +921,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
FunctionBuildConfig.isReportWarning = isChecked
|
||||
}
|
||||
//异常上报开关只在司机端展示
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbReportWarning.visibility = GONE
|
||||
}
|
||||
|
||||
@@ -896,7 +932,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
p.menuInflater.inflate(R.menu.menu_env_pop, p.menu)
|
||||
MenuCompat.setGroupDividerEnabled(p.menu, true)
|
||||
p.setOnMenuItemClickListener { item ->
|
||||
when(item.itemId) {
|
||||
when (item.itemId) {
|
||||
R.id.group_hy -> {
|
||||
return@setOnMenuItemClickListener false
|
||||
}
|
||||
@@ -1104,7 +1140,10 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
accelerationIsShow = isChecked
|
||||
}
|
||||
|
||||
tbRouteDynamicEffect.isChecked = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) && !AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
tbRouteDynamicEffect.isChecked =
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) && !AppIdentityModeUtils.isBus(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
|
||||
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
@@ -1586,50 +1625,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
*/
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun drawAppInfo() {
|
||||
AppConfigInfo.appName = AppUtils.getAppName()
|
||||
if (AppConfigInfo.appVersionCode == 0) {
|
||||
AppConfigInfo.appVersionCode = AppUtils.getAppVersionCode()
|
||||
}
|
||||
if (AppConfigInfo.appVersionName.isNullOrEmpty()) {
|
||||
AppConfigInfo.appVersionName = AppUtils.getAppVersionName()
|
||||
}
|
||||
if (AppConfigInfo.appPackageName.isNullOrEmpty()) {
|
||||
AppConfigInfo.appPackageName = AppUtils.getAppPackageName()
|
||||
}
|
||||
if (AppConfigInfo.uniqueDeviceId.isNullOrEmpty()) {
|
||||
AppConfigInfo.uniqueDeviceId = DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp())
|
||||
}
|
||||
if (AppConfigInfo.widevineIDMd5.isNullOrEmpty()) {
|
||||
AppConfigInfo.widevineIDMd5 =
|
||||
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
|
||||
}
|
||||
if (MoGoAiCloudClient.getInstance().aiCloudClientConfig != null) {
|
||||
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
|
||||
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
|
||||
}
|
||||
|
||||
AppConfigInfo.netMode = DebugConfig.getNetMode()
|
||||
if (MogoMap.getInstance().mogoMap != null) {
|
||||
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
|
||||
}
|
||||
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
|
||||
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
|
||||
|
||||
when {
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端
|
||||
AppConfigInfo.isDriver = true
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted()
|
||||
}
|
||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> {
|
||||
AppConfigInfo.isDriver = false
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
|
||||
AppConfigInfo.serverSn = CallerTelematicManager.getServerToken()
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp()
|
||||
|
||||
/**
|
||||
* 设备绑定关系
|
||||
*/
|
||||
@@ -1825,16 +1820,14 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
mAutoPilotStatusInfo = autoPilotStatusInfo
|
||||
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus
|
||||
AppConfigInfo.connectStatusDescribe = autoPilotStatusInfo.connectStatusDescribe
|
||||
setAutopilotConnectStatus()
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置工控机连接状态
|
||||
*/
|
||||
private fun setAutopilotConnectStatus(){
|
||||
ThreadUtils.runOnUiThread{
|
||||
private fun setAutopilotConnectStatus() {
|
||||
ThreadUtils.runOnUiThread {
|
||||
tvAutopilotConnectStatus.text = Html.fromHtml(
|
||||
"工控机连接状态:${
|
||||
if (AppConfigInfo.isConnectAutopilot) {
|
||||
@@ -1880,6 +1873,22 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {
|
||||
when (type) {
|
||||
BIZ_BEAUTY_MODE -> tbIsDemoMode.isClickable = !lock
|
||||
BIZ_RAIN_MODE -> tbIsRainMode.isClickable = !lock
|
||||
BIZ_WARNING_UPLOAD -> tbReportWarning.isClickable = !lock
|
||||
BIZ_BAG_RECORD -> {
|
||||
if (lock) {
|
||||
btnRecordBag.isClickable = false
|
||||
} else {
|
||||
btnRecordBag.isClickable = true
|
||||
btnRecordBag.requestFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotCarStateData(gnssInfo: MessagePad.GnssInfo?) {
|
||||
mGnssInfo = gnssInfo
|
||||
//实时加速度列表
|
||||
@@ -1945,18 +1954,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
mRouteInfoSize = globalPathResp?.wayPointsList?.size ?: 0
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机基础信息回调
|
||||
*/
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
carConfigResp.let {
|
||||
AppConfigInfo.plateNumber = it.plateNumber//车牌号
|
||||
AppConfigInfo.iPCMacAddress = it.macAddress//工控机MAC地址
|
||||
AppConfigInfo.protocolVersionNumber = it.protocolVersionValue//工控机协议版本
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机异常回调
|
||||
*/
|
||||
@@ -2077,7 +2074,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
private fun toastMsg(msg: String) {
|
||||
//当司机屏处于美化(演示)模式、msg为空时不弹吐司
|
||||
if (!FunctionBuildConfig.isDemoMode && msg.isNotEmpty()
|
||||
&& AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
&& AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
ToastUtils.showLong(msg)
|
||||
}
|
||||
}
|
||||
@@ -2135,4 +2133,5 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
fun showReportListWindow(show: Boolean)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.takeover
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
class TakeOverView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
|
||||
}
|
||||
}
|
||||
@@ -231,9 +231,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
speedLimit = carConfigResp.speedLimit
|
||||
tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²"
|
||||
etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString())
|
||||
AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号
|
||||
AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址
|
||||
AppConfigInfo.protocolVersionNumber = carConfigResp.protocolVersionValue//工控机协议版本
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||