修改主播不展示全服喇叭,超皇文字增加容错

This commit is contained in:
18401019693 2022-09-23 17:49:10 +08:00
parent f0941ffd26
commit 874ee86a10
3 changed files with 15 additions and 7 deletions

View File

@ -850,6 +850,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putString(Constants.LIVE_DANMU_PRICE, mDanmuPrice); bundle.putString(Constants.LIVE_DANMU_PRICE, mDanmuPrice);
bundle.putString(Constants.COIN_NAME, mCoinName); bundle.putString(Constants.COIN_NAME, mCoinName);
bundle.putString(Constants.LIVE_UID, mLiveUid); bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.LIVE_UID, mLiveUid);
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveInputDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveInputDialogFragment");
} }

View File

@ -1,5 +1,7 @@
package com.yunbao.live.dialog; package com.yunbao.live.dialog;
import static android.content.Context.INPUT_METHOD_SERVICE;
import android.app.Activity; import android.app.Activity;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
@ -37,12 +39,12 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static android.content.Context.INPUT_METHOD_SERVICE;
/** /**
* Created by cxf on 2017/8/21. * Created by cxf on 2017/8/21.
* 直播间发言框 * 直播间发言框
@ -97,6 +99,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
@Override @Override
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
imm = (InputMethodManager) mContext.getSystemService(INPUT_METHOD_SERVICE); imm = (InputMethodManager) mContext.getSystemService(INPUT_METHOD_SERVICE);
mInput = (EditText) mRootView.findViewById(R.id.input); mInput = (EditText) mRootView.findViewById(R.id.input);
radioHornType = mRootView.findViewById(R.id.radio_horn_type); radioHornType = mRootView.findViewById(R.id.radio_horn_type);
@ -104,6 +107,11 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
RadioButton radioButton = mRootView.findViewById(id); RadioButton radioButton = mRootView.findViewById(id);
radioHornTypes.add(radioButton); radioHornTypes.add(radioButton);
} }
if (mContext instanceof LiveRyAnchorActivity) {
findViewById(R.id.btn_2).setVisibility(View.GONE);
} else {
findViewById(R.id.btn_2).setVisibility(View.VISIBLE);
}
mInput.setFocusable(true); mInput.setFocusable(true);
mInput.setFocusableInTouchMode(true); mInput.setFocusableInTouchMode(true);
mInput.requestFocus(); mInput.requestFocus();

View File

@ -159,8 +159,6 @@ public class LiveTextRender {
} }
if (bean.isManager()) {//直播间管理员图标 if (bean.isManager()) {//直播间管理员图标
Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_m); Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_m);
if (drawable != null) { if (drawable != null) {
@ -336,7 +334,8 @@ public class LiveTextRender {
} }
builder.append(name); builder.append(name);
//超皇设置渐变色展示昵称 //超皇设置渐变色展示昵称
if (TextUtils.equals("7",bean.getNobleId())){ if (TextUtils.equals("7", bean.getNobleId()) && !TextUtils.isEmpty(bean.getStartColor())) {
builder.setSpan(new LinearGradientFontSpan(Color.parseColor(bean.getStartColor()), Color.parseColor(bean.getEndColor())), length, length + name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new LinearGradientFontSpan(Color.parseColor(bean.getStartColor()), Color.parseColor(bean.getEndColor())), length, length + name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
} else { } else {
builder.setSpan(new ForegroundColorSpan(color), length, length + name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new ForegroundColorSpan(color), length, length + name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
@ -344,7 +343,7 @@ public class LiveTextRender {
int lengthContent = builder.length(); int lengthContent = builder.length();
builder.append(bean.getContent()); builder.append(bean.getContent());
//超皇设置渐变色展示昵称 //超皇设置渐变色展示昵称
if (TextUtils.equals("7",bean.getNobleId())){ if (TextUtils.equals("7", bean.getNobleId()) && !TextUtils.isEmpty(bean.getContentColor())) {
builder.setSpan(new ForegroundColorSpan(Color.parseColor(bean.getContentColor())), lengthContent, lengthContent + bean.getContent().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new ForegroundColorSpan(Color.parseColor(bean.getContentColor())), lengthContent, lengthContent + bean.getContent().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
} }
if (bean.getType() == LiveChatBean.LIGHT) { if (bean.getType() == LiveChatBean.LIGHT) {