2. bugfix
This commit is contained in:
wangcongtao
2020-08-21 21:21:26 +08:00
parent 95d282b377
commit 998eab6d8b
4 changed files with 12 additions and 14 deletions

View File

@@ -79,22 +79,20 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
void onClickRight();
}
private boolean isShown;
private WindowManagerView windowManager;
public void show() {
try {
Logger.d(TAG, "使用windowManager实现");
if (!isShown) {
if ( windowManager == null ) {
windowManager = new WindowManagerView.Builder(
V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2).getContext()
).contentView(this).build();
windowManager.show();
isShown = true;
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
unRegisterVoiceCmd();
registerVoiceCmd();
}
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
unRegisterVoiceCmd();
registerVoiceCmd();
windowManager.show();
} catch (Exception e) {
e.printStackTrace();
}
@@ -111,10 +109,10 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
};
public void dismiss() {
if (isShown && windowManager != null) {
if (windowManager != null) {
windowManager.dismiss();
isShown = false;
}
windowManager = null;
}
//放弃求助