Merge branch 'dev_robotaxi-d-app-module_265_220329_2.6.5' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_265_220329_2.6.5

This commit is contained in:
wangmingjun
2022-03-30 15:56:41 +08:00
144 changed files with 2911 additions and 1380 deletions

View File

@@ -0,0 +1,73 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
annotationProcessor rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.amapnavi3dmap
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_function_v2x
}else {
implementation project(":core:mogo-core-utils")
implementation project(":foudations:mogo-commons")
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
implementation project(':core:function-impl:mogo-core-function-v2x')
}
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -0,0 +1,3 @@
GROUP=com.mogo.och
POM_ARTIFACT_ID=och-bus-passenger
VERSION_CODE=1

View File

@@ -0,0 +1,26 @@
package com.mogo.och.bus.passenger;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.mogo.och.bus.passenger.test", appContext.getPackageName());
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.och.bus.passenger">
</manifest>

View File

@@ -0,0 +1,22 @@
package com.mogo.och.bus.passenger;
import androidx.annotation.IdRes;
import androidx.fragment.app.FragmentActivity;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
/**
* 网约车抽象接口
*
* Created on 2022/3/29
*/
interface IMogoOCH extends IMoGoFunctionProvider {
/**
* 初始化网约车容器
*
* @param activity
* @param containerId 容器ID
*/
void createCoverage(FragmentActivity activity, @IdRes int containerId);
}

View File

@@ -0,0 +1,89 @@
package com.mogo.och.bus.passenger;
import android.content.Context;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.elegant.utils.UiThreadHandler;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.MogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
/**
* 网约车-Bus-乘客端
*
* Created on 2022/3/29
*/
@Route(path = BusPassengerConst.PATH)
public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener {
private static final String TAG = MogoOCHBusPassenger.class.getSimpleName();
private FragmentActivity mActivity;
private int mContainerId;
@Override
public void createCoverage(FragmentActivity activity, int containerId) {
}
@Nullable
@Override
public Fragment createCoverage(@Nullable FragmentActivity activity, @Nullable Integer containerId) {
this.mActivity = activity;
this.mContainerId = containerId;
UiThreadHandler.postDelayed(() -> stepIntoVrMode(), 5_000L);
return null;
}
@NotNull
@Override
public String getFunctionName() {
return null;
}
@Override
public void onDestroy() {
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
if (mActivity == null) return;
mActivity.finish();
}
@Override
public void init(Context context) {
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
, StatusDescriptor.VR_MODE, this);
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
, StatusDescriptor.TOP_VIEW, this);
}
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (descriptor == StatusDescriptor.VR_MODE){
if (isTrue){
}else {
}
}
}
/**
* 进入鹰眼模式,设置手势缩放地图失效
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
MogoMapUIController.getInstance()
.openVrMode( false );
}
}

View File

@@ -0,0 +1,28 @@
package com.mogo.och.bus.passenger.constant
import com.mogo.commons.debug.DebugConfig
/**
* Created on 2021/12/6
*/
class BusPassengerConst {
companion object {
private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com"
private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com"
private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com"
@JvmStatic
fun getBaseUrl(): String {
return when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV
DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA
DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE
else -> BASE_URL_OCH_RELEASE
}
}
// OCH arouter 路由path
const val PATH = "/och/api"
}
}

View File

@@ -0,0 +1,17 @@
package com.mogo.och.bus.passenger;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@@ -25,12 +25,12 @@ public
* @author congtaowang
* @since 2021/1/15
* <p>
* 网约车-出租车
* 网约车-出租车-乘客端
*/
@Route( path = TaxiPassengerConst.PATH )
class MogoOCHTaxi implements IMogoOCH, IMogoStatusChangedListener {
class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener {
private static final String TAG = "MogoOCHTaxi";
private static final String TAG = "MogoOCHTaxiPassenger";
private TaxiPassengerBaseFragment ochTaxiPassengerFragment;
private FragmentActivity mActivity;
private int mContainerId;

View File

@@ -1,72 +0,0 @@
package com.mogo.och.taxi.passenger;
import android.content.Context;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.v2x.events.utils.LocationUtils;
import com.mogo.eagle.core.utilcode.util.ColorUtils;
import com.mogo.map.MogoOverlayManager;
import com.mogo.map.overlay.IMogoOverlayManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.overlay.MogoPolylineOptions;
import com.mogo.module.common.MogoApisHandler;
import java.util.ArrayList;
import java.util.List;
public class OCHTaxiOverlayManager {
private IMogoPolyline mMoGoPolyline;
// 连接线参数
private MogoPolylineOptions mPolylineOptions;
// 线路径集合
private List<MogoLatLng> mPolylinePointList;
// 渐变色
private List<Integer> mPolylineColors;
private Context mContext;
IMogoOverlayManager mogoOverlayManager;
public OCHTaxiOverlayManager(Context context) {
mPolylineOptions = new MogoPolylineOptions();
// 绘制路径集合
mPolylinePointList = new ArrayList<>();
// 引导线颜色
mPolylineColors = new ArrayList<>();
mContext = context;
mogoOverlayManager = MogoOverlayManager.getInstance();
}
/**
* 绘制最优路线
*
* @param polylinePoint 要绘制的经纬度度集合
*/
public IMogoPolyline draw(MogoLocation carLocal, List<MogoLatLng> polylinePoint) {
if (mMoGoPolyline != null) {
mMoGoPolyline.remove();
mPolylinePointList.clear();
mPolylineColors.clear();
}
if (polylinePoint != null) {
// 将当前车辆位置放进去
mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude()));
// 过滤后台推送的推荐路线集合
for (MogoLatLng polyline : polylinePoint) {
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
if (LocationUtils.isPointOnCarFront(carLocal, polyline)) {
mPolylinePointList.add(polyline);
}
}
mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size()));
// 替换路径集合
mPolylineOptions.points(mPolylinePointList);
// 线条粗细,渐变,渐变色值
mPolylineOptions.width(25).useGradient(true).colorValues(mPolylineColors);
// 绘制线
mMoGoPolyline = mogoOverlayManager.addPolyline(mPolylineOptions);
}
return mMoGoPolyline;
}
}

View File

@@ -237,18 +237,18 @@ dependencies {
releaseImplementation rootProject.ext.dependencies.releaseleakcanary
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogo_core_function_main
implementation rootProject.ext.dependencies.ttspad
implementation rootProject.ext.dependencies.mogo_core_function_hmi
androidTestImplementation rootProject.ext.dependencies.mogo_core_function_call
androidTestImplementation rootProject.ext.dependencies.mogo_core_res
androidTestImplementation rootProject.ext.dependencies.mogo_core_function_hmi
androidTestImplementation rootProject.ext.dependencies.mogo_core_function_notice
} else {
implementation project(':core:function-impl:mogo-core-function-main')
implementation project(':tts:tts-pad')
implementation project(':core:function-impl:mogo-core-function-hmi')
androidTestImplementation project(':core:mogo-core-function-call')
androidTestImplementation project(':core:mogo-core-res')
androidTestImplementation project(':core:function-impl:mogo-core-function-hmi')
androidTestImplementation project(':core:function-impl:mogo-core-function-notice')
}

View File

@@ -61,7 +61,7 @@ project.dependencies {
}
// Bus乘客端
fPadLenovoOchBusPassengerImplementation (project(':OCH:mogo-och-bus')) {
fPadLenovoOchBusPassengerImplementation (project(':OCH:mogo-och-bus-passenger')) {
exclude group: 'com.mogo.commons' //by group
exclude group: 'com.mogo.module' //by group
exclude group: 'com.mogo.map' //by group

View File

@@ -26,8 +26,8 @@ project.android.productFlavors {
// GPS数据提供源 0-Android系统1-工控机2-OBU
buildConfigField 'int', 'GPS_PROVIDER', "1"
// 构建的应用身份类型出租车0|小巴A-司机0乘客1
buildConfigField 'int', 'APP_IDENTITY_MODE', "0xA1"
// 构建的应用身份类型出租车0|小巴A-司机0乘客1 (注20220330 bus passengerv1.0.0实际是做为车上单屏司机端使用)
buildConfigField 'int', 'APP_IDENTITY_MODE', "0xA0"
// 连接的工控机IP地址
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.103\""
// 构建的是否是演示(美化)模式

View File

@@ -13,9 +13,9 @@
android:label="@string/app_shell_name"
android:largeHeap="true"
android:resizeableActivity="false"
android:usesCleartextTraffic="true"
android:supportsRtl="true"
android:theme="@style/Main"
android:theme="@style/AppTheme.App"
android:usesCleartextTraffic="true"
tools:replace="android:label">
<!-- 配置APP ID -->
@@ -36,7 +36,6 @@
android:value="${MAP_SDK_VERSION}" />
</application>
</manifest>

View File

@@ -5,4 +5,6 @@
<color name="colorAccent">#D81B60</color>
<color name="app_window_background">#1C1C1C</color>
</resources>

View File

@@ -1,12 +1,32 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<style name="AppTheme.App" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent
</item>
<item name="android:windowEnterAnimation">@null</item>
<item name="android:windowExitAnimation">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@color/app_window_background</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowAnimationStyle">@style/Animation</item>
</style>
<style name="Animation">
<item name="android:activityOpenEnterAnimation">@null</item>
<item name="android:activityOpenExitAnimation">@null</item>
<item name="android:activityCloseEnterAnimation">@null</item>
<item name="android:activityCloseExitAnimation">@null</item>
<item name="android:taskOpenEnterAnimation">@null</item>
<item name="android:taskOpenExitAnimation">@null</item>
<item name="android:taskCloseEnterAnimation">@null</item>
<item name="android:taskCloseExitAnimation">@null</item>
<item name="android:taskToFrontEnterAnimation">@null</item>
<item name="android:taskToFrontExitAnimation">@null</item>
<item name="android:taskToBackEnterAnimation">@null</item>
<item name="android:taskToBackExitAnimation">@null</item>
</style>
</resources>

View File

@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 31
defaultConfig {
applicationId "com.zhidao.adas.client"
minSdkVersion 19
targetSdkVersion 22
minSdkVersion 21
targetSdkVersion 31
multiDexEnabled true
versionCode 1
versionName "1.0"

View File

@@ -39,7 +39,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".ui.mian.MainActivity"
android:name=".ui.MainActivity"
android:screenOrientation="landscape"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
@@ -49,7 +49,9 @@
</intent-filter>
</activity>
<activity android:name=".ui.autopilot.AutopilotConfigActivity">
<activity
android:name=".ui.AutopilotConfigActivity"
android:theme="@style/AppTheme.NoActionBar">
</activity>
</application>

View File

@@ -0,0 +1,405 @@
package com.zhidao.adas.client.adapter;
import android.content.Context;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.bean.AutoPilotMode;
import java.util.ArrayList;
import java.util.List;
public class AutopilotConfigAdapter extends RecyclerView.Adapter<AutopilotConfigAdapter.MyViewHolder> {
private List<AutoPilotMode> datas;
private Context mContext;
private OnHaveDataListener onHaveDataListener;
private boolean isShowDel = false;
public AutopilotConfigAdapter(List<AutoPilotMode> datas) {
this.datas = datas;
if (datas == null) {
this.datas = new ArrayList<>();
}
}
public void setShowDel(boolean showDel) {
isShowDel = showDel;
notifyDataSetChanged();
}
public List<AutoPilotMode> getDatas() {
return datas;
}
public interface OnHaveDataListener {
void onHaveData(boolean isHave);
}
public void setOnItemClickListener(OnHaveDataListener l) {
this.onHaveDataListener = l;
}
public void add() {
datas.add(new AutoPilotMode());
notifyItemInserted(datas.size() - 1);
if (onHaveDataListener != null && datas.size() == 1)
onHaveDataListener.onHaveData(true);
}
public void minus(int position) {
AutoPilotMode bean = datas.get(position);
bean.wayLatLons = null;
bean = null;
datas.remove(position);
notifyItemRemoved(position);
notifyItemRangeChanged(position, getItemCount());
if (onHaveDataListener != null && datas.size() == 0)
onHaveDataListener.onHaveData(false);
}
@Override
public int getItemViewType(int position) {
return position;
}
//创建ViewHolder
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
//实例化得到Item布局文件的View对象
mContext = parent.getContext();
View v = LayoutInflater.from(mContext).inflate(R.layout.item_autopilot_config, parent, false);
//返回MyViewHolder的对象
return new MyViewHolder(v);
}
//绑定数据
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
AutoPilotMode mode = datas.get(position);
if (!TextUtils.isEmpty(mode.name))
holder.path_name.setText(mode.name);
if (mode.speedLimit != 0.0)
holder.speed.setText(String.valueOf(mode.speedLimit));
if (!TextUtils.isEmpty(mode.startName))
holder.start_name.setText(mode.startName);
if (!TextUtils.isEmpty(mode.endName))
holder.end_name.setText(mode.endName);
if (mode.startLatLon != null) {
if (mode.startLatLon.longitude != 0.0)
holder.start_lon.setText(String.valueOf(mode.startLatLon.longitude));
if (mode.startLatLon.latitude != 0.0)
holder.start_lat.setText(String.valueOf(mode.startLatLon.latitude));
}
if (mode.endLatLon != null) {
if (mode.endLatLon.longitude != 0.0)
holder.end_lon.setText(String.valueOf(mode.endLatLon.longitude));
if (mode.endLatLon.latitude != 0.0)
holder.end_lat.setText(String.valueOf(mode.endLatLon.latitude));
}
holder.setViaData();
holder.del.setVisibility(isShowDel ? View.VISIBLE : View.GONE);
}
//返回Item的数量
@Override
public int getItemCount() {
return datas == null ? 0 : datas.size();
}
//继承RecyclerView.ViewHolder抽象类的自定义ViewHolder
class MyViewHolder extends RecyclerView.ViewHolder {
RecyclerView recyclerView;
EditText path_name;
EditText speed;
EditText start_name;
EditText end_name;
EditText start_lon;
EditText start_lat;
EditText end_lon;
EditText end_lat;
TextView num;
TextView del;
ImageView add;
ImageView minus;
ViaPositionAdapter adapter;
MyViewHolder(View itemView) {
super(itemView);
recyclerView = itemView.findViewById(R.id.RecyclerView);
path_name = itemView.findViewById(R.id.path_name);
speed = itemView.findViewById(R.id.speed);
start_name = itemView.findViewById(R.id.start_name);
end_name = itemView.findViewById(R.id.end_name);
start_lon = itemView.findViewById(R.id.start_lon);
start_lat = itemView.findViewById(R.id.start_lat);
end_lon = itemView.findViewById(R.id.end_lon);
end_lat = itemView.findViewById(R.id.end_lat);
num = itemView.findViewById(R.id.num);
del = itemView.findViewById(R.id.del);
add = itemView.findViewById(R.id.add);
minus = itemView.findViewById(R.id.minus);
initRecyclerView();
minus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
minus();
}
});
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
add();
}
});
del.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AutopilotConfigAdapter.this.minus(getBindingAdapterPosition());
}
});
path_name.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
datas.get(getBindingAdapterPosition()).name = s.toString().trim();
}
});
speed.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (!TextUtils.isEmpty(s)) {
try {
datas.get(getBindingAdapterPosition()).speedLimit = Double.parseDouble(s.toString().trim());
} catch (Exception e) {
e.printStackTrace();
speed.setText("");
Toast.makeText(mContext, "输入不合法", Toast.LENGTH_SHORT).show();
}
} else {
datas.get(getBindingAdapterPosition()).speedLimit = 0.0;
}
}
});
start_name.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
datas.get(getBindingAdapterPosition()).startName = s.toString().trim();
}
});
end_name.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
datas.get(getBindingAdapterPosition()).endName = s.toString().trim();
}
});
start_lon.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (!TextUtils.isEmpty(s)) {
try {
if (datas.get(getBindingAdapterPosition()).startLatLon == null)
datas.get(getBindingAdapterPosition()).startLatLon = new AutoPilotMode.Location();
datas.get(getBindingAdapterPosition()).startLatLon.longitude = Double.parseDouble(s.toString().trim());
} catch (Exception e) {
e.printStackTrace();
start_lon.setText("");
Toast.makeText(mContext, "输入不合法", Toast.LENGTH_SHORT).show();
}
} else {
if (datas.get(getBindingAdapterPosition()).startLatLon != null) {
datas.get(getBindingAdapterPosition()).startLatLon.longitude = 0.0;
}
}
}
});
start_lat.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (!TextUtils.isEmpty(s)) {
try {
if (datas.get(getBindingAdapterPosition()).startLatLon == null)
datas.get(getBindingAdapterPosition()).startLatLon = new AutoPilotMode.Location();
datas.get(getBindingAdapterPosition()).startLatLon.latitude = Double.parseDouble(s.toString().trim());
} catch (Exception e) {
e.printStackTrace();
start_lat.setText("");
Toast.makeText(mContext, "输入不合法", Toast.LENGTH_SHORT).show();
}
} else {
if (datas.get(getBindingAdapterPosition()).startLatLon != null)
datas.get(getBindingAdapterPosition()).startLatLon.latitude = 0.0;
}
}
});
end_lon.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (!TextUtils.isEmpty(s)) {
try {
if (datas.get(getBindingAdapterPosition()).endLatLon == null)
datas.get(getBindingAdapterPosition()).endLatLon = new AutoPilotMode.Location();
datas.get(getBindingAdapterPosition()).endLatLon.longitude = Double.parseDouble(s.toString().trim());
} catch (Exception e) {
e.printStackTrace();
end_lon.setText("");
Toast.makeText(mContext, "输入不合法", Toast.LENGTH_SHORT).show();
}
} else {
if (datas.get(getBindingAdapterPosition()).endLatLon != null)
datas.get(getBindingAdapterPosition()).endLatLon.longitude = 0.0;
}
}
});
end_lat.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (!TextUtils.isEmpty(s)) {
try {
if (datas.get(getBindingAdapterPosition()).endLatLon == null)
datas.get(getBindingAdapterPosition()).endLatLon = new AutoPilotMode.Location();
datas.get(getBindingAdapterPosition()).endLatLon.latitude = Double.parseDouble(s.toString().trim());
} catch (Exception e) {
e.printStackTrace();
end_lat.setText("");
Toast.makeText(mContext, "输入不合法", Toast.LENGTH_SHORT).show();
}
} else {
if (datas.get(getBindingAdapterPosition()).endLatLon != null)
datas.get(getBindingAdapterPosition()).endLatLon.latitude = 0.0;
}
}
});
}
private void initRecyclerView() {
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext);
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
recyclerView.setLayoutManager(linearLayoutManager);
adapter = new ViaPositionAdapter();
recyclerView.setAdapter(adapter);
}
private void minus() {
if (adapter.getItemCount() > 0) {
adapter.minus();
num.setText(String.valueOf(adapter.getItemCount()));
}
}
public void add() {
adapter.addHint();
recyclerView.scrollToPosition(adapter.getItemCount() - 1);
num.setText(String.valueOf(adapter.getItemCount()));
}
public void setViaData() {
if (adapter.getDatas() == null) {
List<AutoPilotMode.Location> list = datas.get(getBindingAdapterPosition()).wayLatLons;
if (list == null) {
list = new ArrayList<>();
datas.get(getBindingAdapterPosition()).wayLatLons = list;
}
adapter.setDatas(list);
}
}
}
}

View File

@@ -1,4 +1,4 @@
package com.zhidao.adas.client.ui.mian;
package com.zhidao.adas.client.adapter;
import android.view.LayoutInflater;
import android.view.View;

View File

@@ -1,4 +1,4 @@
package com.zhidao.adas.client.ui.mian;
package com.zhidao.adas.client.adapter;
import android.annotation.SuppressLint;
import android.graphics.Color;

View File

@@ -1,4 +1,4 @@
package com.zhidao.adas.client.ui.mian;
package com.zhidao.adas.client.adapter;
import android.view.LayoutInflater;
import android.view.View;

View File

@@ -0,0 +1,60 @@
package com.zhidao.adas.client.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.base.BaseAdapter;
import com.zhidao.adas.client.base.BaseViewHolder;
import com.zhidao.adas.client.bean.AutoPilotMode;
import java.util.List;
/**
* @author song kenan
* @des 线路
* @date 2021/8/13
*/
public class LineAdapter extends BaseAdapter<AutoPilotMode, LineAdapter.ViewHolder> {
public LineAdapter(List<AutoPilotMode> data) {
super(data);
}
@Override
public void setData(List<AutoPilotMode> mDatas) {
super.setData(mDatas);
}
@Override
protected void onBindDataToItem(ViewHolder viewHolder, AutoPilotMode data, int position) {
viewHolder.title.setText(data.name + " " + data.startName + "->" + data.endName);
}
@Override
protected View getItemViewResource(ViewGroup viewGroup) {
return LayoutInflater.from(mContext).inflate(R.layout.item_info, viewGroup, false);
}
@Override
protected ViewHolder getViewHolder(View view) {
return new ViewHolder(view, this);
}
class ViewHolder extends BaseViewHolder<LineAdapter> {
TextView title;
public ViewHolder(View itemView, LineAdapter adapter) {
super(itemView, adapter);
ViewGroup.LayoutParams layoutParams = itemView.getLayoutParams();
if (layoutParams != null) {
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
}
title = itemView.findViewById(R.id.tv_info_title);
}
}
}

View File

@@ -0,0 +1,157 @@
package com.zhidao.adas.client.adapter;
import android.content.Context;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.bean.AutoPilotMode;
import java.util.List;
public class ViaPositionAdapter extends RecyclerView.Adapter<ViaPositionAdapter.MyViewHolder> {
private List<AutoPilotMode.Location> datas;
private Context mContext;
public void setDatas(List<AutoPilotMode.Location> datas) {
this.datas = datas;
if (!this.datas.isEmpty()) {
for (int i = 0; i < this.datas.size(); i++) {
this.datas.get(i).name = "" + (i + 1);
}
}
}
public List<AutoPilotMode.Location> getDatas() {
return datas;
}
public void addHint() {
datas.add(new AutoPilotMode.Location("" + (datas.size() + 1)));
notifyItemInserted(datas.size() - 1);
}
public void minus() {
datas.remove(datas.size() - 1);
notifyItemRemoved(datas.size() - 1);
notifyItemRangeChanged(datas.size() - 1, getItemCount());
}
@Override
public int getItemViewType(int position) {
return position;
}
//创建ViewHolder
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
//实例化得到Item布局文件的View对象
mContext = parent.getContext();
View v = LayoutInflater.from(mContext).inflate(R.layout.item_via, parent, false);
//返回MyViewHolder的对象
return new MyViewHolder(v);
}
//绑定数据
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
AutoPilotMode.Location location = datas.get(position);
holder.title.setText(location.name);
if (location.longitude != 0.0)
holder.lon.setText(String.valueOf(location.longitude));
if (location.latitude != 0.0)
holder.lat.setText(String.valueOf(location.latitude));
// holder.input.setFocusable(true);
// holder.input.setFocusableInTouchMode(true);
// holder.input.requestFocus();
}
//返回Item的数量
@Override
public int getItemCount() {
return datas == null ? 0 : datas.size();
}
//继承RecyclerView.ViewHolder抽象类的自定义ViewHolder
class MyViewHolder extends RecyclerView.ViewHolder {
TextView title;
EditText lon;
EditText lat;
MyViewHolder(View itemView) {
super(itemView);
title = itemView.findViewById(R.id.title);
lon = itemView.findViewById(R.id.lon);
lat = itemView.findViewById(R.id.lat);
lon.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (!TextUtils.isEmpty(s)) {
try {
datas.get(getBindingAdapterPosition()).longitude = Double.parseDouble(s.toString().trim());
} catch (Exception e) {
e.printStackTrace();
lon.setText("");
Toast.makeText(mContext, "输入不合法", Toast.LENGTH_SHORT).show();
}
} else {
datas.get(getBindingAdapterPosition()).longitude = 0.0;
}
}
});
lat.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (!TextUtils.isEmpty(s)) {
try {
datas.get(getBindingAdapterPosition()).latitude = Double.parseDouble(s.toString().trim());
} catch (Exception e) {
e.printStackTrace();
lat.setText("");
Toast.makeText(mContext, "输入不合法", Toast.LENGTH_SHORT).show();
}
} else {
datas.get(getBindingAdapterPosition()).latitude = 0.0;
}
}
});
}
}
}

View File

@@ -0,0 +1,75 @@
package com.zhidao.adas.client.base;
import android.os.Handler;
import android.os.Message;
import androidx.appcompat.app.AppCompatActivity;
import java.lang.ref.WeakReference;
public abstract class BaseActivity extends AppCompatActivity {
private BaseHandler mBaseHandler;
/**
* 初始化一个Handler如果需要使用Handler先调用此方法
* 然后可以使用postRunnable(Runnable runnable)
* sendMessage在handleMessageMessage msg中接收msg
*/
public void initHandler() {
mBaseHandler = new BaseHandler(this);
}
/**
* 返回Handler在此之前确定已经调用initHandler
*
* @return Handler
*/
public Handler getHandler() {
return mBaseHandler;
}
/**
* 同Handler 的 handleMessage
* getHandler.sendMessage,发送的Message在此接收
* 在此之前确定已经调用initHandler
*
* @param msg
*/
protected void handleMessage(Message msg) {
}
/**
* 同Handler的postRunnable
* 在此之前确定已经调用initHandler
*/
protected void postRunnable(Runnable runnable) {
postRunnableDelayed(runnable, 0);
}
/**
* 同Handler的postRunnableDelayed
* 在此之前确定已经调用initHandler
*/
protected void postRunnableDelayed(Runnable runnable, long delayMillis) {
if (mBaseHandler == null) initHandler();
mBaseHandler.postDelayed(runnable, delayMillis);
}
protected static class BaseHandler extends Handler {
private final WeakReference<BaseActivity> mObjects;
public BaseHandler(BaseActivity mPresenter) {
mObjects = new WeakReference<BaseActivity>(mPresenter);
}
@Override
public void handleMessage(Message msg) {
BaseActivity mPresenter = mObjects.get();
if (mPresenter != null)
mPresenter.handleMessage(msg);
}
}
}

View File

@@ -0,0 +1,59 @@
package com.zhidao.adas.client.bean;
import android.text.TextUtils;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
public class AutoPilotMode {
public String name;
public String startName;
public Location startLatLon;
public String endName;
public Location endLatLon;
public double speedLimit;
public List<Location> wayLatLons;
public List<MessagePad.Location> getWayLatLons() {
if (wayLatLons == null || wayLatLons.isEmpty()) return null;
List<MessagePad.Location> list = new ArrayList<>();
for (int i = 0; i < wayLatLons.size(); i++) {
MessagePad.Location.Builder builder = MessagePad.Location.newBuilder();
builder.setLatitude(wayLatLons.get(i).latitude).setLongitude(wayLatLons.get(i).longitude);
list.add(builder.build());
}
return list;
}
public static class Location {
public String name;
public double longitude;
public double latitude;
public Location() {
}
public Location(String name) {
this.name = name;
}
public boolean isNull() {
return longitude == 0.0 || latitude == 0.0;
}
}
public boolean isNull() {
if (wayLatLons != null && !wayLatLons.isEmpty()) {
for (int i = 0; i < wayLatLons.size(); i++) {
if (wayLatLons.get(i).isNull()) {
return true;
}
}
}
return TextUtils.isEmpty(name) || TextUtils.isEmpty(startName) || TextUtils.isEmpty(endName) ||
startLatLon == null || startLatLon.isNull() || endLatLon == null || endLatLon.isNull() ||
speedLimit == 0.0;
}
}

View File

@@ -0,0 +1,22 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import mogo.telematics.pad.MessagePad;
import perception.TrafficLightOuterClass;
public class PerceptionTrafficLight extends Base {
public final TrafficLightOuterClass.TrafficLights bean;
public PerceptionTrafficLight(MessagePad.Header header, TrafficLightOuterClass.TrafficLights bean) {
super(bean.getSerializedSize(), header);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -0,0 +1,4 @@
package com.zhidao.adas.client.bean;
public class UpdateDataEvent {
}

View File

@@ -0,0 +1,141 @@
package com.zhidao.adas.client.ui;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.LineAdapter;
import com.zhidao.adas.client.base.BaseAdapter;
import com.zhidao.adas.client.bean.UpdateDataEvent;
import com.zhidao.adas.client.bean.AutoPilotMode;
import com.zhidao.adas.client.utils.Constants;
import com.zhidao.support.adas.high.AdasManager;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
import mogo.telematics.pad.MessagePad;
public class AutoPilotModeDialog extends Dialog {
private RecyclerView recyclerView;
private LineAdapter adapter;
private List<AutoPilotMode> list;
public AutoPilotModeDialog(@NonNull Context context) {
super(context, R.style.CustomDialog);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_autopilot_mode);
//初始化界面控件
initView();
list = Constants.getPaths(getContext());
initBtnRecyclerView();
//初始化界面控件的事件
initListener();
setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
EventBus.getDefault().unregister(AutoPilotModeDialog.this);
}
});
}
@Override
public void show() {
super.show();
EventBus.getDefault().register(AutoPilotModeDialog.this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onUpdateDataEvent(UpdateDataEvent event) {
list = Constants.getPaths(getContext());
if (adapter != null) {
adapter.setData(list);
}
}
private void initBtnRecyclerView() {
//初始info-recycle
LinearLayoutManager nodLinearLayoutManage = new LinearLayoutManager(getContext());
nodLinearLayoutManage.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(nodLinearLayoutManage);
//如果可以确定每个item的高度是固定的设置这个选项可以提高性能
recyclerView.setHasFixedSize(true);
//解决局部刷新闪屏问题
SimpleItemAnimator animatorInfo = (SimpleItemAnimator) recyclerView.getItemAnimator();
if (animatorInfo != null)
animatorInfo.setSupportsChangeAnimations(false);
//创建并设置Adapter
adapter = new LineAdapter(list);
recyclerView.setAdapter(adapter);
adapter.setOnItemClickListener(new BaseAdapter.OnItemClickListener<AutoPilotMode>() {
@Override
public void onItemClick(int position, AutoPilotMode data) {
MessagePad.Location startLocation = MessagePad.Location.newBuilder()
.setLatitude(data.startLatLon.latitude)
.setLongitude(data.startLatLon.longitude)
.build();
MessagePad.Location endLocation = MessagePad.Location.newBuilder()
.setLatitude(data.endLatLon.latitude)
.setLongitude(data.endLatLon.longitude)
.build();
MessagePad.RouteInfo.Builder builder = MessagePad.RouteInfo.newBuilder();
builder.setStartLocation(startLocation);
builder.setStartName(data.startName);
builder.setEndLocation(endLocation);
builder.setEndName(data.endName);
List<MessagePad.Location> list = data.getWayLatLons();
if (list != null)
builder.addAllWayPoints(list);
builder.setSpeedLimit(data.speedLimit);
builder.setVehicleType(9);
builder.setIsSpeakVoice(true);
AdasManager.getInstance().sendAutoPilotModeReq(1, 0, builder.build());
AutoPilotModeDialog.this.dismiss();
}
});
}
/**
* 初始化界面的确定和取消监听器
*/
private void initListener() {
findViewById(R.id.settings).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getContext().startActivity(new Intent(getContext(), AutopilotConfigActivity.class));
}
});
}
/**
* 初始化界面控件
*/
private void initView() {
recyclerView = findViewById(R.id.recyclerView);
}
}

View File

@@ -0,0 +1,312 @@
package com.zhidao.adas.client.ui;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Message;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.AutopilotConfigAdapter;
import com.zhidao.adas.client.base.BaseActivity;
import com.zhidao.adas.client.bean.UpdateDataEvent;
import com.zhidao.adas.client.bean.AutoPilotMode;
import com.zhidao.adas.client.bean.GnssInfo;
import com.zhidao.adas.client.utils.Constants;
import com.zhidao.support.adas.high.common.ThreadPoolManager;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
public class AutopilotConfigActivity extends BaseActivity {
private static final String TAG = "CreateActivity";
private TextView toolbar_title;
private RecyclerView recyclerView;
private AutopilotConfigAdapter autopilotConfigAdapter;
private GridLayoutManager linearLayoutManager;
private static final int WHAT_START = 0;
TextView no_date;
private TextView lonText;
private TextView latText;
private double lon = -1;
private double lat = -1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_autopilot_cloud_config);
Toolbar toolbar = findViewById(R.id.toolbar);
recyclerView = findViewById(R.id.recyclerView);
no_date = findViewById(R.id.no_date);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("");
toolbar_title = findViewById(R.id.toolbar_title);
toolbar_title.setText("创建线路");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);//左侧添加一个默认的返回图标
getSupportActionBar().setHomeButtonEnabled(true); //设置返回键可用
initHandler();
EventBus.getDefault().register(this);
initRecyclerView();
toolbar_title.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
Toast.makeText(AutopilotConfigActivity.this, "恭喜解锁隐藏技能", Toast.LENGTH_LONG).show();
return true;
}
});
}
@Override
protected void onResume() {
super.onResume();
init();
}
private void init() {
if (autopilotConfigAdapter.getItemCount() == 0) {
recyclerView.setVisibility(View.GONE);
no_date.setVisibility(View.VISIBLE);
} else {
no_date.setVisibility(View.GONE);
recyclerView.setVisibility(View.VISIBLE);
}
}
private void initRecyclerView() {
linearLayoutManager = new GridLayoutManager(this, 2);
linearLayoutManager.setOrientation(GridLayoutManager.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
//添加Android自带的分割线
recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration(this));
autopilotConfigAdapter = new AutopilotConfigAdapter(Constants.getPaths(this));
recyclerView.setAdapter(autopilotConfigAdapter);
autopilotConfigAdapter.setOnItemClickListener(new AutopilotConfigAdapter.OnHaveDataListener() {
@Override
public void onHaveData(boolean isHave) {
if (isHave) {
no_date.setVisibility(View.GONE);
recyclerView.setVisibility(View.VISIBLE);
} else {
recyclerView.setVisibility(View.GONE);
no_date.setVisibility(View.VISIBLE);
}
}
});
}
public void onSave() {
List<AutoPilotMode> list = autopilotConfigAdapter.getDatas();
if (list == null || list.isEmpty()) {
Toast.makeText(AutopilotConfigActivity.this, "未找到可用数据,无法保存", Toast.LENGTH_SHORT).show();
return;
}
Toast.makeText(AutopilotConfigActivity.this, "正在保存...", Toast.LENGTH_SHORT).show();
Runnable runnable = new Runnable() {
@Override
public void run() {
boolean isNull = false;
for (int i = 0; i < list.size(); i++) {
if (list.get(i).isNull()) {
isNull = true;
break;
}
}
if (!isNull) {
Constants.setPath(AutopilotConfigActivity.this, list);
}
Message msg = Message.obtain();
msg.what = WHAT_START;
msg.obj = !isNull;
getHandler().sendMessage(msg);
}
};
ThreadPoolManager.getsInstance().execute(runnable);
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().post(new UpdateDataEvent());
if (getHandler() != null)
getHandler().removeCallbacksAndMessages(null);
EventBus.getDefault().unregister(this);
}
@Override
protected void handleMessage(Message msg) {
super.handleMessage(msg);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
switch (msg.what) {
case WHAT_START:
if ((Boolean) msg.obj) {
builder.setTitle("保存成功")
.setMessage("配置保存成功啦")
.setNegativeButton("退出",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
})
.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
});
} else {
builder.setTitle("保存失败")
.setMessage("请输入必填项\n所有输入框均必填\uD83E\uDD2A")
.setPositiveButton("确认",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
});
}
break;
}
AlertDialog dialog = builder.show();
// dialog.setCancelable(false);
// dialog.setCanceledOnTouchOutside(false);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_create, menu);
MenuItem itemDel = menu.findItem(R.id.action_del_item);
CheckBox del = itemDel.getActionView().findViewById(R.id.action_del);
del.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (autopilotConfigAdapter != null) {
autopilotConfigAdapter.setShowDel(isChecked);
}
}
});
MenuItem itemLocation = menu.findItem(R.id.action_location_item);
Button btn_lon = itemLocation.getActionView().findViewById(R.id.btn_lon);
Button btn_lat = itemLocation.getActionView().findViewById(R.id.btn_lat);
lonText = itemLocation.getActionView().findViewById(R.id.lon);
latText = itemLocation.getActionView().findViewById(R.id.lat);
btn_lon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (lon != -1) {
findEditText(lon);
}
}
});
btn_lat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (lat != -1) {
findEditText(lat);
}
}
});
return true;
}
private void findEditText(double value) {
View view = getWindow().getDecorView().findFocus();
if (view instanceof EditText) {
EditText editText = ((EditText) view);
String content = String.valueOf(value);
editText.setText(content);
editText.setSelection(content.length());
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onLocationEvent(GnssInfo info) {
if (info != null && info.bean != null) {
lon = info.bean.getLongitude();
lat = info.bean.getLatitude();
if (lonText != null)
lonText.setText("Lon" + lon);
if (latText != null)
latText.setText("Lat" + lat);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
switch (id) {
case R.id.action_settings_item:
autopilotConfigAdapter.add();
// linearLayoutManager.scrollToPositionWithOffset(dbAdapter.getItemCount() - 1, 0);
recyclerView.scrollToPosition(autopilotConfigAdapter.getItemCount() - 1);
return true;
case R.id.action_save_item:
onSave();
return true;
case android.R.id.home:
onBack();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void onBack() {
new AlertDialog.Builder(this)
.setTitle("退出提示")
.setMessage("是否配置页面")
.setNegativeButton("取消",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
})
.setPositiveButton("确认",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
finish();
}
}).show();
}
//返回键处理
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBack();
return true;
} else {
return super.onKeyDown(keyCode, event);
}
}
}

View File

@@ -0,0 +1,140 @@
/*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.zhidao.adas.client.ui;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
/**
* DividerItemDecoration is a {@link RecyclerView.ItemDecoration} that can be used as a divider
* between items of a {@link LinearLayoutManager}. It supports both {@link #HORIZONTAL} and
* {@link #VERTICAL} orientations.
*
* <pre>
* mDividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
* mLayoutManager.getOrientation());
* recyclerView.addItemDecoration(mDividerItemDecoration);
* </pre>
*/
public class HorizontalDividerItemDecoration extends RecyclerView.ItemDecoration {
public static final int HORIZONTAL = LinearLayout.HORIZONTAL;
public static final int VERTICAL = LinearLayout.VERTICAL;
private static final String TAG = "DividerItem";
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
private Drawable mDivider;
private final Rect mBounds = new Rect();
/**
* Creates a divider {@link RecyclerView.ItemDecoration} that can be used with a
* {@link LinearLayoutManager}.
*
* @param context Current context, it will be used to access resources.
*/
public HorizontalDividerItemDecoration(Context context) {
final TypedArray a = context.obtainStyledAttributes(ATTRS);
mDivider = a.getDrawable(0);
if (mDivider == null) {
Log.w(TAG, "@android:attr/listDivider was not set in the theme used for this "
+ "DividerItemDecoration. Please set that attribute all call setDrawable()");
}
a.recycle();
}
/**
* Sets the {@link Drawable} for this divider.
*
* @param drawable Drawable that should be used as a divider.
*/
public void setDrawable(@NonNull Drawable drawable) {
if (drawable == null) {
throw new IllegalArgumentException("Drawable cannot be null.");
}
mDivider = drawable;
}
/**
* @return the {@link Drawable} for this divider.
*/
@Nullable
public Drawable getDrawable() {
return mDivider;
}
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
if (parent.getLayoutManager() == null || mDivider == null) {
return;
}
drawHorizontal(c, parent);
}
private void drawHorizontal(Canvas canvas, RecyclerView parent) {
canvas.save();
final int top;
final int bottom;
//noinspection AndroidLintNewApi - NewApi lint fails to handle overrides.
if (parent.getClipToPadding()) {
top = parent.getPaddingTop();
bottom = parent.getHeight() - parent.getPaddingBottom();
canvas.clipRect(parent.getPaddingLeft(), top,
parent.getWidth() - parent.getPaddingRight(), bottom);
} else {
top = 0;
bottom = parent.getHeight();
}
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; ) {
final View child = parent.getChildAt(i);
parent.getLayoutManager().getDecoratedBoundsWithMargins(child, mBounds);
final int right = mBounds.right + Math.round(child.getTranslationX());
final int left = right - mDivider.getIntrinsicWidth();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(canvas);
i += 2;
}
canvas.restore();
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
RecyclerView.State state) {
if (mDivider == null) {
outRect.set(0, 0, 0, 0);
return;
}
outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
}
}

View File

@@ -1,4 +1,4 @@
package com.zhidao.adas.client.ui.mian;
package com.zhidao.adas.client.ui;
import android.content.Context;
import android.os.Bundle;
@@ -14,12 +14,14 @@ import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.DataShowAdapter;
import com.zhidao.adas.client.bean.ArrivalNotification;
import com.zhidao.adas.client.bean.AutopilotState;
import com.zhidao.adas.client.bean.ErrorData;
import com.zhidao.adas.client.bean.GlobalPathResp;
import com.zhidao.adas.client.bean.GnssInfo;
import com.zhidao.adas.client.bean.MogoReportMessage;
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
import com.zhidao.adas.client.bean.RecordPanel;
import com.zhidao.adas.client.bean.TrackedObjects;
import com.zhidao.adas.client.bean.Trajectory;
@@ -27,7 +29,6 @@ import com.zhidao.adas.client.bean.VehicleState;
import com.zhidao.adas.client.bean.Warn;
import com.zhidao.adas.client.utils.MyLinearLayoutManager;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.msg.ReportMessage;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@@ -271,7 +272,14 @@ public class InfoFragment extends Fragment {
}
}
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void onPerceptionTrafficLightEvent(PerceptionTrafficLight info) {
EventBus.getDefault().removeStickyEvent(info);
if (title.equals(MainActivity.TITLE.RECEIVE_PERCEPTION_TRAFFIC_LIGHT)) {
data.add(info.toString());
adapter.notifyDataSetChanged();
}
}
@Override
public void onDestroyView() {
super.onDestroyView();

View File

@@ -1,8 +1,10 @@
package com.zhidao.adas.client.ui.mian;
package com.zhidao.adas.client.ui;
import static com.mogo.telematic.MogoProtocolMsg.NORMAL_DATA;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.text.Editable;
@@ -20,6 +22,7 @@ import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;
import androidx.fragment.app.FragmentManager;
@@ -37,8 +40,11 @@ import com.mogo.telematic.client.status.ConnectState;
import com.mogo.telematic.server.netty.NettyServerListener;
import com.zhidao.adas.client.BuildConfig;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.InfoTitleAdapter;
import com.zhidao.adas.client.base.BaseActivity;
import com.zhidao.adas.client.base.BaseAdapter;
import com.zhidao.adas.client.bean.ArrivalNotification;
import com.zhidao.adas.client.bean.AutoPilotMode;
import com.zhidao.adas.client.bean.AutopilotState;
import com.zhidao.adas.client.bean.BasicInfoReq;
import com.zhidao.adas.client.bean.CarConfigResp;
@@ -46,6 +52,7 @@ import com.zhidao.adas.client.bean.ErrorData;
import com.zhidao.adas.client.bean.GlobalPathResp;
import com.zhidao.adas.client.bean.GnssInfo;
import com.zhidao.adas.client.bean.MogoReportMessage;
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
import com.zhidao.adas.client.bean.RecordPanel;
import com.zhidao.adas.client.bean.TrackedObjects;
import com.zhidao.adas.client.bean.Trajectory;
@@ -66,28 +73,24 @@ import com.zhidao.support.adas.high.common.ProtocolStatus;
import com.zhidao.support.recorder.RecordDataManager;
import org.greenrobot.eventbus.EventBus;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ScheduledExecutorService;
import chassis.VehicleStateOuterClass;
import io.netty.channel.Channel;
import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
import perception.TrafficLightOuterClass;
import record_cache.RecordPanelOuterClass;
public class MainActivity extends AppCompatActivity implements OnAdasListener, OnAdasConnectStatusListener, BaseAdapter.OnItemClickListener<String> {
public class MainActivity extends BaseActivity implements OnAdasListener, OnAdasConnectStatusListener, BaseAdapter.OnItemClickListener<String> {
private final static String TAG = MainActivity.class.getSimpleName();
private EditText etIp;
private TextView role;
@@ -106,7 +109,6 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
private RecyclerView infoFragment;
private TextView tvConnectState;
private ScheduledExecutorService mExecutorServiceConfigTimer;
private Gson gson;
private final List<String> titleFragmentData = new ArrayList<>();
@@ -127,6 +129,7 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
private InfoFragment badcseFragment;
private InfoFragment errorFragment;
private InfoFragment reportMessageFragment;
private InfoFragment perceptionTrafficLightFragment;
private VersionFragment versionFragment;
private FragmentManager manager;
private FragmentTransaction transaction;
@@ -135,7 +138,7 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
private long recordKey;
private String recordFileName;
private int connectStatus;
private AutoPilotModeDialog autoPilotModeDialog;
public interface TITLE {
String RECEIVE_TRAJECTORY = "车前引导线";
@@ -144,6 +147,8 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
String RECEIVE_VEHICLE_STATE = "底盘信息";
String RECEIVE_AUTOPILOT_STATE = "自动驾驶状态";
String RECEIVE_REPORT_MESSAGE = "监控事件";
String RECEIVE_PERCEPTION_TRAFFIC_LIGHT = "感知红绿灯";
// String RECEIVE_BASIC_INFO_REQ = "自动驾驶设备基础信息请求";
String RECEIVE_CAR_CONFIG_RESP = "信息与配置";
String RECEIVE_RECORD_RESULT = "数据采集结果";
@@ -175,7 +180,7 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
initView();
firstFragment();
gson = new Gson();
initAdas();
connectStatus = AdasManager.getInstance().getIpcConnectionStatus();
onUpdateConnectStateView();
@@ -332,6 +337,7 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
titleFragmentData.add(TITLE.RECEIVE_VEHICLE_STATE);
titleFragmentData.add(TITLE.RECEIVE_AUTOPILOT_STATE);
titleFragmentData.add(TITLE.RECEIVE_REPORT_MESSAGE);
titleFragmentData.add(TITLE.RECEIVE_PERCEPTION_TRAFFIC_LIGHT);
titleFragmentData.add(TITLE.RECEIVE_CAR_CONFIG_RESP);
titleFragmentData.add(TITLE.RECEIVE_RECORD_RESULT);
titleFragmentData.add(TITLE.RECEIVE_GLOBAL_PATH_RESP);
@@ -341,15 +347,15 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
titleFragmentData.add(TITLE.RECEIVE_ERROR);
titleBtnData.add("下发站点1");
titleBtnData.add("下发站点2");
titleBtnData.add("启动自动驾驶");
titleBtnData.add("自动驾驶路径查询");
titleBtnData.add("下发SN");
titleBtnData.add("数据采集5秒");
titleBtnData.add("数据采集start");
titleBtnData.add("数据采集end");
titleBtnData.add("录音测试");
titleBtnData.add("发送信号灯");
titleBtnData.add("度设置");
titleBtnData.add("自动驾驶限");
titleBtnData.add("重启Docker");
titleBtnData.add("重启IPC");
titleBtnData.add("关机");
@@ -481,6 +487,14 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
transaction.commit();
}
break;
case TITLE.RECEIVE_PERCEPTION_TRAFFIC_LIGHT:
if (perceptionTrafficLightFragment == null)
perceptionTrafficLightFragment = new InfoFragment(data);
if (!perceptionTrafficLightFragment.isVisible()) {
transaction.replace(R.id.fl_info, perceptionTrafficLightFragment);
transaction.commit();
}
break;
case TITLE.RECEIVE_CAR_CONFIG_RESP:
AdasManager.getInstance().sendCarConfigReq();
if (versionFragment == null)
@@ -618,6 +632,11 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
EventBus.getDefault().postSticky(new MogoReportMessage(header, mogoReportMessage));
}
@Override
public void onPerceptionTrafficLight(MessagePad.Header header, TrafficLightOuterClass.TrafficLights trafficLights) {
EventBus.getDefault().postSticky(new PerceptionTrafficLight(header, trafficLights));
}
@Override
public void onBasicInfoReq(MessagePad.Header header, MessagePad.BasicInfoReq basicInfoReq) {
BasicInfoReq info = new BasicInfoReq(header, basicInfoReq);
@@ -871,82 +890,51 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
@Override
public void onItemClick(int position, String data) {
CupidLogUtils.w(TAG, "TitleAdapter===>name:" + data);
if (connectStatus == com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
toastMsg("IPC 未连接");
return;
}
switch (data) {
case "下发站点1":
MessagePad.Location startLocation = MessagePad.Location.newBuilder()
.setLatitude(26.820319143036112)
.setLongitude(112.57770688564666)
.build();
MessagePad.Location endLocation = MessagePad.Location.newBuilder()
.setLatitude(26.82355278566775)
.setLongitude(112.57001723522112)
.build();
MessagePad.RouteInfo info = MessagePad.RouteInfo.newBuilder()
.setStartLocation(startLocation)
.setStartName("KXCNMZ")
.setEndLocation(endLocation)
.setEndName("SDYJKXCXMBZ")
// .addAllWayPoints(null)
.setSpeedLimit(0.0)
.setVehicleType(9)
.setIsSpeakVoice(true)
.build();
AdasManager.getInstance().sendAutoPilotModeReq(1, 0, info);
//"{\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.82355278566775,\"lon\":112.57001723522112},\"endName\":\"SDYJKXCXMBZ\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.820319143036112,\"lon\":112.57770688564666},\"startName\":\"KXCNMZ\",\"vehicleType\":9,\"wayLatLons\":null}}"
// " {\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.819811964643154,\"lon\":112.57732459897345},\"endName\":\"KXCNMDM\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.823347858814472,\"lon\":112.56994205894226},\"startName\":\"SDYJKXCXMBDM\",\"vehicleType\":9,\"wayLatLons\":null}}"
// if (connectStatus == com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
// toastMsg("IPC 未连接");
// return;
// }
switch (position) {
case 0:
if (autoPilotModeDialog == null) {
autoPilotModeDialog = new AutoPilotModeDialog(this);
}
if (!autoPilotModeDialog.isShowing()) {
autoPilotModeDialog.show();
}
break;
case "下发站点2":
MessagePad.Location startLocation2 = MessagePad.Location.newBuilder()
.setLatitude(26.823347858814472)
.setLongitude(112.56994205894226)
.build();
MessagePad.Location endLocation2 = MessagePad.Location.newBuilder()
.setLatitude(26.819811964643154)
.setLongitude(112.57732459897345)
.build();
MessagePad.RouteInfo info2 = MessagePad.RouteInfo.newBuilder()
.setStartLocation(startLocation2)
.setStartName("SDYJKXCXMBDM")
.setEndLocation(endLocation2)
.setEndName("KXCNMDM")
// .addAllWayPoints(null)
.setSpeedLimit(0.0)
.setVehicleType(9)
.setIsSpeakVoice(true)
.build();
AdasManager.getInstance().sendAutoPilotModeReq(1, 0, info2);
// "{\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.82355278566775,\"lon\":112.57001723522112},\"endName\":\"SDYJKXCXMBZ\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.820319143036112,\"lon\":112.57770688564666},\"startName\":\"KXCNMZ\",\"vehicleType\":9,\"wayLatLons\":null}}"
//" {\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.819811964643154,\"lon\":112.57732459897345},\"endName\":\"KXCNMDM\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.823347858814472,\"lon\":112.56994205894226},\"startName\":\"SDYJKXCXMBDM\",\"vehicleType\":9,\"wayLatLons\":null}}"
break;
case "自动驾驶路径查询":
case 1:
//自动驾驶路径查询
AdasManager.getInstance().sendGlobalPathReq();
break;
case "下发SN":
case 2:
//发送sn
AdasManager.getInstance().sendBasicInfoResp("X202021111192N41VY", 1);
break;
case "数据采集5秒":
case 3:
//数据采集5秒
boolean b = AdasManager.getInstance().startRecordPackage(1, 5, 1);
CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + b);
break;
case "数据采集start":
case 4:
//数据采集start
boolean bStart = AdasManager.getInstance().startRecordPackage(1, 1);
CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + bStart);
break;
case "数据采集end":
case 5:
//数据采集end
boolean bEnd = AdasManager.getInstance().stopRecordPackage(1, 1);
CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + bEnd);
break;
case "录音测试":
case 6:
//录音测试
CupidLogUtils.w(TAG, "录音测试");
RecordDataManager.getInstance().init(MainActivity.this, "1234567", "", 22, "", "");
RecordDataManager.getInstance().record();
break;
case "发送信号灯":
case 7:
//发送信号灯
MessagePad.TrafficLightStatus left = MessagePad.TrafficLightStatus.newBuilder()
.setPhaseNo("1")
.setColor("R")
@@ -969,25 +957,55 @@ public class MainActivity extends AppCompatActivity implements OnAdasListener, O
.build();
AdasManager.getInstance().sendTrafficLightData("10038", 26.848153, 112.574883, "180.0", "SN", 100413, -4, 201, 0, detail);
break;
case "速度设置":
AdasManager.getInstance().sendAutopilotSpeedReq(28);
case 8:
//速度设置
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("自动驾驶限速");
View view = getLayoutInflater().inflate(R.layout.dialog_speed, null);
final EditText et = (EditText) view.findViewById(R.id.et);
builder.setView(view);//
builder.setCancelable(false);//
builder.setPositiveButton("设置", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Editable editable = et.getText();
if (TextUtils.isEmpty(editable)) {
// 条件不成立不能关闭 AlertDialog 窗口
Toast.makeText(MainActivity.this, "请输入速度", Toast.LENGTH_SHORT).show();
return;
}
String temp = et.getText().toString().trim();
double speed = Double.parseDouble(temp) / 3.6;
AdasManager.getInstance().sendAutopilotSpeedReq(speed);
}
});
//设置反面按钮并做事件处理
builder.setNegativeButton("取消", null);
builder.show();//显示Dialog对话框
break;
case "重启Docker":
case 9:
//重启Docker
AdasManager.getInstance().rebootAPDocker();
break;
case "重启IPC":
case 10:
//重启IPC
AdasManager.getInstance().rebootIPC();
break;
case "关机":
case 11:
//关机
AdasManager.getInstance().shutdownIPC();
break;
case "采集类型":
case 12:
//采集类型
AdasManager.getInstance().sendRecordCause(recordKey, recordFileName, "1", "变道有干扰");
break;
case "打开演示模式":
case 13:
//打开演示模式
AdasManager.getInstance().sendDemoModeReq(1);
break;
case "关闭演示模式":
case 14:
//关闭演示模式
AdasManager.getInstance().sendDemoModeReq(0);
break;
}

View File

@@ -1,4 +1,4 @@
package com.zhidao.adas.client.ui.mian;
package com.zhidao.adas.client.ui;
import android.content.Context;
import android.graphics.Color;

View File

@@ -1,4 +1,4 @@
package com.zhidao.adas.client.ui.mian;
package com.zhidao.adas.client.ui;
import android.content.Context;
import android.os.Bundle;
@@ -21,6 +21,7 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
import com.zhidao.adas.client.BuildConfig;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.ConfigAdapter;
import com.zhidao.adas.client.bean.CarConfigResp;
import com.zhidao.adas.client.bean.Config;
import com.zhidao.support.adas.high.AdasManager;

View File

@@ -1,31 +0,0 @@
package com.zhidao.adas.client.ui.autopilot;
import java.util.List;
public class AiCloudToStartAutopilot {
private String action = "aiCloudToStartAutopilot";
public ResultDTO result;
public static class ResultDTO {
public EndLatLonDTO endLatLon;
public Integer speedLimit = 20;
public StartLatLonDTO startLatLon;
public List<WayLatLonsDTO> wayLatLons;
public static class EndLatLonDTO {
public Double lat;
public Double lon;
}
public static class StartLatLonDTO {
public Double lat;
public Double lon;
}
public static class WayLatLonsDTO {
public Double lat;
public Double lon;
}
}
}

View File

@@ -1,305 +0,0 @@
package com.zhidao.adas.client.ui.autopilot;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.utils.Constants;
import com.zhidao.adas.client.utils.PreferencesUtils;
import java.util.List;
public class AutopilotConfigActivity extends AppCompatActivity {
public static void launch(Context context) {
Intent intent = new Intent(context,AutopilotConfigActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
private Gson gson = new Gson();
private EditText start_lon1;
private EditText start_lat1;
private EditText stop_lon1;
private EditText stop_lat1;
private EditText t_lon1;
private EditText t_lat1;
private EditText start_lon2;
private EditText start_lat2;
private EditText stop_lon2;
private EditText stop_lat2;
private EditText t_lon2;
private EditText t_lat2;
private EditText start_lon3;
private EditText start_lat3;
private EditText stop_lon3;
private EditText stop_lat3;
private EditText t_lon3;
private EditText t_lat3;
private EditText start_lon4;
private EditText start_lat4;
private EditText stop_lon4;
private EditText stop_lat4;
private EditText t_lon4;
private EditText t_lat4;
private List<AiCloudToStartAutopilot> list;
AiCloudToStartAutopilot data1;
AiCloudToStartAutopilot data2;
AiCloudToStartAutopilot data3;
AiCloudToStartAutopilot data4;
private String init_all_path = "[\n" +
" {\n" +
" \"action\": \"aiCloudToStartAutopilot\",\n" +
" \"result\": {\n" +
" \"endLatLon\": {\n" +
" \"lat\": 26.82355278566775,\n" +
" \"lon\": 112.57001723522112\n" +
" },\n" +
" \"speedLimit\": 20,\n" +
" \"startLatLon\": {\n" +
" \"lat\": 26.820319143036112,\n" +
" \"lon\": 112.57770688564666\n" +
" },\n" +
" \"wayLatLons\": [{\n" +
" \"lat\": 40.1984044,\n" +
" \"lon\": 116.7323222\n" +
" }]\n" +
" }\n" +
" },\n" +
" {\n" +
" \"action\": \"aiCloudToStartAutopilot\",\n" +
" \"result\": {\n" +
" \"endLatLon\": {\n" +
" \"lat\": 40.1979005,\n" +
" \"lon\": 116.7261382\n" +
" },\n" +
" \"speedLimit\": 20,\n" +
" \"startLatLon\": {\n" +
" \"lat\": 40.1992337,\n" +
" \"lon\": 116.7386131\n" +
" },\n" +
" \"wayLatLons\": [{\n" +
" \"lat\": 40.1984044,\n" +
" \"lon\": 116.7323222\n" +
" }]\n" +
" }\n" +
" },\n" +
" {\n" +
" \"action\": \"aiCloudToStartAutopilot\",\n" +
" \"result\": {\n" +
" \"endLatLon\": {\n" +
" \"lat\": 40.1979005,\n" +
" \"lon\": 116.7261382\n" +
" },\n" +
" \"speedLimit\": 20,\n" +
" \"startLatLon\": {\n" +
" \"lat\": 40.1992337,\n" +
" \"lon\": 116.7386131\n" +
" },\n" +
" \"wayLatLons\": [{\n" +
" \"lat\": 40.1984044,\n" +
" \"lon\": 116.7323222\n" +
" }]\n" +
" }\n" +
" },\n" +
" {\n" +
" \"action\": \"aiCloudToStartAutopilot\",\n" +
" \"result\": {\n" +
" \"endLatLon\": {\n" +
" \"lat\": 40.1979005,\n" +
" \"lon\": 116.7261382\n" +
" },\n" +
" \"speedLimit\": 20,\n" +
" \"startLatLon\": {\n" +
" \"lat\": 40.1992337,\n" +
" \"lon\": 116.7386131\n" +
" },\n" +
" \"wayLatLons\": [{\n" +
" \"lat\": 40.1984044,\n" +
" \"lon\": 116.7323222\n" +
" }]\n" +
" }\n" +
" }\n" +
"]";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_autopilot_cloud_config);
start_lon1 = findViewById(R.id.start_lon1);
start_lat1 = findViewById(R.id.start_lat1);
stop_lon1 = findViewById(R.id.stop_lon1);
stop_lat1 = findViewById(R.id.stop_lat1);
t_lon1 = findViewById(R.id.t_lon1);
t_lat1 = findViewById(R.id.t_lat1);
start_lon2 = findViewById(R.id.start_lon2);
start_lat2 = findViewById(R.id.start_lat2);
stop_lon2 = findViewById(R.id.stop_lon2);
stop_lat2 = findViewById(R.id.stop_lat2);
t_lon2 = findViewById(R.id.t_lon2);
t_lat2 = findViewById(R.id.t_lat2);
start_lon3 = findViewById(R.id.start_lon3);
start_lat3 = findViewById(R.id.start_lat3);
stop_lon3 = findViewById(R.id.stop_lon3);
stop_lat3 = findViewById(R.id.stop_lat3);
t_lon3 = findViewById(R.id.t_lon3);
t_lat3 = findViewById(R.id.t_lat3);
start_lon4 = findViewById(R.id.start_lon4);
start_lat4 = findViewById(R.id.start_lat4);
stop_lon4 = findViewById(R.id.stop_lon4);
stop_lat4 = findViewById(R.id.stop_lat4);
t_lon4 = findViewById(R.id.t_lon4);
t_lat4 = findViewById(R.id.t_lat4);
//开始执行
final Button button = findViewById(R.id.start);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String json = PreferencesUtils.getString(AutopilotConfigActivity.this, Constants.SEL_PATH, null);
if (TextUtils.isEmpty(json)) {
Toast.makeText(AutopilotConfigActivity.this, "请先选择路线", Toast.LENGTH_SHORT).show();
return;
}
json = json.split("##")[1];
Log.i("开始执行自动驾驶", json);
// AdasManager.getInstance().aiCloudToAdasData(json);
}
});
findViewById(R.id.save).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
data1.result.startLatLon.lon = Double.parseDouble(start_lon1.getText().toString().trim());
data1.result.startLatLon.lat = Double.parseDouble(start_lat1.getText().toString().trim());
data1.result.endLatLon.lon = Double.parseDouble(stop_lon1.getText().toString().trim());
data1.result.endLatLon.lat = Double.parseDouble(stop_lat1.getText().toString().trim());
data1.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon1.getText().toString().trim());
data1.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat1.getText().toString().trim());
data2.result.startLatLon.lon = Double.parseDouble(start_lon2.getText().toString().trim());
data2.result.startLatLon.lat = Double.parseDouble(start_lat2.getText().toString().trim());
data2.result.endLatLon.lon = Double.parseDouble(stop_lon2.getText().toString().trim());
data2.result.endLatLon.lat = Double.parseDouble(stop_lat2.getText().toString().trim());
data2.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon2.getText().toString().trim());
data2.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat2.getText().toString().trim());
data3.result.startLatLon.lon = Double.parseDouble(start_lon3.getText().toString().trim());
data3.result.startLatLon.lat = Double.parseDouble(start_lat3.getText().toString().trim());
data3.result.endLatLon.lon = Double.parseDouble(stop_lon3.getText().toString().trim());
data3.result.endLatLon.lat = Double.parseDouble(stop_lat3.getText().toString().trim());
data3.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon3.getText().toString().trim());
data3.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat3.getText().toString().trim());
data4.result.startLatLon.lon = Double.parseDouble(start_lon4.getText().toString().trim());
data4.result.startLatLon.lat = Double.parseDouble(start_lat4.getText().toString().trim());
data4.result.endLatLon.lon = Double.parseDouble(stop_lon4.getText().toString().trim());
data4.result.endLatLon.lat = Double.parseDouble(stop_lat4.getText().toString().trim());
data4.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon4.getText().toString().trim());
data4.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat4.getText().toString().trim());
PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.ALL_PATH, gson.toJson(list));
}
});
View path1 = findViewById(R.id.path1);
View path2 = findViewById(R.id.path2);
View path3 = findViewById(R.id.path3);
View path4 = findViewById(R.id.path4);
path1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(AutopilotConfigActivity.this, "已设置路线1", Toast.LENGTH_SHORT).show();
PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "1##" + gson.toJson(list.get(0)));
button.setText("开始执行自动驾驶(路线1)");
}
});
path2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(AutopilotConfigActivity.this, "已设置路线2", Toast.LENGTH_SHORT).show();
PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "2##" + gson.toJson(list.get(1)));
button.setText("开始执行自动驾驶(路线2)");
}
});
path3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(AutopilotConfigActivity.this, "已设置路线3", Toast.LENGTH_SHORT).show();
PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "3##" + gson.toJson(list.get(2)));
button.setText("开始执行自动驾驶(路线3)");
}
});
path4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(AutopilotConfigActivity.this, "已设置路线4", Toast.LENGTH_SHORT).show();
PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "4##" + gson.toJson(list.get(3)));
button.setText("开始执行自动驾驶(路线4)");
}
});
String allPath = PreferencesUtils.getString(AutopilotConfigActivity.this, Constants.ALL_PATH, init_all_path);
list = gson.fromJson(allPath, new TypeToken<List<AiCloudToStartAutopilot>>() {
}.getType());
data1 = list.get(0);
data2 = list.get(1);
data3 = list.get(2);
data4 = list.get(3);
start_lon1.setText(String.valueOf(data1.result.startLatLon.lon));
start_lat1.setText(String.valueOf(data1.result.startLatLon.lat));
stop_lon1.setText(String.valueOf(data1.result.endLatLon.lon));
stop_lat1.setText(String.valueOf(data1.result.endLatLon.lat));
t_lon1.setText(String.valueOf(data1.result.wayLatLons.get(0).lon));
t_lat1.setText(String.valueOf(data1.result.wayLatLons.get(0).lat));
start_lon2.setText(String.valueOf(data2.result.startLatLon.lon));
start_lat2.setText(String.valueOf(data2.result.startLatLon.lat));
stop_lon2.setText(String.valueOf(data2.result.endLatLon.lon));
stop_lat2.setText(String.valueOf(data2.result.endLatLon.lat));
t_lon2.setText(String.valueOf(data2.result.wayLatLons.get(0).lon));
t_lat2.setText(String.valueOf(data2.result.wayLatLons.get(0).lat));
start_lon3.setText(String.valueOf(data3.result.startLatLon.lon));
start_lat3.setText(String.valueOf(data3.result.startLatLon.lat));
stop_lon3.setText(String.valueOf(data3.result.endLatLon.lon));
stop_lat3.setText(String.valueOf(data3.result.endLatLon.lat));
t_lon3.setText(String.valueOf(data3.result.wayLatLons.get(0).lon));
t_lat3.setText(String.valueOf(data3.result.wayLatLons.get(0).lat));
start_lon4.setText(String.valueOf(data4.result.startLatLon.lon));
start_lat4.setText(String.valueOf(data4.result.startLatLon.lat));
stop_lon4.setText(String.valueOf(data4.result.endLatLon.lon));
stop_lat4.setText(String.valueOf(data4.result.endLatLon.lat));
t_lon4.setText(String.valueOf(data4.result.wayLatLons.get(0).lon));
t_lat4.setText(String.valueOf(data4.result.wayLatLons.get(0).lat));
}
}

View File

@@ -2,14 +2,58 @@ package com.zhidao.adas.client.utils;
import android.content.Context;
import com.google.gson.reflect.TypeToken;
import com.zhidao.adas.client.bean.AutoPilotMode;
import com.zhidao.support.adas.high.common.JsonUtil;
import java.util.ArrayList;
import java.util.List;
/**
* @author song kenan
* @des
* @date 2021/10/8
*/
public class Constants {
public static final String ALL_PATH = "all_path";//所有路线
public static final String SEL_PATH = "sel_path";//选择的路线
private static final String ALL_PATH = "all_path";//所有路线
private static final String DEFAULT_PATH = "[{\"endLatLon\":{\"latitude\":40.19774,\"longitude\":116.72704},\"endName\":\"汇源果汁\",\"name\":\"北京市顺义区北小营镇\",\"speedLimit\":20.0,\"startLatLon\":{\"latitude\":40.20047,\"longitude\":116.73512},\"startName\":\"13号路口西\"},{\"endLatLon\":{\"latitude\":40.19996,\"longitude\":116.73584},\"endName\":\"13号路口主路\",\"name\":\"北京市顺义区北小营镇\",\"speedLimit\":20.0,\"startLatLon\":{\"latitude\":40.19763,\"longitude\":116.72686},\"startName\":\"汇源果汁\"}]";
public static List<AutoPilotMode> getPaths(Context context) {
String json = PreferencesUtils.getString(context, ALL_PATH, DEFAULT_PATH);
List<AutoPilotMode> list = JsonUtil.fromJson(json, new TypeToken<List<AutoPilotMode>>() {
}.getType());
return list;
}
public static boolean setPath(Context context, List<AutoPilotMode> list) {
if (list != null) {
return PreferencesUtils.putString(context, ALL_PATH, JsonUtil.toJson(list));
}
return false;
}
public static boolean addPath(Context context, List<AutoPilotMode> list, AutoPilotMode mode) {
if (list == null)
list = new ArrayList<>();
if (!list.contains(mode)) {
list.add(mode);
return PreferencesUtils.putString(context, ALL_PATH, JsonUtil.toJson(list));
}
return false;
}
public static boolean delPath(Context context, List<AutoPilotMode> list, AutoPilotMode mode) {
if (list == null) {
return PreferencesUtils.delete(context, ALL_PATH);
} else {
if (list.contains(mode)) {
list.remove(mode);
return PreferencesUtils.putString(context, ALL_PATH, JsonUtil.toJson(list));
}
}
return false;
}
/***********************是否使用固定IP******************/
// 0:固定IP 1:指定 2UDP

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff" />
<stroke
android:width="0.8dp"
android:color="#ffffff" />
<!-- 圆角 -->
<corners android:radius="6dp" />
</shape>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,32C246.88,32 32,246.88 32,512s214.88,480 480,480 480,-214.88 480,-480C991.2,247.2 776.8,32.8 512,32z"
android:fillColor="#98FB98"/>
<path
android:pathData="M751.49,482.02H536.64V261.6a30.05,30.05 0,1 0,-60.13 0v220.32H267.52a30.5,30.5 0,0 0,-36 29.92c-0.96,15.68 10.88,29.12 26.56,30.08h217.76v214.37a30.05,30.05 0,1 0,60.16 0v-214.37h214.4c15.58,-1.44 29.09,-10.91 30.08,-26.59V512c-0.32,-6.88 -4.48,-29.98 -28.99,-29.98z"
android:fillColor="#F5F5F5"/>
</vector>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,32C246.88,32 32,246.88 32,512s214.88,480 480,480 480,-214.88 480,-480C991.2,247.2 776.8,32.8 512,32z"
android:fillColor="#1afa29"/>
<path
android:pathData="M751.49,482.02H536.64V261.6a30.05,30.05 0,1 0,-60.13 0v220.32H267.52a30.5,30.5 0,0 0,-36 29.92c-0.96,15.68 10.88,29.12 26.56,30.08h217.76v214.37a30.05,30.05 0,1 0,60.16 0v-214.37h214.4c15.58,-1.44 29.09,-10.91 30.08,-26.59V512c-0.32,-6.88 -4.48,-29.98 -28.99,-29.98z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,1024C229.21,1024 0,794.79 0,512S229.21,0 512,0s512,229.21 512,512c-0.85,282.45 -229.55,511.15 -512,512z"
android:fillColor="#98FB98"/>
<path
android:pathData="M778.72,537.6H245.42c-17.75,0 -32.09,-14.34 -32.09,-32.09v-4.27c0,-17.75 14.34,-32.09 32.09,-32.09h533.33c17.78,0 32.09,14.34 32.09,32.09v4.27a32.29,32.29 0,0 1,-32.12 32.09z"
android:fillColor="#F5F5F5"/>
</vector>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,1024C229.21,1024 0,794.79 0,512S229.21,0 512,0s512,229.21 512,512c-0.85,282.45 -229.55,511.15 -512,512z"
android:fillColor="#1afa29"/>
<path
android:pathData="M778.72,537.6H245.42c-17.75,0 -32.09,-14.34 -32.09,-32.09v-4.27c0,-17.75 14.34,-32.09 32.09,-32.09h533.33c17.78,0 32.09,14.34 32.09,32.09v4.27a32.29,32.29 0,0 1,-32.12 32.09z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_add_true" android:state_pressed="true" />
<item android:drawable="@drawable/ic_add_false" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_minus_true" android:state_pressed="true" />
<item android:drawable="@drawable/ic_minus_false" />
</selector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#DCDCDC" android:state_focused="true" />
<item android:color="#DCDCDC" android:state_pressed="true" />
<item android:color="#DCDCDC" android:state_selected="true" />
<item android:color="#C0C0C0" android:state_enabled="false" />
<item android:color="#ffffff" />
</selector>

View File

@@ -1,529 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF"
android:orientation="vertical">
tools:context=".ui.AutopilotConfigActivity">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始执行自动驾驶" />
<Button
android:id="@+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="存储配置" />
</LinearLayout>
<LinearLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:theme="@style/AppTheme.AppBarOverlay">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay">
<TextView
android:id="@+id/path1"
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路线1"
android:textColor="#000"
android:textSize="25sp" />
android:layout_gravity="center"
android:text="标题"
android:textColor="#fff"
android:textSize="20sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</androidx.appcompat.widget.Toolbar>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始Lon"
android:textColor="#000"
android:textSize="16sp" />
</com.google.android.material.appbar.AppBarLayout>
<EditText
android:id="@+id/start_lon1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<include layout="@layout/content_autopilot_cloud_config" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="开始Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lat1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lon1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="结束Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lat1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="途径点Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lon1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="途径点Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lat1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#000" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/path2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路线2"
android:textColor="#000"
android:textSize="25sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lon2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="开始Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lat2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lon2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="结束Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lat2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="途径点Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lon2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="途径点Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lat2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/path3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路线3"
android:textColor="#000"
android:textSize="25sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lon3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="开始Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lat3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lon3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="结束Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lat3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="途径点Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lon3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="途径点Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lat3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#000" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/path4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路线4"
android:textColor="#000"
android:textSize="25sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lon4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="开始Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lat4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lon4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="结束Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/stop_lat4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="途径点Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lon4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="途径点Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/t_lat4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F5F5F5"
tools:context=".ui.mian.MainActivity">
tools:context=".ui.MainActivity">
<include
android:id="@+id/include_title"

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="6dp"
android:layout_marginTop="10dp"
android:layout_marginRight="6dp"
android:background="#F5F5F5"
android:paddingLeft="5dp"
android:paddingRight="5dp" />
<TextView
android:id="@+id/no_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="@string/no_date"
android:textColor="#000"
android:textSize="20sp" />
</RelativeLayout>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginStart="160dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="160dp"
android:gravity="center"
android:text="选择自动驾驶线路"
android:textColor="#333333"
android:textSize="18sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_toEndOf="@+id/title"
android:background="@drawable/btn_bg"
android:text="配置"
android:textColor="@color/colorWhile"
android:textSize="16dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/title"
app:layout_constraintStart_toEndOf="@+id/title"
app:layout_constraintTop_toTopOf="@+id/title" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_margin="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center">
<EditText
android:id="@+id/et"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:digits="0123456789."
android:gravity="center"
android:hint="速度"
android:imeOptions="flagNoExtractUi"
android:inputType="number"
android:maxLength="10"
android:maxLines="1"
android:minWidth="100dp"
android:textColor="#000"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="km/h"
android:textColor="#000"
android:textSize="16sp" />
</LinearLayout>

View File

@@ -0,0 +1,225 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/layout_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/speed"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:inputType="numberDecimal"
android:maxLines="1"
android:textSize="16sp" />
<TextView
android:id="@+id/hint_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/speed"
android:text="最大限速:"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/path_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/hint_speed"
android:hint="路线名称"
android:inputType="text"
android:maxLines="1"
android:textColor="#000"
android:textSize="25sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/start_name"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:hint="开始点名称"
android:inputType="text"
android:maxLines="1"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lon"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:maxLines="1"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="开始Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/start_lat"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:maxLines="1"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/end_name"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:hint="结束点名称"
android:inputType="text"
android:maxLines="1"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/end_lon"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:maxLines="1"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="结束Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/end_lat"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:maxLines="1"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/del"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_gravity="end"
android:layout_marginEnd="15dp"
android:background="@drawable/btn_bg"
android:paddingStart="20dp"
android:paddingTop="35dp"
android:paddingEnd="20dp"
android:paddingBottom="35dp"
android:text="删\n除"
android:textColor="@drawable/text" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/hint_via"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="2dp"
android:text="途经:"
android:textColor="#000"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/layout_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/minus"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/selector_minus" />
<TextView
android:id="@+id/num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="0"
android:textSize="10sp" />
<ImageView
android:id="@+id/add"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/selector_add" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/RecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/layout_btn"
android:layout_toEndOf="@id/hint_via" />
</RelativeLayout>
</LinearLayout>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginEnd="8dp"
android:text="点1"
android:textColor="#000"
android:textSize="16sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:text="Lon"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/lon"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:maxLines="1"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:text="Lat"
android:textColor="#000"
android:textSize="16sp" />
<EditText
android:id="@+id/lat"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:maxLines="1"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/action_del"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/action_del"
android:textColor="#ffffff" />

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="2dp"
android:paddingBottom="2dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/btn_lon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_bg"
android:text="选择"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/lon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:maxLines="1"
android:text="Lon"
android:textColor="#ffffff"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="2dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/btn_lat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_bg"
android:text="选择"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/lat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:maxLines="1"
android:text="Lat"
android:textColor="#ffffff"
android:textSize="11sp" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,28 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="xyz.anndou.bank.MainActivity">
<item
android:id="@+id/action_location_item"
android:title="@string/action_del"
app:actionLayout="@layout/layout_location"
app:showAsAction="always" />
<item
android:id="@+id/action_del_item"
android:title="@string/action_del"
app:actionLayout="@layout/layout_del"
app:showAsAction="always" />
<item
android:id="@+id/action_settings_item"
android:icon="@android:drawable/ic_menu_add"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="always" />
<item
android:id="@+id/action_save_item"
android:icon="@android:drawable/ic_menu_save"
android:orderInCategory="100"
android:title="@string/action_save"
app:showAsAction="always" />
</menu>

View File

@@ -1,3 +1,7 @@
<resources>
<string name="app_name">工控机监控</string>
<string name="action_settings">添加</string>
<string name="action_save">保存</string>
<string name="action_del">删除</string>
<string name="no_date">没有数据\n请点击右上角\"⊕\"添加</string>
</resources>

View File

@@ -16,5 +16,16 @@
<item name="android:windowEnableSplitTouch">false</item>
<item name="android:splitMotionEvents">false</item>
</style>
<style name="CustomDialog" parent="Theme.MaterialComponents.Light.Dialog">
<!--背景颜色及和透明程度-->
<item name="android:windowBackground">@android:color/transparent</item>
<!--是否去除标题 -->
<item name="android:windowNoTitle">true</item>
<!--是否去除边框-->
<item name="android:windowFrame">@null</item>
<!--是否浮现在activity之上-->
<item name="android:windowIsFloating">true</item>
<!--是否模糊-->
<item name="android:backgroundDimEnabled">true</item>
</style>
</resources>

View File

@@ -57,7 +57,7 @@ class MoGoAutopilotProvider :
get() = TAG
override fun init(context: Context) {
MoGoHandAdasMsgManager.getInstance()
MoGoHandAdasMsgManager.getInstance(context)
CallerLogger.i("$M_ADAS_IMPL$TAG", "初始化工控机连接……")
mContext = context
// 初始化ADAS 域控制器

View File

@@ -47,6 +47,7 @@ import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo_msg.MogoReportMsg
import perception.TrafficLightOuterClass
import record_cache.RecordPanelOuterClass
import java.util.*
@@ -209,6 +210,13 @@ class MoGoAdasListenerImpl : OnAdasListener {
invokeAutopilotGuardian(mogoReportMessage)
}
}
//感知红绿灯
override fun onPerceptionTrafficLight(
header: MessagePad.Header?,
trafficLights: TrafficLightOuterClass.TrafficLights?
) {
}
override fun onBasicInfoReq(
header: MessagePad.Header,

View File

@@ -2,11 +2,14 @@ package com.mogo.eagle.core.function.autopilot.adapter;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MoGoConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener;
@@ -18,6 +21,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateLi
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.module.common.drawer.IdentifyDataDrawer;
@@ -38,19 +42,21 @@ public class MoGoHandAdasMsgManager implements
private final String TAG = "AdasEventManager";
private static volatile MoGoHandAdasMsgManager moGoHandAdasMsgManager;
private Context mContext;
private MoGoHandAdasMsgManager() {
private MoGoHandAdasMsgManager(Context context) {
CallerAutopilotIdentifyListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotCarConfigListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotCarStatusListenerManager.INSTANCE.addListener(TAG, this);
mContext = context;
}
public static MoGoHandAdasMsgManager getInstance() {
public static MoGoHandAdasMsgManager getInstance(Context context) {
if (moGoHandAdasMsgManager == null) {
synchronized (MoGoHandAdasMsgManager.class) {
if (moGoHandAdasMsgManager == null) {
moGoHandAdasMsgManager = new MoGoHandAdasMsgManager();
moGoHandAdasMsgManager = new MoGoHandAdasMsgManager(context);
}
}
}
@@ -102,7 +108,6 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
}
@Override
@@ -143,13 +148,13 @@ public class MoGoHandAdasMsgManager implements
//根据加速度判断 是否刹车
if (gnssInfo != null) {
//设置刹车信息
if (gnssInfo.getAcceleration() < -2.5) {
if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)) {
brakeLight = 1;
} else {
brakeLight = 0;
}
if (!isShowTurnLight) {
ThreadUtils.runOnUiThread(() -> CallerHmiManager.INSTANCE.showBrakeLight(brakeLight));
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
}
}
}

View File

@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
import com.mogo.eagle.core.utilcode.kotlin.shape
import com.mogo.eagle.core.utilcode.reminder.Reminder
import com.mogo.eagle.core.utilcode.reminder.api.impl.PopupWindowReminder
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.WindowUtils
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@@ -66,8 +67,9 @@ internal fun Context.toast(text: CharSequence, duration: Long = 2, unit: TimeUni
}
@SuppressLint("ClickableViewAccessibility")
internal fun Context.pop(content: View, width: Int, height: Int, key: String, fitSystemWindow: Boolean = true, onOuterViewClicked:((focus: View) -> Unit)? = null): () -> Unit {
internal fun Context.pop(content: View, width: Int, height: Int, key: String, onOuterViewClicked:((focus: View) -> Unit)? = null): () -> Unit {
val activity = (this as? FragmentActivity) ?: throw IllegalStateException("please use Activity to trigger pop show.")
val isImmersiveMode = BarUtils.isImmersiveMode(activity)
var tempReminder: PopupWindowReminder? = null
activity.lifecycleScope.launchWhenResumed {
val pop = PopupWindow(width, height).also {
@@ -128,7 +130,7 @@ internal fun Context.pop(content: View, width: Int, height: Int, key: String, fi
}
override fun show() {
pop.showAtLocation(activity.window.decorView, Gravity.START, 0, if (fitSystemWindow) WindowUtils.getStatusBarHeight(activity) else 0)
pop.showAtLocation(activity.window.decorView, Gravity.START, 0, if (isImmersiveMode) 0 else BarUtils.getStatusBarHeight())
}
override fun isOverride(): Boolean = false
}

View File

@@ -97,7 +97,7 @@ internal class FeedBackView : ConstraintLayout {
transitionTo(0)
} else {
editOutRect.run {
transitionTo(-( it - top + height() + 300.PX))
transitionTo(-( it - top + height() + 228.PX))
}
}
}.also {

View File

@@ -5,6 +5,7 @@ plugins {
id 'kotlin-kapt'
id 'com.alibaba.arouter'
}
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
@@ -50,39 +51,93 @@ dependencies {
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.androidxrecyclerview
implementation rootProject.ext.dependencies.flexbox
implementation rootProject.ext.dependencies.rxandroid
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
//Crash日志收集
implementation rootProject.ext.dependencies.crashSdk
implementation rootProject.ext.dependencies.boostmultidex
debugImplementation rootProject.ext.dependencies.debugleakcanary
releaseImplementation rootProject.ext.dependencies.releaseleakcanary
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.mogochainbase
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.modulecommon
compileOnly rootProject.ext.dependencies.mogoserviceapi
api rootProject.ext.dependencies.mogoaicloudservicesdk
api rootProject.ext.dependencies.mogocommons
api rootProject.ext.dependencies.modulecommon
api rootProject.ext.dependencies.mogoserviceapi
api rootProject.ext.dependencies.moduleservice
api rootProject.ext.dependencies.mogoservice
api rootProject.ext.dependencies.mogomap
api rootProject.ext.dependencies.crashreportupgrade
// api rootProject.ext.dependencies.crashreportbugly
api rootProject.ext.dependencies.mogo_core_res
api rootProject.ext.dependencies.mogo_core_data
api rootProject.ext.dependencies.mogo_core_utils
api rootProject.ext.dependencies.mogo_core_network
api rootProject.ext.dependencies.mogo_core_function_obu_mogo
api rootProject.ext.dependencies.mogo_core_function_notice
api rootProject.ext.dependencies.mogo_core_function_bindingcar
api rootProject.ext.dependencies.mogo_core_function_autopilot
api rootProject.ext.dependencies.mogo_core_function_check
api rootProject.ext.dependencies.mogo_core_function_map
api rootProject.ext.dependencies.mogo_core_function_v2x
api rootProject.ext.dependencies.mogo_core_function_monitoring
api rootProject.ext.dependencies.mogo_core_function_devatools
api rootProject.ext.dependencies.mogo_core_function_carcorder
api rootProject.ext.dependencies.mogo_core_function_call
api rootProject.ext.dependencies.mogo_core_function_api
implementation project(':libraries:map-usbcamera')
implementation rootProject.ext.dependencies.mogo_core_res
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_utils
implementation rootProject.ext.dependencies.mogo_core_network
implementation rootProject.ext.dependencies.mogo_core_function_call
} else {
implementation project(':modules:mogo-module-common')
implementation project(':services:mogo-service-api')
implementation project(':libraries:map-usbcamera')
api project(':foudations:mogo-aicloud-services-sdk')
api project(':foudations:mogo-commons')
api project(':modules:mogo-module-common')
api project(':services:mogo-service-api')
api project(':services:mogo-service')
implementation project(':core:mogo-core-res')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
implementation project(':core:mogo-core-network')
implementation project(':core:mogo-core-function-api')
implementation project(':core:mogo-core-function-call')
api project(':modules:mogo-module-service')
api project(':libraries:mogo-map')
api project(':test:crashreport-upgrade')
// api project(':test:crashreport-bugly')
api project(':test:crashreport-apmbyte')
api project(':core:mogo-core-res')
api project(':core:mogo-core-data')
api project(':core:mogo-core-utils')
api project(':core:function-impl:mogo-core-function-obu-mogo')
api project(':core:function-impl:mogo-core-function-autopilot')
api project(':core:function-impl:mogo-core-function-check')
api project(':core:function-impl:mogo-core-function-map')
api project(':core:function-impl:mogo-core-function-notice')
api project(':core:function-impl:mogo-core-function-v2x')
api project(':core:function-impl:mogo-core-function-monitoring')
api project(':core:function-impl:mogo-core-function-devatools')
api project(':core:function-impl:mogo-core-function-carcorder')
api project(':core:function-impl:mogo-core-function-dispatch')
api project(':core:function-impl:mogo-core-function-chat')
api project(':core:function-impl:mogo-core-function-bindingcar')
api project(':core:mogo-core-function-call')
api project(':core:mogo-core-function-api')
api project(':libraries:map-usbcamera')
}
}

View File

@@ -3,9 +3,73 @@
package="com.mogo.eagle.core.function.hmi">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<application>
<!-- &lt;!&ndash;保活用&ndash;&gt;
<service
android:name="com.zhidao.boot.persistent.lib.PersistentAliveService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.zhidao.boot.persistent.lib.action" />
</intent-filter>
</service>
<activity
android:name="com.zhidao.boot.persistent.lib.PersistentAliveActivity"
android:resizeableActivity="false"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
-->
<activity
android:name="com.mogo.eagle.core.function.main.MainLauncherActivity"
android:clearTaskOnLaunch="true"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
android:enabled="true"
android:launchMode="singleTop"
android:resizeableActivity="false"
android:resumeWhilePausing="true"
android:screenOrientation="landscape"
android:stateNotNeeded="true"
android:theme="@style/Main"
android:windowSoftInputMode="adjustPan|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!--调试用暂时开启LAUNCHER这个属性-->
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER_APP" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<data
android:host="launcher"
android:path="/main/switch2"
android:scheme="mogo" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<service
android:name="com.mogo.eagle.core.function.main.service.MogoMainService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.mogo.launcher.action.MAIN_SERVICE" />
</intent-filter>
</service>
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.V2XWarningBroadcastReceiver">
<intent-filter>
<action android:name="com.hmi.v2x.notification" />

View File

@@ -257,6 +257,18 @@ class DebugSettingView @JvmOverloads constructor(
}
}
tbEagleEyeController.setOnCheckedChangeListener { buttonView, isChecked ->
if(isChecked){
buttonView.setCompoundDrawables(null, null, iconDown, null)
//展示参数配置
eagleEyeControllerLayout.visibility = View.VISIBLE
}else{
buttonView.setCompoundDrawables(null, null, iconRight, null)
//隐藏参数配置
eagleEyeControllerLayout.visibility = View.GONE
}
}
/**
* 域控制器
*/
@@ -388,6 +400,8 @@ class DebugSettingView @JvmOverloads constructor(
}
}
//设置鹰眼本地参数配置监听
setEagleEyeConfigListener()
//域控制器中心事件点击监听
setDomainControllerCheckedChangeListener()
//Hmi控制中心事件点击监听
@@ -500,6 +514,39 @@ class DebugSettingView @JvmOverloads constructor(
}
/**
* 设置鹰眼本地参数配置监听
*/
private fun setEagleEyeConfigListener(){
//初始化刹车加速度阈值信息
val brakeThreshold = SharedPrefsMgr.getInstance(context)
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)
etInputBrakeThreshold.setText(brakeThreshold.toString())
etInputBrakeThreshold.text?.let { etInputBrakeThreshold.setSelection(brakeThreshold.toString().length) }
//设置刹车加速度阈值信息
btnBrakeThreshold.setOnClickListener {
val thresholdStr = etInputBrakeThreshold.text.toString()
if(thresholdStr.isNullOrEmpty()){
ToastUtils.showShort("请输入正确的判定刹车加速度阈值")
}else{
try{
val thresholdStrFloat = thresholdStr.toFloat()
if(thresholdStrFloat<0){
SharedPrefsMgr.getInstance(context).putFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,thresholdStrFloat)
ToastUtils.showShort("刹车阈值设置成功")
}else{
ToastUtils.showShort("刹车阈值加速度值应小于0")
}
}catch (e: Exception){
ToastUtils.showShort("判定刹车加速度阈值格式设置不正确")
}
}
}
}
/**
* 设置域控制器点击监听
*/

View File

@@ -25,6 +25,7 @@ import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
import com.mogo.eagle.core.function.main.service.MogoMainService;
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper;
@@ -33,7 +34,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils;
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
import com.mogo.eagle.core.utilcode.util.BarUtils;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.map.listener.IMogoHosListenerRegister;

View File

@@ -13,6 +13,7 @@ import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.service.intent.IMogoIntentListener;

View File

@@ -39,7 +39,6 @@ import com.mogo.service.IMogoServiceApis;
import com.mogo.service.cloud.socket.IMogoLifecycleListener;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants;
import com.zhidao.boot.persistent.lib.PersistentManager;
import com.zhidao.support.obu.ami.AmiClientManager;
import java.lang.reflect.Field;
@@ -354,11 +353,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
}
if (!DebugConfig.isLauncher()) {
PersistentManager
.getInstance().initManager(this);
}
CallerLogger.INSTANCE.i(M_MAIN + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
}

View File

@@ -176,9 +176,9 @@ public class SchemeIntent implements IMogoStatusChangedListener {
mApis.getAnalyticsApi().track("appenterfront", properties);
}
/*
/**
* 语音打开事件面板
* */
*/
private void handleShowEventPanel(int item) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "语音打开事件面板" + item);
//mApis.getEventPanelManager().showPanelWithSelectedItem(item);

View File

@@ -6,7 +6,8 @@ import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.View;
import com.mogo.eagle.core.function.main.R;
import com.mogo.eagle.core.function.hmi.R;
/**
* created by wujifei on 2021/3/30 14:05

Some files were not shown because too many files have changed in this diff Show More