Merge branch 'dev_robotaxi-d-app-module_251_220125_2.5.1' into dev_MogoAP_eagle-220_211207_8.0.17_merge
This commit is contained in:
@@ -51,17 +51,17 @@ public class OchBusProvider implements IMogoOCH {
|
||||
if (busFragment == null) {
|
||||
Logger.d(TAG, "准备add fragment======");
|
||||
busFragment = new OchBusFragment();
|
||||
activity.getSupportFragmentManager().beginTransaction().add(containerId, busFragment).commit();
|
||||
activity.getSupportFragmentManager().beginTransaction().add(containerId, busFragment).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "准备show fragment");
|
||||
activity.getSupportFragmentManager().beginTransaction().show(busFragment).commit();
|
||||
activity.getSupportFragmentManager().beginTransaction().show(busFragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
private void hideFragment() {
|
||||
if (busFragment != null) {
|
||||
Logger.d(TAG, "准备hide fragment");
|
||||
activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commit();
|
||||
activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
|
||||
private TextView ctvAutopilotStatusTv;
|
||||
protected TextView tvOperationStatus;
|
||||
protected LinearLayout mSettingBtn;
|
||||
protected ImageView mBadcaseBtn;
|
||||
public boolean isOperationStatus;//false-收车,true-出车
|
||||
private FrameLayout flStationPanelContainer;
|
||||
private Group groupTestPanel;
|
||||
@@ -198,6 +199,15 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
|
||||
// TODO: 2021/12/9
|
||||
CallerHmiManager.INSTANCE.showToolsView();
|
||||
});
|
||||
|
||||
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
|
||||
mBadcaseBtn = findViewById(R.id.module_mogo_och_badcase_iv);
|
||||
CallerHmiManager.INSTANCE.registerBadCaseCallback(
|
||||
() -> { // onShow()
|
||||
CallerHmiManager.INSTANCE.showBadCaseEntrance(mBadcaseBtn);
|
||||
return null; },
|
||||
() -> { // onHide()
|
||||
return null; });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -141,9 +141,20 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bus_setting_btn_bg" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_mogo_och_badcase_iv"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:src="@drawable/bus_badcase_btn_bg"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout"/>
|
||||
|
||||
<com.mogo.och.bus.view.SlidePanelView
|
||||
android:id="@+id/module_mogo_och_slide_panel"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -68,13 +68,18 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
private static OCHTaxiFragment mTaxiFragment;
|
||||
private static boolean serverHadNoData = false;
|
||||
|
||||
public OCHTaxiPersonalDialogFragment(){
|
||||
}
|
||||
|
||||
public OCHTaxiPersonalDialogFragment(OCHTaxiFragment taxiFragment){
|
||||
mTaxiFragment = taxiFragment;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
// getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
View view = inflater.inflate(R.layout.taxi_orders_list_view, container, false);
|
||||
initView(view);
|
||||
return view;
|
||||
@@ -87,6 +92,8 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
getDialog().setCanceledOnTouchOutside(true);
|
||||
Window window = getDialog().getWindow();
|
||||
//dialog padding 去掉
|
||||
window.getDecorView().setPadding(0,0,0,0);
|
||||
window.setDimAmount(0f);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.x = 0;
|
||||
params.y = 0;
|
||||
@@ -94,12 +101,13 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
Point point = new Point();
|
||||
windowManager.getDefaultDisplay().getSize(point);
|
||||
params.width = (int)(point.x * 0.375);
|
||||
params.height = point.y;
|
||||
Log.d(TAG,"width= "+params.width+"height= "+params.height);
|
||||
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
window.setAttributes(params);
|
||||
window.getDecorView().setBackgroundColor(Color.parseColor("#00FFFFFF"));//设置背景, 不然显示不全
|
||||
//设置背景, 不然显示不全
|
||||
window.getDecorView().setBackgroundColor(Color.parseColor("#00FFFFFF"));
|
||||
window.setGravity(Gravity.LEFT|Gravity.BOTTOM);
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
initOperationTabDatas(view);
|
||||
mCloseIv = view.findViewById(R.id.module_och_taxi_order_list_close_iv);
|
||||
@@ -178,15 +186,28 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
}
|
||||
});
|
||||
mOperationViewPager.setAdapter(new OrdersOperationFragmentAdapter(getChildFragmentManager(), FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT));
|
||||
mOperationViewPager.setAdapter(new OrdersOperationFragmentAdapter(getChildFragmentManager()
|
||||
, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT));
|
||||
fragments.get(0).setmType(0);
|
||||
mTaxiFragment.queryDriverServiceData();
|
||||
|
||||
if (mTaxiFragment == null){
|
||||
dismiss();
|
||||
}else {
|
||||
mTaxiFragment.queryDriverServiceData();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新运营数据 时间和订单数
|
||||
* @param dailyTimeDuration
|
||||
* @param dailyOrderNum
|
||||
*/
|
||||
public void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum){
|
||||
for (int i=0; i< fragments.size();i++){
|
||||
fragments.get(i).updateData(dailyTimeDuration,dailyOrderNum);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeOperationTabLayoutTabUI(TabLayout.Tab tab, boolean isSelected) {
|
||||
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.operation_tab_title);
|
||||
ImageView imageView = (ImageView) tab.getCustomView().findViewById(R.id.operation_tab_line_iv);
|
||||
@@ -232,9 +253,20 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
});
|
||||
mOrdersRv.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求订单数据
|
||||
* @param page
|
||||
* @param size
|
||||
*/
|
||||
private void requestOrdersList(int page, int size){
|
||||
mTaxiFragment.queryOrdersList(page,size);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单数据结果返回
|
||||
* @param ordersList
|
||||
*/
|
||||
public void onOrdersListPageRefresh(List<OrderQueryRespBean.Result> ordersList){
|
||||
if (null == ordersList && mNextPage == 0){//无数据
|
||||
mOrdersRv.setVisibility(View.GONE);
|
||||
@@ -256,6 +288,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mNextPage = mNextPage +1;
|
||||
}
|
||||
|
||||
class OrderAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
|
||||
private static final int ORDER_DETAIL_ITEM = 0;
|
||||
private static final int DAY_GROUP_ITEM = 1;
|
||||
@@ -270,11 +303,13 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == ORDER_DETAIL_ITEM){
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_item,parent,false);
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_item,parent
|
||||
,false);
|
||||
OrderDetailViewHolder viewHolder = new OrderDetailViewHolder(view);
|
||||
return viewHolder;
|
||||
}else if (viewType == DAY_GROUP_ITEM){
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_day_item,parent,false);
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_day_item,parent
|
||||
,false);
|
||||
DayGroupViewHolder viewHolder = new DayGroupViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
@@ -289,8 +324,9 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
if (holder instanceof DayGroupViewHolder){
|
||||
DayGroupViewHolder groupViewHolder = (DayGroupViewHolder)holder;
|
||||
groupViewHolder.dayGroupTv.setText(OchTaxiUtils.getYMDTime(queryRespBean.createTime));
|
||||
bindOrderDetailData(queryRespBean,groupViewHolder.orderTimeTv,groupViewHolder.startStationTv,groupViewHolder.endStationTv,
|
||||
groupViewHolder.orderStatusBt,groupViewHolder.orderTypeBt,groupViewHolder.orderNumTv);
|
||||
bindOrderDetailData(queryRespBean,groupViewHolder.orderTimeTv,groupViewHolder.startStationTv
|
||||
, groupViewHolder.endStationTv, groupViewHolder.orderStatusBt,groupViewHolder.orderTypeBt
|
||||
,groupViewHolder.orderNumTv);
|
||||
if (isNoLineItem(position)){
|
||||
groupViewHolder.dividerLine.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
@@ -303,7 +339,8 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
}
|
||||
}else if (holder instanceof OrderDetailViewHolder){
|
||||
OrderDetailViewHolder detailViewHolder = (OrderDetailViewHolder)holder;
|
||||
bindOrderDetailData(queryRespBean,detailViewHolder.orderTimeTv,detailViewHolder.startStationTv,detailViewHolder.endStationTv,
|
||||
bindOrderDetailData(queryRespBean,detailViewHolder.orderTimeTv,
|
||||
detailViewHolder.startStationTv,detailViewHolder.endStationTv,
|
||||
detailViewHolder.orderStatusBt,detailViewHolder.orderTypeBt,detailViewHolder.orderNumTv);
|
||||
if (isNoLineItem(position)){
|
||||
detailViewHolder.dividerLine.setVisibility(View.VISIBLE);
|
||||
@@ -352,8 +389,10 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
public int getItemCount() {
|
||||
return orders.size();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private void bindOrderDetailData(OrderQueryRespBean.Result queryRespBean, TextView orderTimeTv, TextView startStationTv, TextView endStationTv,
|
||||
private void bindOrderDetailData(OrderQueryRespBean.Result queryRespBean, TextView orderTimeTv,
|
||||
TextView startStationTv, TextView endStationTv,
|
||||
Button orderStatusBt, Button orderTypeBt, TextView orderNumTv){
|
||||
Calendar calendar= Calendar.getInstance();
|
||||
calendar.setTimeInMillis(queryRespBean.createTime);
|
||||
@@ -364,6 +403,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
orderTypeBt.setText(getOrderType(queryRespBean.orderType,orderTypeBt));
|
||||
orderNumTv.setText("订单编号:"+String.valueOf(queryRespBean.orderId));
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private String getOrderStatus(int status, Button button){
|
||||
OrderStatusEnum orderStatus = OrderStatusEnum.valueOf(status);
|
||||
@@ -379,6 +419,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
return "服务中";
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private String getOrderType(int type, Button button){
|
||||
if (type == OrderTypeEnum.Reserved.getType()){
|
||||
@@ -391,6 +432,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class OrderDetailViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
protected TextView orderTimeTv;
|
||||
@@ -420,6 +462,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DayGroupViewHolder extends OrderDetailViewHolder{
|
||||
|
||||
private TextView dayGroupTv;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
android:id="@+id/module_och_taxi_order_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="94px">
|
||||
android:paddingBottom="50px">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -38,6 +38,9 @@ import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.taxi.R;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
@@ -62,6 +65,7 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
private ImageView mCloseNaviIcon;
|
||||
protected LinearLayout mPersonalBtn;
|
||||
protected LinearLayout mSettingBtn;
|
||||
protected ImageView mBadcaseBtn;
|
||||
protected OCHNaviFragment ochNaviFragment = null;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
@@ -128,6 +132,16 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
// TODO: 2021/12/9
|
||||
CallerHmiManager.INSTANCE.showToolsView();
|
||||
});
|
||||
|
||||
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
|
||||
mBadcaseBtn = findViewById(R.id.module_och_taxi_badcase_iv);
|
||||
CallerHmiManager.INSTANCE.registerBadCaseCallback(
|
||||
() -> { // onShow()
|
||||
CallerHmiManager.INSTANCE.showBadCaseEntrance(mBadcaseBtn);
|
||||
return null; },
|
||||
() -> { // onHide()
|
||||
return null; });
|
||||
|
||||
panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -68,13 +68,15 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
private static OCHTaxiFragment mTaxiFragment;
|
||||
private static boolean serverHadNoData = false;
|
||||
|
||||
public OCHTaxiPersonalDialogFragment(){
|
||||
}
|
||||
|
||||
public OCHTaxiPersonalDialogFragment(OCHTaxiFragment taxiFragment){
|
||||
mTaxiFragment = taxiFragment;
|
||||
}
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
View view = inflater.inflate(R.layout.taxi_orders_list_view, container, false);
|
||||
initView(view);
|
||||
return view;
|
||||
@@ -87,6 +89,8 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
getDialog().setCanceledOnTouchOutside(true);
|
||||
Window window = getDialog().getWindow();
|
||||
//dialog padding 去掉
|
||||
window.getDecorView().setPadding(0,0,0,0);
|
||||
window.setDimAmount(0f);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.x = 0;
|
||||
params.y = 0;
|
||||
@@ -94,7 +98,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
Point point = new Point();
|
||||
windowManager.getDefaultDisplay().getSize(point);
|
||||
params.width = (int)(point.x * 0.375);
|
||||
params.height = point.y;
|
||||
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
Log.d(TAG,"width= "+params.width+"height= "+params.height);
|
||||
window.setAttributes(params);
|
||||
window.getDecorView().setBackgroundColor(Color.parseColor("#00FFFFFF"));//设置背景, 不然显示不全
|
||||
@@ -180,13 +184,20 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
});
|
||||
mOperationViewPager.setAdapter(new OrdersOperationFragmentAdapter(getChildFragmentManager(), FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT));
|
||||
fragments.get(0).setmType(0);
|
||||
mTaxiFragment.queryDriverServiceData();
|
||||
|
||||
if (mTaxiFragment == null){
|
||||
dismiss();
|
||||
}else {
|
||||
mTaxiFragment.queryDriverServiceData();
|
||||
}
|
||||
}
|
||||
|
||||
public void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum){
|
||||
for (int i=0; i< fragments.size();i++){
|
||||
fragments.get(i).updateData(dailyTimeDuration,dailyOrderNum);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeOperationTabLayoutTabUI(TabLayout.Tab tab, boolean isSelected) {
|
||||
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.operation_tab_title);
|
||||
ImageView imageView = (ImageView) tab.getCustomView().findViewById(R.id.operation_tab_line_iv);
|
||||
@@ -232,9 +243,11 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
});
|
||||
mOrdersRv.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
private void requestOrdersList(int page, int size){
|
||||
mTaxiFragment.queryOrdersList(page,size);
|
||||
}
|
||||
|
||||
public void onOrdersListPageRefresh(List<OrderQueryRespBean.Result> ordersList){
|
||||
if (null == ordersList && mNextPage == 0){//无数据
|
||||
mOrdersRv.setVisibility(View.GONE);
|
||||
@@ -256,6 +269,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mNextPage = mNextPage +1;
|
||||
}
|
||||
|
||||
class OrderAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
|
||||
private static final int ORDER_DETAIL_ITEM = 0;
|
||||
private static final int DAY_GROUP_ITEM = 1;
|
||||
@@ -352,6 +366,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
public int getItemCount() {
|
||||
return orders.size();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private void bindOrderDetailData(OrderQueryRespBean.Result queryRespBean, TextView orderTimeTv, TextView startStationTv, TextView endStationTv,
|
||||
Button orderStatusBt, Button orderTypeBt, TextView orderNumTv){
|
||||
@@ -364,6 +379,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
orderTypeBt.setText(getOrderType(queryRespBean.orderType,orderTypeBt));
|
||||
orderNumTv.setText("订单编号:"+String.valueOf(queryRespBean.orderId));
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private String getOrderStatus(int status, Button button){
|
||||
OrderStatusEnum orderStatus = OrderStatusEnum.valueOf(status);
|
||||
@@ -379,6 +395,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
return "服务中";
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private String getOrderType(int type, Button button){
|
||||
if (type == OrderTypeEnum.Reserved.getType()){
|
||||
@@ -391,6 +408,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class OrderDetailViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
protected TextView orderTimeTv;
|
||||
@@ -420,6 +438,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DayGroupViewHolder extends OrderDetailViewHolder{
|
||||
|
||||
private TextView dayGroupTv;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -127,7 +127,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_och_taxi_swich_map_layout"
|
||||
android:id="@+id/module_och_taxi_setting_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="40px"
|
||||
@@ -142,12 +142,11 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/taxi_switch_map_bg" />
|
||||
|
||||
android:background="@drawable/taxi_setting_btn_bg" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_och_taxi_setting_layout"
|
||||
android:id="@+id/module_och_taxi_swich_map_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="40px"
|
||||
@@ -156,15 +155,26 @@
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_swich_map_layout">
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_setting_layout">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/taxi_setting_btn_bg" />
|
||||
|
||||
android:background="@drawable/taxi_switch_map_bg" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_badcase_iv"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="40px"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:src="@drawable/taxi_badcase_btn_bg"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_swich_map_layout"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
|
||||
@@ -79,10 +79,11 @@
|
||||
android:id="@+id/module_och_taxi_order_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="94px">
|
||||
android:paddingBottom="50px">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</RelativeLayout>
|
||||
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -84,6 +84,7 @@ public class MogoApplication extends MainMoGoApplication {
|
||||
HmiBuildConfig.isShowAutopilotStatusView = false;
|
||||
HmiBuildConfig.isShowPerspectiveSwitchView = false;
|
||||
HmiBuildConfig.isShowToolsView = false;
|
||||
HmiBuildConfig.isShowBadCaseView = false;
|
||||
}
|
||||
|
||||
if (DebugConfig.getProductFlavor().equals("fPadLenovoOchTaxi")
|
||||
@@ -91,7 +92,7 @@ public class MogoApplication extends MainMoGoApplication {
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche;
|
||||
} else if (DebugConfig.getProductFlavor().equals("fPadLenovoOchBus")
|
||||
|| DebugConfig.getProductFlavor().equals("fPadLenovoOchBusPassenger")) {
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache;
|
||||
// HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -189,9 +189,15 @@ public class MoGoAdasListenerImpl implements OnAdasListener {
|
||||
autopilotStatusInfo.setRadar(autopilotStatusValues.getRadar());
|
||||
autopilotStatusInfo.setSpeed(autopilotStatusValues.getSpeed());
|
||||
// 初始化自动驾驶状态信息
|
||||
autopilotStatusInfo.setVersion(AdasManager.getInstance().getAdasConfig().getVersion());
|
||||
autopilotStatusInfo.setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
|
||||
autopilotStatusInfo.setDockVersion(AdasManager.getInstance().getAdasConfig().getDockVersion());
|
||||
if (autopilotStatusInfo.getVersion() == null) {
|
||||
autopilotStatusInfo.setVersion(AdasManager.getInstance().getAdasConfig().getVersion());
|
||||
}
|
||||
if (autopilotStatusInfo.getConnectIP() == null) {
|
||||
autopilotStatusInfo.setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
|
||||
}
|
||||
if (autopilotStatusInfo.getDockVersion() == null) {
|
||||
autopilotStatusInfo.setDockVersion(AdasManager.getInstance().getAdasConfig().getDockVersion());
|
||||
}
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogoaicloudtrafficlive
|
||||
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
implementation rootProject.ext.dependencies.androidxroomktx
|
||||
|
||||
@@ -7,7 +7,10 @@ import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.transition.*
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
@@ -42,6 +45,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotBadCaseView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.Repository
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.post
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
@@ -91,6 +95,9 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
|
||||
private var autoPilotBadCaseView: AutoPilotBadCaseView? = null
|
||||
|
||||
private var onBadCaseShow: (() -> Unit)? = null
|
||||
private var onBadCaseHide: (() -> Unit)? = null
|
||||
|
||||
companion object {
|
||||
private const val MSG_WHAT_DISMISS_BAD_CASE_ENTRY = 0x1010
|
||||
private val CASE_EXPIRE_DURATION = TimeUnit.HOURS.toMillis(4)
|
||||
@@ -154,8 +161,13 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
showBadCaseEntrance(it)
|
||||
}
|
||||
} else {
|
||||
entrance.takeIf { it.visibility != View.VISIBLE }?.also {
|
||||
it.visibility = View.VISIBLE
|
||||
withContext(Dispatchers.Main) {
|
||||
entrance.takeIf { it.visibility != View.VISIBLE }?.also {
|
||||
(entrance.parent as? ViewGroup)?.let { g ->
|
||||
TransitionManager.beginDelayedTransition(g, AutoTransition())
|
||||
}
|
||||
it.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
Log.d("QQQ", "record: [$old] hasn't been consumed~~~~" )
|
||||
}
|
||||
@@ -169,7 +181,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
|
||||
private val handler by lazy {
|
||||
Handler(Handler.Callback {
|
||||
Handler(Handler.Callback { it ->
|
||||
if (it.what == MSG_WHAT_DISMISS_BAD_CASE_ENTRY) {
|
||||
val entrance = autoPilotBadCaseEntrance
|
||||
if (entrance != null && entrance.visibility == View.VISIBLE) {
|
||||
@@ -186,7 +198,13 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
}
|
||||
dismissBadCaseFloatView()
|
||||
entrance.visibility = View.GONE
|
||||
if (entrance.visibility != View.GONE) {
|
||||
(entrance.parent as? ViewGroup)?.let { g ->
|
||||
TransitionManager.beginDelayedTransition(g, AutoTransition())
|
||||
}
|
||||
entrance.visibility = View.GONE
|
||||
onBadCaseHide?.invoke()
|
||||
}
|
||||
}
|
||||
return@Callback true
|
||||
}
|
||||
@@ -230,7 +248,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
}
|
||||
|
||||
@ExperimentalCoroutinesApi
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
@@ -248,7 +266,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
}
|
||||
|
||||
@ExperimentalCoroutinesApi
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
override fun onAutopilotRecordResult(record: AutoPilotRecordResult?) {
|
||||
record ?: return
|
||||
Log.d("QQQ", "onAutopilotRecordResult:$record")
|
||||
@@ -277,27 +295,66 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
private fun showBadCaseEntrance(record: AutoPilotRecordResult) {
|
||||
Log.d("QQQ", "showBadCaseEntrance:$record")
|
||||
lifecycleScope.launch {
|
||||
if (vs_bad_case_entrance?.parent != null) {
|
||||
val inflateView = vs_bad_case_entrance.inflate()
|
||||
autoPilotBadCaseEntrance = inflateView
|
||||
if (HmiBuildConfig.isShowBadCaseView) {
|
||||
if (vsBadCaseToolsView?.parent != null) {
|
||||
val inflateView = vsBadCaseToolsView.inflate()
|
||||
autoPilotBadCaseEntrance = inflateView
|
||||
}
|
||||
}
|
||||
val entrance = autoPilotBadCaseEntrance
|
||||
Log.d("QQQ", "show --- 1 ----")
|
||||
if (entrance != null) {
|
||||
if (entrance.visibility != View.VISIBLE) {
|
||||
(entrance.parent as? ViewGroup)?.let { g ->
|
||||
TransitionManager.beginDelayedTransition(g, AutoTransition())
|
||||
}
|
||||
entrance.visibility = View.VISIBLE
|
||||
}
|
||||
entrance.setTag(R.id.autopilot_badcase_record, record)
|
||||
entrance.onClick {
|
||||
showBadCasesFloat {
|
||||
it.visibility = View.GONE
|
||||
if (it.visibility != View.GONE) {
|
||||
(entrance.parent as? ViewGroup)?.let { g ->
|
||||
TransitionManager.beginDelayedTransition(g, AutoTransition())
|
||||
}
|
||||
it.visibility = View.GONE
|
||||
onBadCaseHide?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
dismissBadCaseEntryAfterSomeTime()
|
||||
} else {
|
||||
onBadCaseShow?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun showBadCaseEntrance(entrance: View) {
|
||||
entrance.lifecycleOwner.lifecycle.addObserver(badCaseEntranceObserver)
|
||||
autoPilotBadCaseEntrance = entrance
|
||||
lifecycleScope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
val dao = Repository.dao()
|
||||
dao.getAllUnConsumedRecords()?.first()?.let {
|
||||
showBadCaseEntrance(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val badCaseEntranceObserver = LifecycleEventObserver { _, event ->
|
||||
if (event == ON_DESTROY) {
|
||||
onBadCaseShow = null
|
||||
onBadCaseHide = null
|
||||
autoPilotBadCaseEntrance = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun registerBadCaseCallback(onShow: () -> Unit, onHide: (() -> Unit)?) {
|
||||
onBadCaseShow = onShow
|
||||
onBadCaseHide = onHide
|
||||
}
|
||||
|
||||
private fun showBadCasesFloat(dismiss: (() -> Unit)?) {
|
||||
Log.d("QQQ", "showBadCaseToolsFloat")
|
||||
context?.let { it ->
|
||||
@@ -502,7 +559,6 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
} else {
|
||||
setToolsViewVisibility(View.GONE)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -42,6 +43,7 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoMap
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -62,11 +64,26 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
private var logInfoView: LogInfoView? = null
|
||||
private var logViewAttach = false
|
||||
|
||||
private var mAutoPilotStatusInfo: AutopilotStatusInfo?=null
|
||||
private var mAutoPilotCarStateInfo: AutopilotCarStateInfo?=null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时刷新视图数据,防止因为过快更新导致anr异常
|
||||
*/
|
||||
private val timerTaskRefresh = object : TimerTask() {
|
||||
override fun run() {
|
||||
UiThreadHandler.post {
|
||||
// 绘制应用基本信息
|
||||
drawAppInfo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
// 添加 OBU状态 监听
|
||||
@@ -82,6 +99,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
if (logInfoView != null) {
|
||||
logInfoView!!.onEnterForeground()
|
||||
}
|
||||
// 开启定时查询速度
|
||||
Timer().schedule(timerTaskRefresh, Date(), 100)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
@@ -99,6 +118,11 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
if (logInfoView != null) {
|
||||
logInfoView!!.onEnterBackground()
|
||||
}
|
||||
try {
|
||||
timerTaskRefresh.cancel()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
@@ -260,10 +284,16 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.IS_DEMO_MODE, false)
|
||||
CallerAutoPilotManager.setDemoMode(isDemoMode)
|
||||
tbIsDemoMode.isChecked = isDemoMode
|
||||
if (isDemoMode){
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true
|
||||
}
|
||||
// 演示模式
|
||||
tbIsDemoMode.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
CallerAutoPilotManager.setDemoMode(isChecked)
|
||||
FunctionBuildConfig.isDemoMode = isChecked
|
||||
if (!FunctionBuildConfig.isDemoMode){
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context).putBoolean(MoGoConfig.IS_DEMO_MODE, isChecked)
|
||||
}
|
||||
|
||||
@@ -371,35 +401,33 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
|
||||
|
||||
// 将数据绘制
|
||||
tvAppInfo.text = AppConfigInfo.toString()
|
||||
tvAppInfo.text = Html.fromHtml(AppConfigInfo.toString())
|
||||
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
|
||||
tvCarInfo.text =
|
||||
"GPS时间:${mAutoPilotCarStateInfo?.values?.satelliteTime}\n" +
|
||||
"自车经纬度:\n${mAutoPilotCarStateInfo?.values?.lon}\n${mAutoPilotCarStateInfo?.values?.lat}\n"
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU状态回调
|
||||
*/
|
||||
override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) {
|
||||
UiThreadHandler.post {
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
|
||||
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
||||
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
||||
drawAppInfo()
|
||||
}
|
||||
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
||||
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态回调
|
||||
*/
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
UiThreadHandler.post {
|
||||
tvAutopilotInfo.post {
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(autoPilotStatusInfo)
|
||||
mAutoPilotStatusInfo = autoPilotStatusInfo
|
||||
|
||||
AppConfigInfo.adasSdkVersion = autoPilotStatusInfo.version
|
||||
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus
|
||||
drawAppInfo()
|
||||
}
|
||||
}
|
||||
AppConfigInfo.adasSdkVersion = autoPilotStatusInfo.version
|
||||
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?) {
|
||||
@@ -408,13 +436,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
override fun onAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
|
||||
//Logger.d(TAG, "autoPilotCarStateInfo:$autoPilotCarStateInfo")
|
||||
UiThreadHandler.post {
|
||||
tvAutopilotInfo.post {
|
||||
tvCarInfo.text =
|
||||
"GPS时间:${autoPilotCarStateInfo?.values?.satelliteTime}\n" +
|
||||
"自车经纬度:\n${autoPilotCarStateInfo?.values?.lon}\n${autoPilotCarStateInfo?.values?.lat}\n"
|
||||
}
|
||||
}
|
||||
mAutoPilotCarStateInfo = autoPilotCarStateInfo
|
||||
}
|
||||
|
||||
override fun onAutopilotSNRequest() {
|
||||
|
||||
@@ -99,8 +99,8 @@
|
||||
app:layout_goneMarginStart="50px" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/vs_bad_case_entrance"
|
||||
android:inflatedId="@+id/bad_case_entrance"
|
||||
android:id="@+id/vsBadCaseToolsView"
|
||||
android:inflatedId="@+id/badCaseToolsView"
|
||||
android:layout_width="@dimen/module_hmi_check_size"
|
||||
android:layout_height="@dimen/module_hmi_check_size"
|
||||
android:layout_marginStart="25px"
|
||||
|
||||
@@ -31,27 +31,6 @@
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- <LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="PAD系统时间:"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/tvNowTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="yyyy年MM月dd日 EEEE aa HH:mm:ss"
|
||||
android:format24Hour="yyyy年MM月dd日 EEEE aa HH:mm:ss"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
</LinearLayout>-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAppInfo"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -44,38 +44,26 @@ object AppConfigInfo {
|
||||
// 是否OBU
|
||||
var isConnectObu: Boolean = false
|
||||
|
||||
/*应用配置信息,这里的配置将影响功能,用来替换productFlavors配置的那种编译渠道*/
|
||||
// GPS数据提供源: 0-Android系统,1-工控机,2-OBU
|
||||
var GPS_PROVIDER = 1
|
||||
|
||||
// 是否在地图上绘制感知元素
|
||||
// 网络下发 false--不绘制,true--绘制
|
||||
var TRAFFIC_PROVIDER_NET_STATUS = false
|
||||
|
||||
// 域控制器 false--不绘制,true--绘制
|
||||
var TRAFFIC_PROVIDER_AUTOPILOT_STATUS = true
|
||||
|
||||
// OBU false--不绘制,true--绘制
|
||||
var TRAFFIC_PROVIDER_OBU_STATUS = false
|
||||
|
||||
// 进入应用的地图模式。0-2D模式,1-VR模式
|
||||
var MAP_STYLE_MODE = 1
|
||||
|
||||
override fun toString(): String {
|
||||
return "应用名称:${appName}\n" +
|
||||
"应用版本:${appVersionCode}\n" +
|
||||
"应用版本名称:${appVersionName}\n" +
|
||||
"Git分支名称:${workingBranchName}\n" +
|
||||
"Git分支HASH:${workingBranchHash}\n" +
|
||||
"HD-MAP-SDK版本:${mapSdkVersion}\n" +
|
||||
"ADAS-SDK版本:${adasSdkVersion}\n" +
|
||||
"OBU-SDK版本:${obuSdkVersion}\n" +
|
||||
"PAD唯一标志:${uniqueDeviceId}\n" +
|
||||
//"mogoToken:${mogoToken}\n"+
|
||||
"中台分配的SN:${mogoSN}\n" +
|
||||
"网络是否正常:${isConnectNet}\n" +
|
||||
return "<font color='red' size='30'>-------------------应用信息--------------------</font><br/>" +
|
||||
"应用名称:${appName}<br/>" +
|
||||
"应用版本号:${appVersionCode}<br/>" +
|
||||
"应用版本名称:${appVersionName}<br/>" +
|
||||
"<font color='red' size='30'>------------------Git信息---------------------</font><br/>" +
|
||||
"Git分支名称:<br/>${workingBranchName}<br/>" +
|
||||
"Git分支HASH:${workingBranchHash}<br/>" +
|
||||
"<font color='red' size='30'>------------------依赖信息---------------------</font><br/>" +
|
||||
"MAP-SDK版本:${mapSdkVersion}<br/>" +
|
||||
"ADAS-SDK版本:${adasSdkVersion}<br/>" +
|
||||
"OBU-SDK版本:${obuSdkVersion}<br/>" +
|
||||
"<font color='red' size='30'>------------------鉴权信息---------------------</font><br/>" +
|
||||
"PAD唯一标志:${uniqueDeviceId}<br/>" +
|
||||
//"mogoToken:${mogoToken}<br/>"+
|
||||
"中台分配的SN:${mogoSN}<br/>" +
|
||||
"<font color='red' size='30'>------------------连接信息---------------------</font><br/>" +
|
||||
"当前网络服务连接:${netMode} -- ${
|
||||
(when (netMode) {
|
||||
when (netMode) {
|
||||
2 -> {
|
||||
"测试环境"
|
||||
}
|
||||
@@ -88,10 +76,35 @@ object AppConfigInfo {
|
||||
else -> {
|
||||
"未知环境"
|
||||
}
|
||||
})
|
||||
}\n" +
|
||||
"Socket是否正常:${isConnectSocket}\n" +
|
||||
"ADAS连接是否正常:${isConnectAutopilot}\n" +
|
||||
"OBU连接是否正常:${isConnectObu}\n"
|
||||
}
|
||||
}<br/>" +
|
||||
"网络是否正常:${
|
||||
if (isConnectNet) {
|
||||
"<font color='green'>"
|
||||
} else {
|
||||
"<font color='red'>"
|
||||
}
|
||||
}${isConnectNet}</font><br/>" +
|
||||
"Socket是否正常:${
|
||||
if (isConnectSocket) {
|
||||
"<font color='green'>"
|
||||
} else {
|
||||
"<font color='red'>"
|
||||
}
|
||||
}${isConnectSocket}</font><br/>" +
|
||||
"ADAS连接是否正常:${
|
||||
if (isConnectAutopilot) {
|
||||
"<font color='green'>"
|
||||
} else {
|
||||
"<font color='red'>"
|
||||
}
|
||||
}${isConnectAutopilot}</font><br/>" +
|
||||
"OBU连接是否正常:${
|
||||
if (isConnectObu) {
|
||||
"<font color='green'>"
|
||||
} else {
|
||||
"<font color='red'>"
|
||||
}
|
||||
}${isConnectObu}</font><br/>"
|
||||
}
|
||||
}
|
||||
@@ -60,12 +60,12 @@ class AutopilotStatusInfo : Serializable {
|
||||
var rtk = 0
|
||||
|
||||
/**
|
||||
* 自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
* 底盘的自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
*/
|
||||
var pilotmode = 0
|
||||
|
||||
/**
|
||||
* 自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
* 底盘的自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
*/
|
||||
var control_pilotmode = 0
|
||||
|
||||
|
||||
@@ -29,4 +29,10 @@ object HmiBuildConfig {
|
||||
*/
|
||||
@JvmField
|
||||
var isShowToolsView = true
|
||||
|
||||
/**
|
||||
* 是否展示BadCase按钮
|
||||
*/
|
||||
@JvmField
|
||||
var isShowBadCaseView = true
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.api.hmi.warning
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
@@ -179,4 +180,17 @@ interface IMoGoWaringProvider {
|
||||
*/
|
||||
fun showAdUpgradeStatus(upgradeMode : Int,downloadStatus : Int,currentProgress : Int,totalProgress : Int
|
||||
,downloadVersion : String,upgradeStatus : Int)
|
||||
|
||||
|
||||
/**
|
||||
* 显示BadCase入口
|
||||
*/
|
||||
fun showBadCaseEntrance(entrance: View)
|
||||
|
||||
/**
|
||||
* 注册badcase入口展示和隐藏的回调
|
||||
* 当[onShow]被调用时,调用[showBadCaseEntrance]
|
||||
* [onHide]回调不用关心,可以不注册
|
||||
*/
|
||||
fun registerBadCaseCallback(onShow:() -> Unit, onHide: (() -> Unit)?)
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.call.hmi
|
||||
|
||||
import android.view.View
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
@@ -16,16 +17,16 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
* HMI 调用者管理,这里对外及其他模块提供功能的调用,用啥写啥,不要过度设计,不允许直接将Provider暴露出去
|
||||
*/
|
||||
object CallerHmiManager : CallerBase() {
|
||||
private val waringProviderApi: IMoGoWaringProvider
|
||||
private val waringProviderApi
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
||||
.navigation() as IMoGoWaringProvider;
|
||||
.navigation() as? IMoGoWaringProvider;
|
||||
|
||||
/**
|
||||
* 隐藏 脉速表
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setSpeedChartViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setSpeedChartViewVisibility(visibility)
|
||||
waringProviderApi?.setSpeedChartViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +34,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setAutopilotStatusViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setAutopilotStatusViewVisibility(visibility)
|
||||
waringProviderApi?.setAutopilotStatusViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,7 +42,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setPerspectiveSwitchViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setPerspectiveSwitchViewVisibility(visibility)
|
||||
waringProviderApi?.setPerspectiveSwitchViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,21 +50,21 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
|
||||
*/
|
||||
fun setToolsViewVisibility(visibility: Int) {
|
||||
waringProviderApi.setToolsViewVisibility(visibility)
|
||||
waringProviderApi?.setToolsViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制转向灯和刹车功能
|
||||
*/
|
||||
fun setTurnLightFunction(isOpen: Boolean) {
|
||||
waringProviderApi.setTurnLightFunction(isOpen)
|
||||
waringProviderApi?.setTurnLightFunction(isOpen)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
fun toggleDebugView(){
|
||||
waringProviderApi.toggleDebugView()
|
||||
waringProviderApi?.toggleDebugView()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +76,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param tag tag绑定弹窗的标志
|
||||
*/
|
||||
fun showWarningV2X(v2xType: Int, alertContent: CharSequence?, ttsContent: String?, tag: String?, listenerIMoGo: IMoGoWarningStatusListener?, playTts: Boolean, expireTime: Long = 5000L) {
|
||||
waringProviderApi.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo, playTts, expireTime)
|
||||
waringProviderApi?.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo, playTts, expireTime)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +84,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param tag 弹窗标识
|
||||
*/
|
||||
fun disableWarningV2X(tag: String?) {
|
||||
waringProviderApi.disableWarningV2X(tag)
|
||||
waringProviderApi?.disableWarningV2X(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,42 +93,42 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param checkLightId 0-都是默认,1-红,2-黄,3-绿
|
||||
*/
|
||||
fun showWarningTrafficLight(checkLightId: Int) {
|
||||
waringProviderApi.showWarningTrafficLight(checkLightId)
|
||||
waringProviderApi?.showWarningTrafficLight(checkLightId)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭红绿灯预警
|
||||
*/
|
||||
fun disableWarningTrafficLight() {
|
||||
waringProviderApi.disableWarningTrafficLight()
|
||||
waringProviderApi?.disableWarningTrafficLight()
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯是否展示
|
||||
*/
|
||||
fun isWarningTrafficLightShow(): Boolean {
|
||||
return waringProviderApi.isWarningTrafficLightShow()
|
||||
return waringProviderApi?.isWarningTrafficLightShow() ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改红灯倒计时
|
||||
*/
|
||||
fun changeCountdownRed(redNum: Int) {
|
||||
waringProviderApi.changeCountdownRed(redNum)
|
||||
waringProviderApi?.changeCountdownRed(redNum)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改黄灯倒计时
|
||||
*/
|
||||
fun changeCountdownYellow(yellowNum: Int) {
|
||||
waringProviderApi.changeCountdownYellow(yellowNum)
|
||||
waringProviderApi?.changeCountdownYellow(yellowNum)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿灯倒计时
|
||||
*/
|
||||
fun changeCountdownGreen(greenNum: Int) {
|
||||
waringProviderApi.changeCountdownGreen(greenNum)
|
||||
waringProviderApi?.changeCountdownGreen(greenNum)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +137,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param greenNum 绿灯倒计时
|
||||
*/
|
||||
fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) {
|
||||
waringProviderApi.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
|
||||
waringProviderApi?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,14 +146,14 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param limitingSpeed 限速速度
|
||||
*/
|
||||
fun showLimitingVelocity(limitingSpeed: Int) {
|
||||
waringProviderApi.showLimitingVelocity(limitingSpeed)
|
||||
waringProviderApi?.showLimitingVelocity(limitingSpeed)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭限速预警
|
||||
*/
|
||||
fun disableLimitingVelocity() {
|
||||
waringProviderApi.disableLimitingVelocity()
|
||||
waringProviderApi?.disableLimitingVelocity()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,7 +162,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @see WarningDirectionEnum
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum) {
|
||||
waringProviderApi.showWarning(direction)
|
||||
waringProviderApi?.showWarning(direction)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,14 +172,14 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param closeTime 倒计时
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
||||
waringProviderApi.showWarning(direction, closeTime)
|
||||
waringProviderApi?.showWarning(direction, closeTime)
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动消失边框预警
|
||||
*/
|
||||
fun dismissWarning(direction: WarningDirectionEnum) {
|
||||
waringProviderApi.dismissWarning(direction)
|
||||
waringProviderApi?.dismissWarning(direction)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +188,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param trafficStylePushData
|
||||
*/
|
||||
fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) {
|
||||
waringProviderApi.showNoticeForTrafficWithData(trafficStylePushData)
|
||||
waringProviderApi?.showNoticeForTrafficWithData(trafficStylePushData)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,21 +196,21 @@ object CallerHmiManager : CallerBase() {
|
||||
*
|
||||
*/
|
||||
fun showNoticeNormalData(noticeNormal: NoticeNormalData) {
|
||||
waringProviderApi.showNoticeNormalData(noticeNormal)
|
||||
waringProviderApi?.showNoticeNormalData(noticeNormal)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示VIP标识
|
||||
*/
|
||||
fun vipIdentification(visible: Boolean) {
|
||||
waringProviderApi.vipIdentification(visible)
|
||||
waringProviderApi?.vipIdentification(visible)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启道路视频直播
|
||||
*/
|
||||
fun startRoadCameraLive(flvUrl: String) {
|
||||
waringProviderApi.startRoadCameraLive(flvUrl)
|
||||
waringProviderApi?.startRoadCameraLive(flvUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +219,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param light
|
||||
*/
|
||||
fun showTurnLight(light: Int) {
|
||||
waringProviderApi.showTurnLight(light)
|
||||
waringProviderApi?.showTurnLight(light)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,19 +228,19 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param brakeLight
|
||||
*/
|
||||
fun showBrakeLight(brakeLight: Int) {
|
||||
waringProviderApi.showBrakeLight(brakeLight)
|
||||
waringProviderApi?.showBrakeLight(brakeLight)
|
||||
}
|
||||
|
||||
fun showNoSignalView() {
|
||||
waringProviderApi.showNoSignView()
|
||||
waringProviderApi?.showNoSignView()
|
||||
}
|
||||
|
||||
fun showToolsView() {
|
||||
waringProviderApi.showToolsView()
|
||||
waringProviderApi?.showToolsView()
|
||||
}
|
||||
|
||||
fun hideToolsView() {
|
||||
waringProviderApi.hideToolsView()
|
||||
waringProviderApi?.hideToolsView()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,8 +254,23 @@ object CallerHmiManager : CallerBase() {
|
||||
*/
|
||||
fun showAdUpgradeStatus(upgradeMode : Int, downloadStatus : Int,currentProgress : Int,totalProgress : Int
|
||||
,downloadVersion : String,upgradeStatus : Int){
|
||||
waringProviderApi.showAdUpgradeStatus(upgradeMode,downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
|
||||
waringProviderApi?.showAdUpgradeStatus(upgradeMode,downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示BadCase入口
|
||||
*/
|
||||
fun showBadCaseEntrance(entrance: View) {
|
||||
waringProviderApi?.showBadCaseEntrance(entrance)
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册badcase入口展示和隐藏的回调
|
||||
* 当[onShow]被调用时,调用[showBadCaseEntrance]
|
||||
* [onHide]回调不用关心,可以不注册
|
||||
*/
|
||||
fun registerBadCaseCallback(onShow:() -> Unit, onHide: (() -> Unit)?) {
|
||||
waringProviderApi?.registerBadCaseCallback(onShow, onHide)
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -8,10 +8,60 @@ import android.util.TypedValue
|
||||
import android.view.View
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.annotation.IntRange
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.LifecycleRegistry
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.R
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import java.util.*
|
||||
|
||||
val <T: View> T.lifecycleOwner: LifecycleOwner
|
||||
get() = getTag(R.id.view_lifecycle_owner) as? LifecycleOwner ?: object : LifecycleOwner, LifecycleEventObserver {
|
||||
|
||||
private val lifecycle = LifecycleRegistry(this)
|
||||
|
||||
init {
|
||||
if (ViewCompat.isAttachedToWindow(this@lifecycleOwner)) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) {
|
||||
it.currentState = Lifecycle.State.CREATED
|
||||
}
|
||||
}
|
||||
}
|
||||
addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener {
|
||||
override fun onViewAttachedToWindow(v: View?) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) {
|
||||
it.currentState = Lifecycle.State.CREATED
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewDetachedFromWindow(v: View?) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.CREATED)) {
|
||||
this@lifecycleOwner.removeOnAttachStateChangeListener(this)
|
||||
it.currentState = Lifecycle.State.DESTROYED
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
|
||||
lifecycle.currentState = event.targetState
|
||||
}
|
||||
|
||||
override fun getLifecycle(): Lifecycle {
|
||||
return lifecycle
|
||||
}
|
||||
|
||||
}.also {
|
||||
setTag(R.id.view_lifecycle_owner, it)
|
||||
}
|
||||
|
||||
fun View.onClick(block: (View) -> Unit) {
|
||||
this.setOnClickListener {
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.doOnAttach
|
||||
import androidx.core.view.doOnDetach
|
||||
import androidx.lifecycle.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.util.R
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -106,52 +107,6 @@ interface IReminder : Comparable<IReminder> {
|
||||
}
|
||||
}
|
||||
|
||||
val <T: View> T.lifecycleOwner: LifecycleOwner
|
||||
get() = getTag(R.id.view_lifecycle_owner) as? LifecycleOwner ?: object : LifecycleOwner, LifecycleEventObserver {
|
||||
|
||||
private val lifecycle = LifecycleRegistry(this)
|
||||
|
||||
init {
|
||||
if (ViewCompat.isAttachedToWindow(this@lifecycleOwner)) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) {
|
||||
it.currentState = Lifecycle.State.CREATED
|
||||
}
|
||||
}
|
||||
}
|
||||
addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener {
|
||||
override fun onViewAttachedToWindow(v: View?) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) {
|
||||
it.currentState = Lifecycle.State.CREATED
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewDetachedFromWindow(v: View?) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.CREATED)) {
|
||||
this@lifecycleOwner.removeOnAttachStateChangeListener(this)
|
||||
it.currentState = Lifecycle.State.DESTROYED
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
|
||||
lifecycle.currentState = event.targetState
|
||||
}
|
||||
|
||||
override fun getLifecycle(): Lifecycle {
|
||||
return lifecycle
|
||||
}
|
||||
|
||||
}.also {
|
||||
setTag(R.id.view_lifecycle_owner, it)
|
||||
}
|
||||
|
||||
|
||||
val <T: PopupWindow> T.lifecycleOwner: LifecycleOwner
|
||||
get() = popupWindowLifecycleMap[this]
|
||||
?: object : LifecycleOwner, LifecycleEventObserver {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.utilcode.reminder.api.impl
|
||||
import android.view.View
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder
|
||||
|
||||
abstract class ViewReminder(private val content: View): IReminder {
|
||||
|
||||
@@ -134,8 +134,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(false);
|
||||
}
|
||||
// 设置自车的图片对象
|
||||
//options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(DEFAULT_OPTION.getCarCursorRes()));
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
// MapAutoApi.INSTANCE.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +717,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
Logger.i(TAG, "autoop--onMapLoaded: ");
|
||||
MapAutoApi.INSTANCE.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true); //修改自车模型,未来需区分车的类型
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
|
||||
@@ -138,8 +138,8 @@ public class MogoRouteOverlayManager implements
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "onArriveAt data : " + autopilotWayArrive.toString());
|
||||
//演示模式下 到达终点将忽略 引导线绘制 选项关闭
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
// //演示模式下 到达终点将忽略 引导线绘制 选项关闭
|
||||
// FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user