diff --git a/common/src/main/java/com/yunbao/common/views/weight/Recognizer.java b/common/src/main/java/com/yunbao/common/views/weight/Recognizer.java index 1a528aa90..a4c141ce4 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/Recognizer.java +++ b/common/src/main/java/com/yunbao/common/views/weight/Recognizer.java @@ -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; diff --git a/common/src/main/res/mipmap-xxhdpi/icon_voice.png b/common/src/main/res/mipmap-xxhdpi/icon_voice.png new file mode 100644 index 000000000..2ea9d64e5 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_voice.png differ diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index eaa2a8f33..2bdd4222f 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -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) { diff --git a/main/src/main/java/com/yunbao/main/dialog/HintDialog.java b/main/src/main/java/com/yunbao/main/dialog/HintDialog.java index 269a98382..db59a3b37 100644 --- a/main/src/main/java/com/yunbao/main/dialog/HintDialog.java +++ b/main/src/main/java/com/yunbao/main/dialog/HintDialog.java @@ -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() {