星级挑战成功
This commit is contained in:
parent
99308f5ac5
commit
b9977a3d90
@ -909,4 +909,9 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="online_audience">在線觀眾</string>
|
||||
<string name="audience">觀眾</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>
|
||||
|
@ -31,6 +31,7 @@ import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.KeyBoardHeightUtil2;
|
||||
import com.yunbao.common.utils.L;
|
||||
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.LiveUserDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
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;
|
||||
SocketRyChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType, atUserID, atUserName);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -856,6 +856,9 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
case STAR_CHALLENGE_UPGRADE_NOTIFY:
|
||||
manager.starChallengeUpgradeNotify(event.getMsgModel());
|
||||
break;
|
||||
case MESSAGE_BOTTOM:
|
||||
manager.messageBottom();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
@ -339,8 +339,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
LiveTextRender.aiAutomaticSpeech(mContext, mTextView, bean.getAiAutomaticSpeechModel());
|
||||
} else if (bean.getType() == STAR_CHALLENGE_UPGRADE_NOTIFY) {
|
||||
//加载.9图聊天气泡
|
||||
if (!TextUtils.isEmpty(bean.getMsgModel().getSystemBubble())){
|
||||
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystemBubble(), 1);
|
||||
LiveTextRender.starChallengeUpgradeNotify(mContext, mTextView, bean.getMsgModel());
|
||||
}
|
||||
} else {
|
||||
if (bean.getBubble() != null && !bean.getBubble().equals("")) {
|
||||
//加载.9图聊天气泡
|
||||
|
@ -147,8 +147,8 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
AT_MESSAGE(24, "@消息"),
|
||||
START_MESSAGE(25, "星级消息"),
|
||||
AI_AUTOMATIC_SPEECH(26, "机器人助手"),
|
||||
STAR_CHALLENGE_UPGRADE_NOTIFY(27, "星级挑战成功")
|
||||
;
|
||||
STAR_CHALLENGE_UPGRADE_NOTIFY(27, "星级挑战成功"),
|
||||
MESSAGE_BOTTOM(28, "聊天消息滚动到底部");
|
||||
|
||||
private int type;
|
||||
private String name;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.yunbao.live.socket;
|
||||
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
@ -65,6 +67,9 @@ public class SocketSendBean {
|
||||
e.printStackTrace();
|
||||
}
|
||||
L.e("发送socket-->" + mResult.toString());
|
||||
//发消息
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.MESSAGE_BOTTOM));//自动滚动到底部
|
||||
return mResult;
|
||||
}
|
||||
|
||||
|
@ -360,9 +360,23 @@ public class LiveTextRender {
|
||||
|
||||
private static void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
|
||||
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() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
@ -372,7 +386,11 @@ public class LiveTextRender {
|
||||
if (bean.isAnchor()) {
|
||||
color = 0xffffdd00;
|
||||
} else {
|
||||
try {
|
||||
color = Color.parseColor(levelBean.getColor());
|
||||
} catch (Exception e) {
|
||||
color = Color.parseColor("#ffffff");
|
||||
}
|
||||
}
|
||||
switch (bean.getType()) {
|
||||
case LiveChatBean.GIFT:
|
||||
@ -408,6 +426,8 @@ public class LiveTextRender {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1602,4 +1602,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.starChallengeUpgradeNotify(msgModel);
|
||||
}
|
||||
}
|
||||
public void messageBottom(){
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.chatScrollToBottom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user