diff --git a/common/src/main/assets/gift_live_naming_bg.svga b/common/src/main/assets/gift_live_naming_bg.svga new file mode 100644 index 000000000..8f5b594ef Binary files /dev/null and b/common/src/main/assets/gift_live_naming_bg.svga differ diff --git a/common/src/main/assets/gift_live_naming_title_cn.svga b/common/src/main/assets/gift_live_naming_title_cn.svga new file mode 100644 index 000000000..6cc2da491 Binary files /dev/null and b/common/src/main/assets/gift_live_naming_title_cn.svga differ diff --git a/common/src/main/assets/gift_live_naming_title_en.svga b/common/src/main/assets/gift_live_naming_title_en.svga new file mode 100644 index 000000000..548f31417 Binary files /dev/null and b/common/src/main/assets/gift_live_naming_title_en.svga differ diff --git a/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java b/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java index 7597786ab..b0b22b603 100644 --- a/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java +++ b/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java @@ -30,6 +30,10 @@ public class UserMedalModel extends BaseModel implements BaseBannerInfo { return use_status; } + public void setUse_status(String use_status) { + this.use_status = use_status; + } + public String getId() { return id; } diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveDialog.java index 452e74a95..12e90ba32 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveDialog.java @@ -13,16 +13,22 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.lxj.xpopup.XPopup; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; import com.yunbao.common.adapter.GiftWallAchieveAdapter; +import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.MedalAchievementModel; import com.yunbao.common.bean.UserMedalListModel; import com.yunbao.common.fragment.GiftWallMainTab1Fragment; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; import java.util.ArrayList; import java.util.List; @@ -41,6 +47,7 @@ public class GiftWallAchieveDialog extends AbsDialogPopupWindow { private String toUid; private boolean isAnchor; private View topBar; + private TextView honor; private List userMedalListModelList = new ArrayList<>(); @@ -90,12 +97,29 @@ public class GiftWallAchieveDialog extends AbsDialogPopupWindow { mRecyclerView.setLayoutManager(new GridLayoutManager(mContext, 3, GridLayoutManager.VERTICAL, false)); numCount = findViewById(R.id.numCount); topBar = findViewById(R.id.top_bar); + honor = findViewById(R.id.honor); + mIvBack.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { dialog.dismiss(); } }); + + ViewClicksAntiShake.clicksAntiShake(honor, () -> { + StringBuffer htmlUrl = new StringBuffer(); + IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo(); + htmlUrl.append(CommonAppConfig.HOST) + .append("/h5/shequ/index.html#/h5/shequ/RongYuQiang?") + .append("touid=") + .append(toUid) + .append("&token=") + .append(userInfo.getToken()) + .append("&uid=") + .append(userInfo.getId()) .append("&isZh=") + .append(WordUtil.isNewZh() ? "1" : 0); + RouteUtil.forwardLiveZhuangBanActivity(htmlUrl.toString(), true); + }); } @Override @@ -124,7 +148,12 @@ public class GiftWallAchieveDialog extends AbsDialogPopupWindow { giftWallAchieveAdapter.setOnItemClickListener(new GiftWallAchieveAdapter.OnItemClickListener() { @Override public void onItemClick(int position) { - GiftWallAchieveWearDialog giftWallAchieveWearDialog = new GiftWallAchieveWearDialog(mContext,isAnchor,userMedalListModelList.get(position).getDressInfo()); + GiftWallAchieveWearDialog giftWallAchieveWearDialog = new GiftWallAchieveWearDialog(mContext, isAnchor, userMedalListModelList.get(position).getDressInfo(), new GiftWallAchieveWearDialog.UserUseDressSuccess() { + @Override + public void onSuccess() { + initData(); + } + }); giftWallAchieveWearDialog.showDialog(); } }); diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveWearDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveWearDialog.java index 31c73951d..7780a3429 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveWearDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveWearDialog.java @@ -12,7 +12,7 @@ import com.lxj.xpopup.XPopup; import com.stx.xhb.androidx.XBanner; import com.stx.xhb.androidx.transformers.Transformer; import com.yunbao.common.R; -import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.UserMedalModel; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.base.HttpCallback; @@ -43,11 +43,14 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow { String putOn = WordUtil.isNewZh() ? "佩戴" : "wearing"; String wearing = WordUtil.isNewZh() ? "已佩戴" : "worn"; private List achieveWearModels = new ArrayList<>(); + private UserUseDressSuccess userUseDressSuccess; - public GiftWallAchieveWearDialog(@NonNull Context context,boolean isAnchor, List achieveWearModels) { + + public GiftWallAchieveWearDialog(@NonNull Context context,boolean isAnchor, List achieveWearModels,UserUseDressSuccess userUseDressSuccess) { super(context); this.isAnchor = isAnchor; this.achieveWearModels = achieveWearModels; + this.userUseDressSuccess = userUseDressSuccess; } public GiftWallAchieveWearDialog setFullWindows(boolean fullWindows) { @@ -94,16 +97,22 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow { btnConfirm.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { - if (achieveWearModels.get(selectPosition).getUseStatus().equals("2") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) { - LiveNetManager.get(mContext).userUseDress("3", achieveWearModels.get(selectPosition).getUsersDressId(), new HttpCallback() { + if (achieveWearModels.get(selectPosition).getUseStatus().equals("0") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) { + LiveNetManager.get(mContext).userUseDress("3", achieveWearModels.get(selectPosition).getUsersDressId(), new HttpCallback() { @Override - public void onSuccess(BaseModel data) { - dialog.dismiss(); + public void onSuccess(HttpCallbackModel data) { + ToastUtil.show(data.getMsg()); + if (data.getCode() == 0) { + if(userUseDressSuccess!=null){ + userUseDressSuccess.onSuccess(); + } + dialog.dismiss(); + } } @Override public void onError(String error) { - ToastUtil.show(error); + } }); } @@ -132,8 +141,8 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow { public void setWearInfo() { textAchieveName.setText(achieveWearModels.get(selectPosition).getDressName()); textAchieveHint.setText(achieveWearModels.get(selectPosition).getDressDescription()); - btnConfirm.setText(achieveWearModels.get(selectPosition).getUseStatus().equals("2") ? wearing : putOn); - if (achieveWearModels.get(selectPosition).getUseStatus().equals("2") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) { + btnConfirm.setText(achieveWearModels.get(selectPosition).getUseStatus().equals("1") ? wearing : putOn); + if (achieveWearModels.get(selectPosition).getUseStatus().equals("0") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) { btnConfirm.setBackground(getResources().getDrawable(R.drawable.gift_wall_achieve_wear_sure)); } else { btnConfirm.setBackground(getResources().getDrawable(R.drawable.gift_wall_achieve_wear_disable)); @@ -176,4 +185,8 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow { } }); } + + public interface UserUseDressSuccess { + void onSuccess(); + } } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 977def227..45ddd7105 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -1274,8 +1274,7 @@ public interface PDLiveApi { Observable> getGiftHallMedalList(@Query("to_uid") String liveUid,@Query("type")String type); @GET("/api/public/?service=Dress.userUseDress") - Observable> userUseDress(@Query("dress_type") String dress_type,@Query("users_dress_id")String users_dress_id); - + Observable>> userUseDress(@Query("dress_type") String dress_type,@Query("users_dress_id")String users_dress_id); /** * 个人展馆 diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 9a3c629a5..7952cd01d 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -3528,16 +3528,19 @@ public class LiveNetManager { }).isDisposed(); } - public void userUseDress(String dressType, String usersDressId, HttpCallback callback) { + public void userUseDress(String dressType, String usersDressId, HttpCallback callback) { API.get().pdLiveApi(mContext) .userUseDress(dressType, usersDressId) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new Consumer>() { + .subscribe(new Consumer>>() { @Override - public void accept(ResponseModel listResponseModel) throws Exception { + public void accept(ResponseModel> responseModel) throws Exception { if (callback != null) { - callback.onSuccess(listResponseModel.getData().getInfo()); + HttpCallbackModel model = new HttpCallbackModel(); + model.setCode(responseModel.getData().getCode()); + model.setMsg(responseModel.getData().getMsg()); + callback.onSuccess(model); } } }, new Consumer() { diff --git a/common/src/main/res/layout/dialog_gift_wall_achieve.xml b/common/src/main/res/layout/dialog_gift_wall_achieve.xml index 4e2283b1a..b360c7757 100644 --- a/common/src/main/res/layout/dialog_gift_wall_achieve.xml +++ b/common/src/main/res/layout/dialog_gift_wall_achieve.xml @@ -64,11 +64,13 @@ android:layout_height="match_parent"/> + android:layout_height="match_parent"/> - + /> @@ -76,11 +79,13 @@ @@ -123,11 +128,10 @@ android:textColor="#DB7008" android:textSize="10sp" /> - diff --git a/live/src/main/res/layout/view_live_gift_naming.xml b/live/src/main/res/layout/view_live_gift_naming.xml new file mode 100644 index 000000000..43f21194b --- /dev/null +++ b/live/src/main/res/layout/view_live_gift_naming.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +