Skip to content

Commit 6d0ab67

Browse files
committed
发送超时改变录音按钮状态
1 parent 59ce95e commit 6d0ab67

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

android/chatinput/src/main/java/cn/jiguang/imui/chatinput/ChatInputView.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ private void init(Context context, AttributeSet attrs) {
187187
// mSendBtn.setBackground(mStyle.getSendBtnBg());
188188
// mSendBtn.setImageResource(mStyle.getSendBtnIcon());
189189
}
190-
190+
public void resetVoice() {
191+
onChatVoiceTouch.reset();
192+
}
191193
public void addActionView(View view, int index) {
192194
actionLayout.addView(view, index);
193195
}
@@ -680,4 +682,6 @@ private long convertStrTimeToLong(String strTime) {
680682
}
681683
return SystemClock.elapsedRealtime() - longTime;
682684
}
685+
686+
683687
}

android/chatinput/src/main/java/cn/jiguang/imui/chatinput/record/OnChatVoiceTouch.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ private void updateTimerTip(boolean cancel) {
6868
button.setText(cancel ? text[2] : text[1]);
6969
}
7070

71+
public void reset(){
72+
button.setText(text[0]);
73+
button.setSelected(false);
74+
}
7175
private boolean isCancelled(View view, MotionEvent event) {
7276
int[] location = new int[2];
7377
view.getLocationOnScreen(location);

android/src/main/java/cn/jiguang/imui/messagelist/ReactChatInputManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,15 @@ public void onStartRecord() {
174174

175175
@Override
176176
public void onFinishRecord(String voiceFile, boolean isTooLong, int duration) {
177+
178+
177179
if (TextUtils.isEmpty(voiceFile)) {
178180
timerTipView.updateStatus(0, 2, 0);
179181
handler.sendEmptyMessageDelayed(1, 500);
180182
return;
181183
}
182184
if (isTooLong) {
185+
chatInput.resetVoice();
183186
timerTipView.updateStatus(0, 3, 0);
184187
handler.sendEmptyMessageDelayed(1, 500);
185188
} else {

0 commit comments

Comments
 (0)