悬浮窗修改

This commit is contained in:
18401019693 2022-10-22 16:27:12 +08:00
parent a82d3984fa
commit 60a132489a
4 changed files with 60 additions and 57 deletions

View File

@ -30,7 +30,7 @@ import java.util.Locale;
import java.util.Random;
public class Recognizer extends RelativeLayout implements RecognizerListener {
public class Recognizer extends RelativeLayout {
private static final String TAG = "Recognizer";
private ImageView imgMic;
@ -104,17 +104,17 @@ public class Recognizer extends RelativeLayout implements RecognizerListener {
};
public void startRecognize() {
if (null == mIat) {
mIat = SpeechRecognizer.createRecognizer(getContext(), mInitListener);
}
if (mIat.isListening()) {
return;
}
setParam();
int ret = mIat.startListening(this);
if (ret != ErrorCode.SUCCESS) {
Log.e(TAG, "startRecognize ret error " + ret);
}
// if (null == mIat) {
// mIat = SpeechRecognizer.createRecognizer(getContext(), mInitListener);
// }
// if (mIat.isListening()) {
// return;
// }
// setParam();
// int ret = mIat.startListening(this);
// if (ret != ErrorCode.SUCCESS) {
// Log.e(TAG, "startRecognize ret error " + ret);
// }
}
/**
@ -267,50 +267,50 @@ public class Recognizer extends RelativeLayout implements RecognizerListener {
mResultCallBack.onResult(text);
}
}
@Override
public void onResult(RecognizerResult recognizerResult, boolean b) {
printResult(recognizerResult);
if (imgMic != null) {
imgMic.setImageResource(R.mipmap.rc_recognize_disable);
}
}
@Override
public void onError(SpeechError speechError) {
if (speechError.getErrorCode() == ErrorCode.ERROR_NO_NETWORK) {
Toast.makeText(
getContext(),
getContext().getString(R.string.load_failure),
Toast.LENGTH_SHORT)
.show();
}
if (imgMic != null) {
imgMic.setImageResource(R.mipmap.rc_recognize_disable);
}
}
@Override
public void onEvent(int eventType, int i1, int i2, Bundle bundle) {
Log.e(TAG, "RecognizerView onEvent eventType: " + eventType);
}
@Override
public void onVolumeChanged(int volume, byte[] bytes) {
changeVolume(volume);
}
@Override
public void onBeginOfSpeech() {
Log.e(TAG, "RecognizerView onBeginOfSpeech");
beginOfSpeech();
}
@Override
public void onEndOfSpeech() {
Log.e(TAG, "RecognizerView onEndOfSpeech");
endOfSpeech();
}
//
// @Override
// public void onResult(RecognizerResult recognizerResult, boolean b) {
// printResult(recognizerResult);
// if (imgMic != null) {
// imgMic.setImageResource(R.mipmap.rc_recognize_disable);
// }
// }
//
// @Override
// public void onError(SpeechError speechError) {
// if (speechError.getErrorCode() == ErrorCode.ERROR_NO_NETWORK) {
// Toast.makeText(
// getContext(),
// getContext().getString(R.string.load_failure),
// Toast.LENGTH_SHORT)
// .show();
// }
// if (imgMic != null) {
// imgMic.setImageResource(R.mipmap.rc_recognize_disable);
// }
// }
//
// @Override
// public void onEvent(int eventType, int i1, int i2, Bundle bundle) {
// Log.e(TAG, "RecognizerView onEvent eventType: " + eventType);
// }
//
// @Override
// public void onVolumeChanged(int volume, byte[] bytes) {
// changeVolume(volume);
// }
//
// @Override
// public void onBeginOfSpeech() {
// Log.e(TAG, "RecognizerView onBeginOfSpeech");
// beginOfSpeech();
// }
//
// @Override
// public void onEndOfSpeech() {
// Log.e(TAG, "RecognizerView onEndOfSpeech");
// endOfSpeech();
// }
public void setCallBack(IRecognizedResult resultCallBack) {
mResultCallBack = resultCallBack;

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

View File

@ -67,6 +67,7 @@ import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ProcessResultUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.floatingview.APPEasyFloat;
import com.yunbao.common.views.weight.VerticalViewPager;
import com.yunbao.live.R;
import com.yunbao.live.adapter.VerticalPagerAdapter;
@ -183,7 +184,8 @@ public class LiveAudienceActivity extends LiveActivity {
if (EasyFloat.isShow("LiveFloatView")) {
EasyFloat.dismiss("LiveFloatView", true);
}
IMLoginManager.get(mContext).initISHint();
APPEasyFloat.getInstance().dismiss(mContext);
IMLoginManager.get(mContext).initISHint();
}
public void setBackIndex(int backIndex) {

View File

@ -42,6 +42,7 @@ public class HintDialog extends AbsDialogFragment {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
IMLoginManager.get(mContext).initISHint();
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_set_up), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {