1:添加在房间点击用户头像,展示有师傅的头像,并且添加点击事件
2:点击用户头像,进入用户主页的时候,展示师傅的头像
This commit is contained in:
@@ -161,7 +161,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
//设置mqtt环境 false 测试环境 true 正式环境
|
||||
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
|
||||
//设置http环境 false 测试环境 true 正式环境
|
||||
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(true);
|
||||
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(false);
|
||||
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
|
||||
|
||||
initialization();
|
||||
|
||||
@@ -50,6 +50,8 @@ class MyFamilyBean {
|
||||
var sign_user_ratio : Int = 0 //非首签签约比例
|
||||
var end_day: String = "" //签约剩余时长
|
||||
|
||||
val free_re_sign_day : Int=0 //免费续签时长
|
||||
|
||||
}
|
||||
|
||||
/* "group_id": "string",
|
||||
|
||||
@@ -89,6 +89,15 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
private String sign_value;
|
||||
private String sign_id;
|
||||
|
||||
private Master master;
|
||||
|
||||
@Data
|
||||
public static class Master implements Serializable {
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
}
|
||||
|
||||
/*"cp_info": {
|
||||
"name": "string",
|
||||
"user_id1": "string",
|
||||
|
||||
@@ -2567,8 +2567,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getRoomUserInfo(String room_id, String
|
||||
user_id, BaseObserver<UserInfo> observer) {
|
||||
public void getRoomUserInfo(String room_id, String user_id, BaseObserver<UserInfo> observer) {
|
||||
sApiServer.getRoomUserInfo(room_id, user_id).enqueue(new Callback<BaseModel<UserInfo>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<UserInfo>> call, Response<BaseModel<UserInfo>> response) {
|
||||
|
||||
@@ -23,6 +23,7 @@ public class MeHeadView extends ConstraintLayout {
|
||||
private ImageView mIvSex;
|
||||
private ImageView mIvOnline;
|
||||
private ImageView iv_frame_bg;
|
||||
private ImageView iv_master_bg;
|
||||
|
||||
public MeHeadView(Context context) {
|
||||
this(context, null, 0);
|
||||
@@ -43,7 +44,8 @@ public class MeHeadView extends ConstraintLayout {
|
||||
mIvFrame = findViewById(R.id.iv_frame);
|
||||
mIvSex = findViewById(R.id.iv_sex);
|
||||
mIvOnline = findViewById(R.id.iv_online);
|
||||
iv_frame_bg=findViewById(R.id.iv_frame_bg);
|
||||
iv_frame_bg = findViewById(R.id.iv_frame_bg);
|
||||
iv_master_bg = findViewById(R.id.iv_master_bg);
|
||||
mIvSex.setVisibility(GONE);
|
||||
}
|
||||
|
||||
@@ -59,21 +61,30 @@ public class MeHeadView extends ConstraintLayout {
|
||||
mIvFrame.setSource(framePicture, 1);
|
||||
}
|
||||
|
||||
if (nobilityImage!=null && !TextUtils.isEmpty(nobilityImage)){
|
||||
if (nobilityImage != null && !TextUtils.isEmpty(nobilityImage)) {
|
||||
iv_frame_bg.setVisibility(VISIBLE);
|
||||
ImageUtils.loadRoomItem(nobilityImage, iv_frame_bg);
|
||||
}else {
|
||||
} else {
|
||||
iv_frame_bg.setVisibility(GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setMaster(String headPicture) {
|
||||
if (!TextUtils.isEmpty(headPicture)) {
|
||||
ImageUtils.loadHead(headPicture, mRiv);
|
||||
}
|
||||
|
||||
iv_master_bg.setVisibility(VISIBLE);
|
||||
iv_master_bg.setImageResource(R.mipmap.icon_master);
|
||||
}
|
||||
|
||||
public void setOnline(boolean isOnline) {
|
||||
mIvOnline.setVisibility(VISIBLE);
|
||||
mIvOnline.setImageResource(isOnline ? R.mipmap.me_online_icon : R.mipmap.me_icon_unchecked);
|
||||
}
|
||||
|
||||
public void setSex(int sex,String headPicture,String dress) {
|
||||
public void setSex(int sex, String headPicture, String dress) {
|
||||
if (!TextUtils.isEmpty(headPicture)) {
|
||||
ImageUtils.loadHead(headPicture, mRiv);
|
||||
}
|
||||
|
||||
@@ -65,6 +65,18 @@
|
||||
tools:src="@mipmap/me_sj"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_master_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintHeight_default="spread"
|
||||
app:layout_constraintTop_toTopOf="@+id/guideline"
|
||||
app:layout_constraintWidth_default="spread"
|
||||
tools:src="@mipmap/icon_master"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_online"
|
||||
android:layout_width="@dimen/dp_13"
|
||||
|
||||
BIN
BaseModule/src/main/res/mipmap-hdpi/icon_master.png
Normal file
BIN
BaseModule/src/main/res/mipmap-hdpi/icon_master.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
BaseModule/src/main/res/mipmap-xhdpi/icon_master.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xhdpi/icon_master.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
BIN
BaseModule/src/main/res/mipmap-xxhdpi/icon_master.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xxhdpi/icon_master.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
@@ -163,7 +163,7 @@ class MyFamilyFragment(var data: MyFamilyBean) : BaseFragment<FragmentMyFamilyBi
|
||||
if (item.free_renewal > 0) {
|
||||
queren1(
|
||||
1,
|
||||
onMessage(1, item.nickname, item.free_renewal, null, null, null),
|
||||
onMessage(1, item.nickname, item.free_renewal, item.free_re_sign_day, null, null),
|
||||
item.user_id.toString()
|
||||
)
|
||||
} else {
|
||||
@@ -194,15 +194,15 @@ class MyFamilyFragment(var data: MyFamilyBean) : BaseFragment<FragmentMyFamilyBi
|
||||
type: Int,//类型 1:免费续约 2:续签 花金币
|
||||
userName: String? = null, //当前徒弟的名称
|
||||
remainingCount: Int? = 0, //当前免费续签次数
|
||||
percentage: Int? = null, //身价的百分比,是按照这个进行扣款的
|
||||
percentage: Int? = null, //当type==1的时候,这个值是合约延续的时间,type=2的时候,身价的百分比,是按照这个进行扣款的
|
||||
days: Int? = null,// 花钱后最总的时长
|
||||
userValue: Int? = null //当前徒弟的身价
|
||||
): SpannableString {
|
||||
return when (type) {
|
||||
1 -> SpannableString("尊敬的用户:\n 您的徒弟【${userName ?: "?"}】当前为首次签约的免费签约期。续约后,师徒合约将延续7天,您剩余的免费续约次数:${remainingCount ?: "?"} 次")
|
||||
1 -> SpannableString("尊敬的用户:\n 您的徒弟【${userName ?: "?"}】当前为首次签约的免费签约期。续约后,师徒合约将延续${percentage}天,您剩余的免费续约次数:${remainingCount ?: "?"} 次")
|
||||
2 -> {
|
||||
// 计算预估金币数,向上取整
|
||||
val actualUserValue = userValue ?: 1000 // 如果未提供用户身价,默认使用1000
|
||||
val actualUserValue = userValue ?: 10 // 如果未提供用户身价,默认使用1000
|
||||
val percentageValue = percentage ?: 10
|
||||
val estimatedCoins =
|
||||
kotlin.math.ceil(actualUserValue * percentageValue / 100.0).toInt()
|
||||
|
||||
@@ -20,6 +20,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.google.android.flexbox.FlexboxLayout;
|
||||
import com.tencent.imsdk.v2.V2TIMConversation;
|
||||
@@ -42,6 +43,7 @@ import com.xscm.moduleutil.bean.RelationshipBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.UserTagBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
@@ -168,6 +170,13 @@ public class UserHomepageFragment extends BaseMvpFragment<UserHomepagePresenter,
|
||||
mBinding.headerInfo.imBeautiful.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(userInfo.getMaster()!=null){
|
||||
mBinding.headerInfo.ivRightAvatar.setVisibility(VISIBLE);
|
||||
mBinding.headerInfo.ivRightAvatar.setMaster(userInfo.getMaster().getAvatar());
|
||||
}else {
|
||||
mBinding.headerInfo.ivRightAvatar.setVisibility(GONE);
|
||||
}
|
||||
|
||||
|
||||
if (!userInfo.getIcon().isEmpty()){
|
||||
mBinding.headerInfo.flexEntry.setVisibility(VISIBLE);
|
||||
@@ -217,6 +226,7 @@ public class UserHomepageFragment extends BaseMvpFragment<UserHomepagePresenter,
|
||||
|
||||
mBinding.headerInfo.tvGz.setOnClickListener(this::onClick);
|
||||
mBinding.headerInfo.tvGsSx.setOnClickListener(this::onClick);
|
||||
mBinding.headerInfo.ivRightAvatar.setOnClickListener(this::onClick);
|
||||
refreshView();
|
||||
if (userInfo.getGuild() == null || userInfo.getGuild().isEmpty()) {
|
||||
mBinding.headerInfo.ctlGuild.setVisibility(View.GONE);
|
||||
@@ -366,6 +376,8 @@ public class UserHomepageFragment extends BaseMvpFragment<UserHomepagePresenter,
|
||||
Intent intent=new Intent(getContext(), GiftWallActivity.class);
|
||||
intent.putExtra("userId",userInfo.getUser_id());
|
||||
startActivity(intent);
|
||||
}else if (view.getId()==R.id.iv_right_avatar){
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId",userInfo.getMaster().getUser_id()).navigation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,11 +180,11 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.textView2.setOnClickListener(this::onClick);
|
||||
mBinding.moreButton.setOnClickListener(this::onClick);
|
||||
mBinding.imQml.setOnClickListener(this::onClick);
|
||||
mBinding.ivRightAvatar.setOnClickListener(this::onClick);
|
||||
|
||||
// ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.roomMCz, ColorManager.getInstance().getPrimaryColorInt(), 65);
|
||||
// mBinding.roomMCz.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
mBinding.moreButton.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -275,6 +275,11 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
MvpPre.clearUserCharm(room_id, user_id);
|
||||
} else if (id == R.id.im_gs) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), room_id, "", null);
|
||||
}else if (id == R.id.iv_right_avatar){
|
||||
if(userInfo.getMaster()!=null && userInfo.getMaster().getUser_id()!=null) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", userInfo.getMaster().getUser_id() + "").navigation();
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,6 +468,13 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.tvName.setShineType(0);
|
||||
}
|
||||
|
||||
if(userInfo.getMaster()!=null){
|
||||
mBinding.ivRightAvatar.setVisibility(VISIBLE);
|
||||
mBinding.ivRightAvatar.setMaster(userInfo.getMaster().getAvatar());
|
||||
}else {
|
||||
mBinding.ivRightAvatar.setVisibility(GONE);
|
||||
}
|
||||
|
||||
// mBinding.tvName.setTextColor( (userInfo.getNickname_color()!=null && !userInfo.getNickname_color().equals(""))? Color.parseColor(userInfo.getNickname_color()):Color.parseColor("#333333"));
|
||||
// mBinding.tvId.setText("ID:" + userInfo.getUser_code());
|
||||
if (userInfo.getIs_in_pit() == 1) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
android:id="@+id/iv_right_avatar"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:layout_marginStart="-15dp"
|
||||
android:layout_marginStart="-6dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_avatar" />
|
||||
|
||||
Reference in New Issue
Block a user