Skip to content

Commit 2b2b681

Browse files
guangyaoguangyao
authored andcommitted
2 parents 27f2d5c + 5e9747f commit 2b2b681

File tree

32 files changed

+351
-131
lines changed

32 files changed

+351
-131
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
@@ -57,7 +57,7 @@ public void startRecording() {
5757
recorder = new MediaRecorder();
5858
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
5959
recorder.setMaxDuration(MAX_INTERVAL_TIME * 1000);
60-
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
60+
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
6161
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
6262
// recorder.setAudioEncodingBitRate();
6363
// recorder.setAudioSamplingRate();

android/emoji/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/build
2+
*.iml

android/messagelist/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ dependencies {
2626
compile fileTree(include: ['*.jar'], dir: 'libs')
2727
compile project(':react-native-imui:emoji')
2828
compile project(':react-native-imui:photoViewPagerview')
29+
30+
compile 'com.facebook.fresco:fresco:1.0.1'
2931
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
3032
exclude group: 'com.android.support', module: 'support-annotations'
3133
})

android/messagelist/proguard-rules.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@
2727
public static int d(...);
2828
public static int e(...);
2929
}
30+

android/messagelist/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="cn.jiguang.imui">
33

4+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
46
<application
57
android:allowBackup="true"
68
android:supportsRtl="true">

android/messagelist/src/main/java/cn/jiguang/imui/commons/models/IMessage.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ enum MessageType {
8888
* Status of message, enum.
8989
*/
9090
enum MessageStatus {
91-
READED,
92-
CREATED,
93-
SEND_GOING,
91+
RECEIVE_UNREAD,
92+
RECEIVE_READ,
93+
SEND_SENDING,
9494
SEND_SUCCEED,
95-
SEND_FAILED,
95+
SEND_FAILE,
9696
SEND_DRAFT,
97-
RECEIVE_GOING,
98-
RECEIVE_SUCCEED,
99-
RECEIVE_FAILED;
97+
SEND_SUCCESS;
10098
}
10199

102100
MessageStatus getMessageStatus();
103101

102+
void setMessageStatus(MessageStatus status);
103+
104104

105105
IExtend getExtend();
106106

@@ -113,5 +113,5 @@ enum MessageStatus {
113113

114114
String getThumb();
115115

116-
String getProgress();
116+
// String getProgress();
117117
}

android/messagelist/src/main/java/cn/jiguang/imui/messages/viewholder/AvatarViewHolder.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ public void onBind(final MESSAGE message) {
7070
}
7171
} else {
7272
switch (message.getMessageStatus()) {
73-
case SEND_GOING:
73+
case SEND_SENDING:
7474
mSendingPb.setVisibility(View.VISIBLE);
7575
mResendIb.setVisibility(View.INVISIBLE);
7676
Log.i("TxtViewHolder", "sending message");
7777
break;
78-
case SEND_FAILED:
78+
case SEND_FAILE:
7979
mSendingPb.setVisibility(View.GONE);
8080
Log.i("TxtViewHolder", "send message failed");
8181
mResendIb.setVisibility(View.VISIBLE);
@@ -89,10 +89,16 @@ public void onClick(View v) {
8989
});
9090
break;
9191
case SEND_SUCCEED:
92+
case RECEIVE_READ:
93+
case RECEIVE_UNREAD:
9294
mSendingPb.setVisibility(View.GONE);
9395
mResendIb.setVisibility(View.INVISIBLE);
9496
Log.i("TxtViewHolder", "send message succeed");
9597
break;
98+
default:
99+
mSendingPb.setVisibility(View.GONE);
100+
mResendIb.setVisibility(View.INVISIBLE);
101+
break;
96102
}
97103
}
98104

android/messagelist/src/main/java/cn/jiguang/imui/messages/viewholder/CustonViewHolder.java

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cn.jiguang.imui.messages.viewholder;
22

3+
import android.graphics.Color;
34
import android.support.v7.widget.RecyclerView;
45
import android.util.Log;
56
import android.view.View;
@@ -28,7 +29,7 @@ public void onBind(final MESSAGE message) {
2829
// mMsgTv.setText(message.getText());
2930
String mText = message.getText();
3031

31-
mMsgTv.setText(mText);
32+
mMsgTv.setText("暂不支持该消息类型");
3233

3334
mMsgTv.setOnClickListener(new View.OnClickListener() {
3435
@Override
@@ -57,39 +58,8 @@ public boolean onLongClick(View view) {
5758
@Override
5859
public void applyStyle(MessageListStyle style) {
5960
mMsgTv.setMaxWidth((int) (style.getWindowWidth() * style.getBubbleMaxWidth()));
60-
if (mIsSender) {
61-
mMsgTv.setBackground(style.getSendBubbleDrawable());
62-
mMsgTv.setTextColor(style.getSendBubbleTextColor());
63-
mMsgTv.setTextSize(style.getSendBubbleTextSize());
64-
mMsgTv.setPadding(style.getSendBubblePaddingLeft(),
65-
style.getSendBubblePaddingTop(),
66-
style.getSendBubblePaddingRight(),
67-
style.getSendBubblePaddingBottom());
68-
if (style.getSendingProgressDrawable() != null) {
69-
mSendingPb.setProgressDrawable(style.getSendingProgressDrawable());
70-
}
71-
if (style.getSendingIndeterminateDrawable() != null) {
72-
mSendingPb.setIndeterminateDrawable(style.getSendingIndeterminateDrawable());
73-
}
74-
} else {
75-
mMsgTv.setBackground(style.getReceiveBubbleDrawable());
76-
mMsgTv.setTextColor(style.getReceiveBubbleTextColor());
77-
mMsgTv.setTextSize(style.getReceiveBubbleTextSize());
78-
mMsgTv.setPadding(style.getReceiveBubblePaddingLeft(),
79-
style.getReceiveBubblePaddingTop(),
80-
style.getReceiveBubblePaddingRight(),
81-
style.getReceiveBubblePaddingBottom());
82-
if (style.getShowDisplayName() == 1) {
83-
mDisplayNameTv.setVisibility(View.VISIBLE);
84-
}
85-
}
86-
mDateTv.setTextSize(style.getDateTextSize());
87-
mDateTv.setTextColor(style.getDateTextColor());
88-
89-
android.view.ViewGroup.LayoutParams layoutParams = mAvatarIv.getLayoutParams();
90-
layoutParams.width = style.getAvatarWidth();
91-
layoutParams.height = style.getAvatarHeight();
92-
mAvatarIv.setLayoutParams(layoutParams);
61+
mMsgTv.setTextSize(17);
62+
mMsgTv.setLinkTextColor(Color.rgb(173,0,151));
9363
}
9464

9565

android/messagelist/src/main/java/cn/jiguang/imui/messages/viewholder/NotificationViewHolder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void onBind(MESSAGE message) {
3232
@Override
3333
public void applyStyle(MessageListStyle style) {
3434

35-
mEvent.setTextColor(Color.rgb(157, 157, 158));
35+
mEvent.setTextColor(Color.WHITE);
3636
mEvent.setTextSize(style.getEventTextSize());
3737
mEvent.setPadding(style.getEventPadding(), style.getEventPadding(), style.getEventPadding(), style.getEventPadding());
3838
}

android/messagelist/src/main/java/cn/jiguang/imui/messages/viewholder/VideoViewHolder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public void onBind(final MESSAGE message) {
3232
super.onBind(message);
3333

3434
IMediaFile ext = getExtend(message);
35-
if(ext==null){
35+
if (ext == null) {
3636
return;
3737
}
38-
mImageLoader.loadImage(mImageCover,ext.getThumbPath());
38+
mImageLoader.loadImage(mImageCover, ext.getThumbPath());
3939
mImageCover.setOnClickListener(new View.OnClickListener() {
4040
@Override
4141
public void onClick(View view) {

0 commit comments

Comments
 (0)