Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fa4042bf42
@ -909,4 +909,9 @@ Limited ride And limited avatar frame</string>
|
|||||||
<string name="online_audience">在線觀眾</string>
|
<string name="online_audience">在線觀眾</string>
|
||||||
<string name="audience">觀眾</string>
|
<string name="audience">觀眾</string>
|
||||||
<string name="cannot_yourself">無法@自己</string>
|
<string name="cannot_yourself">無法@自己</string>
|
||||||
|
<string name="total_star_value">總星值</string>
|
||||||
|
<string name="number_of_people_assisted">助力人數</string>
|
||||||
|
<string name="star_change">%s星挑战</string>
|
||||||
|
<string name="star_success">恭喜 %s,完成了%s %s星 挑戰,快去一睹主播芳容吧!</string>
|
||||||
|
<string name="star">星</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -31,6 +31,7 @@ import com.yunbao.common.event.FollowEvent;
|
|||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
|
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.KeyBoardHeightUtil2;
|
import com.yunbao.common.utils.KeyBoardHeightUtil2;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.ProcessImageUtil;
|
import com.yunbao.common.utils.ProcessImageUtil;
|
||||||
@ -67,6 +68,7 @@ import com.yunbao.live.dialog.LiveRedPackSendDialogFragment;
|
|||||||
import com.yunbao.live.dialog.LiveShareDialogFragment;
|
import com.yunbao.live.dialog.LiveShareDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
|
import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
|
||||||
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
import com.yunbao.live.http.LiveHttpConsts;
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
|
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
|
||||||
@ -949,6 +951,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
|||||||
}
|
}
|
||||||
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
||||||
SocketRyChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType, atUserID, atUserName);
|
SocketRyChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType, atUserID, atUserName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -856,6 +856,9 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
case STAR_CHALLENGE_UPGRADE_NOTIFY:
|
case STAR_CHALLENGE_UPGRADE_NOTIFY:
|
||||||
manager.starChallengeUpgradeNotify(event.getMsgModel());
|
manager.starChallengeUpgradeNotify(event.getMsgModel());
|
||||||
break;
|
break;
|
||||||
|
case MESSAGE_BOTTOM:
|
||||||
|
manager.messageBottom();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,8 +339,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
|||||||
LiveTextRender.aiAutomaticSpeech(mContext, mTextView, bean.getAiAutomaticSpeechModel());
|
LiveTextRender.aiAutomaticSpeech(mContext, mTextView, bean.getAiAutomaticSpeechModel());
|
||||||
} else if (bean.getType() == STAR_CHALLENGE_UPGRADE_NOTIFY) {
|
} else if (bean.getType() == STAR_CHALLENGE_UPGRADE_NOTIFY) {
|
||||||
//加载.9图聊天气泡
|
//加载.9图聊天气泡
|
||||||
|
if (!TextUtils.isEmpty(bean.getMsgModel().getSystemBubble())){
|
||||||
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystemBubble(), 1);
|
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystemBubble(), 1);
|
||||||
LiveTextRender.starChallengeUpgradeNotify(mContext, mTextView, bean.getMsgModel());
|
LiveTextRender.starChallengeUpgradeNotify(mContext, mTextView, bean.getMsgModel());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (bean.getBubble() != null && !bean.getBubble().equals("")) {
|
if (bean.getBubble() != null && !bean.getBubble().equals("")) {
|
||||||
//加载.9图聊天气泡
|
//加载.9图聊天气泡
|
||||||
|
@ -147,8 +147,8 @@ public class LiveAudienceEvent extends BaseModel {
|
|||||||
AT_MESSAGE(24, "@消息"),
|
AT_MESSAGE(24, "@消息"),
|
||||||
START_MESSAGE(25, "星级消息"),
|
START_MESSAGE(25, "星级消息"),
|
||||||
AI_AUTOMATIC_SPEECH(26, "机器人助手"),
|
AI_AUTOMATIC_SPEECH(26, "机器人助手"),
|
||||||
STAR_CHALLENGE_UPGRADE_NOTIFY(27, "星级挑战成功")
|
STAR_CHALLENGE_UPGRADE_NOTIFY(27, "星级挑战成功"),
|
||||||
;
|
MESSAGE_BOTTOM(28, "聊天消息滚动到底部");
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.yunbao.live.socket;
|
package com.yunbao.live.socket;
|
||||||
|
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
@ -65,6 +67,9 @@ public class SocketSendBean {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
L.e("发送socket-->" + mResult.toString());
|
L.e("发送socket-->" + mResult.toString());
|
||||||
|
//发消息
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.MESSAGE_BOTTOM));//自动滚动到底部
|
||||||
return mResult;
|
return mResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,9 +360,23 @@ public class LiveTextRender {
|
|||||||
|
|
||||||
private static void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
private static void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||||
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||||
|
|
||||||
if (levelBean == null) {
|
if (levelBean == null) {
|
||||||
return;
|
if (textView != null) {
|
||||||
|
SpannableStringBuilder builder = createPrefix(null, bean);
|
||||||
|
int color = 0xffffdd00;
|
||||||
|
|
||||||
|
switch (bean.getType()) {
|
||||||
|
case LiveChatBean.GIFT:
|
||||||
|
builder = renderGift(color, builder, bean);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
builder = renderChat(color, builder, bean);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
textView.setText(builder);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
ImgLoader.displayDrawable(context, levelBean.getThumb(), new ImgLoader.DrawableCallback() {
|
ImgLoader.displayDrawable(context, levelBean.getThumb(), new ImgLoader.DrawableCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onLoadSuccess(Drawable drawable) {
|
public void onLoadSuccess(Drawable drawable) {
|
||||||
@ -372,7 +386,11 @@ public class LiveTextRender {
|
|||||||
if (bean.isAnchor()) {
|
if (bean.isAnchor()) {
|
||||||
color = 0xffffdd00;
|
color = 0xffffdd00;
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
color = Color.parseColor(levelBean.getColor());
|
color = Color.parseColor(levelBean.getColor());
|
||||||
|
} catch (Exception e) {
|
||||||
|
color = Color.parseColor("#ffffff");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch (bean.getType()) {
|
switch (bean.getType()) {
|
||||||
case LiveChatBean.GIFT:
|
case LiveChatBean.GIFT:
|
||||||
@ -408,6 +426,8 @@ public class LiveTextRender {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1602,4 +1602,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mLiveRoomViewHolder.starChallengeUpgradeNotify(msgModel);
|
mLiveRoomViewHolder.starChallengeUpgradeNotify(msgModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void messageBottom(){
|
||||||
|
if (mLiveRoomViewHolder != null) {
|
||||||
|
mLiveRoomViewHolder.chatScrollToBottom();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user