Skip to content

Commit

Permalink
Merge pull request #279 from jpush/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
KenChoi1992 committed Mar 5, 2018
2 parents 21fa715 + 30faa6b commit e2a5289
Show file tree
Hide file tree
Showing 79 changed files with 6,211 additions and 416 deletions.
2 changes: 1 addition & 1 deletion Android/chatinput/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
PUBLISH_ARTIFACT_ID = 'chatinput'
PUBLISH_VERSION = '0.6.3'
PUBLISH_VERSION = '0.6.4'
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class ChatInputStyle extends Style {
private String inputHint;
private int inputHintColor;

private int inputDefaultPaddingLeft;
private int inputDefaultPaddingRight;
private int inputDefaultPaddingTop;
private int inputDefaultPaddingBottom;
private int inputPaddingLeft;
private int inputPaddingRight;
private int inputPaddingTop;
private int inputPaddingBottom;

private int inputCursorDrawable;

Expand Down Expand Up @@ -80,13 +80,15 @@ public static ChatInputStyle parse(Context context, AttributeSet attrs) {
style.sendBtnPressedIcon = typedArray.getResourceId(R.styleable.ChatInputView_sendBtnPressedIcon, R.drawable.aurora_menuitem_send_pres);
style.sendCountBg = typedArray.getDrawable(R.styleable.ChatInputView_sendCountBg);
style.showSelectAlbumBtn = typedArray.getBoolean(R.styleable.ChatInputView_showSelectAlbum, true);
style.inputPaddingLeft = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingLeft,
style.getDimension(R.dimen.aurora_padding_input_left));
style.inputPaddingTop = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingTop,
style.getDimension(R.dimen.aurora_padding_input_top));
style.inputPaddingRight = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingRight,
style.getDimension(R.dimen.aurora_padding_input_right));
style.inputPaddingBottom = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingBottom,
style.getDimension(R.dimen.aurora_padding_input_bottom));
typedArray.recycle();

style.inputDefaultPaddingLeft = style.getDimension(R.dimen.aurora_padding_input_left);
style.inputDefaultPaddingRight = style.getDimension(R.dimen.aurora_padding_input_right);
style.inputDefaultPaddingTop = style.getDimension(R.dimen.aurora_padding_input_top);
style.inputDefaultPaddingBottom = style.getDimension(R.dimen.aurora_padding_input_bottom);

return style;
}

Expand Down Expand Up @@ -181,20 +183,20 @@ public Drawable getSendCountBg() {
return this.sendCountBg;
}

public int getInputDefaultPaddingLeft() {
return inputDefaultPaddingLeft;
public int getInputPaddingLeft() {
return inputPaddingLeft;
}

public int getInputDefaultPaddingRight() {
return inputDefaultPaddingRight;
public int getInputPaddingRight() {
return inputPaddingRight;
}

public int getInputDefaultPaddingTop() {
return inputDefaultPaddingTop;
public int getInputPaddingTop() {
return inputPaddingTop;
}

public int getInputDefaultPaddingBottom() {
return inputDefaultPaddingBottom;
public int getInputPaddingBottom() {
return inputPaddingBottom;
}

public boolean getShowSelectAlbum() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ private void init(Context context, AttributeSet attrs) {
mChatInput.setTextColor(mStyle.getInputTextColor());
mChatInput.setHintTextColor(mStyle.getInputHintColor());
mChatInput.setBackgroundResource(mStyle.getInputEditTextBg());
mChatInput.setPadding(mStyle.getInputPaddingLeft(), mStyle.getInputPaddingTop(),
mStyle.getInputPaddingRight(), mStyle.getInputPaddingBottom());
mInputMarginLeft.getLayoutParams().width = mStyle.getInputMarginLeft();
mInputMarginRight.getLayoutParams().width = mStyle.getInputMarginRight();
mVoiceBtn.setImageResource(mStyle.getVoiceBtnIcon());
Expand Down
4 changes: 4 additions & 0 deletions Android/chatinput/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<declare-styleable name="ChatInputView">
<attr name="inputMarginLeft" format="dimension|reference" />
<attr name="inputMarginRight" format="dimension|reference" />
<attr name="inputPaddingLeft" format="dimension|reference" />
<attr name="inputPaddingTop" format="dimension|reference" />
<attr name="inputPaddingRight" format="dimension|reference" />
<attr name="inputPaddingBottom" format="dimension|reference" />
<attr name="inputEditTextBg" format="reference" />
<attr name="inputMaxLines" format="integer" />
<attr name="inputHint" format="string" />
Expand Down
4 changes: 2 additions & 2 deletions Android/chatinput/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

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

<dimen name="aurora_padding_input_left">16sp</dimen>
<dimen name="aurora_padding_input_right">16sp</dimen>
<dimen name="aurora_padding_input_left">5dp</dimen>
<dimen name="aurora_padding_input_right">5dp</dimen>
<dimen name="aurora_padding_input_top">0dp</dimen>
<dimen name="aurora_padding_input_bottom">0dp</dimen>

Expand Down
2 changes: 1 addition & 1 deletion Android/messagelist/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
PUBLISH_ARTIFACT_ID = 'messagelist'
PUBLISH_VERSION = '0.5.8'
PUBLISH_VERSION = '0.6.1'
}

android {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package cn.jiguang.imui.messages;

import android.view.View;
import android.widget.TextView;

import cn.jiguang.imui.R;
import cn.jiguang.imui.commons.models.IMessage;
import cn.jiguang.imui.view.RoundTextView;


public class EventViewHolder<MESSAGE extends IMessage>
extends BaseMessageViewHolder<MESSAGE>
implements MsgListAdapter.DefaultMessageViewHolder {

private TextView mEvent;
private RoundTextView mEvent;

public EventViewHolder(View itemView, boolean isSender) {
super(itemView);
mEvent = (TextView) itemView.findViewById(R.id.aurora_tv_msgitem_event);
mEvent = (RoundTextView) itemView.findViewById(R.id.aurora_tv_msgitem_event);
}

@Override
Expand All @@ -26,7 +26,11 @@ public void onBind(MESSAGE message) {
@Override
public void applyStyle(MessageListStyle style) {
mEvent.setTextColor(style.getEventTextColor());
mEvent.setLineSpacing(style.getEventLineSpacingExtra(), 1.0f);
mEvent.setBgColor(style.getEventBgColor());
mEvent.setBgCornerRadius(style.getEventBgCornerRadius());
mEvent.setTextSize(style.getEventTextSize());
mEvent.setPadding(style.getEventPadding(), style.getEventPadding(), style.getEventPadding(), style.getEventPadding());
mEvent.setPadding(style.getEventPaddingLeft(), style.getEventPaddingTop(),
style.getEventPaddingRight(), style.getEventPaddingBottom());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,16 @@ public void setDateTextColor(int color) {
mMsgListStyle.setDateTextColor(color);
}

public void setDatePadding(int padding) {
mMsgListStyle.setDatePadding(padding);
public void setDatePadding(int left, int top, int right, int bottom) {
mMsgListStyle.setDatePadding(left, top, right, bottom);
}

public void setDateBgCornerRadius(int radius) {
mMsgListStyle.setDateBgCornerRadius(radius);
}

public void setDateBgColor(int color) {
mMsgListStyle.setDateBgColor(color);
}

public void setEventTextColor(int color) {
Expand All @@ -162,10 +170,6 @@ public void setEventTextSize(float size) {
mMsgListStyle.setEventTextSize(size);
}

public void setEventTextPadding(int padding) {
mMsgListStyle.setEventTextPadding(padding);
}

public void setAvatarWidth(int width) {
mMsgListStyle.setAvatarWidth(width);
}
Expand All @@ -186,6 +190,18 @@ public void setShowReceiverDisplayName(boolean showDisplayName) {
mMsgListStyle.setShowReceiverDisplayName(showDisplayName);
}

public void setDisplayNameTextSize(float size) {
mMsgListStyle.setDisplayNameTextSize(size);
}

public void setDisplayNameTextColor(int color) {
mMsgListStyle.setDisplayNameTextColor(color);
}

public void setDisplayNamePadding(int left, int top, int right, int bottom) {
mMsgListStyle.setDisplayNamePadding(left, top, right, bottom);
}

public void setSendVoiceDrawable(int resId) {
mMsgListStyle.setSendVoiceDrawable(resId);
}
Expand Down Expand Up @@ -224,6 +240,38 @@ public void setLineSpacingMultiplier(float mult) {
mMsgListStyle.setLineSpacingMultiplier(mult);
}

public void setEventBgColor(int color) {
mMsgListStyle.setEventBgColor(color);
}

public void setEventPadding(int left, int top, int right, int bottom) {
mMsgListStyle.setEventTextPadding(left, top, right, bottom);
}

public void setEventLineSpacingExtra(int spacingExtra) {
mMsgListStyle.setEventLineSpacingExtra(spacingExtra);
}

public void setEventBgCornerRadius(int radius) {
mMsgListStyle.setEventBgCornerRadius(radius);
}

public void setVideoDurationTextColor(int color) {
mMsgListStyle.setVideoDurationTextColor(color);
}

public void setVideoDurationTextSize(float size) {
mMsgListStyle.setVideoDurationTextSize(size);
}

public void setVideoMessageRadius(int radius) {
mMsgListStyle.setVideoMessageRadius(radius);
}

public void setPhotoMessageRadius(int radius) {
mMsgListStyle.setPhotoMessageRadius(radius);
}

@Override
public boolean onDown(MotionEvent e) {
return false;
Expand Down
Loading

0 comments on commit e2a5289

Please sign in to comment.