修复测试反馈内容
新增临时需求:banner点进礼物墙 新增临时需求:主播下播后显示违规内容(未接入接口) 合并潘多拉修复问题
This commit is contained in:
@@ -102,6 +102,11 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
}
|
||||
|
||||
public void setData(GiftWallInfoBean.Data data, int position) {
|
||||
user_name.setText("");
|
||||
anchor_name.setText("");
|
||||
tv_rank.setText("");
|
||||
avatar.setVisibility(View.INVISIBLE);
|
||||
avatar2.setVisibility(View.INVISIBLE);
|
||||
if (data.getId() == -1) {
|
||||
tv_rank.setText("");
|
||||
tv_rename.setText("");
|
||||
@@ -118,6 +123,7 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
}
|
||||
anchor_name.setVisibility(View.GONE);
|
||||
if (isStar && list_type == 2) {
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(itemView.getContext(), data.getLive_avatar(), avatar);
|
||||
anchor_name.setText(data.getLive_user_name());
|
||||
if (data.getGift_hall_rank_hide() == 1 && !data.getUser_id().equals(IMLoginManager.get(itemView.getContext()).getUserInfo().getId() + "")) {
|
||||
@@ -132,7 +138,8 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
} else {
|
||||
avatar2.setVisibility(View.INVISIBLE);
|
||||
anchor_name.setVisibility(View.GONE);
|
||||
if (data.getGift_hall_rank_hide() == 1&& !data.getUser_id().equals(IMLoginManager.get(itemView.getContext()).getUserInfo().getId() + "")) {
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
if (data.getGift_hall_rank_hide() == 1 && !data.getUser_id().equals(IMLoginManager.get(itemView.getContext()).getUserInfo().getId() + "")) {
|
||||
avatar.setImageResource(R.mipmap.hide);
|
||||
user_name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
} else {
|
||||
|
||||
@@ -152,6 +152,14 @@ public class GiftWallMainTab1List2Adapter extends RecyclerView.Adapter<GiftWallM
|
||||
ImgLoader.display(itemView.getContext(), gift.getGift_icon(), giftImage, 40, 40);
|
||||
giftBg.setClearsAfterDetached(false);
|
||||
giftBg.setClearsAfterStop(false);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
if (isAnchor) {
|
||||
progressBar.setMax(gift.getIlluminate_num());
|
||||
progressBar.setProgress(gift.getGift_hall_send_num());
|
||||
}else{
|
||||
progressBar.setMax(1);
|
||||
}
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
if (gift.getIlluminate_status() == 1) {
|
||||
gift_status.setText(String.format("%s%s", WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_up), gift.getGift_hall_send_numForString()));
|
||||
gift_status.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
@@ -163,10 +171,20 @@ public class GiftWallMainTab1List2Adapter extends RecyclerView.Adapter<GiftWallM
|
||||
giftBg.startAnimation();
|
||||
});
|
||||
}
|
||||
progressBar.setMax(gift.getIlluminate_num());
|
||||
progressBar.setProgress(gift.getGift_hall_send_num());
|
||||
if(!isAnchor){
|
||||
progressBar.setProgress(1);
|
||||
}
|
||||
} else {
|
||||
gift_status.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_down));
|
||||
if (isAnchor) {
|
||||
gift_status.setText(String.format("%s %s/%s",
|
||||
WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_down2),
|
||||
gift.getGift_hall_send_numForString(),
|
||||
gift.getIlluminate_num()
|
||||
));
|
||||
} else {
|
||||
progressBar.setProgress(0);
|
||||
gift_status.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_down));
|
||||
}
|
||||
gift_status.setTextColor(Color.parseColor("#01071A"));
|
||||
gift_soles.setImageResource(getUnSolesrRes());
|
||||
giftBg.setImageResource(R.mipmap.gift_wall_main_item_bg1);
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.yunbao.common.dialog.GiftWallMainTab2ClassicInfoDialog;
|
||||
import com.yunbao.common.dialog.GiftWallTab2List2Dialog;
|
||||
import com.yunbao.common.event.ClosePopupDialogEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@@ -166,7 +167,7 @@ public class GiftWallMainTab2ListAdapter extends RecyclerView.Adapter<GiftWallMa
|
||||
@SuppressLint("DefaultLocale")
|
||||
public void setData(GiftWallTab2Bean.Gift giftData, int position) {
|
||||
gift_name.setText(WordUtil.isNewZh() ? giftData.getGiftName() : giftData.getGiftNameEn());
|
||||
display(itemView.getContext(), giftData.getGiftIcon(), gift, 60, 60);
|
||||
display(itemView.getContext(), giftData.getGiftIcon(), gift, -1,-1);
|
||||
if (!StringUtil.isEmpty(giftData.getNamingLiveNicename(), giftData.getNamingUserNicename())) {
|
||||
anchor_nickname.setVisibility(View.VISIBLE);
|
||||
user_nickname.setVisibility(View.VISIBLE);
|
||||
@@ -176,18 +177,18 @@ public class GiftWallMainTab2ListAdapter extends RecyclerView.Adapter<GiftWallMa
|
||||
imageView8.setVisibility(View.VISIBLE);
|
||||
tv_wait.setVisibility(View.GONE);
|
||||
gift_number.setText(String.format(Locale.getDefault(), "%d", giftData.getGiftHallSendNum()));
|
||||
if (giftData.getNamingLiveActiveRankHide() == 1) {
|
||||
if (giftData.getNamingLiveActiveRankHide() == 1 && giftData.getNamingLiveId()!= IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
user1Avatar.setImageResource(R.mipmap.hide);
|
||||
anchor_nickname.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
} else {
|
||||
display(mContext, giftData.getNamingLiveAvatar(), user1Avatar, 35, 35);
|
||||
display(mContext, giftData.getNamingLiveAvatar(), user1Avatar, 60, 60);
|
||||
anchor_nickname.setText(giftData.getNamingLiveNicename());
|
||||
}
|
||||
if (giftData.getNamingUserActiveRankHide() == 1) {
|
||||
if (giftData.getNamingUserActiveRankHide() == 1&& giftData.getNamingUserId()!= IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
user2Avatar.setImageResource(R.mipmap.hide);
|
||||
user_nickname.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
} else {
|
||||
display(mContext, giftData.getNamingUserAvatar(), user2Avatar, 35, 35);
|
||||
display(mContext, giftData.getNamingUserAvatar(), user2Avatar, 60, 60);
|
||||
user_nickname.setText(giftData.getNamingUserNicename());
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -68,7 +68,7 @@ public class GiftWallTab2GiftInfoListItemAdapter extends RecyclerView.Adapter<Gi
|
||||
tv_rank.setText(String.format(Locale.getDefault(), "%d", (position + 4)));
|
||||
tv_rank.setTextColor(Color.parseColor("#FCC755"));
|
||||
tv_rank.setTextSize(20);
|
||||
tv_rename.setText(String.format(Locale.getDefault(), "%d", (data.getGiftHallSendNum())));
|
||||
tv_rename.setText(String.format(Locale.getDefault(), "%s", (data.getGiftHallSendNumForString())));
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
if (data.getActiveRankHide() == 1) {
|
||||
user_name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@@ -45,9 +47,9 @@ public class GiftNamingInfoModel extends BaseModel {
|
||||
private String giftStartTime;
|
||||
@SerializedName("gift_end_time")
|
||||
private String giftEndTime;
|
||||
@SerializedName("naming_liveuid")
|
||||
@SerializedName("naming_live_id")
|
||||
private String namingLiveuid;
|
||||
@SerializedName("naming_uid")
|
||||
@SerializedName("naming_user_id")
|
||||
private String namingUid;
|
||||
@SerializedName("naming_live_name")
|
||||
private String namingLiveName;
|
||||
@@ -327,6 +329,10 @@ public class GiftNamingInfoModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getNamingStatus() {
|
||||
//后端反馈 namingStatus 已经无效了,需要判断冠名主播id和冠名用户id是否为0
|
||||
if(TextUtils.equals(namingLiveuid,"0")||TextUtils.equals(namingUid,"0")){
|
||||
return "0";
|
||||
}
|
||||
return namingStatus;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,16 @@ public class GiftWallInfoBean extends BaseModel {
|
||||
private int user_gift_hall_send_num;
|
||||
@SerializedName("gift_status")
|
||||
private int gift_status;
|
||||
@SerializedName("sendtype")
|
||||
private int sendtype;//0默认钻石购买,1金币购买
|
||||
|
||||
public int getSendtype() {
|
||||
return sendtype;
|
||||
}
|
||||
|
||||
public void setSendtype(int sendtype) {
|
||||
this.sendtype = sendtype;
|
||||
}
|
||||
|
||||
public int getGift_status() {
|
||||
return gift_status;
|
||||
@@ -230,6 +240,9 @@ public class GiftWallInfoBean extends BaseModel {
|
||||
// 同样地,这里省略getter和setter方法
|
||||
|
||||
public String getUser_id() {
|
||||
if(StringUtil.isEmpty(user_id)){
|
||||
return "0";
|
||||
}
|
||||
return user_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -350,12 +351,28 @@ public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
|
||||
|
||||
@SerializedName("create_time")
|
||||
private String createTime;
|
||||
@SerializedName("naming_user_gift_hall_rank_hide")
|
||||
private int naming_user_gift_hall_rank_hide;
|
||||
|
||||
// 如果需要,可以添加无参构造器、getter和setter(这里省略)
|
||||
|
||||
public int getNaming_user_gift_hall_rank_hide() {
|
||||
return naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setNaming_user_gift_hall_rank_hide(int naming_user_gift_hall_rank_hide) {
|
||||
this.naming_user_gift_hall_rank_hide = naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public int getGiftHallSendNum() {
|
||||
return giftHallSendNum;
|
||||
}
|
||||
public String getGiftHallSendNumForString() {
|
||||
if(giftHallSendNum>999999){
|
||||
return "999999+";
|
||||
}
|
||||
return giftHallSendNum+"";
|
||||
}
|
||||
|
||||
public void setGiftHallSendNum(int giftHallSendNum) {
|
||||
this.giftHallSendNum = giftHallSendNum;
|
||||
@@ -402,6 +419,9 @@ public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
if(StringUtil.isEmpty(userId)){
|
||||
return "0";
|
||||
}
|
||||
return userId;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.view.View;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/12.
|
||||
@@ -52,9 +53,9 @@ public class LiveGiftBean {
|
||||
|
||||
@JSONField(name = "operate_url")
|
||||
private String operateUrl;
|
||||
@JSONField(name = "naming_liveuid")
|
||||
@JSONField(name = "naming_live_id")
|
||||
private String namingLiveuid;
|
||||
@JSONField(name = "naming_uid")
|
||||
@JSONField(name = "naming_user_id")
|
||||
private String namingUid;
|
||||
@JSONField(name = "naming_live_name")
|
||||
private String namingLiveName;
|
||||
@@ -168,6 +169,9 @@ public class LiveGiftBean {
|
||||
}
|
||||
|
||||
public String getNamingUid() {
|
||||
if(StringUtil.isEmpty(namingUid)){
|
||||
namingUid="0";
|
||||
}
|
||||
return namingUid;
|
||||
}
|
||||
|
||||
@@ -310,6 +314,9 @@ public class LiveGiftBean {
|
||||
}
|
||||
|
||||
public String getSwf() {
|
||||
if(StringUtil.isEmpty(swf)){
|
||||
swf="";
|
||||
}
|
||||
return swf;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ package com.yunbao.common.custom;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.stx.xhb.androidx.transformers.BasePageTransformer;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
public class LiveGifWallAchieveWearTransformer extends BasePageTransformer {
|
||||
@@ -15,7 +18,7 @@ public class LiveGifWallAchieveWearTransformer extends BasePageTransformer {
|
||||
* github:https://github.com/xiaohaibin
|
||||
* describe: 适用于一屏显示多个模式
|
||||
*/
|
||||
private float mMinScale = 0.55f;
|
||||
private float mMinScale = 0.85f;
|
||||
private float mMinAlpha = 1f;
|
||||
|
||||
public LiveGifWallAchieveWearTransformer() {
|
||||
@@ -28,7 +31,7 @@ public class LiveGifWallAchieveWearTransformer extends BasePageTransformer {
|
||||
|
||||
@Override
|
||||
public void handleInvisiblePage(View view, float position) {
|
||||
ViewCompat.setAlpha(view, 0);
|
||||
// ViewCompat.setAlpha(view, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -36,19 +39,12 @@ public class LiveGifWallAchieveWearTransformer extends BasePageTransformer {
|
||||
float scale = Math.max(mMinScale, 1 + position);
|
||||
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||
L.eSw("l position:"+position);
|
||||
L.eSw("l mMinScale:"+mMinScale);
|
||||
L.eSw("l getHeight:"+view.getHeight());
|
||||
L.eSw("l getWidth:"+view.getWidth());
|
||||
L.eSw("l scale:"+scale);
|
||||
L.eSw("l vertMargin:"+vertMargin);
|
||||
L.eSw("l horzMargin:"+horzMargin);
|
||||
L.eSw("l setTranslationX :"+(horzMargin - vertMargin / 2));
|
||||
L.eSw("l setAlpha :"+mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
view.setTranslationX(horzMargin - vertMargin / 4);
|
||||
view.setTranslationX(horzMargin - vertMargin / 2);
|
||||
view.setScaleX(scale);
|
||||
view.setScaleY( scale);
|
||||
view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
L.e("handleLeftPage scale:"+scale);
|
||||
// view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
view.setAlpha(1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,19 +52,13 @@ public class LiveGifWallAchieveWearTransformer extends BasePageTransformer {
|
||||
float scale = Math.max(mMinScale, 1 - position);
|
||||
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||
L.eSw("r position:"+position);
|
||||
L.eSw("r mMinScale:"+mMinScale);
|
||||
L.eSw("r getHeight:"+view.getHeight());
|
||||
L.eSw("r getWidth:"+view.getWidth());
|
||||
L.eSw("r scale:"+scale);
|
||||
L.eSw("r vertMargin:"+vertMargin);
|
||||
L.eSw("r horzMargin:"+horzMargin);
|
||||
L.eSw("r setTranslationX :"+(horzMargin - vertMargin / 2));
|
||||
L.eSw("r setAlpha :"+mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
view.setTranslationX( -horzMargin + vertMargin / 4);
|
||||
view.setTranslationX( -horzMargin + vertMargin / 2);
|
||||
view.setScaleX( scale);
|
||||
|
||||
view.setScaleY( scale);
|
||||
view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
L.e("handleRightPage scale:"+scale);
|
||||
// view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
view.setAlpha(1f);
|
||||
}
|
||||
|
||||
public void setMinAlpha(float minAlpha) {
|
||||
|
||||
@@ -10,12 +10,14 @@ import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.stx.xhb.androidx.XBanner;
|
||||
import com.stx.xhb.androidx.transformers.BasePageTransformer;
|
||||
import com.stx.xhb.androidx.transformers.Transformer;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserMedalModel;
|
||||
import com.yunbao.common.custom.LiveGifWallAchieveWearTransformer;
|
||||
import com.yunbao.common.custom.LiveGuardScalePageTransformer;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -47,13 +49,20 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow {
|
||||
String wearing = WordUtil.isNewZh() ? "已佩戴" : "worn";
|
||||
private List<UserMedalModel> achieveWearModels = new ArrayList<>();
|
||||
private UserUseDressSuccess userUseDressSuccess;
|
||||
private int useIndex = 0;
|
||||
|
||||
public GiftWallAchieveWearDialog(@NonNull Context context,String toUid,boolean isAnchor, List<UserMedalModel> achieveWearModels,UserUseDressSuccess userUseDressSuccess) {
|
||||
public GiftWallAchieveWearDialog(@NonNull Context context, String toUid, boolean isAnchor, List<UserMedalModel> achieveWearModels, UserUseDressSuccess userUseDressSuccess) {
|
||||
super(context);
|
||||
this.toUid = toUid;
|
||||
this.isAnchor = isAnchor;
|
||||
this.achieveWearModels = achieveWearModels;
|
||||
this.userUseDressSuccess = userUseDressSuccess;
|
||||
for (int i = 0; i < this.achieveWearModels.size(); i++) {
|
||||
if ("1".equals(this.achieveWearModels.get(i).getUseStatus())) {
|
||||
useIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GiftWallAchieveWearDialog setFullWindows(boolean fullWindows) {
|
||||
@@ -102,30 +111,30 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow {
|
||||
public void onClick(View view) {
|
||||
if (achieveWearModels.get(selectPosition).getUseStatus().equals("0") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) {
|
||||
LiveNetManager.get(mContext).userUseDress(
|
||||
achieveWearModels.get(selectPosition).getUsersDressId(), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show(data.getMsg());
|
||||
if (data.getCode() == 0) {
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
u.setMedal_no_display_src(achieveWearModels.get(selectPosition).getDisplaySrc());
|
||||
CommonAppConfig.getInstance().setUserBean(u);
|
||||
if(userUseDressSuccess!=null){
|
||||
userUseDressSuccess.onSuccess();
|
||||
achieveWearModels.get(selectPosition).getUsersDressId(), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show(data.getMsg());
|
||||
if (data.getCode() == 0) {
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
u.setMedal_no_display_src(achieveWearModels.get(selectPosition).getDisplaySrc());
|
||||
CommonAppConfig.getInstance().setUserBean(u);
|
||||
if (userUseDressSuccess != null) {
|
||||
userUseDressSuccess.onSuccess();
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
btnConfirm.setVisibility(CommonAppConfig.getInstance().getUid().equals(toUid)?View.VISIBLE:View.GONE);
|
||||
btnConfirm.setVisibility(CommonAppConfig.getInstance().getUid().equals(toUid) ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,9 +170,9 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow {
|
||||
setWearInfo();
|
||||
xBanner.setBannerData(R.layout.dialog_gift_wall_achieve_wear_item, achieveWearModels);
|
||||
//xBanner.setCustomPageTransformer(new LiveGuardScalePageTransformer());
|
||||
//xBanner.setCustomPageTransformer(new LiveGifWallAchieveWearTransformer());
|
||||
xBanner.setCustomPageTransformer(new LiveGifWallAchieveWearTransformer());
|
||||
xBanner.setIsClipChildrenMode(true);
|
||||
xBanner.setPageTransformer(Transformer.Scale);
|
||||
//xBanner.setCustomPageTransformer(BasePageTransformer.getPageTransformer(Transformer.Zoom));
|
||||
xBanner.getViewPager().setOffscreenPageLimit(3);
|
||||
xBanner.loadImage(new XBanner.XBannerAdapter() {
|
||||
@Override
|
||||
@@ -192,9 +201,10 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow {
|
||||
|
||||
}
|
||||
});
|
||||
// xBanner.getViewPager().setCurrentItem(useIndex); //自动定位到已佩戴到的勋章
|
||||
}
|
||||
|
||||
public interface UserUseDressSuccess {
|
||||
public interface UserUseDressSuccess {
|
||||
void onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
@@ -54,13 +55,14 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
String toUserId;
|
||||
String userName;
|
||||
boolean isAnchor;
|
||||
boolean isTab2;
|
||||
|
||||
public GiftWallDialog(@NonNull Context context, String toUserId, String userName, String anchorId, boolean isAnchor) {
|
||||
super(context);
|
||||
this.toUserId = toUserId;
|
||||
this.isAnchor = isAnchor;
|
||||
this.userName = userName;
|
||||
this.anchorId=anchorId;
|
||||
this.anchorId = anchorId;
|
||||
}
|
||||
|
||||
public GiftWallDialog setFullWindows(boolean fullWindows) {
|
||||
@@ -68,6 +70,11 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallDialog setTab2(boolean isTab2) {
|
||||
this.isTab2 = isTab2;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
@@ -140,10 +147,15 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
mTvUserName.setTextColor(Color.parseColor("#6BCDFF"));
|
||||
} else {
|
||||
mTvUserName.setTextColor(Color.parseColor("#FFCF94"));
|
||||
if (isTab2) {
|
||||
((GiftWallMainTab2Fragment) fragments.get(position)).setTab2();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (isTab2) {
|
||||
mViewPager.setCurrentItem(1);
|
||||
}
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(mTvTab1, () -> {
|
||||
mIvBg.setImageResource(R.mipmap.bg_gift_wall_main_root);
|
||||
@@ -181,6 +193,9 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
new GiftWallRuleDialog(mContext).setFullWindows(isFullWindows).showDialog();
|
||||
});
|
||||
resetWindows();
|
||||
if (isTab2) {
|
||||
mTvTab2.callOnClick();
|
||||
}
|
||||
}
|
||||
|
||||
private void resetWindows() {
|
||||
@@ -208,4 +223,6 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
mIvBack.setLayoutParams(params);
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
View tab_layout;
|
||||
View bottom_layout;
|
||||
View gift_schedule;
|
||||
ImageView diamond_icon;
|
||||
|
||||
GiftWallGiftInfoListItemAdapter adapter;
|
||||
RecyclerView recyclerView;
|
||||
@@ -143,6 +144,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvBack = findViewById(R.id.iv_back);
|
||||
diamond_icon = findViewById(R.id.diamond_icon);
|
||||
giftName = findViewById(R.id.gift_name);
|
||||
gift = findViewById(R.id.gift);
|
||||
diamond_text = findViewById(R.id.diamond_text);
|
||||
@@ -319,6 +321,11 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
gift_tv_progress.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getGift_hall_send_num()));
|
||||
gift_progress.setMax(giftBean.getGift_info().getIlluminate_num());
|
||||
gift_progress.setProgress(Integer.parseInt(giftBean.getGift_info().getGift_hall_send_num()));
|
||||
if (giftBean.getGift_info().getSendtype() == 0) {
|
||||
diamond_icon.setImageResource(R.mipmap.diamond);
|
||||
} else {
|
||||
diamond_icon.setImageResource(R.mipmap.gold_coin);
|
||||
}
|
||||
if (giftBean.getGift_info().getIlluminate_status() == 1) {
|
||||
gift_btn.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_top_btn_continue));
|
||||
btn_lighten.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_up));
|
||||
@@ -329,6 +336,11 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
btn_lighten.setBackgroundResource(R.drawable.gift_wall_gift_info_un_lighten);
|
||||
}
|
||||
adapter.setGiftStatus(giftBean.getGift_info().getIlluminate_status());
|
||||
/**
|
||||
* 如果对方是主播,要有点亮标记。
|
||||
* 如果对方是用户,不要有点亮标记
|
||||
*
|
||||
*/
|
||||
if (isAnchor) {
|
||||
tab_layout.setVisibility(View.VISIBLE);
|
||||
bottom_layout.setVisibility(View.VISIBLE);
|
||||
@@ -337,18 +349,20 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
tab_layout.setVisibility(View.GONE);
|
||||
bottom_layout.setVisibility(View.GONE);
|
||||
tv_list_title.setVisibility(View.VISIBLE);
|
||||
gift_progress.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
tab_layout.setVisibility(View.GONE);
|
||||
bottom_layout.setVisibility(View.GONE);
|
||||
tv_list_title.setVisibility(View.VISIBLE);
|
||||
if (!toUserId.equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
gift_progress.setVisibility(View.GONE);
|
||||
gift_schedule.setVisibility(View.GONE);
|
||||
if (isTab2Enter || ((!toUserId.equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) && !isTab2Enter)) {
|
||||
gift_btn.setVisibility(View.GONE);
|
||||
gift_schedule.setVisibility(View.GONE);
|
||||
gift_progress.setVisibility(View.GONE);
|
||||
} else {
|
||||
System.out.println("---------------显示 " + toUserId + " " + IMLoginManager.get(mContext).getUserInfo().getId() + "|" + isTab2Enter);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isLiveRoom || giftBean.getGift_info().getGift_status() == 0) {
|
||||
gift_btn.setEnabled(false);
|
||||
btn_one.setEnabled(false);
|
||||
@@ -373,15 +387,12 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
loadChampion(giftBean);
|
||||
}
|
||||
}
|
||||
if (!isAnchor) {
|
||||
gift_schedule.setVisibility(View.GONE);
|
||||
gift_progress.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
initAnim();
|
||||
}
|
||||
|
||||
private void setTips(String tmp) {
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
btn_one_tips.setText(String.format(Locale.getDefault(), "%s%s%s"
|
||||
, WordUtil.isNewZh() ? "需 " : "Need ",
|
||||
tmp,
|
||||
@@ -394,6 +405,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
if (giftBean.getData() != null && !giftBean.getData().isEmpty()) {
|
||||
tmp = giftBean.getData().get(0).getGift_hall_send_num() - giftBean.getGift_info().getUser_gift_hall_send_num() + 1;
|
||||
}
|
||||
System.out.println("冠名数据 我发的 = " + mySend + " 检测的 = " + tmp + " 第一名id = " + giftBean.getData().get(0).getUser_id() + " 我的id = " + IMLoginManager.get(mContext).getUserInfo().getId());
|
||||
if (mySend > tmp || giftBean.getData().get(0).getUser_id().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get));
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
|
||||
@@ -115,13 +115,14 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
|
||||
void initData(GiftWallMainTab2ClassicInfoBean data) {
|
||||
ImgLoader.display(mContext, data.getGiftInfo().getGiftIcon(), mIvGift);
|
||||
if (data.getGiftInfo().getNamingLiveActiveRankHide() == 0 || data.getGiftInfo().getNamingUserId() == IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
if (data.getGiftInfo().getNamingLiveActiveRankHide() == 0 || data.getGiftInfo().getNamingLiveId() == IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
ImgLoader.display(mContext, data.getGiftInfo().getNamingLiveAvatar(), user_avatar);
|
||||
mTvUserName.setText(data.getGiftInfo().getNamingLiveNicename());
|
||||
} else {
|
||||
user_avatar.setImageResource(R.mipmap.hide);
|
||||
mTvUserName.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
}
|
||||
gift_name.setText(WordUtil.isNewZh() ? data.getGiftInfo().getGiftName() : data.getGiftInfo().getGiftNameEn());
|
||||
mTvUserName.setText(data.getGiftInfo().getNamingLiveNicename());
|
||||
star_value.setText(String.format(Locale.getDefault(), "%d", data.getGiftInfo().getGiftHallSendNum()));
|
||||
int max = data.getData().size() > 3 ? 3 : 0;
|
||||
if (max != 0) {
|
||||
@@ -151,6 +152,11 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
void setTopData(GiftWallMainTab2ClassicInfoBean.GiftData data, ImageView avatar, TextView name, TextView value) {
|
||||
if (data.getNaming_user_gift_hall_rank_hide() == 1 && Integer.parseInt(data.getUserId()) != IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
avatar.setImageResource(R.mipmap.hide);
|
||||
name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
return;
|
||||
}
|
||||
ImgLoader.display(mContext, data.getAvatar(), avatar);
|
||||
name.setText(data.getUserName());
|
||||
value.setText(String.format(Locale.getDefault(), "%d", data.getGiftHallSendNum()));
|
||||
|
||||
@@ -91,7 +91,7 @@ public class GiftWallRuleDialog extends AbsDialogPopupWindow {
|
||||
} else {
|
||||
mIvBg.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
}
|
||||
ImgLoader.displayDrawable(mContext, WordUtil.isNewZh() ? "https://downs.yaoulive.com/Group%201384.png" : "https://downs.yaoulive.com/Group%201381.png", -1, -1, new ImgLoader.DrawableCallback() {
|
||||
ImgLoader.displayDrawable(mContext, WordUtil.isNewZh() ? "https://downs.yaoulive.com/%E4%B8%AD%E6%96%87%E8%A7%84%E5%88%99.png" : "https://downs.yaoulive.com/%E8%8B%B1%E6%96%87%E8%A7%84%E5%88%99.png", -1, -1, new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
iv_rule.setImageDrawable(drawable);
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
@@ -57,14 +58,14 @@ public class GiftWallTab2List2Dialog extends AbsDialogCenterPopupWindow {
|
||||
giftName = findViewById(R.id.gift_name);
|
||||
|
||||
ImgLoader.display(mContext, gift.getGiftIcon(), giftImage);
|
||||
if (gift.getNamingLiveActiveRankHide() == 0) {
|
||||
if (gift.getNamingLiveActiveRankHide() == 0 || gift.getNamingLiveId()== IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
ImgLoader.display(mContext, gift.getNamingLiveAvatar(), user2Avatar);
|
||||
user2Name.setText(gift.getNamingLiveNicename());
|
||||
} else {
|
||||
user2Avatar.setImageResource(R.mipmap.hide);
|
||||
user2Name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
}
|
||||
if (gift.getNamingUserActiveRankHide() == 0) {
|
||||
if (gift.getNamingUserActiveRankHide() == 0|| gift.getNamingUserId()== IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
ImgLoader.display(mContext, gift.getNamingUserAvatar(), user1Avatar);
|
||||
user1Name.setText(gift.getNamingUserNicename());
|
||||
} else {
|
||||
|
||||
@@ -93,8 +93,13 @@ public class GiftWallMainTab1Fragment extends BaseFragment {
|
||||
@Override
|
||||
public void updateData() {
|
||||
super.updateData();
|
||||
list1Adapter.notifyDataSetChanged();
|
||||
list2Adapter.notifyDataSetChanged();
|
||||
if (list1Adapter != null) {
|
||||
list1Adapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
if (list2Adapter != null) {
|
||||
list2Adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
String anchorId;
|
||||
boolean isAnchor;
|
||||
private boolean isLiveRoom;
|
||||
private boolean isTab2;
|
||||
|
||||
public GiftWallMainTab2Fragment setToUserId(String toUserId) {
|
||||
this.toUserId = toUserId;
|
||||
@@ -151,11 +152,14 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
public Unit invoke(Integer fromIndex, List<Integer> selectIndexList, Boolean select, Boolean fromUser) {
|
||||
//参考setOnSelectViewChange
|
||||
//只不过对象从view,变成了view在ViewGroup中的索引
|
||||
if (fromIndex == 0) {
|
||||
if (isTab2 && fromIndex == -1) {
|
||||
fromIndex = 1;
|
||||
} else if (fromIndex == 0) {
|
||||
fromIndex = 1;
|
||||
} else {
|
||||
fromIndex = 0;
|
||||
}
|
||||
|
||||
setDslTabColor(fromIndex == 0 ? dslTab1 : dslTab2, fromIndex == 1 ? dslTab1 : dslTab2);
|
||||
type = (fromIndex + 1);
|
||||
list1Adapter.setNowRank(fromIndex == 0);
|
||||
@@ -179,7 +183,7 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
spinnerImage.setRotation(180);
|
||||
((XPopup.Builder) spinner.getTag()).asCustom(new GiftWallMainTab1List2SpinnerDialog(getContext(),1, new OnItemClickListener<Integer>() {
|
||||
((XPopup.Builder) spinner.getTag()).asCustom(new GiftWallMainTab1List2SpinnerDialog(getContext(), 1, new OnItemClickListener<Integer>() {
|
||||
@Override
|
||||
public void onItemClick(Integer bean, int position) {
|
||||
if (bean > -1) {
|
||||
@@ -203,7 +207,11 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
|
||||
}
|
||||
});
|
||||
initData();
|
||||
if (isTab2) {
|
||||
tabLayout.onPageSelected(1);
|
||||
} else {
|
||||
initData();
|
||||
}
|
||||
}
|
||||
|
||||
void setDslTabColor(TextView select, TextView unSelect) {
|
||||
@@ -216,9 +224,9 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
void initData() {
|
||||
list1Adapter.clear();
|
||||
list2Adapter.clear();
|
||||
if(type==2){
|
||||
if (type == 2) {
|
||||
spinner.setVisibility(View.INVISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
spinner.setVisibility(View.VISIBLE);
|
||||
}
|
||||
LiveNetManager.get(getContext())
|
||||
@@ -254,7 +262,7 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
list1Adapter.setList(bean.getIlluminateData().getWeekStartData());
|
||||
list2Adapter.setList(bean.getIlluminateData().getGiftData());
|
||||
show_time.setText(String.format(Locale.getDefault(), "%s%s - %s",
|
||||
WordUtil.getNewString(type==1?R.string.dialog_gift_wall_time_now:R.string.dialog_gift_wall_time_old),
|
||||
WordUtil.getNewString(type == 1 ? R.string.dialog_gift_wall_time_now : R.string.dialog_gift_wall_time_old),
|
||||
bean.getGift_hall_start_date(),
|
||||
bean.getGift_hall_end_date()));
|
||||
}
|
||||
@@ -263,4 +271,8 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
|
||||
public void setTab2() {
|
||||
isTab2 = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user