opt left notice
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="SuppressionsComponent">
|
||||
|
||||
@@ -9,14 +9,19 @@ import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.MogoADASWarnType;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.mogo.service.entrance.IMogoEntranceButtonController;
|
||||
|
||||
/**
|
||||
* vr模式下,adas左侧提示框帮助类
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class AdasNoticeHelper {
|
||||
public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback {
|
||||
private Context context;
|
||||
private AdasNoticeReceiver adasReceiver = new AdasNoticeReceiver();
|
||||
|
||||
@@ -27,11 +32,20 @@ public class AdasNoticeHelper {
|
||||
public void enterVrMode(){
|
||||
IntentFilter filter = new IntentFilter("com.mogo.launcher.adas.app.biz");
|
||||
context.registerReceiver(adasReceiver, filter);
|
||||
// todo 注册adas事件回调
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasWarnMessageCallback(this);
|
||||
}
|
||||
|
||||
public void exitVrMode(){
|
||||
context.unregisterReceiver(adasReceiver);
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().removeAdasWarnMessageCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveData(ADASWarnMessage msg) {
|
||||
// 处理adas识别的时间,主要是行人碰撞预警
|
||||
if (msg.type == MogoADASWarnType.ADAS_WARNING_PERSON) {
|
||||
MogoApisHandler.getInstance().getApis().getEntranceButtonController().showLeftNoticeByType(IMogoEntranceButtonController.NOTICE_TYPE_PEOPLE_WARN, R.drawable.module_ext_people_warn, "前方注意行人");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,6 +57,19 @@ public class AdasNoticeHelper {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// todo 处理发给adas的事件, 主要处理逆向超车和obu行人碰撞
|
||||
String id = intent.getStringExtra("v2x_warning_type");
|
||||
if (id != null) {
|
||||
switch (id) {
|
||||
case "100003":
|
||||
MogoApisHandler.getInstance().getApis().getEntranceButtonController().showLeftNoticeByType(IMogoEntranceButtonController.NOTICE_TYPE_PEOPLE_WARN, R.drawable.module_ext_people_warn, "前方注意行人");
|
||||
break;
|
||||
case "":
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -192,6 +192,7 @@ public class EntranceViewHolder {
|
||||
}
|
||||
|
||||
private void realShowLeftNoticeView(View view){
|
||||
leftNoticeContainer.setVisibility(View.VISIBLE);
|
||||
leftNoticeContainer.removeAllViews();
|
||||
leftNoticeContainer.addView(view);
|
||||
preAddLeftNoticeView = null;
|
||||
@@ -199,6 +200,7 @@ public class EntranceViewHolder {
|
||||
|
||||
private void realHideLeftNoticeView(View view) {
|
||||
leftNoticeContainer.removeView(view);
|
||||
leftNoticeContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void release(){
|
||||
|
||||
@@ -137,7 +137,13 @@
|
||||
android:textColor="#fff"
|
||||
android:gravity="center" />
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/module_ext_vr_mode_left_notice_container"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:visibility="gone"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/module_entrance_id_buttons_container"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -146,7 +152,7 @@
|
||||
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginBottom="@dimen/module_common_shadow_width_pos"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent">
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_ext_vr_mode_left_notice_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_entrance_id_button1"
|
||||
@@ -218,12 +224,6 @@
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/module_ext_vr_mode_left_notice_container"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
|
||||
@@ -15,6 +16,7 @@ import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.service.entrance.IMogoEntranceButtonController;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -109,6 +111,7 @@ public class V2XCarForHelpScenario extends AbsV2XScenario<Boolean> implements IM
|
||||
if (getV2XButton() != null) {
|
||||
getV2XButton().setOnActionListener(this::showDialog);
|
||||
getV2XButton().show();
|
||||
V2XServiceManager.getMogoEntranceButtonController().showLeftNoticeByType(IMogoEntranceButtonController.NOTICE_TYPE_SEEK_HELP, R.drawable.module_v2x_left_notice_seek_help, "正在发起求助...");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -117,6 +120,7 @@ public class V2XCarForHelpScenario extends AbsV2XScenario<Boolean> implements IM
|
||||
public void closeButton() {
|
||||
if (V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
|
||||
Logger.d(TAG, "关闭自车求助按钮!");
|
||||
V2XServiceManager.getMogoEntranceButtonController().hideLeftNoticeByType(IMogoEntranceButtonController.NOTICE_TYPE_SEEK_HELP);
|
||||
V2XServiceManager.getMoGoStatusManager().setSeekHelping(TAG, false);
|
||||
if (getV2XButton() != null) {
|
||||
getV2XButton().close();
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
|
||||
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.module.v2x.utils.ADASUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.service.entrance.IMogoEntranceButtonController;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Reference in New Issue
Block a user