修改取消求助的弹窗bug
This commit is contained in:
@@ -12,10 +12,12 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
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.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -77,18 +79,26 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
void onClickRight();
|
||||
}
|
||||
|
||||
boolean isShown;
|
||||
WindowManagerView windowManager;
|
||||
private boolean isShown;
|
||||
private WindowManagerView windowManager;
|
||||
|
||||
public void show() {
|
||||
Logger.d(TAG, "使用windowManager实现");
|
||||
if (!isShown) {
|
||||
windowManager = new WindowManagerView.Builder(getContext()).contentView(R.layout.module_commons_layout_wm_dialog).build();
|
||||
windowManager.show();
|
||||
isShown = true;
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
|
||||
unRegisterVoiceCmd();
|
||||
registerVoiceCmd();
|
||||
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();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,18 +115,15 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
public void dismiss() {
|
||||
if (isShown && windowManager != null) {
|
||||
windowManager.dismiss();
|
||||
windowManager = null;
|
||||
isShown = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//放弃求助
|
||||
private void handleLeft() {
|
||||
if (mListener != null) {
|
||||
mListener.onClickLeft();
|
||||
}
|
||||
|
||||
unRegisterVoiceCmd();
|
||||
}
|
||||
|
||||
@@ -126,7 +133,6 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
mListener.onClickRight();
|
||||
}
|
||||
unRegisterVoiceCmd();
|
||||
|
||||
}
|
||||
|
||||
private void registerVoiceCmd() {
|
||||
|
||||
Reference in New Issue
Block a user