From 874ee86a109f516ffab65533023bf4b98d0c8101 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 23 Sep 2022 17:49:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=92=AD=E4=B8=8D?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=85=A8=E6=9C=8D=E5=96=87=E5=8F=AD=EF=BC=8C?= =?UTF-8?q?=E8=B6=85=E7=9A=87=E6=96=87=E5=AD=97=E5=A2=9E=E5=8A=A0=E5=AE=B9?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/activity/LiveActivity.java | 1 + .../yunbao/live/dialog/LiveInputDialogFragment.java | 12 ++++++++++-- .../java/com/yunbao/live/utils/LiveTextRender.java | 9 ++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 91238fb2f..6260f2ce8 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -850,6 +850,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL bundle.putString(Constants.LIVE_DANMU_PRICE, mDanmuPrice); bundle.putString(Constants.COIN_NAME, mCoinName); bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_UID, mLiveUid); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveInputDialogFragment"); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java index 94d43c393..1ac176c7a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -1,5 +1,7 @@ package com.yunbao.live.dialog; +import static android.content.Context.INPUT_METHOD_SERVICE; + import android.app.Activity; import android.graphics.Color; import android.graphics.drawable.Drawable; @@ -37,12 +39,12 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; 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.List; -import static android.content.Context.INPUT_METHOD_SERVICE; - /** * Created by cxf on 2017/8/21. * 直播间发言框 @@ -97,6 +99,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); + imm = (InputMethodManager) mContext.getSystemService(INPUT_METHOD_SERVICE); mInput = (EditText) mRootView.findViewById(R.id.input); 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); 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.setFocusableInTouchMode(true); mInput.requestFocus(); diff --git a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java index 4ff1b43be..e00a38b16 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java @@ -159,8 +159,6 @@ public class LiveTextRender { } - - if (bean.isManager()) {//直播间管理员图标 Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_m); if (drawable != null) { @@ -336,15 +334,16 @@ public class LiveTextRender { } 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); - }else { + } else { builder.setSpan(new ForegroundColorSpan(color), length, length + name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } int lengthContent = builder.length(); 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); } if (bean.getType() == LiveChatBean.LIGHT) {