fix: bug fix
This commit is contained in:
@@ -40,23 +40,24 @@ public class UpMicAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
||||
this.upUid = upUid;
|
||||
List<String> list = new ArrayList<>();
|
||||
int size;
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
size = 2;
|
||||
} else if (AvRoomDataManager.get().isSingleRoom()) {
|
||||
size = 4;
|
||||
} else if (AvRoomDataManager.get().isOpenGame()) {
|
||||
size = 6;
|
||||
} else if (AvRoomDataManager.get().isPartyRoom()) {
|
||||
size = 10;
|
||||
} else if (AvRoomDataManager.get().isRevelryRoom()) {
|
||||
size = 15;
|
||||
}else if (AvRoomDataManager.get().is19Room()) {
|
||||
size = 19;
|
||||
} else if (AvRoomDataManager.get().is20Room()) {
|
||||
size = 20;
|
||||
} else {
|
||||
size = 9;
|
||||
}
|
||||
size = AvRoomDataManager.get().getMicSize();
|
||||
// if (AvRoomDataManager.get().isCpRoom()) {
|
||||
// size = 2;
|
||||
// } else if (AvRoomDataManager.get().isSingleRoom()) {
|
||||
// size = 4;
|
||||
// } else if (AvRoomDataManager.get().isHomeParty()) {
|
||||
// size = 9;
|
||||
// }else if (AvRoomDataManager.get().isPartyRoom()) {
|
||||
// size = 10;
|
||||
// } else if (AvRoomDataManager.get().isRevelryRoom()) {
|
||||
// size = 15;
|
||||
// }else if (AvRoomDataManager.get().is19Room()) {
|
||||
// size = 19;
|
||||
// } else if (AvRoomDataManager.get().is20Room()) {
|
||||
// size = 20;
|
||||
// } else {
|
||||
// size = 9;
|
||||
// }
|
||||
for (int i = 0; i < size; i++) {
|
||||
list.add("");
|
||||
}
|
||||
|
@@ -2225,6 +2225,17 @@ public class MessageView extends FrameLayout {
|
||||
TextSpannableBuilder text = new TextSpannableBuilder(tvContent);
|
||||
addCommonTag(chatRoomMessage, text, tvContent);
|
||||
String nickName = extension == null ? ResUtil.getString(R.string.avroom_widget_messageview_0116) : RegexUtil.getPrintableString(extension.getSenderNick());
|
||||
|
||||
if (UserInfoHelper.isDefNick(nickName)) {
|
||||
HashMap<String, Object> map = UserInfoHelper.getChatRoomMessageUserInfo(chatRoomMessage, chatRoomMessage.getFromAccount());
|
||||
if (map != null) {
|
||||
Object nick = map.get(UserInfo.NICK);
|
||||
if (nick != null && nick instanceof String) {
|
||||
nickName = nick.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
text.append(nickName, new ForegroundColorSpan(greyColor))
|
||||
.append(": " + chatRoomMessage.getContent(), new ForegroundColorSpan(getResources().getColor(R.color.white)));
|
||||
List<String> atUids = ExtensionUtil.getListExtension(chatRoomMessage, UserInfo.AT_UIDS);
|
||||
@@ -2250,9 +2261,10 @@ public class MessageView extends FrameLayout {
|
||||
if (Objects.equals(chatRoomMessage.getFromAccount(), String.valueOf(AuthModel.get().getCurrentUid()))) {
|
||||
tvContent.setOnLongClickListener(null);
|
||||
} else {
|
||||
String finalNickName = nickName;
|
||||
tvContent.setOnLongClickListener(v -> {
|
||||
if (onLongClickListener != null) {
|
||||
onLongClickListener.onLongClick(v, chatRoomMessage.getFromAccount(), nickName);
|
||||
onLongClickListener.onLongClick(v, chatRoomMessage.getFromAccount(), finalNickName);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
@@ -99,9 +99,11 @@ class HomeRecommendFragment : BaseViewBindingFragment<FragmentHomeRecommendBindi
|
||||
private fun initListener() {
|
||||
binding.refreshLayout.setOnRefreshListener {
|
||||
it.finishRefresh()
|
||||
childFragmentManager.fragments.forEach {
|
||||
(it as? OnRefreshListener)?.onRefresh()
|
||||
}
|
||||
try {
|
||||
childFragmentManager?.fragments?.forEach {
|
||||
(it as? OnRefreshListener)?.onRefresh()
|
||||
}
|
||||
} catch (e: Exception) { }
|
||||
|
||||
if (!tabList.isVerify()){
|
||||
homeViewModel.getHomeTabInfo()
|
||||
|
@@ -4,13 +4,11 @@ import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.common.widget.CircleImageView;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
@@ -19,6 +17,7 @@ import com.chwl.core.room.pk.bean.PKTeamInfo;
|
||||
import com.chwl.core.room.queue.bean.MicMemberInfo;
|
||||
import com.chwl.library.utils.ListUtils;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -99,12 +98,20 @@ public class GiftAvatarAdapter extends RecyclerView.Adapter<GiftAvatarAdapter.Vi
|
||||
// 强制给一个透明的边框,避免因为复用导致的出现边框
|
||||
holder.avatar.setBorderColor(context.getResources().getColor(R.color.transparent));
|
||||
|
||||
if (micMemberInfo.getMicPosition() == AvRoomDataManager.POSITION_BOSS_MIC) {
|
||||
holder.micNumber.setText(ResUtil.getString(R.string.ui_widget_giftavataradapter_01));
|
||||
} else if (micMemberInfo.getMicPosition() == AvRoomDataManager.POSITION_VIP_MIC) {
|
||||
holder.micNumber.setText("VIP");
|
||||
if (AvRoomDataManager.get().isPartyRoom()) {
|
||||
if (micMemberInfo.getMicPosition() == AvRoomDataManager.POSITION_BOSS_MIC) {
|
||||
holder.micNumber.setText(ResUtil.getString(R.string.ui_widget_giftavataradapter_01));
|
||||
} else if (micMemberInfo.getMicPosition() == AvRoomDataManager.POSITION_VIP_MIC) {
|
||||
holder.micNumber.setText("VIP");
|
||||
} else {
|
||||
holder.micNumber.setText(String.valueOf(micMemberInfo.getMicPosition() + 1));
|
||||
}
|
||||
} else {
|
||||
holder.micNumber.setText(String.valueOf(micMemberInfo.getMicPosition() + 1));
|
||||
if (micMemberInfo.getMicPosition() == AvRoomDataManager.POSITION_VIP_MIC) {
|
||||
holder.micNumber.setText("VIP");
|
||||
} else {
|
||||
holder.micNumber.setText(String.valueOf(micMemberInfo.getMicPosition() + 2));
|
||||
}
|
||||
}
|
||||
|
||||
if (micMemberInfo.isInPkMode()) {
|
||||
|
@@ -1373,12 +1373,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
return;
|
||||
}
|
||||
if (!userOnMic && uid > 0) {
|
||||
if (uid == AuthModel.get().getCurrentUid()) {
|
||||
SingleToastUtil.showToast(ResUtil.getString(R.string.send_gift_to_self_tips));
|
||||
sendGiftButton.setText(ResUtil.getString(R.string.ui_widget_giftdialog_026));
|
||||
sendGiftButton.setEnabled(true);
|
||||
return;
|
||||
}
|
||||
// if (uid == AuthModel.get().getCurrentUid()) {
|
||||
// SingleToastUtil.showToast(ResUtil.getString(R.string.send_gift_to_self_tips));
|
||||
// sendGiftButton.setText(ResUtil.getString(R.string.ui_widget_giftdialog_026));
|
||||
// sendGiftButton.setEnabled(true);
|
||||
// return;
|
||||
// }
|
||||
ArrayList<MicMemberInfo> targetUids = new ArrayList<>();
|
||||
MicMemberInfo micMemberInfo = new MicMemberInfo();
|
||||
micMemberInfo.setAccount(String.valueOf(uid));
|
||||
|
@@ -150,8 +150,8 @@ class EffectView : FrameLayout {
|
||||
|
||||
private fun loadImg(resource: File) {
|
||||
"EffectView loadImg() ".doLog(mNeedLog)
|
||||
try {
|
||||
this@EffectView.post {
|
||||
this@EffectView.post {
|
||||
try {
|
||||
|
||||
val fis = FileInputStream(resource)
|
||||
val bitmap = BitmapFactory.decodeStream(fis)
|
||||
@@ -186,12 +186,13 @@ class EffectView : FrameLayout {
|
||||
imageView.setImageBitmap(bitmap)
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
playCallBack(false)
|
||||
"EffectView loadImg() false".doLog(mNeedLog)
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
playCallBack(false)
|
||||
"EffectView loadImg() false".doLog(mNeedLog)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun loadMp4(resource: File) {
|
||||
|
@@ -98,7 +98,7 @@
|
||||
android:textStyle="bold"
|
||||
android:textSize="36sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sentUserAvatar"
|
||||
app:layout_constraintStart_toEndOf="@+id/giftImg"
|
||||
app:layout_constraintStart_toEndOf="@+id/bagImg"
|
||||
app:layout_constraintTop_toTopOf="@id/sentUserAvatar"
|
||||
tools:text="x1111111" />
|
||||
|
||||
|
@@ -858,6 +858,8 @@ public final class AvRoomDataManager {
|
||||
}
|
||||
}
|
||||
|
||||
public int getMicSize(){ return mMicQueueMemberMap.size();}
|
||||
|
||||
/**
|
||||
* 是否是房主或管理员
|
||||
*
|
||||
|
@@ -7,7 +7,7 @@ import android.net.Uri
|
||||
import android.provider.MediaStore
|
||||
import android.text.TextUtils
|
||||
import com.chwl.library.common.application.BaseApp
|
||||
import com.chwl.library.common.base.BaseDialogFragment
|
||||
import com.chwl.library.common.base.BaseCommonDialogFragment
|
||||
import com.chwl.library.common.util.PhotoCompressUtil
|
||||
import com.chwl.library.common.util.PhotosCompressCallback
|
||||
import com.chwl.library.utils.ResUtil
|
||||
@@ -39,7 +39,7 @@ abstract class PickImageActionNew protected constructor(
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == BaseDialogFragment.RESULT_OK) {
|
||||
if (resultCode == BaseCommonDialogFragment.RESULT_OK) {
|
||||
when (requestCode) {
|
||||
NimPhotoPickActivity.PICK_ACT_RESULT and 0xff -> {
|
||||
try {
|
||||
|
@@ -2,12 +2,17 @@ package com.netease.nim.uikit.business.uinfo;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.netease.nim.uikit.R;
|
||||
import com.netease.nim.uikit.api.NimUIKit;
|
||||
import com.netease.nim.uikit.business.team.helper.TeamHelper;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessageExtension;
|
||||
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
|
||||
import com.netease.nimlib.sdk.uinfo.model.UserInfo;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class UserInfoHelper {
|
||||
|
||||
@@ -65,4 +70,23 @@ public class UserInfoHelper {
|
||||
|
||||
return getUserDisplayName(account);
|
||||
}
|
||||
|
||||
public static HashMap<String,Object> getChatRoomMessageUserInfo(ChatRoomMessage chatRoomMessage, String uid) {
|
||||
try {
|
||||
ChatRoomMessageExtension chatRoomMessageExtension = chatRoomMessage.getChatRoomMessageExtension();
|
||||
if (chatRoomMessageExtension != null) {
|
||||
Map<String, Object> senderExtension = chatRoomMessageExtension.getSenderExtension();
|
||||
if (senderExtension != null) {
|
||||
return (HashMap<String, Object>) senderExtension.get(uid);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isDefNick(String nick) {
|
||||
return nick.equals("Platform New User");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user