cp挂件头像显示位置null判断,去除请求头打印。

This commit is contained in:
2026-01-21 10:11:23 +08:00
parent 9ab1f171f8
commit 3f49cf3790
2 changed files with 53 additions and 56 deletions

View File

@@ -121,10 +121,6 @@ public class RetrofitClient {
sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, new TrustManager[]{trustAllCert}, new SecureRandom());
headers.entrySet().stream()
.forEach(entry -> LogUtils.e("Header: %-20s Value: %s", entry.getKey(), entry.getValue()));
final OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new DataLoggingInterceptor(new DataLogger()))
.addInterceptor(new AccessTokenInterceptor(headers))

View File

@@ -221,7 +221,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
.create()
.showAsDropDown(mBinding.roomDian, 0, 20);
} else if (id == R.id.im_room_t) {
if (userInfo != null && TextUtils.isEmpty(userInfo.getNickname())){
if (userInfo != null && TextUtils.isEmpty(userInfo.getNickname())) {
ToastUtils.show("用户信息加载中,请稍后...");
return;
}
@@ -462,7 +462,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
}
return "";
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
return "";
}
@@ -491,9 +491,9 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
mBinding.ivAvatar.setData(userInfo.getAvatar(), "", userInfo.getNobility_image() + "");
String sex = userInfo.getSex() == 1 ? "" : "";
mBinding.tvId.setText(sex + " ID:" + userInfo.getUser_code());
if (userInfo.getIs_use_code() == 1){
if (userInfo.getIs_use_code() == 1) {
mBinding.ivLh.setVisibility(VISIBLE);
}else {
} else {
mBinding.ivLh.setVisibility(GONE);
}
mBinding.tvName.setText(userInfo.getNickname());
@@ -582,7 +582,6 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
}
if (userInfo.getProfile().isEmpty()) {
mBinding.jianj.setText("");
mBinding.jianj.setVisibility(GONE);
@@ -626,52 +625,54 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
ConstraintLayout.LayoutParams.WRAP_CONTENT);
//挂件上的头像位置0-上1-右上2-右3-右下4-下5-左下6-左7-左上'
try {
switch (Integer.parseInt(userInfo.getCp_info().direction)) {
case 0:
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToTop = mBinding.topGuideline.getId();
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.HORIZONTAL);
break;
case 1:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 2:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 3:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 4:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.HORIZONTAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToBottom = mBinding.bottomGuideline.getId();
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 5:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 6:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 7:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
if (userInfo.getCp_info().direction != null) {
switch (Integer.parseInt(userInfo.getCp_info().direction)) {
case 0:
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToTop = mBinding.topGuideline.getId();
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.HORIZONTAL);
break;
case 1:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 2:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 3:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 4:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.HORIZONTAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToBottom = mBinding.bottomGuideline.getId();
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 5:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 6:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
case 7:
mBinding.llCpAnimAvatar.setOrientation(LinearLayout.VERTICAL);
params.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
params.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
break;
}
}
} catch (NullPointerException e) {
LogUtils.e("挂件位置异常" + e.toString());
@@ -681,7 +682,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
if (!userInfo.getIcon().isEmpty()) {
mBinding.flexEntry.setVisibility(VISIBLE);
if (mBinding.rlCpAnim.getVisibility() == VISIBLE){
if (mBinding.rlCpAnim.getVisibility() == VISIBLE) {
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) mBinding.flexEntry.getLayoutParams();
params.endToStart = mBinding.rlCpAnim.getId();
mBinding.flexEntry.setLayoutParams(params);