Skip to content

Commit 6731ace

Browse files
committed
fix record && text color
1 parent 877bd79 commit 6731ace

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void handleMessage(Message msg) {
244244
finishRecord();
245245
} else {
246246
if (mListener != null) {
247-
mListener.onRecording(cancelAble, db, (int) intervalTime);
247+
mListener.onRecording(cancelAble, db, MAX_INTERVAL_TIME - (int) intervalTime);
248248
}
249249
}
250250
break;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void onCancelRecord() {
134134

135135
@Override
136136
public void onRecording(boolean cancelAble, int dbSize, int time) {
137-
view.updateStatus(dbSize, cancelAble ? 1 : 0, "" + time);
137+
view.updateStatus(dbSize, cancelAble ? 1 : 0, time);
138138
}
139139

140140
void hideDialog() {

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class TimerTipView extends FrameLayout {
2929
private int timerStatus = 0;
3030
private String[] timerTip = {"手指上滑,取消发送", "松开手指,取消发送", "录音时间太短", "录音时间过长"};
3131
GradientDrawable bgDrawable;
32-
private String time;
32+
private String timeStr;
3333

3434
public TimerTipView(@NonNull Context context) {
3535
this(context, null);
@@ -63,11 +63,13 @@ void init(Context context) {
6363
bgDrawable.setColor(TIP_COLOR);
6464
}
6565

66-
public void updateStatus(int level,int status,String time){
66+
public void updateStatus(int level, int status, int time) {
6767

6868

69-
if (timerStatus == 0 && !TextUtils.isEmpty(time)) {
70-
timerTipText.setText(String.format(LAST_TIME, time));
69+
if (time > 0 && time <= 10) {
70+
timeStr = "" + time;
71+
} else {
72+
timeStr = null;
7173
}
7274
updateTextStatus(status);
7375
updateImageStatus(status);
@@ -98,8 +100,8 @@ void updateTextStatus(int status) {
98100
if (status < 0 || status > 3) {
99101
updateS = 0;
100102
}
101-
if (updateS == 0 && !TextUtils.isEmpty(time)) {
102-
timerTipText.setText(String.format(LAST_TIME, time));
103+
if (updateS == 0 && !TextUtils.isEmpty(timeStr)) {
104+
timerTipText.setText(String.format(LAST_TIME, timeStr));
103105
} else {
104106
timerTipText.setText(timerTip[updateS]);
105107
}

0 commit comments

Comments
 (0)