Skip to content

Commit 0ba0b38

Browse files
committed
fix ui
1 parent 44f5cc1 commit 0ba0b38

File tree

12 files changed

+28
-18
lines changed

12 files changed

+28
-18
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ public boolean onLongClick(View view) {
5959
@Override
6060
public void applyStyle(MessageListStyle style) {
6161
super.applyStyle(style);
62-
if (mIsSender) {
63-
mPhotoIv.setBackground(style.getSendPhotoMsgBg());
64-
} else {
65-
mPhotoIv.setBackground(style.getReceivePhotoMsgBg());
66-
}
62+
63+
mPhotoIv.setScaleType(ImageView.ScaleType.FIT_END);
64+
// if (mIsSender) {
65+
// mPhotoIv.setBackground(style.getSendPhotoMsgBg());
66+
// } else {
67+
// mPhotoIv.setBackground(style.getReceivePhotoMsgBg());
68+
// }
6769
}
6870

6971
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public void onBind(MESSAGE message) {
3232

3333
@Override
3434
public void applyStyle(MessageListStyle style) {
35+
3536
mEvent.setTextColor(Color.WHITE);
36-
mEvent.setTextSize(style.getEventTextSize());
37+
mEvent.setTextSize(12);
3738
mEvent.setPadding(style.getEventPadding(), style.getEventPadding(), style.getEventPadding(), style.getEventPadding());
3839
}
3940
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public boolean onLongClick(View view) {
7777
public void applyStyle(MessageListStyle style) {
7878
super.applyStyle(style);
7979
mMsgTv.setMaxWidth((int) (style.getWindowWidth() * style.getBubbleMaxWidth()));
80-
mMsgTv.setTextSize(17);
80+
mMsgTv.setTextSize(22);
8181
mMsgTv.setTextColor(mIsSender ? Color.WHITE : Color.BLACK);
8282
mMsgTv.setLinkTextColor(mIsSender ? Color.parseColor("#bbdcff") : Color.parseColor("#238dfa"));
8383

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import cn.jiguang.imui.commons.models.IMessage;
2222
import cn.jiguang.imui.messages.MessageListStyle;
2323
import cn.jiguang.imui.messages.ViewHolderController;
24+
import cn.jiguang.imui.utils.DisplayUtil;
2425
import cn.jiguang.imui.utils.SessorUtil;
2526
import cn.jiguang.imui.utils.TimeUtil;
2627

@@ -211,6 +212,7 @@ public void applyStyle(MessageListStyle style) {
211212
if (mIsSender) {
212213
mVoiceIv.setImageResource(mSendDrawable);
213214
mMsgTv.setBackground(style.getSendBubbleDrawable());
215+
mMsgTv.setPadding(0,DisplayUtil.dp2px(style.mContext,12),DisplayUtil.dp2px(style.mContext,3),DisplayUtil.dp2px(style.mContext,12));
214216
if (style.getSendingProgressDrawable() != null) {
215217
mSendingPb.setProgressDrawable(style.getSendingProgressDrawable());
216218
}
@@ -220,13 +222,8 @@ public void applyStyle(MessageListStyle style) {
220222
} else {
221223
mVoiceIv.setImageResource(mReceiveDrawable);
222224
mMsgTv.setBackground(style.getReceiveBubbleDrawable());
225+
mMsgTv.setPadding(DisplayUtil.dp2px(style.mContext,3),DisplayUtil.dp2px(style.mContext,12),0,DisplayUtil.dp2px(style.mContext,12));
223226
}
224-
225-
android.view.ViewGroup.LayoutParams layoutParams = mAvatarIv.getLayoutParams();
226-
layoutParams.width = style.getAvatarWidth();
227-
layoutParams.height = style.getAvatarHeight();
228-
mAvatarIv.setLayoutParams(layoutParams);
229-
230227
mLengthTv.setTextColor(Color.rgb(157, 157, 158));
231228
}
232229

android/messagelist/src/main/res/layout/item_receive_photo.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@
2626
android:id="@+id/aurora_iv_msgitem_photo"
2727
android:layout_width="wrap_content"
2828
android:layout_height="wrap_content"
29+
android:maxHeight="@dimen/photo_width"
30+
android:maxWidth="@dimen/photo_width"
2931
android:layout_below="@id/aurora_tv_msgitem_display_name"
3032
android:layout_centerVertical="true"
3133
android:layout_marginLeft="@dimen/aurora_avatar_padding"
3234
android:layout_toRightOf="@id/aurora_iv_msgitem_avatar"
3335
android:background="@drawable/aurora_bg_imagemsg_default"
3436
android:src="@drawable/aurora_picture_not_found"
35-
app:videomessage_radius="8dp" />
37+
app:videomessage_radius="8dp"
38+
/>
3639

3740
</RelativeLayout>
3841
</LinearLayout>

android/messagelist/src/main/res/layout/item_receive_voice.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232

3333
<TextView
34+
android:paddingTop="@dimen/voice_padding"
35+
android:paddingBottom="@dimen/voice_padding"
3436
android:id="@+id/aurora_tv_msgitem_message"
3537
android:layout_width="wrap_content"
3638
android:layout_height="wrap_content"

android/messagelist/src/main/res/layout/item_send_photo.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
android:layout_height="wrap_content"
4040
android:layout_marginRight="8dp"
4141
android:background="@drawable/aurora_bg_imagemsg_default"
42-
android:maxHeight="300dp"
43-
android:maxWidth="300dp"
42+
android:maxHeight="@dimen/photo_width"
43+
android:maxWidth="@dimen/photo_width"
4444
android:src="@drawable/aurora_picture_not_found"
4545
app:videomessage_radius="8dp" />
4646

android/messagelist/src/main/res/layout/item_send_voice.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
android:gravity="right">
2323

2424
<TextView
25+
android:paddingTop="@dimen/voice_padding"
26+
android:paddingBottom="@dimen/voice_padding"
2527
android:id="@+id/aurora_tv_msgitem_message"
2628
android:layout_width="wrap_content"
2729
android:layout_height="wrap_content"

android/messagelist/src/main/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@
5353
<attr name="receivePhotoMsgBg" format="reference"/>
5454

5555
<attr name="videomessage_radius" format="dimension|reference"/>
56+
<attr name="videomessage_shape" format="reference"/>
5657
</declare-styleable>
5758
</resources>

android/messagelist/src/main/res/values/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<color name="aurora_msg_send_bubble_selected_color">#0e63f0</color>
1717
<color name="aurora_msg_send_text_color">@color/white</color>
1818
<!--receive_bubble-->
19-
<color name="aurora_msg_receive_bubble_default_color">#e7ebef</color>
19+
<color name="aurora_msg_receive_bubble_default_color">#ffffff</color>
2020
<color name="aurora_msg_receive_bubble_pressed_color">#c9d3dd</color>
2121
<color name="aurora_msg_receive_bubble_selected_color">#d3d9df</color>
2222
<color name="aurora_msg_receive_text_color">@color/black</color>

0 commit comments

Comments
 (0)