Skip to content

Commit e2a5289

Browse files
authored
Merge pull request #279 from jpush/dev
Dev
2 parents 21fa715 + 30faa6b commit e2a5289

File tree

79 files changed

+6211
-416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+6211
-416
lines changed

Android/chatinput/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
33
ext {
44
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
55
PUBLISH_ARTIFACT_ID = 'chatinput'
6-
PUBLISH_VERSION = '0.6.3'
6+
PUBLISH_VERSION = '0.6.4'
77
}
88

99
android {

Android/chatinput/src/main/java/cn/jiguang/imui/chatinput/ChatInputStyle.java

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public class ChatInputStyle extends Style {
2525
private String inputHint;
2626
private int inputHintColor;
2727

28-
private int inputDefaultPaddingLeft;
29-
private int inputDefaultPaddingRight;
30-
private int inputDefaultPaddingTop;
31-
private int inputDefaultPaddingBottom;
28+
private int inputPaddingLeft;
29+
private int inputPaddingRight;
30+
private int inputPaddingTop;
31+
private int inputPaddingBottom;
3232

3333
private int inputCursorDrawable;
3434

@@ -80,13 +80,15 @@ public static ChatInputStyle parse(Context context, AttributeSet attrs) {
8080
style.sendBtnPressedIcon = typedArray.getResourceId(R.styleable.ChatInputView_sendBtnPressedIcon, R.drawable.aurora_menuitem_send_pres);
8181
style.sendCountBg = typedArray.getDrawable(R.styleable.ChatInputView_sendCountBg);
8282
style.showSelectAlbumBtn = typedArray.getBoolean(R.styleable.ChatInputView_showSelectAlbum, true);
83+
style.inputPaddingLeft = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingLeft,
84+
style.getDimension(R.dimen.aurora_padding_input_left));
85+
style.inputPaddingTop = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingTop,
86+
style.getDimension(R.dimen.aurora_padding_input_top));
87+
style.inputPaddingRight = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingRight,
88+
style.getDimension(R.dimen.aurora_padding_input_right));
89+
style.inputPaddingBottom = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingBottom,
90+
style.getDimension(R.dimen.aurora_padding_input_bottom));
8391
typedArray.recycle();
84-
85-
style.inputDefaultPaddingLeft = style.getDimension(R.dimen.aurora_padding_input_left);
86-
style.inputDefaultPaddingRight = style.getDimension(R.dimen.aurora_padding_input_right);
87-
style.inputDefaultPaddingTop = style.getDimension(R.dimen.aurora_padding_input_top);
88-
style.inputDefaultPaddingBottom = style.getDimension(R.dimen.aurora_padding_input_bottom);
89-
9092
return style;
9193
}
9294

@@ -181,20 +183,20 @@ public Drawable getSendCountBg() {
181183
return this.sendCountBg;
182184
}
183185

184-
public int getInputDefaultPaddingLeft() {
185-
return inputDefaultPaddingLeft;
186+
public int getInputPaddingLeft() {
187+
return inputPaddingLeft;
186188
}
187189

188-
public int getInputDefaultPaddingRight() {
189-
return inputDefaultPaddingRight;
190+
public int getInputPaddingRight() {
191+
return inputPaddingRight;
190192
}
191193

192-
public int getInputDefaultPaddingTop() {
193-
return inputDefaultPaddingTop;
194+
public int getInputPaddingTop() {
195+
return inputPaddingTop;
194196
}
195197

196-
public int getInputDefaultPaddingBottom() {
197-
return inputDefaultPaddingBottom;
198+
public int getInputPaddingBottom() {
199+
return inputPaddingBottom;
198200
}
199201

200202
public boolean getShowSelectAlbum() {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ private void init(Context context, AttributeSet attrs) {
324324
mChatInput.setTextColor(mStyle.getInputTextColor());
325325
mChatInput.setHintTextColor(mStyle.getInputHintColor());
326326
mChatInput.setBackgroundResource(mStyle.getInputEditTextBg());
327+
mChatInput.setPadding(mStyle.getInputPaddingLeft(), mStyle.getInputPaddingTop(),
328+
mStyle.getInputPaddingRight(), mStyle.getInputPaddingBottom());
327329
mInputMarginLeft.getLayoutParams().width = mStyle.getInputMarginLeft();
328330
mInputMarginRight.getLayoutParams().width = mStyle.getInputMarginRight();
329331
mVoiceBtn.setImageResource(mStyle.getVoiceBtnIcon());

Android/chatinput/src/main/res/values/attrs.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
<declare-styleable name="ChatInputView">
77
<attr name="inputMarginLeft" format="dimension|reference" />
88
<attr name="inputMarginRight" format="dimension|reference" />
9+
<attr name="inputPaddingLeft" format="dimension|reference" />
10+
<attr name="inputPaddingTop" format="dimension|reference" />
11+
<attr name="inputPaddingRight" format="dimension|reference" />
12+
<attr name="inputPaddingBottom" format="dimension|reference" />
913
<attr name="inputEditTextBg" format="reference" />
1014
<attr name="inputMaxLines" format="integer" />
1115
<attr name="inputHint" format="string" />

Android/chatinput/src/main/res/values/dimens.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
<dimen name="aurora_textsize_input">17sp</dimen>
1313

14-
<dimen name="aurora_padding_input_left">16sp</dimen>
15-
<dimen name="aurora_padding_input_right">16sp</dimen>
14+
<dimen name="aurora_padding_input_left">5dp</dimen>
15+
<dimen name="aurora_padding_input_right">5dp</dimen>
1616
<dimen name="aurora_padding_input_top">0dp</dimen>
1717
<dimen name="aurora_padding_input_bottom">0dp</dimen>
1818

Android/messagelist/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
33
ext {
44
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
55
PUBLISH_ARTIFACT_ID = 'messagelist'
6-
PUBLISH_VERSION = '0.5.8'
6+
PUBLISH_VERSION = '0.6.1'
77
}
88

99
android {
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package cn.jiguang.imui.messages;
22

33
import android.view.View;
4-
import android.widget.TextView;
54

65
import cn.jiguang.imui.R;
76
import cn.jiguang.imui.commons.models.IMessage;
7+
import cn.jiguang.imui.view.RoundTextView;
88

99

1010
public class EventViewHolder<MESSAGE extends IMessage>
1111
extends BaseMessageViewHolder<MESSAGE>
1212
implements MsgListAdapter.DefaultMessageViewHolder {
1313

14-
private TextView mEvent;
14+
private RoundTextView mEvent;
1515

1616
public EventViewHolder(View itemView, boolean isSender) {
1717
super(itemView);
18-
mEvent = (TextView) itemView.findViewById(R.id.aurora_tv_msgitem_event);
18+
mEvent = (RoundTextView) itemView.findViewById(R.id.aurora_tv_msgitem_event);
1919
}
2020

2121
@Override
@@ -26,7 +26,11 @@ public void onBind(MESSAGE message) {
2626
@Override
2727
public void applyStyle(MessageListStyle style) {
2828
mEvent.setTextColor(style.getEventTextColor());
29+
mEvent.setLineSpacing(style.getEventLineSpacingExtra(), 1.0f);
30+
mEvent.setBgColor(style.getEventBgColor());
31+
mEvent.setBgCornerRadius(style.getEventBgCornerRadius());
2932
mEvent.setTextSize(style.getEventTextSize());
30-
mEvent.setPadding(style.getEventPadding(), style.getEventPadding(), style.getEventPadding(), style.getEventPadding());
33+
mEvent.setPadding(style.getEventPaddingLeft(), style.getEventPaddingTop(),
34+
style.getEventPaddingRight(), style.getEventPaddingBottom());
3135
}
3236
}

Android/messagelist/src/main/java/cn/jiguang/imui/messages/MessageList.java

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,16 @@ public void setDateTextColor(int color) {
150150
mMsgListStyle.setDateTextColor(color);
151151
}
152152

153-
public void setDatePadding(int padding) {
154-
mMsgListStyle.setDatePadding(padding);
153+
public void setDatePadding(int left, int top, int right, int bottom) {
154+
mMsgListStyle.setDatePadding(left, top, right, bottom);
155+
}
156+
157+
public void setDateBgCornerRadius(int radius) {
158+
mMsgListStyle.setDateBgCornerRadius(radius);
159+
}
160+
161+
public void setDateBgColor(int color) {
162+
mMsgListStyle.setDateBgColor(color);
155163
}
156164

157165
public void setEventTextColor(int color) {
@@ -162,10 +170,6 @@ public void setEventTextSize(float size) {
162170
mMsgListStyle.setEventTextSize(size);
163171
}
164172

165-
public void setEventTextPadding(int padding) {
166-
mMsgListStyle.setEventTextPadding(padding);
167-
}
168-
169173
public void setAvatarWidth(int width) {
170174
mMsgListStyle.setAvatarWidth(width);
171175
}
@@ -186,6 +190,18 @@ public void setShowReceiverDisplayName(boolean showDisplayName) {
186190
mMsgListStyle.setShowReceiverDisplayName(showDisplayName);
187191
}
188192

193+
public void setDisplayNameTextSize(float size) {
194+
mMsgListStyle.setDisplayNameTextSize(size);
195+
}
196+
197+
public void setDisplayNameTextColor(int color) {
198+
mMsgListStyle.setDisplayNameTextColor(color);
199+
}
200+
201+
public void setDisplayNamePadding(int left, int top, int right, int bottom) {
202+
mMsgListStyle.setDisplayNamePadding(left, top, right, bottom);
203+
}
204+
189205
public void setSendVoiceDrawable(int resId) {
190206
mMsgListStyle.setSendVoiceDrawable(resId);
191207
}
@@ -224,6 +240,38 @@ public void setLineSpacingMultiplier(float mult) {
224240
mMsgListStyle.setLineSpacingMultiplier(mult);
225241
}
226242

243+
public void setEventBgColor(int color) {
244+
mMsgListStyle.setEventBgColor(color);
245+
}
246+
247+
public void setEventPadding(int left, int top, int right, int bottom) {
248+
mMsgListStyle.setEventTextPadding(left, top, right, bottom);
249+
}
250+
251+
public void setEventLineSpacingExtra(int spacingExtra) {
252+
mMsgListStyle.setEventLineSpacingExtra(spacingExtra);
253+
}
254+
255+
public void setEventBgCornerRadius(int radius) {
256+
mMsgListStyle.setEventBgCornerRadius(radius);
257+
}
258+
259+
public void setVideoDurationTextColor(int color) {
260+
mMsgListStyle.setVideoDurationTextColor(color);
261+
}
262+
263+
public void setVideoDurationTextSize(float size) {
264+
mMsgListStyle.setVideoDurationTextSize(size);
265+
}
266+
267+
public void setVideoMessageRadius(int radius) {
268+
mMsgListStyle.setVideoMessageRadius(radius);
269+
}
270+
271+
public void setPhotoMessageRadius(int radius) {
272+
mMsgListStyle.setPhotoMessageRadius(radius);
273+
}
274+
227275
@Override
228276
public boolean onDown(MotionEvent e) {
229277
return false;

0 commit comments

Comments
 (0)