修复测试反馈问题
This commit is contained in:
parent
0d52db8edb
commit
f5849a3ca2
@ -24,6 +24,7 @@ import com.yunbao.common.utils.WordUtil;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import io.rong.imkit.conversation.extension.RongExtension;
|
||||
import io.rong.imkit.manager.AudioPlayManager;
|
||||
import io.rong.imkit.manager.AudioRecordManager;
|
||||
@ -64,6 +65,7 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
}
|
||||
|
||||
private boolean isAudio;
|
||||
private boolean isDownload=false;
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
@ -83,6 +85,7 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
System.out.println("点击事件 没权限掉了");
|
||||
return true;
|
||||
} else {
|
||||
isDownload=true;
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
System.out.println("点击事件:点下 isAudio = " + isAudio);
|
||||
if (isAudio) {
|
||||
@ -100,6 +103,7 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
}
|
||||
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
isDownload=false;
|
||||
if (isAudio) {
|
||||
onUp(v, event);
|
||||
}
|
||||
@ -118,6 +122,11 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
|
||||
private void toToken(View v, float mLastTouchY) {
|
||||
System.out.println("点击事件:调用token");
|
||||
if(!isDownload){
|
||||
ToastUtil.show("过短,结束");
|
||||
AudioRecordManager.getInstance().stopRecord();
|
||||
return;
|
||||
}
|
||||
SendMessageManager.sendMessageForAudio(targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
@ -132,6 +141,8 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == OnSendMessageListener.STATUS_NOT_PRICE) {
|
||||
AudioRecordManager.getInstance().stopRecord();
|
||||
mUpDirection = false;
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_text_tips), msg))
|
||||
@ -180,10 +191,10 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
|
||||
private boolean onUp(View v, MotionEvent event) {
|
||||
AudioRecordManager.getInstance().stopRecord();
|
||||
isAudio = false;
|
||||
if (mUpDirection) {
|
||||
ToastUtil.show("取消发送");
|
||||
SendMessageManager.cancel(token);
|
||||
isAudio = false;
|
||||
return false;
|
||||
}
|
||||
SendMessageManager.onCallSuccess(token, new OnSendMessageListener() {
|
||||
@ -191,7 +202,6 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
ToastUtil.show(msg);
|
||||
isAudio = false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user