diff --git a/common/build.gradle b/common/build.gradle index 09d7dd30a..19700ba89 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -194,5 +194,6 @@ dependencies { //选择器 api 'com.github.gzu-liyujiang.AndroidPicker:Common:4.1.11' api 'com.github.gzu-liyujiang.AndroidPicker:WheelView:4.1.11' - + //自定义圆角图片 + api 'com.makeramen:roundedimageview:2.3.0' } diff --git a/common/src/main/java/com/yunbao/common/adapter/AchievementDetailsAdapter.java b/common/src/main/java/com/yunbao/common/adapter/AchievementDetailsAdapter.java new file mode 100644 index 000000000..79cebed8e --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/AchievementDetailsAdapter.java @@ -0,0 +1,41 @@ +package com.yunbao.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.UserMedalModel; +import com.yunbao.common.views.AchievementDetailsViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class AchievementDetailsAdapter extends RecyclerView.Adapter { + private List dressInfo = new ArrayList<>(); + + public AchievementDetailsAdapter(List dressInfo) { + this.dressInfo = dressInfo; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_achievement_details, parent, false); + return new AchievementDetailsViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + AchievementDetailsViewHolder achievementDetailsViewHolder = (AchievementDetailsViewHolder) holder; + achievementDetailsViewHolder.showData(dressInfo.get(position)); + } + + @Override + public int getItemCount() { + return dressInfo.size(); + } +} diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftAlreadyWallAdapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftAlreadyWallAdapter.java new file mode 100644 index 000000000..815c8f949 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/GiftAlreadyWallAdapter.java @@ -0,0 +1,43 @@ +package com.yunbao.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.views.GiftAlreadyWallViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class GiftAlreadyWallAdapter extends RecyclerView.Adapter { + private List giftWall = new ArrayList<>(); + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_already_wall, parent, false); + return new GiftAlreadyWallViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + GiftAlreadyWallViewHolder withoutWallViewHolder = (GiftAlreadyWallViewHolder) holder; + withoutWallViewHolder.showData(giftWall.get(position)); + } + + @Override + public int getItemCount() { + return giftWall.size(); + } + + public void addAllData(List mGiftWall) { + giftWall.clear(); + giftWall.addAll(mGiftWall); + notifyDataSetChanged(); + } +} diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftNumberAdapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftNumberAdapter.java new file mode 100644 index 000000000..6dcea6851 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/GiftNumberAdapter.java @@ -0,0 +1,40 @@ +package com.yunbao.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftQuantityModel; +import com.yunbao.common.views.GiftNumber; + +import java.util.List; + +public class GiftNumberAdapter extends RecyclerView.Adapter { + private List giftQuantityModels; + + public GiftNumberAdapter(List giftQuantityModels) { + this.giftQuantityModels = giftQuantityModels; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_gift_number, parent, false); + return new GiftNumber(robotSayHelloView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + GiftNumber giftNumber = (GiftNumber) holder; + giftNumber.showData(giftQuantityModels.get(position)); + } + + @Override + public int getItemCount() { + return giftQuantityModels.size(); + } +} diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftWithoutWallAdapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftWithoutWallAdapter.java new file mode 100644 index 000000000..0f78a3e64 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/GiftWithoutWallAdapter.java @@ -0,0 +1,43 @@ +package com.yunbao.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.views.GiftWithoutWallViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class GiftWithoutWallAdapter extends RecyclerView.Adapter { + private List giftWall = new ArrayList<>(); + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_without_wall, parent, false); + return new GiftWithoutWallViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + GiftWithoutWallViewHolder withoutWallViewHolder = (GiftWithoutWallViewHolder) holder; + withoutWallViewHolder.showData(giftWall.get(position)); + } + + @Override + public int getItemCount() { + return giftWall.size(); + } + + public void addAllData(List mGiftWall) { + giftWall.clear(); + giftWall.addAll(mGiftWall); + notifyDataSetChanged(); + } +} diff --git a/common/src/main/java/com/yunbao/common/adapter/MedalAchievementAdapter.java b/common/src/main/java/com/yunbao/common/adapter/MedalAchievementAdapter.java new file mode 100644 index 000000000..e0b43c9df --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/MedalAchievementAdapter.java @@ -0,0 +1,44 @@ +package com.yunbao.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.UserMedalListModel; +import com.yunbao.common.views.MedalAchievementViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class MedalAchievementAdapter extends RecyclerView.Adapter { + private List medalData = new ArrayList<>(); + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_medal_achievement, parent, false); + return new MedalAchievementViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + MedalAchievementViewHolder achievementViewHolder = (MedalAchievementViewHolder) holder; + achievementViewHolder.showData(medalData.get(position)); + } + + @Override + public int getItemCount() { + return medalData.size(); + } + + public void addAllData(List mGiftWall) { + + medalData.clear(); + medalData.addAll(mGiftWall); + notifyDataSetChanged(); + } +} diff --git a/common/src/main/java/com/yunbao/common/adapter/MonthGiftNamingAdapter.java b/common/src/main/java/com/yunbao/common/adapter/MonthGiftNamingAdapter.java new file mode 100644 index 000000000..ed15f7b54 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/MonthGiftNamingAdapter.java @@ -0,0 +1,43 @@ +package com.yunbao.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.views.MonthGiftNamingViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class MonthGiftNamingAdapter extends RecyclerView.Adapter { + private List giftWall = new ArrayList<>(); + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_month_gift_naming, parent, false); + return new MonthGiftNamingViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + MonthGiftNamingViewHolder monthGiftNamingViewHolder = (MonthGiftNamingViewHolder) holder; + monthGiftNamingViewHolder.showData(giftWall.get(position)); + } + + @Override + public int getItemCount() { + return giftWall.size(); + } + + public void addAllData(List mGiftWall) { + giftWall.clear(); + giftWall.addAll(mGiftWall); + notifyDataSetChanged(); + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java b/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java index b69499034..ec265a735 100644 --- a/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java +++ b/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java @@ -109,6 +109,29 @@ public class EnterRoomInfoModel extends BaseModel { @SerializedName("red_packet") private RedPacketModel redPacketModel; + @SerializedName("gift_wall_lighten_number") + private String giftWallLightenNumber; + @SerializedName("gift_wall_lighten_total") + private String giftWallLightenTotal; + + public String getGiftWallLightenNumber() { + return giftWallLightenNumber; + } + + public EnterRoomInfoModel setGiftWallLightenNumber(String giftWallLightenNumber) { + this.giftWallLightenNumber = giftWallLightenNumber; + return this; + } + + public String getGiftWallLightenTotal() { + return giftWallLightenTotal; + } + + public EnterRoomInfoModel setGiftWallLightenTotal(String giftWallLightenTotal) { + this.giftWallLightenTotal = giftWallLightenTotal; + return this; + } + public RedPacketModel getRedPacketModel() { return redPacketModel; } diff --git a/common/src/main/java/com/yunbao/common/bean/GiftAlreadyWallModel.java b/common/src/main/java/com/yunbao/common/bean/GiftAlreadyWallModel.java new file mode 100644 index 000000000..1384cb511 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/GiftAlreadyWallModel.java @@ -0,0 +1,44 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +/** + * 礼物墙已点亮 + */ +public class GiftAlreadyWallModel extends BaseModel { + @SerializedName("gift_wall") + private List giftWall; + @SerializedName("gift_wall_lighten_number") + private String giftWallLightenNumber; + @SerializedName("gift_wall_lighten_total") + private String giftWallLightenTotal; + + public List getGiftWall() { + return giftWall; + } + + public GiftAlreadyWallModel setGiftWall(List giftWall) { + this.giftWall = giftWall; + return this; + } + + public String getGiftWallLightenNumber() { + return giftWallLightenNumber; + } + + public GiftAlreadyWallModel setGiftWallLightenNumber(String giftWallLightenNumber) { + this.giftWallLightenNumber = giftWallLightenNumber; + return this; + } + + public String getGiftWallLightenTotal() { + return giftWallLightenTotal; + } + + public GiftAlreadyWallModel setGiftWallLightenTotal(String giftWallLightenTotal) { + this.giftWallLightenTotal = giftWallLightenTotal; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/GiftGuideModel.java b/common/src/main/java/com/yunbao/common/bean/GiftGuideModel.java new file mode 100644 index 000000000..c2484cfd5 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/GiftGuideModel.java @@ -0,0 +1,119 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class GiftGuideModel extends BaseModel { + + @SerializedName("guide_name") + private String guideName; + @SerializedName("illuminate_count") + private int illuminateCount; + @SerializedName("already_font") + private String alreadyFont; + @SerializedName("without_font") + private String withoutFont; + @SerializedName("number") + private String number; + @SerializedName("illuminate_total") + private int illuminateTotal; + @SerializedName("week_number") + private String weekNumber; + @SerializedName("guide_name_img_path") + private String guideNameImgPath; + @SerializedName("guide_background_picture_path") + private String guideBackgroundPicturePath; + @SerializedName("gift_data") + private List giftData; + + public String getAlreadyFont() { + return alreadyFont; + } + + public GiftGuideModel setAlreadyFont(String alreadyFont) { + this.alreadyFont = alreadyFont; + return this; + } + + public String getWithoutFont() { + return withoutFont; + } + + public GiftGuideModel setWithoutFont(String withoutFont) { + this.withoutFont = withoutFont; + return this; + } + + public String getNumber() { + return number; + } + + public GiftGuideModel setNumber(String number) { + this.number = number; + return this; + } + + public int getIlluminateTotal() { + return illuminateTotal; + } + + public GiftGuideModel setIlluminateTotal(int illuminateTotal) { + this.illuminateTotal = illuminateTotal; + return this; + } + + public String getWeekNumber() { + return weekNumber; + } + + public GiftGuideModel setWeekNumber(String weekNumber) { + this.weekNumber = weekNumber; + return this; + } + + public String getGuideNameImgPath() { + return guideNameImgPath; + } + + public GiftGuideModel setGuideNameImgPath(String guideNameImgPath) { + this.guideNameImgPath = guideNameImgPath; + return this; + } + + public String getGuideBackgroundPicturePath() { + return guideBackgroundPicturePath; + } + + public GiftGuideModel setGuideBackgroundPicturePath(String guideBackgroundPicturePath) { + this.guideBackgroundPicturePath = guideBackgroundPicturePath; + return this; + } + + public String getGuideName() { + return guideName; + } + + public GiftGuideModel setGuideName(String guideName) { + this.guideName = guideName; + return this; + } + + public int getIlluminateCount() { + return illuminateCount; + } + + public GiftGuideModel setIlluminateCount(int illuminateCount) { + this.illuminateCount = illuminateCount; + return this; + } + + public List getGiftData() { + return giftData; + } + + public GiftGuideModel setGiftData(List giftData) { + this.giftData = giftData; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/GiftQuantityModel.java b/common/src/main/java/com/yunbao/common/bean/GiftQuantityModel.java new file mode 100644 index 000000000..09fda25b7 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/GiftQuantityModel.java @@ -0,0 +1,43 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +/** + * 礼物选择数量 + */ +public class GiftQuantityModel extends BaseModel { + + @SerializedName("id") + private String id; + @SerializedName("gift_quantity") + private String giftQuantity; + @SerializedName("font_colour") + private String fontColour; + + public String getId() { + return id; + } + + public GiftQuantityModel setId(String id) { + this.id = id; + return this; + } + + public String getGiftQuantity() { + return giftQuantity; + } + + public GiftQuantityModel setGiftQuantity(String giftQuantity) { + this.giftQuantity = giftQuantity; + return this; + } + + public String getFontColour() { + return fontColour; + } + + public GiftQuantityModel setFontColour(String fontColour) { + this.fontColour = fontColour; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/GiftWallGiftDetail.java b/common/src/main/java/com/yunbao/common/bean/GiftWallGiftDetail.java new file mode 100644 index 000000000..7c069265f --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/GiftWallGiftDetail.java @@ -0,0 +1,51 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class GiftWallGiftDetail extends BaseModel { + + @SerializedName("uid") + private int uid; + @SerializedName("user_nicename") + private String userNicename; + @SerializedName("avatar") + private String avatar; + @SerializedName("naming_coin") + private int namingCoin; + + public int getUid() { + return uid; + } + + public GiftWallGiftDetail setUid(int uid) { + this.uid = uid; + return this; + } + + public String getUserNicename() { + return userNicename; + } + + public GiftWallGiftDetail setUserNicename(String userNicename) { + this.userNicename = userNicename; + return this; + } + + public String getAvatar() { + return avatar; + } + + public GiftWallGiftDetail setAvatar(String avatar) { + this.avatar = avatar; + return this; + } + + public int getNamingCoin() { + return namingCoin; + } + + public GiftWallGiftDetail setNamingCoin(int namingCoin) { + this.namingCoin = namingCoin; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/GiftWallModel.java b/common/src/main/java/com/yunbao/common/bean/GiftWallModel.java new file mode 100644 index 000000000..ac4dc6841 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/GiftWallModel.java @@ -0,0 +1,392 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class GiftWallModel extends BaseModel { + @SerializedName("id") + private String id; + @SerializedName("sendtype") + private String sendtype; + @SerializedName("type") + private String type; + @SerializedName("name") + private String name; + @SerializedName("release_status") + private String releaseStatus; + @SerializedName("type_sort") + private String typeSort; + @SerializedName("operate_image") + private String operateImage; + @SerializedName("operate_url") + private String operateUrl; + @SerializedName("mark") + private String mark; + @SerializedName("giftname") + private String giftname; + @SerializedName("needcoin") + private String needcoin; + @SerializedName("gifticon") + private String gifticon; + @SerializedName("gift_description") + private String giftDescription; + @SerializedName("corner_mark") + private String cornerMark; + @SerializedName("swf") + private String swf; + @SerializedName("gift_uid") + private String giftUid; + @SerializedName("type_start_time") + private String typeStartTime; + @SerializedName("type_end_time") + private String typeEndTime; + @SerializedName("gift_start_time") + private String giftStartTime; + @SerializedName("gift_end_time") + private String giftEndTime; + @SerializedName("naming_liveuid") + private String namingLiveuid; + @SerializedName("naming_uid") + private String namingUid; + @SerializedName("naming_live_name") + private String namingLiveName; + @SerializedName("naming_user_name") + private String namingUserName; + @SerializedName("naming_live_avatar") + private String namingLiveAvatar; + @SerializedName("naming_user_avatar") + private String namingUserAvatar; + @SerializedName("naming_status") + private String namingStatus; + @SerializedName("naming_coin") + private String namingCoin; + @SerializedName("gifticon_total") + private String gifticonTotal; + @SerializedName("gift_count_number") + private String giftCountNumber; + @SerializedName("user_nicename") + private String userNicename; + @SerializedName("avatar") + private String avatar; + @SerializedName("naming_coin_max") + private String namingCoinMax; + + @SerializedName("illuminate_status") + private int illuminateStatus; + @SerializedName("font_color") + private String fontColor; + + public String getFontColor() { + return fontColor; + } + + public GiftWallModel setFontColor(String fontColor) { + this.fontColor = fontColor; + return this; + } + + public int getIlluminateStatus() { + return illuminateStatus; + } + + public GiftWallModel setIlluminateStatus(int illuminateStatus) { + this.illuminateStatus = illuminateStatus; + return this; + } + + public String getNamingCoinMax() { + return namingCoinMax; + } + + public GiftWallModel setNamingCoinMax(String namingCoinMax) { + this.namingCoinMax = namingCoinMax; + return this; + } + + public String getAvatar() { + return avatar; + } + + public GiftWallModel setAvatar(String avatar) { + this.avatar = avatar; + return this; + } + + public String getUserNicename() { + return userNicename; + } + + public GiftWallModel setUserNicename(String userNicename) { + this.userNicename = userNicename; + return this; + } + + public String getId() { + return id; + } + + public GiftWallModel setId(String id) { + this.id = id; + return this; + } + + public String getSendtype() { + return sendtype; + } + + public GiftWallModel setSendtype(String sendtype) { + this.sendtype = sendtype; + return this; + } + + public String getType() { + return type; + } + + public GiftWallModel setType(String type) { + this.type = type; + return this; + } + + public String getName() { + return name; + } + + public GiftWallModel setName(String name) { + this.name = name; + return this; + } + + public String getReleaseStatus() { + return releaseStatus; + } + + public GiftWallModel setReleaseStatus(String releaseStatus) { + this.releaseStatus = releaseStatus; + return this; + } + + public String getTypeSort() { + return typeSort; + } + + public GiftWallModel setTypeSort(String typeSort) { + this.typeSort = typeSort; + return this; + } + + public String getOperateImage() { + return operateImage; + } + + public GiftWallModel setOperateImage(String operateImage) { + this.operateImage = operateImage; + return this; + } + + public String getOperateUrl() { + return operateUrl; + } + + public GiftWallModel setOperateUrl(String operateUrl) { + this.operateUrl = operateUrl; + return this; + } + + public String getMark() { + return mark; + } + + public GiftWallModel setMark(String mark) { + this.mark = mark; + return this; + } + + public String getGiftname() { + return giftname; + } + + public GiftWallModel setGiftname(String giftname) { + this.giftname = giftname; + return this; + } + + public String getNeedcoin() { + return needcoin; + } + + public GiftWallModel setNeedcoin(String needcoin) { + this.needcoin = needcoin; + return this; + } + + public String getGifticon() { + return gifticon; + } + + public GiftWallModel setGifticon(String gifticon) { + this.gifticon = gifticon; + return this; + } + + public String getGiftDescription() { + return giftDescription; + } + + public GiftWallModel setGiftDescription(String giftDescription) { + this.giftDescription = giftDescription; + return this; + } + + public String getCornerMark() { + return cornerMark; + } + + public GiftWallModel setCornerMark(String cornerMark) { + this.cornerMark = cornerMark; + return this; + } + + public String getSwf() { + return swf; + } + + public GiftWallModel setSwf(String swf) { + this.swf = swf; + return this; + } + + public String getGiftUid() { + return giftUid; + } + + public GiftWallModel setGiftUid(String giftUid) { + this.giftUid = giftUid; + return this; + } + + public String getTypeStartTime() { + return typeStartTime; + } + + public GiftWallModel setTypeStartTime(String typeStartTime) { + this.typeStartTime = typeStartTime; + return this; + } + + public String getTypeEndTime() { + return typeEndTime; + } + + public GiftWallModel setTypeEndTime(String typeEndTime) { + this.typeEndTime = typeEndTime; + return this; + } + + public String getGiftStartTime() { + return giftStartTime; + } + + public GiftWallModel setGiftStartTime(String giftStartTime) { + this.giftStartTime = giftStartTime; + return this; + } + + public String getGiftEndTime() { + return giftEndTime; + } + + public GiftWallModel setGiftEndTime(String giftEndTime) { + this.giftEndTime = giftEndTime; + return this; + } + + public String getNamingLiveuid() { + return namingLiveuid; + } + + public GiftWallModel setNamingLiveuid(String namingLiveuid) { + this.namingLiveuid = namingLiveuid; + return this; + } + + public String getNamingUid() { + return namingUid; + } + + public GiftWallModel setNamingUid(String namingUid) { + this.namingUid = namingUid; + return this; + } + + public String getNamingLiveName() { + return namingLiveName; + } + + public GiftWallModel setNamingLiveName(String namingLiveName) { + this.namingLiveName = namingLiveName; + return this; + } + + public String getNamingUserName() { + return namingUserName; + } + + public GiftWallModel setNamingUserName(String namingUserName) { + this.namingUserName = namingUserName; + return this; + } + + public String getNamingLiveAvatar() { + return namingLiveAvatar; + } + + public GiftWallModel setNamingLiveAvatar(String namingLiveAvatar) { + this.namingLiveAvatar = namingLiveAvatar; + return this; + } + + public String getNamingUserAvatar() { + return namingUserAvatar; + } + + public GiftWallModel setNamingUserAvatar(String namingUserAvatar) { + this.namingUserAvatar = namingUserAvatar; + return this; + } + + public String getNamingStatus() { + return namingStatus; + } + + public GiftWallModel setNamingStatus(String namingStatus) { + this.namingStatus = namingStatus; + return this; + } + + public String getNamingCoin() { + return namingCoin; + } + + public GiftWallModel setNamingCoin(String namingCoin) { + this.namingCoin = namingCoin; + return this; + } + + public String getGifticonTotal() { + return gifticonTotal; + } + + public GiftWallModel setGifticonTotal(String gifticonTotal) { + this.gifticonTotal = gifticonTotal; + return this; + } + + public String getGiftCountNumber() { + return giftCountNumber; + } + + public GiftWallModel setGiftCountNumber(String giftCountNumber) { + this.giftCountNumber = giftCountNumber; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java index c0777d57e..5047d7c1b 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java @@ -23,7 +23,7 @@ public class LiveGiftBean { private String name; private String price; private String icon; - private boolean checked; + private boolean checked = false; private int page; private View mView; private String sendType;//支付是金币还是钻石 @@ -36,6 +36,160 @@ public class LiveGiftBean { private String tag; @JSONField(name = "blind_box_type") private int blind_box_type = 0; + //礼物角标 + + @JSONField(name = "corner_mark") + private String cornerMark; + @JSONField(name = "gift_description") + private String giftDescription; + + @JSONField(name = "operate_image") + private String operateImage; + + @JSONField(name = "operate_url") + private String operateUrl; + @JSONField(name = "naming_liveuid") + private String namingLiveuid; + @JSONField(name = "naming_uid") + private String namingUid; + @JSONField(name = "naming_live_name") + private String namingLiveName; + @JSONField(name = "naming_user_name") + private String namingUserName; + @JSONField(name = "naming_live_avatar") + private String namingLiveAvatar; + @JSONField(name = "naming_user_avatar") + private String namingUserAvatar; + @JSONField(name = "naming_status") + private String namingStatus; + @JSONField(name = "naming_coin") + private String namingCoin; + + public View getmView() { + return mView; + } + + public LiveGiftBean setmView(View mView) { + this.mView = mView; + return this; + } + + public String getmGiftNum() { + return mGiftNum; + } + + public LiveGiftBean setmGiftNum(String mGiftNum) { + this.mGiftNum = mGiftNum; + return this; + } + + public String getNamingLiveuid() { + return namingLiveuid; + } + + public LiveGiftBean setNamingLiveuid(String namingLiveuid) { + this.namingLiveuid = namingLiveuid; + return this; + } + + public String getNamingUid() { + return namingUid; + } + + public LiveGiftBean setNamingUid(String namingUid) { + this.namingUid = namingUid; + return this; + } + + public String getNamingLiveName() { + return namingLiveName; + } + + public LiveGiftBean setNamingLiveName(String namingLiveName) { + this.namingLiveName = namingLiveName; + return this; + } + + public String getNamingUserName() { + return namingUserName; + } + + public LiveGiftBean setNamingUserName(String namingUserName) { + this.namingUserName = namingUserName; + return this; + } + + public String getNamingLiveAvatar() { + return namingLiveAvatar; + } + + public LiveGiftBean setNamingLiveAvatar(String namingLiveAvatar) { + this.namingLiveAvatar = namingLiveAvatar; + return this; + } + + public String getNamingUserAvatar() { + return namingUserAvatar; + } + + public LiveGiftBean setNamingUserAvatar(String namingUserAvatar) { + this.namingUserAvatar = namingUserAvatar; + return this; + } + + public String getNamingStatus() { + return namingStatus; + } + + public LiveGiftBean setNamingStatus(String namingStatus) { + this.namingStatus = namingStatus; + return this; + } + + public String getNamingCoin() { + return namingCoin; + } + + public LiveGiftBean setNamingCoin(String namingCoin) { + this.namingCoin = namingCoin; + return this; + } + + public String getOperateImage() { + return operateImage; + } + + public LiveGiftBean setOperateImage(String operateImage) { + this.operateImage = operateImage; + return this; + } + + public String getOperateUrl() { + return operateUrl; + } + + public LiveGiftBean setOperateUrl(String operateUrl) { + this.operateUrl = operateUrl; + return this; + } + + public String getGiftDescription() { + return giftDescription; + } + + public LiveGiftBean setGiftDescription(String giftDescription) { + this.giftDescription = giftDescription; + return this; + } + + public String getCornerMark() { + return cornerMark; + } + + public LiveGiftBean setCornerMark(String cornerMark) { + this.cornerMark = cornerMark; + return this; + } public int getBlind_box_type() { return blind_box_type; diff --git a/common/src/main/java/com/yunbao/common/bean/MedalAchievementModel.java b/common/src/main/java/com/yunbao/common/bean/MedalAchievementModel.java new file mode 100644 index 000000000..9a6fb6ea5 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/MedalAchievementModel.java @@ -0,0 +1,42 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class MedalAchievementModel extends BaseModel { + + @SerializedName("medal_total_number") + private String medalTotalNumber; + @SerializedName("medal_light_number") + private String medalLightNumber; + @SerializedName("medal_data") + private List medalData; + + public String getMedalTotalNumber() { + return medalTotalNumber; + } + + public MedalAchievementModel setMedalTotalNumber(String medalTotalNumber) { + this.medalTotalNumber = medalTotalNumber; + return this; + } + + public String getMedalLightNumber() { + return medalLightNumber; + } + + public MedalAchievementModel setMedalLightNumber(String medalLightNumber) { + this.medalLightNumber = medalLightNumber; + return this; + } + + public List getMedalData() { + return medalData; + } + + public MedalAchievementModel setMedalData(List medalData) { + this.medalData = medalData; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/UserMedalListModel.java b/common/src/main/java/com/yunbao/common/bean/UserMedalListModel.java new file mode 100644 index 000000000..13b783833 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/UserMedalListModel.java @@ -0,0 +1,76 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +public class UserMedalListModel extends BaseModel { + + @SerializedName("dress_name") + private String dressName; + @SerializedName("dress_info") + private List dressInfo = new ArrayList<>(); + @SerializedName("display_src") + private String displaySrc; + @SerializedName("dress_description") + private String dressDescription; + @SerializedName("display_src_second") + private String displaySrcSecond; + @SerializedName("dress_status")//1Hd2whd + private String dressStatus; + + public String getDressDescription() { + return dressDescription; + } + + public UserMedalListModel setDressDescription(String dressDescription) { + this.dressDescription = dressDescription; + return this; + } + + public String getDisplaySrcSecond() { + return displaySrcSecond; + } + + public UserMedalListModel setDisplaySrcSecond(String displaySrcSecond) { + this.displaySrcSecond = displaySrcSecond; + return this; + } + + public String getDressStatus() { + return dressStatus; + } + + public UserMedalListModel setDressStatus(String dressStatus) { + this.dressStatus = dressStatus; + return this; + } + + public String getDressName() { + return dressName; + } + + public UserMedalListModel setDressName(String dressName) { + this.dressName = dressName; + return this; + } + + public List getDressInfo() { + return dressInfo; + } + + public UserMedalListModel setDressInfo(List dressInfo) { + this.dressInfo = dressInfo; + return this; + } + + public String getDisplaySrc() { + return displaySrc; + } + + public UserMedalListModel setDisplaySrc(String displaySrc) { + this.displaySrc = displaySrc; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java b/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java new file mode 100644 index 000000000..4ac5dde3e --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java @@ -0,0 +1,72 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class UserMedalModel extends BaseModel { + @SerializedName("id") + private String id; + @SerializedName("display_src") + private String displaySrc; + @SerializedName("dress_name") + private String dressName; + @SerializedName("dress_description") + private String dressDescription; + @SerializedName("sort") + private String sort; + @SerializedName("dress_status") + private String dressStatus; + + public String getId() { + return id; + } + + public UserMedalModel setId(String id) { + this.id = id; + return this; + } + + public String getDisplaySrc() { + return displaySrc; + } + + public UserMedalModel setDisplaySrc(String displaySrc) { + this.displaySrc = displaySrc; + return this; + } + + public String getDressName() { + return dressName; + } + + public UserMedalModel setDressName(String dressName) { + this.dressName = dressName; + return this; + } + + public String getDressDescription() { + return dressDescription; + } + + public UserMedalModel setDressDescription(String dressDescription) { + this.dressDescription = dressDescription; + return this; + } + + public String getSort() { + return sort; + } + + public UserMedalModel setSort(String sort) { + this.sort = sort; + return this; + } + + public String getDressStatus() { + return dressStatus; + } + + public UserMedalModel setDressStatus(String dressStatus) { + this.dressStatus = dressStatus; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/AchievementDetailsPopup.java b/common/src/main/java/com/yunbao/common/dialog/AchievementDetailsPopup.java new file mode 100644 index 000000000..2c7fc07a3 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/AchievementDetailsPopup.java @@ -0,0 +1,93 @@ +package com.yunbao.common.dialog; + + +import android.content.Context; +import android.text.TextUtils; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +import com.yunbao.common.adapter.AchievementDetailsAdapter; +import com.yunbao.common.bean.UserMedalListModel; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class AchievementDetailsPopup extends CenterPopupView { + private UserMedalListModel userMedalListModel; + private ImageView achievementImg; + private TextView dressName, dressDescription; + private View havaDataList, havaData; + private AchievementDetailsAdapter achievementDetailsAdapter; +private RecyclerView achievementImgList; + public AchievementDetailsPopup(@NonNull Context context, UserMedalListModel userMedalListModel) { + super(context); + this.userMedalListModel = userMedalListModel; + } + + @Override + protected int getImplLayoutId() { + return R.layout.popup_achievement_details; + } + + @Override + protected void onCreate() { + super.onCreate(); + havaDataList = findViewById(R.id.hava_data_list); + havaData = findViewById(R.id.hava_data); + if (userMedalListModel.getDressInfo().size() > 0) { + havaDataList.setVisibility(GONE); + havaData.setVisibility(VISIBLE); + achievementDetailsAdapter = new AchievementDetailsAdapter(userMedalListModel.getDressInfo()); + + achievementImg = findViewById(R.id.achievement_img2); + dressName = findViewById(R.id.dress_name2); + dressDescription = findViewById(R.id.dress_description2); + achievementImgList = findViewById(R.id.achievement_img_list); + + if (TextUtils.equals(userMedalListModel.getDressStatus(), "1")) { + ImgLoader.display(getContext(), userMedalListModel.getDisplaySrc(), achievementImg); + } else { + ImgLoader.display(getContext(), userMedalListModel.getDisplaySrcSecond(), achievementImg); + } + dressName.setText(userMedalListModel.getDressName()); + dressDescription.setText(userMedalListModel.getDressDescription()); + achievementImgList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); + achievementImgList.setAdapter(achievementDetailsAdapter); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.gift_details_btn2), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + + } else { + havaDataList.setVisibility(VISIBLE); + havaData.setVisibility(GONE); + + achievementImg = findViewById(R.id.achievement_img); + dressName = findViewById(R.id.dress_name); + dressDescription = findViewById(R.id.dress_description); + + if (TextUtils.equals(userMedalListModel.getDressStatus(), "1")) { + ImgLoader.display(getContext(), userMedalListModel.getDisplaySrc(), achievementImg); + } else { + ImgLoader.display(getContext(), userMedalListModel.getDisplaySrcSecond(), achievementImg); + } + dressName.setText(userMedalListModel.getDressName()); + dressDescription.setText(userMedalListModel.getDressDescription()); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.gift_details_btn), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + } + + } +} diff --git a/common/src/main/java/com/yunbao/common/event/CodexEvent.java b/common/src/main/java/com/yunbao/common/event/CodexEvent.java new file mode 100644 index 000000000..09c6e9d00 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/CodexEvent.java @@ -0,0 +1,6 @@ +package com.yunbao.common.event; + +import com.yunbao.common.bean.BaseModel; + +public class CodexEvent extends BaseModel { +} diff --git a/common/src/main/java/com/yunbao/common/event/GiftNumberEvent.java b/common/src/main/java/com/yunbao/common/event/GiftNumberEvent.java new file mode 100644 index 000000000..b4684d0b8 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/GiftNumberEvent.java @@ -0,0 +1,16 @@ +package com.yunbao.common.event; + +import com.yunbao.common.bean.BaseModel; + +public class GiftNumberEvent extends BaseModel { + private String mCount; + + public String getmCount() { + return mCount; + } + + public GiftNumberEvent setmCount(String mCount) { + this.mCount = mCount; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/event/GiftWallIlluminateEvent.java b/common/src/main/java/com/yunbao/common/event/GiftWallIlluminateEvent.java new file mode 100644 index 000000000..ef36b27f1 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/GiftWallIlluminateEvent.java @@ -0,0 +1,52 @@ +package com.yunbao.common.event; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.bean.BaseModel; + +public class GiftWallIlluminateEvent extends BaseModel { + + @SerializedName("_method_") + private String method; + @SerializedName("action") + private String action; + @SerializedName("max_number") + private int maxNumber; + @SerializedName("new_number") + private int newNumber; + + public String getMethod() { + return method; + } + + public GiftWallIlluminateEvent setMethod(String method) { + this.method = method; + return this; + } + + public String getAction() { + return action; + } + + public GiftWallIlluminateEvent setAction(String action) { + this.action = action; + return this; + } + + public int getMaxNumber() { + return maxNumber; + } + + public GiftWallIlluminateEvent setMaxNumber(int maxNumber) { + this.maxNumber = maxNumber; + return this; + } + + public int getNewNumber() { + return newNumber; + } + + public GiftWallIlluminateEvent setNewNumber(int newNumber) { + this.newNumber = newNumber; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/event/GiftWallItemEvent.java b/common/src/main/java/com/yunbao/common/event/GiftWallItemEvent.java new file mode 100644 index 000000000..301d46608 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/GiftWallItemEvent.java @@ -0,0 +1,27 @@ +package com.yunbao.common.event; + +import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.GiftWallModel; + +public class GiftWallItemEvent extends BaseModel { + private GiftWallModel giftWallModel; + private boolean unlit; + + public GiftWallModel getGiftWallModel() { + return giftWallModel; + } + + public GiftWallItemEvent setGiftWallModel(GiftWallModel giftWallModel) { + this.giftWallModel = giftWallModel; + return this; + } + + public boolean isUnlit() { + return unlit; + } + + public GiftWallItemEvent setUnlit(boolean unlit) { + this.unlit = unlit; + return this; + } +} diff --git a/live/src/main/java/com/yunbao/live/event/LiveGiftDialogEvent.java b/common/src/main/java/com/yunbao/common/event/LiveGiftDialogEvent.java similarity index 53% rename from live/src/main/java/com/yunbao/live/event/LiveGiftDialogEvent.java rename to common/src/main/java/com/yunbao/common/event/LiveGiftDialogEvent.java index cd0a65171..5c6c76e48 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveGiftDialogEvent.java +++ b/common/src/main/java/com/yunbao/common/event/LiveGiftDialogEvent.java @@ -1,4 +1,4 @@ -package com.yunbao.live.event; +package com.yunbao.common.event; public class LiveGiftDialogEvent { } diff --git a/common/src/main/java/com/yunbao/common/fragment/AllServiceChampionFragment.java b/common/src/main/java/com/yunbao/common/fragment/AllServiceChampionFragment.java new file mode 100644 index 000000000..8f6501212 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/fragment/AllServiceChampionFragment.java @@ -0,0 +1,73 @@ +package com.yunbao.common.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.fragment.app.FragmentTransaction; + +import com.yunbao.common.R; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class AllServiceChampionFragment extends BaseFragment { + private TextView winnerOfTheMonth, lastMonthWinner; + private String mStream, mLiveUid; + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_all_service_champion, viewGroup, false); + } + + @Override + protected void initVariables(Bundle bundle) { + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + winnerOfTheMonth = contentView.findViewById(R.id.winner_of_the_month); + lastMonthWinner = contentView.findViewById(R.id.last_month_winner); + winnerOfTheMonth.setSelected(true); + lastMonthWinner.setSelected(false); + + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, CurrentMonthGiftNamingFragment.newInstance(mStream, mLiveUid)); + transaction.commit(); + ViewClicksAntiShake.clicksAntiShake(winnerOfTheMonth, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + winnerOfTheMonth.setSelected(true); + lastMonthWinner.setSelected(false); + + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, CurrentMonthGiftNamingFragment.newInstance(mStream, mLiveUid)); + transaction.commit(); + } + }); + ViewClicksAntiShake.clicksAntiShake(lastMonthWinner, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + lastMonthWinner.setSelected(true); + winnerOfTheMonth.setSelected(false); + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, LastMonthGiftNamingFragment.newInstance(mStream, mLiveUid)); + transaction.commit(); + } + }); + } + + @Override + protected void loadData() { + + } + public static AllServiceChampionFragment newInstance(String mStream, String mLiveUid) { + AllServiceChampionFragment allServiceChampionFragment = new AllServiceChampionFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + allServiceChampionFragment.setArguments(bundle); + return allServiceChampionFragment; + } +} diff --git a/common/src/main/java/com/yunbao/common/fragment/CurrentMonthGiftNamingFragment.java b/common/src/main/java/com/yunbao/common/fragment/CurrentMonthGiftNamingFragment.java new file mode 100644 index 000000000..53364a780 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/fragment/CurrentMonthGiftNamingFragment.java @@ -0,0 +1,79 @@ +package com.yunbao.common.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.adapter.MonthGiftNamingAdapter; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.ToastUtil; + +import java.util.List; + +public class CurrentMonthGiftNamingFragment extends BaseFragment { + private String mStream, mLiveUid; + private RecyclerView giftList; + private MonthGiftNamingAdapter monthGiftNamingAdapter; + private View noData; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_current_month_gift_naming, viewGroup, false); + } + + + @Override + protected void initVariables(Bundle bundle) { + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + giftList = contentView.findViewById(R.id.gift_list); + noData = contentView.findViewById(R.id.no_data); + monthGiftNamingAdapter = new MonthGiftNamingAdapter(); + giftList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false)); + giftList.setAdapter(monthGiftNamingAdapter); + } + + @Override + protected void loadData() { + LiveNetManager.get(getContext()). + currentMonthGiftNaming(new HttpCallback>() { + @Override + public void onSuccess(List data) { + if (data.size() > 0) { + giftList.setVisibility(View.VISIBLE); + noData.setVisibility(View.GONE); + monthGiftNamingAdapter.addAllData(data); + } else { + giftList.setVisibility(View.GONE); + noData.setVisibility(View.VISIBLE); + + } + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + + public static CurrentMonthGiftNamingFragment newInstance(String mStream, String mLiveUid) { + CurrentMonthGiftNamingFragment currentMonthGiftNamingFragment = new CurrentMonthGiftNamingFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + currentMonthGiftNamingFragment.setArguments(bundle); + return currentMonthGiftNamingFragment; + } +} diff --git a/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.java b/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.java new file mode 100644 index 000000000..f86e1aebf --- /dev/null +++ b/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.java @@ -0,0 +1,81 @@ +package com.yunbao.common.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.adapter.GiftWithoutWallAdapter; +import com.yunbao.common.bean.GiftAlreadyWallModel; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; + +/** + * wei点亮礼物墙 + */ +public class GiftWithoutWallFragment extends BaseFragment { + private String mStream, mLiveUid, toUid; + private RecyclerView withoutList; + private LinearLayout giftWallNoData; + private GiftWithoutWallAdapter withoutWallAdapter; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_gift_without_wall, viewGroup, false); + } + + + @Override + protected void initVariables(Bundle bundle) { + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + toUid = bundle.getString("toUid"); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + withoutList = contentView.findViewById(R.id.without_list); + giftWallNoData = contentView.findViewById(R.id.gift_wall_no_data); + withoutWallAdapter = new GiftWithoutWallAdapter(); + withoutList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false)); + withoutList.setAdapter(withoutWallAdapter); + } + + @Override + protected void loadData() { + LiveNetManager.get(getActivity()). + giftWithoutWall(mLiveUid, toUid, new HttpCallback() { + @Override + public void onSuccess(GiftAlreadyWallModel data) { + if (data.getGiftWall().size() > 0) { + giftWallNoData.setVisibility(View.GONE); + withoutList.setVisibility(View.VISIBLE); + withoutWallAdapter.addAllData(data.getGiftWall()); + } else { + giftWallNoData.setVisibility(View.VISIBLE); + withoutList.setVisibility(View.GONE); + } + } + + @Override + public void onError(String error) { + + } + }); + } + + public static GiftWithoutWallFragment newInstance(String mStream, String mLiveUid, String toUid) { + GiftWithoutWallFragment liveGiftFragment = new GiftWithoutWallFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + bundle.putString("toUid", toUid); + liveGiftFragment.setArguments(bundle); + return liveGiftFragment; + } +} diff --git a/common/src/main/java/com/yunbao/common/fragment/LastMonthGiftNamingFragment.java b/common/src/main/java/com/yunbao/common/fragment/LastMonthGiftNamingFragment.java new file mode 100644 index 000000000..7aaabb134 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/fragment/LastMonthGiftNamingFragment.java @@ -0,0 +1,79 @@ +package com.yunbao.common.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.adapter.MonthGiftNamingAdapter; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.ToastUtil; + +import java.util.List; + +public class LastMonthGiftNamingFragment extends BaseFragment { + private String mStream, mLiveUid; + private RecyclerView giftList; + private MonthGiftNamingAdapter monthGiftNamingAdapter; + private View noData; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_last_month_gift_naming, viewGroup, false); + } + + + @Override + protected void initVariables(Bundle bundle) { + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + giftList = contentView.findViewById(R.id.gift_list); + noData = contentView.findViewById(R.id.no_data); + monthGiftNamingAdapter = new MonthGiftNamingAdapter(); + giftList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false)); + giftList.setAdapter(monthGiftNamingAdapter); + } + + @Override + protected void loadData() { + LiveNetManager.get(getContext()). + lastMonthGiftNaming(new HttpCallback>() { + @Override + public void onSuccess(List data) { + if (data.size() > 0) { + giftList.setVisibility(View.VISIBLE); + noData.setVisibility(View.GONE); + monthGiftNamingAdapter.addAllData(data); + } else { + giftList.setVisibility(View.GONE); + noData.setVisibility(View.VISIBLE); + + } + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + + public static LastMonthGiftNamingFragment newInstance(String mStream, String mLiveUid) { + LastMonthGiftNamingFragment lastMonthGiftNamingFragment = new LastMonthGiftNamingFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + lastMonthGiftNamingFragment.setArguments(bundle); + return lastMonthGiftNamingFragment; + } +} diff --git a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java index 4d7882868..f13262a34 100644 --- a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java +++ b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java @@ -336,6 +336,18 @@ public class ImgLoader { builder.into(imageView); } + public static void displayBlurLive(Context context, int url, ImageView imageView) { + if (!contextIsExist(context)) { + return; + } + RequestBuilder builder = Glide.with(context) + .load(url) + .thumbnail(thumbnail) + .apply(RequestOptions.bitmapTransform(new BlurTransformation(20))) + .placeholder(R.mipmap.live_bg); + builder.into(imageView); + } + private static boolean contextIsExist(Context context) { if (context == null) { return false; diff --git a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java index 439bc94da..3f038fab2 100644 --- a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java @@ -19,13 +19,13 @@ import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.event.FollowEvent; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.APKManager; +import com.yunbao.common.manager.GiftQuantityManager; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.LiveClassManager; import com.yunbao.common.manager.NewLevelManager; import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.L; -import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.VersionUtil; @@ -231,6 +231,10 @@ public class CommonHttpUtil { if (obj.containsKey("defaultBubbleUrl")) { IMLoginManager.get(context).setDefaultBubbleUrl(obj.getString("defaultBubbleUrl")); } + if (obj.containsKey("gift_quantity")) { + JSONArray giftQuantity = obj.getJSONArray("gift_quantity"); + new GiftQuantityManager(context).UpGiftQuantity(giftQuantity.toJSONString()); + } } catch (Exception e) { e.printStackTrace(); String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage(); 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 60938e8fb..1155d847c 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -12,6 +12,10 @@ import com.yunbao.common.bean.CustomSidebarInfoModel; import com.yunbao.common.bean.DiscountsModel; import com.yunbao.common.bean.EnterRoomNewModel; import com.yunbao.common.bean.FaceBookUpModel; +import com.yunbao.common.bean.GiftAlreadyWallModel; +import com.yunbao.common.bean.GiftGuideModel; +import com.yunbao.common.bean.GiftWallGiftDetail; +import com.yunbao.common.bean.GiftWallModel; import com.yunbao.common.bean.HourRank; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.IMLoginModel; @@ -27,6 +31,7 @@ import com.yunbao.common.bean.LiveRoomVoteModel; import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveTaskModel; import com.yunbao.common.bean.LiveUserMailBoxModel; +import com.yunbao.common.bean.MedalAchievementModel; import com.yunbao.common.bean.MsgSwitchDetailModel; import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.bean.NobleRankHideUserListModel; @@ -829,4 +834,69 @@ public interface PDLiveApi { @Query("stream") String stream, @Query("red_packet_id") String redPacketId ); + + /** + * 礼物墙已点亮 + */ + @GET("/api/public/?service=Gift.giftAlreadyWall") + Observable> giftAlreadyWall( + @Query("liveuid") String liveUid, + @Query("to_uid") String toUid + ); + + /** + * 礼物墙未点亮 + */ + @GET("/api/public/?service=Gift.giftWithoutWall") + Observable> giftWithoutWall( + @Query("liveuid") String liveUid, + @Query("to_uid") String toUid + ); + + /** + * 礼物墙选中礼物详情 + */ + @GET("/api/public/?service=Gift.giftDetail") + Observable> giftDetail( + @Query("liveuid") String liveUid, + @Query("gift_id") String giftId + ); + + /** + * 礼物墙本月冠名礼物 + * + * @return + */ + @GET("/api/public/?service=Gift.currentMonthGiftNaming") + Observable>> currentMonthGiftNaming(); + + /** + * 礼物墙上月冠名 + * + * @return + */ + @GET("/api/public/?service=Gift.lastMonthGiftNaming") + Observable>> lastMonthGiftNaming(); + + /** + * 礼物墙上月冠名 + * + * @return + */ + @GET("/api/public/?service=Gift.getGiftGuide") + Observable>> getGiftGuide( + @Query("liveuid") String liveUid + ); + + @GET("/api/public/?service=Gift.getGiftGuideHistory") + Observable>> getGiftGuideHistory( + @Query("liveuid") String liveUid + ); + + @GET("/api/public/?service=Gift.getUserMedalList") + Observable> getUserMedalList(@Query("to_uid") String toUid); + + @GET("/api/public/?service=Gift.getLiveMedalList") + Observable> getLiveMedalList(); + } 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 6e1313e02..07c530e3b 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 @@ -13,6 +13,10 @@ import com.yunbao.common.bean.CheckLiveModel; import com.yunbao.common.bean.CustomSidebarInfoModel; import com.yunbao.common.bean.DiscountsModel; import com.yunbao.common.bean.EnterRoomNewModel; +import com.yunbao.common.bean.GiftAlreadyWallModel; +import com.yunbao.common.bean.GiftGuideModel; +import com.yunbao.common.bean.GiftWallGiftDetail; +import com.yunbao.common.bean.GiftWallModel; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LinkMicUserBeanV2; @@ -27,6 +31,7 @@ import com.yunbao.common.bean.LiveRoomVoteModel; import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveTaskModel; import com.yunbao.common.bean.LiveUserMailBoxModel; +import com.yunbao.common.bean.MedalAchievementModel; import com.yunbao.common.bean.NobleRankHideUserListModel; import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.PkRankBean; @@ -1796,6 +1801,204 @@ public class LiveNetManager { }).isDisposed(); } + public void giftAlreadyWall(String liveUid, String toUid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .giftAlreadyWall(liveUid, toUid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel giftAlreadyWallModelResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(giftAlreadyWallModelResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void giftWithoutWall(String liveUid, String toUid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .giftWithoutWall(liveUid, toUid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel giftAlreadyWallModelResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(giftAlreadyWallModelResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void giftDetail(String liveUid, String giftId, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .giftDetail(liveUid, giftId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel giftWallGiftDetailResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(giftWallGiftDetailResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void currentMonthGiftNaming(HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .currentMonthGiftNaming() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void lastMonthGiftNaming(HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .lastMonthGiftNaming() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getGiftGuide(String liveUid, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getGiftGuide(liveUid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getGiftGuideHistory(String liveUid, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getGiftGuideHistory(liveUid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getUserMedalList(String toUid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getUserMedalList(toUid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getLiveMedalList(HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getLiveMedalList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + /** * 直播间取消网络请求 */ diff --git a/common/src/main/java/com/yunbao/common/manager/GiftQuantityManager.java b/common/src/main/java/com/yunbao/common/manager/GiftQuantityManager.java new file mode 100644 index 000000000..cdb98a0be --- /dev/null +++ b/common/src/main/java/com/yunbao/common/manager/GiftQuantityManager.java @@ -0,0 +1,53 @@ +package com.yunbao.common.manager; + +import android.content.Context; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.yunbao.common.bean.GiftQuantityModel; +import com.yunbao.common.bean.LiveClassBean; +import com.yunbao.common.manager.base.BaseCacheManager; + +import java.util.List; + +public class GiftQuantityManager extends BaseCacheManager { + private final static String KEY_GIFT_QUANTITY = "GiftQuantity"; + private static GiftQuantityManager manager; + private Context context; + private List giftQuantityModels; + + public GiftQuantityManager(Context context) { + super(context); + } + + /** + * 获取指导员备注信息 + * + * @return + */ + public List getGiftQuantity() { + List giftQuantityModels = getList(KEY_GIFT_QUANTITY, new TypeToken>() { + }.getType()); + if (giftQuantityModels == null || giftQuantityModels.size() == 0) { + giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("1").setFontColour("#ffffff")); + giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("10").setFontColour("#ffffff")); + giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("66").setFontColour("#ffffff")); + giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("88").setFontColour("#FA62A1")); + giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("100").setFontColour("#9B62FF")); + giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("520").setFontColour("#65BFFB")); + giftQuantityModels.add(new GiftQuantityModel().setGiftQuantity("1314").setFontColour("#05F3EC")); + } + return giftQuantityModels; + } + + /** + * 缓存等级图标 + * + * @param json + */ + public void UpGiftQuantity(String json) { + giftQuantityModels = new Gson().fromJson(json, new TypeToken>() { + }.getType()); + put(KEY_GIFT_QUANTITY, giftQuantityModels); + } +} diff --git a/common/src/main/java/com/yunbao/common/utils/BlurBitmapUtil.java b/common/src/main/java/com/yunbao/common/utils/BlurBitmapUtil.java new file mode 100644 index 000000000..b674089a2 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/utils/BlurBitmapUtil.java @@ -0,0 +1,56 @@ +package com.yunbao.common.utils; + +import android.content.Context; +import android.graphics.Bitmap; +import android.renderscript.Allocation; +import android.renderscript.Element; +import android.renderscript.RenderScript; +import android.renderscript.ScriptIntrinsicBlur; + +/** + * Created by L on 2017/10/12. + */ + +public class BlurBitmapUtil { + /** + * 图片缩放比例 + */ + private static final float BITMAP_SCALE = 0.4f; + /** + * 最大模糊度(在0.0到25.0之间) + */ + private static final float BLUR_RADIUS = 25f; + /** + * 模糊图片的具体方法 + * + * @param context 上下文对象 + * @param image 需要模糊的图片 + * @return 模糊处理后的图片 + */ + public static Bitmap blur(Context context, Bitmap image) { + // 计算图片缩小后的长宽 + int width = Math.round(image.getWidth() * BITMAP_SCALE); + int height = Math.round(image.getHeight() * BITMAP_SCALE); + // 将缩小后的图片做为预渲染的图片。 + Bitmap inputBitmap = Bitmap.createScaledBitmap(image, width, height, false); + // 创建一张渲染后的输出图片。 + Bitmap outputBitmap = Bitmap.createBitmap(inputBitmap); + // 创建RenderScript内核对象 + RenderScript rs = RenderScript.create(context); + // 创建一个模糊效果的RenderScript的工具对象 + ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); + // 由于RenderScript并没有使用VM来分配内存,所以需要使用Allocation类来创建和分配内存空间。 + // 创建Allocation对象的时候其实内存是空的,需要使用copyTo()将数据填充进去。 + Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap); + Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap); + // 设置渲染的模糊程度, 25f是最大模糊度 + blurScript.setRadius(BLUR_RADIUS); + // 设置blurScript对象的输入内存 + blurScript.setInput(tmpIn); + // 将输出数据保存到输出内存中 + blurScript.forEach(tmpOut); + // 将数据填充到Allocation中 + tmpOut.copyTo(outputBitmap); + return outputBitmap; + } +} diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 99d965be4..41f967ed3 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -542,9 +542,15 @@ public class JavascriptInterfaceUtils { Bus.get().post(new JavascriptInterfaceEvent() .setMethod("closeLiveRoom")); } + @JavascriptInterface public void clickLogOffAccount() { Bus.get().post(new JavascriptInterfaceEvent() .setMethod("clickLogOffAccount")); } + + @JavascriptInterface + public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl) { + RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0); + } } diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index aaae75cc4..e7346a06b 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -35,6 +35,7 @@ public class RouteUtil { public static final String PATH_MAIN = "/main/MainActivity"; public static final String PATH_ENTRY = "/main/EntryActivity"; public static final String PATH_LIVE_AUDIENCE = "/live/LiveAudienceActivity"; + public static final String PATH_GIFT_WALL = "/live/GiftWallActivity"; public static final String PATH_SETTING = "/main/SettingActivity"; public static final String PATH_FANSACTIVITY = "/main/FansActivity"; public static final String PATH_MYWEBVIEWACTIVTITY2 = "/main/MyWebViewActivity2"; @@ -232,6 +233,15 @@ public class RouteUtil { postcard.navigation(); } + public static void forwardGiftWallActivity(String mStream, String mAnchorName, String mLiveUid, String mAvatarUrl, int isAttention) { + ARouter.getInstance().build(PATH_GIFT_WALL) + .withString(Constants.LIVE_UID, mLiveUid) + .withString(Constants.STREAM, mStream) + .withString("mAnchorName", mAnchorName) + .withString("mAvatarUrl", mAvatarUrl) + .withInt("isAttention", isAttention) + .navigation(); + } /** * 举报个人 @@ -287,6 +297,7 @@ public class RouteUtil { /** * 红包发放情况 + * * @param id 发放者uid */ public static void forwardRedPacketUser(int id) { diff --git a/common/src/main/java/com/yunbao/common/views/AchievementDetailsViewHolder.java b/common/src/main/java/com/yunbao/common/views/AchievementDetailsViewHolder.java new file mode 100644 index 000000000..05c44f939 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/AchievementDetailsViewHolder.java @@ -0,0 +1,22 @@ +package com.yunbao.common.views; + +import android.view.View; +import android.widget.ImageView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.UserMedalModel; +import com.yunbao.common.glide.ImgLoader; + +public class AchievementDetailsViewHolder extends RecyclerView.ViewHolder { + private ImageView achievementImg; + public AchievementDetailsViewHolder(@NonNull View itemView) { + super(itemView); + achievementImg = itemView.findViewById(R.id.achievement_img); + } + public void showData(UserMedalModel userMedalModel){ + ImgLoader.display(itemView.getContext(), userMedalModel.getDisplaySrc(), achievementImg); + } +} diff --git a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java index 232ea3a6c..7705efb0b 100644 --- a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java +++ b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java @@ -139,7 +139,7 @@ public class CustomDrawerPopupView extends DrawerPopupView { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.online), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.more_menu)); + XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.diamond_linear)); builder.hasShadowBg(false) .isDestroyOnDismiss(true) .isLightStatusBar(false) diff --git a/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java b/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java new file mode 100644 index 000000000..e19c54ad6 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java @@ -0,0 +1,37 @@ +package com.yunbao.common.views; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.event.GiftWallItemEvent; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class GiftAlreadyWallViewHolder extends RecyclerView.ViewHolder { + private ImageView giftImg; + private TextView giftTitle; + + public GiftAlreadyWallViewHolder(@NonNull View itemView) { + super(itemView); + giftImg = itemView.findViewById(R.id.gift_img); + giftTitle = itemView.findViewById(R.id.gift_title); + } + + public void showData(GiftWallModel giftWallModel) { + giftTitle.setText(giftWallModel.getGiftname()); + ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg); + ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new GiftWallItemEvent().setGiftWallModel(giftWallModel).setUnlit(true)); + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/views/GiftNumber.java b/common/src/main/java/com/yunbao/common/views/GiftNumber.java new file mode 100644 index 000000000..c6d021823 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/GiftNumber.java @@ -0,0 +1,34 @@ +package com.yunbao.common.views; + +import android.graphics.Color; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftQuantityModel; +import com.yunbao.common.event.GiftNumberEvent; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class GiftNumber extends RecyclerView.ViewHolder { + private TextView customQuantity; + + public GiftNumber(@NonNull View itemView) { + super(itemView); + customQuantity = itemView.findViewById(R.id.custom_quantity); + } + + public void showData(GiftQuantityModel quantityModel) { + customQuantity.setText(quantityModel.getGiftQuantity()); + customQuantity.setTextColor(Color.parseColor(quantityModel.getFontColour())); + ViewClicksAntiShake.clicksAntiShake(customQuantity, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new GiftNumberEvent().setmCount(quantityModel.getGiftQuantity())); + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/views/GiftNumberPopup.java b/common/src/main/java/com/yunbao/common/views/GiftNumberPopup.java new file mode 100644 index 000000000..54ddcdfea --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/GiftNumberPopup.java @@ -0,0 +1,59 @@ +package com.yunbao.common.views; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.core.BottomPopupView; +import com.yunbao.common.R; +import com.yunbao.common.adapter.GiftNumberAdapter; +import com.yunbao.common.event.GiftNumberEvent; +import com.yunbao.common.manager.GiftQuantityManager; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +public class GiftNumberPopup extends BottomPopupView { + public GiftNumberPopup(@NonNull Context context) { + super(context); + } + + // 返回自定义弹窗的布局 + @Override + protected int getImplLayoutId() { + return R.layout.view_live_gift_number; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + Bus.getOn(this); + super.onCreate(); + RecyclerView giftList = findViewById(R.id.gift_list); + giftList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false)); + GiftNumberAdapter giftNumberAdapter = new GiftNumberAdapter(new GiftQuantityManager(getContext()).getGiftQuantity()); + giftList.setAdapter(giftNumberAdapter); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_can), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dismiss(); + } + }); + } + + @Override + protected void onDismiss() { + super.onDismiss(); + Bus.getOff(this); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onGiftNumberEvent(GiftNumberEvent event) { + dismiss(); + } + +} diff --git a/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java b/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java new file mode 100644 index 000000000..9cd0d6f9e --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java @@ -0,0 +1,37 @@ +package com.yunbao.common.views; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.event.GiftWallItemEvent; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class GiftWithoutWallViewHolder extends RecyclerView.ViewHolder { + private ImageView giftImg; + private TextView giftTitle; + + public GiftWithoutWallViewHolder(@NonNull View itemView) { + super(itemView); + giftImg = itemView.findViewById(R.id.gift_img); + giftTitle = itemView.findViewById(R.id.gift_title); + } + + public void showData(GiftWallModel giftWallModel) { + giftTitle.setText(giftWallModel.getGiftname()); + ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg); + ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new GiftWallItemEvent().setGiftWallModel(giftWallModel).setUnlit(false)); + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/views/MedalAchievementViewHolder.java b/common/src/main/java/com/yunbao/common/views/MedalAchievementViewHolder.java new file mode 100644 index 000000000..6c45a011c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/MedalAchievementViewHolder.java @@ -0,0 +1,48 @@ +package com.yunbao.common.views; + +import android.graphics.Color; +import android.text.TextUtils; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.XPopup; +import com.yunbao.common.R; +import com.yunbao.common.bean.UserMedalListModel; +import com.yunbao.common.dialog.AchievementDetailsPopup; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class MedalAchievementViewHolder extends RecyclerView.ViewHolder { + private ImageView achievementImg; + private TextView giftWall; + + public MedalAchievementViewHolder(@NonNull View itemView) { + super(itemView); + achievementImg = itemView.findViewById(R.id.achievement_img); + giftWall = itemView.findViewById(R.id.gift_wall); + } + + public void showData(UserMedalListModel userMedalListModel) { + if (TextUtils.equals(userMedalListModel.getDressStatus(), "1")) { + ImgLoader.display(itemView.getContext(), userMedalListModel.getDisplaySrc(), achievementImg); + giftWall.setTextColor(Color.parseColor("#6F43FF")); + } else { + ImgLoader.display(itemView.getContext(), userMedalListModel.getDisplaySrcSecond(), achievementImg); + giftWall.setTextColor(Color.parseColor("#53408F")); + } + giftWall.setText(userMedalListModel.getDressName()); + ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(itemView.getContext()) + .enableDrag(false) + .asCustom(new AchievementDetailsPopup(itemView.getContext(), userMedalListModel)) + .show(); + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/views/MonthGiftNamingViewHolder.java b/common/src/main/java/com/yunbao/common/views/MonthGiftNamingViewHolder.java new file mode 100644 index 000000000..35da55a3a --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/MonthGiftNamingViewHolder.java @@ -0,0 +1,35 @@ +package com.yunbao.common.views; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.glide.ImgLoader; + +public class MonthGiftNamingViewHolder extends RecyclerView.ViewHolder { + private ImageView giftImg, avatar; + private TextView giftTitle, namingCoin, userName; + + public MonthGiftNamingViewHolder(@NonNull View itemView) { + super(itemView); + giftImg = itemView.findViewById(R.id.gift_img); + avatar = itemView.findViewById(R.id.avatar); + giftTitle = itemView.findViewById(R.id.gift_title); + namingCoin = itemView.findViewById(R.id.naming_coin); + userName = itemView.findViewById(R.id.user_name); + } + + public void showData(GiftWallModel giftWallModel) { + giftTitle.setText(giftWallModel.getGiftname()); + namingCoin.setText(giftWallModel.getNamingCoinMax()); + userName.setText(giftWallModel.getUserNicename()); + ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg); + ImgLoader.display(itemView.getContext(), giftWallModel.getAvatar(), avatar); + + } +} diff --git a/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java b/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java index b2474695e..c59283b42 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java +++ b/common/src/main/java/com/yunbao/common/views/weight/ViewClicksAntiShake.java @@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit; import io.reactivex.Observer; import io.reactivex.disposables.Disposable; -import kotlin.*; +import kotlin.Unit; /** * View防抖 diff --git a/common/src/main/res/drawable/backgroud_custom_gift.xml b/common/src/main/res/drawable/backgroud_custom_gift.xml new file mode 100644 index 000000000..d61532880 --- /dev/null +++ b/common/src/main/res/drawable/backgroud_custom_gift.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/backgroud_custom_gift2.png b/common/src/main/res/drawable/backgroud_custom_gift2.png new file mode 100644 index 000000000..ec7301771 Binary files /dev/null and b/common/src/main/res/drawable/backgroud_custom_gift2.png differ diff --git a/common/src/main/res/drawable/background_achievement_details_list.xml b/common/src/main/res/drawable/background_achievement_details_list.xml new file mode 100644 index 000000000..a803f914b --- /dev/null +++ b/common/src/main/res/drawable/background_achievement_details_list.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_codex_item_btn.xml b/common/src/main/res/drawable/background_codex_item_btn.xml new file mode 100644 index 000000000..9769f0609 --- /dev/null +++ b/common/src/main/res/drawable/background_codex_item_btn.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_codex_top.xml b/common/src/main/res/drawable/background_codex_top.xml new file mode 100644 index 000000000..96109f515 --- /dev/null +++ b/common/src/main/res/drawable/background_codex_top.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_dialog_live_codex.xml b/common/src/main/res/drawable/background_dialog_live_codex.xml new file mode 100644 index 000000000..cc001c397 --- /dev/null +++ b/common/src/main/res/drawable/background_dialog_live_codex.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_gift_description.xml b/common/src/main/res/drawable/background_gift_description.xml new file mode 100644 index 000000000..0e79673a2 --- /dev/null +++ b/common/src/main/res/drawable/background_gift_description.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_gift_money.xml b/common/src/main/res/drawable/background_gift_money.xml new file mode 100644 index 000000000..524773a5d --- /dev/null +++ b/common/src/main/res/drawable/background_gift_money.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_gift_money2.xml b/common/src/main/res/drawable/background_gift_money2.xml new file mode 100644 index 000000000..eb1babf8d --- /dev/null +++ b/common/src/main/res/drawable/background_gift_money2.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_gift_select2.xml b/common/src/main/res/drawable/background_gift_select2.xml new file mode 100644 index 000000000..b7f308b1a --- /dev/null +++ b/common/src/main/res/drawable/background_gift_select2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_select_all_service.xml b/common/src/main/res/drawable/background_select_all_service.xml new file mode 100644 index 000000000..aab1d1cb8 --- /dev/null +++ b/common/src/main/res/drawable/background_select_all_service.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_skip_button.png b/common/src/main/res/drawable/background_skip_button.png new file mode 100644 index 000000000..47ea4cb9e Binary files /dev/null and b/common/src/main/res/drawable/background_skip_button.png differ diff --git a/common/src/main/res/drawable/bg_gift_wall_list.xml b/common/src/main/res/drawable/bg_gift_wall_list.xml new file mode 100644 index 000000000..ae4451c0a --- /dev/null +++ b/common/src/main/res/drawable/bg_gift_wall_list.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/bg_live_gift_send_new.xml b/common/src/main/res/drawable/bg_live_gift_send_new.xml new file mode 100644 index 000000000..0e72f15d9 --- /dev/null +++ b/common/src/main/res/drawable/bg_live_gift_send_new.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/common/src/main/res/drawable/bg_parcel_point.xml b/common/src/main/res/drawable/bg_parcel_point.xml new file mode 100644 index 000000000..1cb330428 --- /dev/null +++ b/common/src/main/res/drawable/bg_parcel_point.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/bg_selection_quantity.png b/common/src/main/res/drawable/bg_selection_quantity.png new file mode 100644 index 000000000..19fc075ce Binary files /dev/null and b/common/src/main/res/drawable/bg_selection_quantity.png differ diff --git a/common/src/main/res/drawable/icon_covering_layer.png b/common/src/main/res/drawable/icon_covering_layer.png new file mode 100644 index 000000000..f343669dc Binary files /dev/null and b/common/src/main/res/drawable/icon_covering_layer.png differ diff --git a/common/src/main/res/drawable/icon_gift_wall_no_data.png b/common/src/main/res/drawable/icon_gift_wall_no_data.png new file mode 100644 index 000000000..7687a95b0 Binary files /dev/null and b/common/src/main/res/drawable/icon_gift_wall_no_data.png differ diff --git a/common/src/main/res/drawable/progress_bg_user.xml b/common/src/main/res/drawable/progress_bg_user.xml new file mode 100644 index 000000000..6d3cc5386 --- /dev/null +++ b/common/src/main/res/drawable/progress_bg_user.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/tablayout_gift_wall.xml b/common/src/main/res/drawable/tablayout_gift_wall.xml new file mode 100644 index 000000000..468a4c9db --- /dev/null +++ b/common/src/main/res/drawable/tablayout_gift_wall.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_live_codex.xml b/common/src/main/res/layout/dialog_live_codex.xml new file mode 100644 index 000000000..9bc06cce4 --- /dev/null +++ b/common/src/main/res/layout/dialog_live_codex.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_live_gift_popup.xml b/common/src/main/res/layout/dialog_live_gift_popup.xml new file mode 100644 index 000000000..e51c57a5d --- /dev/null +++ b/common/src/main/res/layout/dialog_live_gift_popup.xml @@ -0,0 +1,437 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/fragment_all_service_champion.xml b/common/src/main/res/layout/fragment_all_service_champion.xml new file mode 100644 index 000000000..6e2e6ffb5 --- /dev/null +++ b/common/src/main/res/layout/fragment_all_service_champion.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/fragment_current_month_gift_naming.xml b/common/src/main/res/layout/fragment_current_month_gift_naming.xml new file mode 100644 index 000000000..37a78bbb7 --- /dev/null +++ b/common/src/main/res/layout/fragment_current_month_gift_naming.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/fragment_gift_already_wall.xml b/common/src/main/res/layout/fragment_gift_already_wall.xml new file mode 100644 index 000000000..40823ee2c --- /dev/null +++ b/common/src/main/res/layout/fragment_gift_already_wall.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/fragment_gift_without_wall.xml b/common/src/main/res/layout/fragment_gift_without_wall.xml new file mode 100644 index 000000000..09b79300d --- /dev/null +++ b/common/src/main/res/layout/fragment_gift_without_wall.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/fragment_last_month_gift_naming.xml b/common/src/main/res/layout/fragment_last_month_gift_naming.xml new file mode 100644 index 000000000..37a78bbb7 --- /dev/null +++ b/common/src/main/res/layout/fragment_last_month_gift_naming.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_achievement_details.xml b/common/src/main/res/layout/item_achievement_details.xml new file mode 100644 index 000000000..cb19261f7 --- /dev/null +++ b/common/src/main/res/layout/item_achievement_details.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_codex.xml b/common/src/main/res/layout/item_codex.xml new file mode 100644 index 000000000..4e975281f --- /dev/null +++ b/common/src/main/res/layout/item_codex.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_codex_item.xml b/common/src/main/res/layout/item_codex_item.xml new file mode 100644 index 000000000..9b24732aa --- /dev/null +++ b/common/src/main/res/layout/item_codex_item.xml @@ -0,0 +1,32 @@ + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_gift_already_wall.xml b/common/src/main/res/layout/item_gift_already_wall.xml new file mode 100644 index 000000000..672734db4 --- /dev/null +++ b/common/src/main/res/layout/item_gift_already_wall.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_gift_without_wall.xml b/common/src/main/res/layout/item_gift_without_wall.xml new file mode 100644 index 000000000..82c8830e8 --- /dev/null +++ b/common/src/main/res/layout/item_gift_without_wall.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_medal_achievement.xml b/common/src/main/res/layout/item_medal_achievement.xml new file mode 100644 index 000000000..6f25b39d9 --- /dev/null +++ b/common/src/main/res/layout/item_medal_achievement.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_month_gift_naming.xml b/common/src/main/res/layout/item_month_gift_naming.xml new file mode 100644 index 000000000..ea267bc88 --- /dev/null +++ b/common/src/main/res/layout/item_month_gift_naming.xml @@ -0,0 +1,65 @@ + + + + + + + + +a + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/popup_achievement_details.xml b/common/src/main/res/layout/popup_achievement_details.xml new file mode 100644 index 000000000..9a706886d --- /dev/null +++ b/common/src/main/res/layout/popup_achievement_details.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/popup_gift_wall_item.xml b/common/src/main/res/layout/popup_gift_wall_item.xml new file mode 100644 index 000000000..d7fd2c668 --- /dev/null +++ b/common/src/main/res/layout/popup_gift_wall_item.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_blind_box.xml b/common/src/main/res/layout/view_blind_box.xml similarity index 100% rename from live/src/main/res/layout/view_blind_box.xml rename to common/src/main/res/layout/view_blind_box.xml diff --git a/common/src/main/res/layout/view_gift_number.xml b/common/src/main/res/layout/view_gift_number.xml new file mode 100644 index 000000000..2a7f8828a --- /dev/null +++ b/common/src/main/res/layout/view_gift_number.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/view_live_gift_number.xml b/common/src/main/res/layout/view_live_gift_number.xml new file mode 100644 index 000000000..241947d70 --- /dev/null +++ b/common/src/main/res/layout/view_live_gift_number.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/view_nobility.xml b/common/src/main/res/layout/view_nobility.xml new file mode 100644 index 000000000..a11e0b664 --- /dev/null +++ b/common/src/main/res/layout/view_nobility.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/mipmap-mdpi/icon_live_gift_lian.png b/common/src/main/res/mipmap-mdpi/icon_live_gift_lian.png similarity index 100% rename from live/src/main/res/mipmap-mdpi/icon_live_gift_lian.png rename to common/src/main/res/mipmap-mdpi/icon_live_gift_lian.png diff --git a/common/src/main/res/mipmap-xxhdpi/background_gift_already_wall.png b/common/src/main/res/mipmap-xxhdpi/background_gift_already_wall.png new file mode 100644 index 000000000..69555875d Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/background_gift_already_wall.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/background_gift_wall.png b/common/src/main/res/mipmap-xxhdpi/background_gift_wall.png new file mode 100644 index 000000000..2b7522e08 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/background_gift_wall.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/background_gift_wall_item.png b/common/src/main/res/mipmap-xxhdpi/background_gift_wall_item.png new file mode 100644 index 000000000..cc3c0faf7 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/background_gift_wall_item.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/background_gift_without_wall.png b/common/src/main/res/mipmap-xxhdpi/background_gift_without_wall.png new file mode 100644 index 000000000..e26393222 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/background_gift_without_wall.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/background_live_gift_gift_itle.png b/common/src/main/res/mipmap-xxhdpi/background_live_gift_gift_itle.png new file mode 100644 index 000000000..50a0b6a9d Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/background_live_gift_gift_itle.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/background_medal_achievement.png b/common/src/main/res/mipmap-xxhdpi/background_medal_achievement.png new file mode 100644 index 000000000..67933e568 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/background_medal_achievement.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/bg_blind_bottom.png b/common/src/main/res/mipmap-xxhdpi/bg_blind_bottom.png similarity index 100% rename from live/src/main/res/mipmap-xxxhdpi/bg_blind_bottom.png rename to common/src/main/res/mipmap-xxhdpi/bg_blind_bottom.png diff --git a/common/src/main/res/mipmap-xxhdpi/icon_aristocrat_tip.png b/common/src/main/res/mipmap-xxhdpi/icon_aristocrat_tip.png new file mode 100644 index 000000000..5bad5e448 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_aristocrat_tip.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_arrow_down.png b/common/src/main/res/mipmap-xxhdpi/icon_arrow_down.png new file mode 100644 index 000000000..9d428a4d1 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_arrow_down.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_arrow_right_2.png b/common/src/main/res/mipmap-xxhdpi/icon_arrow_right_2.png new file mode 100644 index 000000000..3175b9743 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_arrow_right_2.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_empty_parcel.png b/common/src/main/res/mipmap-xxhdpi/icon_empty_parcel.png new file mode 100644 index 000000000..2bcdb7034 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_empty_parcel.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_established_nobility.png b/common/src/main/res/mipmap-xxhdpi/icon_established_nobility.png new file mode 100644 index 000000000..bd0559cbe Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_established_nobility.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_gift_wall.png b/common/src/main/res/mipmap-xxhdpi/icon_gift_wall.png new file mode 100644 index 000000000..3b102da48 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_gift_wall.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_grade_angle_mark.png b/common/src/main/res/mipmap-xxhdpi/icon_grade_angle_mark.png new file mode 100644 index 000000000..5d71cbd2a Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_grade_angle_mark.png differ diff --git a/live/src/main/res/mipmap-mdpi/icon_live_gift_2.png b/common/src/main/res/mipmap-xxhdpi/icon_live_gift_2.png similarity index 100% rename from live/src/main/res/mipmap-mdpi/icon_live_gift_2.png rename to common/src/main/res/mipmap-xxhdpi/icon_live_gift_2.png diff --git a/common/src/main/res/mipmap-xxhdpi/icon_live_gift_gift_itle.png b/common/src/main/res/mipmap-xxhdpi/icon_live_gift_gift_itle.png new file mode 100644 index 000000000..b575ecf36 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_live_gift_gift_itle.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_regular_black.png b/common/src/main/res/mipmap-xxhdpi/icon_regular_black.png new file mode 100644 index 000000000..397c175cc Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_regular_black.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_right.png b/common/src/main/res/mipmap-xxhdpi/icon_right.png new file mode 100644 index 000000000..b9d1d45b0 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_right.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_vacant_position_awaits.png b/common/src/main/res/mipmap-xxhdpi/icon_vacant_position_awaits.png new file mode 100644 index 000000000..bc47926ff Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_vacant_position_awaits.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/icon_what.png b/common/src/main/res/mipmap-xxhdpi/icon_what.png similarity index 100% rename from live/src/main/res/mipmap-xxxhdpi/icon_what.png rename to common/src/main/res/mipmap-xxhdpi/icon_what.png diff --git a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_chaohuang.png b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_chaohuang.png index c5a3448ad..e018cc6c1 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_chaohuang.png and b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_chaohuang.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_guowang.png b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_guowang.png index 9a423031f..d947bd9d1 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_guowang.png and b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_guowang.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_houjue.png b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_houjue.png index 48ca70c1f..9b0f2aea6 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_houjue.png and b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_houjue.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_huangdi.png b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_huangdi.png index 5ad36e1f4..9c91a929e 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_huangdi.png and b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_huangdi.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_nanjue.png b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_nanjue.png index 39abe8dd9..8b49fa910 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_nanjue.png and b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_nanjue.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_notopen.png b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_notopen.png index cf7c027d3..a4b0d5c28 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_notopen.png and b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_notopen.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_zijue.png b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_zijue.png index cbacb5725..78e3abdc4 100644 Binary files a/common/src/main/res/mipmap-xxhdpi/img_aristocrat_zijue.png and b/common/src/main/res/mipmap-xxhdpi/img_aristocrat_zijue.png differ diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 73e2c8718..3cbc3365f 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1249,6 +1249,39 @@ Limited ride And limited avatar frame %s drew %s in the lucky red envelope number Red successfully + %s experience upgrade,%s receive rewards + You have reached the highest level! + There\'s nothing in the package yet + Custom quantity + Gift wall + %s has been lit + Illustrated book + unlit + All service + Love \\ \"ceremony \\\" at the beginning, \\ \"wall \\\" potential light temporarily no light + No unlit gifts yet + Instant light + Honorary achievement + Lit + Gift Wall Entrance + Personal profile card, personal homepage, live streaming room header button, and by clickingView personal and person\'s profile cards and homepage. + Lighting up gifts + On the gift panel and click on the gift wall of the recipient to light up the gift for gifting, Illuminate the corresponding gift icon in the recipient\'s gift wall. Only diamond gifts Can light up gifts. When the gifts in the event are compared to the gifts in the gift wall and guidebook When the same, give the same gift, first light up the event, gift wall, and picture guide A gift for. + Named gift + Within each cycle, if a certain amount of diamonds are given as a single or cumulative gift Display the most gifts given to a recipient on the gift icon Gift person avatar, clicking on the avatar can also directly reach the giver\'s homepage of the named gift. + When the gift in the guidebook is the same as the gift in the gift wall, give the same gift Objects, first point the gift on the gift wall, and then light up the gift in the guidebook. Honor achievement + Medal of Achievement + Medal of achievement + Currently, there are three achievements, namely A cloud of good friends, A rich party, Very rich, + A cloud of good friends: When the number of gifts received reaches 20, 30, 50, 100When it comes to 200 models, light up the corresponding achievements separately;Rich and capriciou + A rich party: When the price of a single gift received exceeds 50000 diamonds, it is sufficient Illuminate the achievement; + Very rich: When receiving 100 gifts priced over 3000 diamonds, i.e This achievement can be illuminated. + The current user has a total of 4 achievements, namely being rich and capricious, sharing rain and dew, and giving gifts Gift machines, lighting masters. + Rich and capricious: Accumulated gifts worth 50K, 2M,10M, 100M, 300M, light up the corresponding achievements separately; + Rain and dew evenly: the cumulative Style quantity of gifts given to anchors reaches 10, 20, 50, 100,200, can achieve success; + gift machine: The cumulative number of gifts given reaches 200, 1000, 10K,100K,1M,light up the corresponding achievements separately; + lighting master: The number of unlocked Gift Walls has reached 10, 30, 50 At 100 and 200, light up the corresponding achievements separately. + rule diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 1c2e77cb7..9134aec0e 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1244,4 +1244,37 @@ " %s 在 好運紅包 中抽到了 %s" 数量 红包发布成功 + 升級還需%s經驗值,升至%s即可領取獎勵 + 恭喜,你已達到最高等級 + 包裹中暫無物品哦 + 自定義數量 + 禮物墻 + 已點亮%s個 + 圖鑒 + 榮譽成就 + 已點亮 + 未點亮 + 全服冠軍 + 愛\\“禮\\”伊始,\\“墻\\”勢點亮 暫無點亮 + 暂无未点亮礼物哦 + 立即點亮 + 禮物墻入口 + 個人資料卡片、個人主頁、直播間頭部按鈕及通過點擊 自己與TA人的資料卡和主頁查看。 + 點亮禮物 + 在禮物面板和點擊收禮人禮物牆待點亮的禮物進行送禮, 即點亮收禮人禮物牆中對應的禮物圖標。只有鑽石送禮可點亮禮物。當活動中的禮物與禮物牆和圖鑒中的禮物相同時,則的禮物。 + 冠名禮物 + 每個週期內單個或累計送同一禮物達一定數量鑽石,會在該禮物圖標上顯示對於某位收禮人而言送出最多的送禮人頭像,點擊頭像還可直達冠名禮物的送禮人主頁。 + 當圖鑒的禮物與禮物牆中的禮物相同時,則送同一個禮物,先點禮物牆的禮物,之後再點亮圖鑒的禮物。 + 榮譽成就 + 成就勳章 + 當前主播共有3個成就,分別是勝友如雲、富甲一方、腰纏萬貫。 + 勝友如雲:當收到的禮物款數達到20、30、50、100、200款時,分別點亮對應的成就; + 富甲一方:收到的單款禮物價格超過50000鑽時,即可點亮該成就; + 腰纏萬貫:當收到100款價格超過3000鑽的禮物時,即可點亮該成就。 + 當前用戶共有4個成就,分別是有錢任性、雨露均沾、送禮機器、點燈大師。 + 有錢任性:纍計送出禮物價值鉆石數量達到50K、2M、10M、100M、300M時,分別點亮對應的成就 + 雨露均沾:纍計送禮給主播人數達到10、20、50、100、200時,分別點亮對應的成就; + 送禮機器:纍計贈送禮物個數達到200、1000、10K、00K、1M時,分別點亮對應的成就; + 點燈大師:解鎖【禮物墻】的數量達到10、30、50、100、200時,分別點亮對應的成就 + 規則 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 6d306b272..d0f6ba525 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1243,4 +1243,37 @@ " %s 在 好運紅包 中抽到了 %s" 数量 红包发布成功 + 升級還需%s經驗值,升至%s即可領取獎勵 + 恭喜,你已達到最高等級 + 包裹中暫無物品哦 + 自定義數量 + 禮物墻 + 已點亮%s個 + 圖鑒 + 榮譽成就 + 已點亮 + 未點亮 + 全服冠軍 + 愛\\“禮\\”伊始,\\“墻\\”勢點亮 暫無點亮 + 暂无未点亮礼物哦 + 立即點亮 + 禮物墻入口 + 個人資料卡片、個人主頁、直播間頭部按鈕及通過點擊 自己與TA人的資料卡和主頁查看。 + 點亮禮物 + 在禮物面板和點擊收禮人禮物牆待點亮的禮物進行送禮, 即點亮收禮人禮物牆中對應的禮物圖標。只有鑽石送禮可點亮禮物。當活動中的禮物與禮物牆和圖鑒中的禮物相同時,則的禮物。 + 冠名禮物 + 每個週期內單個或累計送同一禮物達一定數量鑽石,會在該禮物圖標上顯示對於某位收禮人而言送出最多的送禮人頭像,點擊頭像還可直達冠名禮物的送禮人主頁。 + 當圖鑒的禮物與禮物牆中的禮物相同時,則送同一個禮物,先點禮物牆的禮物,之後再點亮圖鑒的禮物。 + 榮譽成就 + 成就勳章 + 當前主播共有3個成就,分別是勝友如雲、富甲一方、腰纏萬貫。 + 勝友如雲:當收到的禮物款數達到20、30、50、100、200款時,分別點亮對應的成就; + 富甲一方:收到的單款禮物價格超過50000鑽時,即可點亮該成就; + 腰纏萬貫:當收到100款價格超過3000鑽的禮物時,即可點亮該成就。 + 當前用戶共有4個成就,分別是有錢任性、雨露均沾、送禮機器、點燈大師。 + 有錢任性:纍計送出禮物價值鉆石數量達到50K、2M、10M、100M、300M時,分別點亮對應的成就 + 雨露均沾:纍計送禮給主播人數達到10、20、50、100、200時,分別點亮對應的成就; + 送禮機器:纍計贈送禮物個數達到200、1000、10K、00K、1M時,分別點亮對應的成就; + 點燈大師:解鎖【禮物墻】的數量達到10、30、50、100、200時,分別點亮對應的成就 + 規則 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 94d89a69d..de2da757d 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1244,6 +1244,39 @@ " %s 在 好運紅包 中抽到了 %s" 数量 红包发布成功 + 升級還需%s經驗值,升至%s即可領取獎勵 + 恭喜,你已達到最高等級 + 包裹中暫無物品哦 + 自定義數量 + 禮物墻 + 已點亮%s個 + 圖鑒 + 未點亮 + 全服冠軍 + 愛\\“禮\\”伊始,\\“墻\\”勢點亮 暫無點亮 + 暂无未点亮礼物哦 + 立即點亮 + 榮譽成就 + 已點亮 + 禮物墻入口 + 個人資料卡片、個人主頁、直播間頭部按鈕及通過點擊 自己與TA人的資料卡和主頁查看。 + 點亮禮物 + 在禮物面板和點擊收禮人禮物牆待點亮的禮物進行送禮, 即點亮收禮人禮物牆中對應的禮物圖標。只有鑽石送禮可點亮禮物。當活動中的禮物與禮物牆和圖鑒中的禮物相同時,則的禮物。 + 冠名禮物 + 每個週期內單個或累計送同一禮物達一定數量鑽石,會在該禮物圖標上顯示對於某位收禮人而言送出最多的送禮人頭像,點擊頭像還可直達冠名禮物的送禮人主頁。 + 當圖鑒的禮物與禮物牆中的禮物相同時,則送同一個禮物,先點禮物牆的禮物,之後再點亮圖鑒的禮物。 + 榮譽成就 + 成就勳章 + 當前主播共有3個成就,分別是勝友如雲、富甲一方、腰纏萬貫。 + 勝友如雲:當收到的禮物款數達到20、30、50、100、200款時,分別點亮對應的成就; + 富甲一方:收到的單款禮物價格超過50000鑽時,即可點亮該成就; + 腰纏萬貫:當收到100款價格超過3000鑽的禮物時,即可點亮該成就。 + 當前用戶共有4個成就,分別是有錢任性、雨露均沾、送禮機器、點燈大師。 + 有錢任性:纍計送出禮物價值鉆石數量達到50K、2M、10M、100M、300M時,分別點亮對應的成就 + 雨露均沾:纍計送禮給主播人數達到10、20、50、100、200時,分別點亮對應的成就; + 送禮機器:纍計贈送禮物個數達到200、1000、10K、00K、1M時,分別點亮對應的成就; + 點燈大師:解鎖【禮物墻】的數量達到10、30、50、100、200時,分別點亮對應的成就 + 規則 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 6715ce5e3..46c21fc10 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1250,4 +1250,54 @@ Limited ride And limited avatar frame %s drew %s in the lucky red envelope number >Red successfully + %s experience upgrade,%s receive rewards + There\'s nothing in the package yet + You have reached the highest level! + Custom quantity + Gift wall + %s has been lit + unlit + All service + Love \\ \"ceremony \\\" at the beginning, \\ \"wall \\\" potential light temporarily no light + No unlit gifts yet + Instant light + Gift Wall Entrance + Personal profile card, personal homepage, live streaming room header button, and by clicking + Lighting up gifts + On the gift panel and click on the gift wall of the recipient to light up the gift for gifting, Illuminate the corresponding gift icon in the recipient\'s gift wall. Only diamond gifts Can light up gifts. When the gifts in the event are compared to the gifts in the gift wall and guidebook When the same, give the same gift, first light up the event, gift wall, and picture guide A gift for. + Named gift + Within each cycle, if a certain amount of diamonds are given as a single or cumulative gift Display the most gifts given to a recipient on the gift icon Gift person avatar, clicking on the avatar can also directly reach the giver\'s homepage of the named gift. + When the gift in the guidebook is the same as the gift in the gift wall, give the same gift Objects, first point the gift on the gift wall, and then light up the gift in the guidebook. Honor achievement + Medal of Achievement + Medal of achievement + Currently, there are three achievements, namely A cloud of good friends, A rich party, Very rich, + A cloud of good friends: When the number of gifts received reaches 20, 30, 50, 100When it comes to 200 models, light up the corresponding achievements separately;Rich and capriciou + A rich party: When the price of a single gift received exceeds 50000 diamonds, it is sufficient Illuminate the achievement; + Very rich: When receiving 100 gifts priced over 3000 diamonds, i.e This achievement can be illuminated. + The current user has a total of 4 achievements, namely being rich and capricious, sharing rain and dew, and giving gifts Gift machines, lighting masters. + Rich and capricious: Accumulated gifts worth 50K, 2M,10M, 100M, 300M, light up the corresponding achievements separately; + Rain and dew evenly: the cumulative Style quantity of gifts given to anchors reaches 10, 20, 50, 100,200, can achieve success; + gift machine: The cumulative number of gifts given reaches 200, 1000, 10K,100K,1M,light up the corresponding achievements separately; + lighting master: The number of unlocked Gift Walls has reached 10, 30, 50 At 100 and 200, light up the corresponding achievements separately. + rule + Illustrated book + Honorary achievement + Lit + 規則介紹 + 禮物詳情 + 虛位以待 + 距離冠名還需%s鑽 + 送TA + 本月得主 + 上月得主 + 上月奪得最終禮物冠名權用戶將獲得該禮物一個月專屬冠名皮膚 + 近期點亮 + 已獲得 + 去點亮 + 我的荣誉墙 + 成就詳情 + 冠名主播: + 冠名金主: + 冠名 + diff --git a/config.gradle b/config.gradle index 5bba46103..e31787a93 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", diff --git a/gradle.properties b/gradle.properties index a5066c177..e850a38e3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,8 +19,8 @@ org.gradle.configureondemand=true android.useAndroidX=true android.enableJetifier=true -#systemProp.http.proxyHost=127.0.0.1 -#systemProp.https.proxyHost=127.0.0.1 -#systemProp.https.proxyPort=7890 -#systemProp.http.proxyPort=7890 +systemProp.http.proxyHost=127.0.0.1 +systemProp.https.proxyHost=127.0.0.1 +systemProp.https.proxyPort=10809 +systemProp.http.proxyPort=10809 #android.enableR8.fullMode=true \ No newline at end of file diff --git a/live/src/main/AndroidManifest.xml b/live/src/main/AndroidManifest.xml index d780e2f5e..71ec8f14e 100644 --- a/live/src/main/AndroidManifest.xml +++ b/live/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ + + tabText = new ArrayList<>(); + private List tabView = new ArrayList<>(); + private String mStream, mAnchorName, mLiveUid, mAvatarUrl; + private int isAttention = 0;//是否关注 0=没关注, + + @Override + protected int getLayoutId() { + return R.layout.activity_live_gift_wall; + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Bus.getOn(this); + initView(); + initDate(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + Bus.getOff(this); + } + + private void initView() { + layoutLitIcon = findViewById(R.id.layout_lit_icon); + layoutUnlitIcon = findViewById(R.id.layout_unlit_icon); + layoutAllServiceChampion = findViewById(R.id.layout_all_service_champion); + textLitIcon = findViewById(R.id.text_lit_icon); + textUnlitIcon = findViewById(R.id.text_unlit_icon); + textAllServiceChampion = findViewById(R.id.text_all_service_champion); + viewAllServiceChampion = findViewById(R.id.view_all_service_champion); + viewUnlitIcon = findViewById(R.id.view_unlit_icon); + viewLitIcon = findViewById(R.id.view_lit_icon); + avatar = findViewById(R.id.avatar); + anchorName = findViewById(R.id.anchor_name); + tabText.add(textLitIcon); + tabText.add(textUnlitIcon); + tabText.add(textAllServiceChampion); + tabView.add(viewLitIcon); + tabView.add(viewUnlitIcon); + tabView.add(viewAllServiceChampion); + selectTab(textLitIcon, viewLitIcon); + ViewClicksAntiShake.clicksAntiShake(layoutLitIcon, () -> { + selectTab(textLitIcon, viewLitIcon); + FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, mLiveUid)); + transaction.commit(); + }); + ViewClicksAntiShake.clicksAntiShake(layoutUnlitIcon, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + selectTab(textUnlitIcon, viewUnlitIcon); + FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid, mLiveUid)); + transaction.commit(); + + } + }); + ViewClicksAntiShake.clicksAntiShake(layoutAllServiceChampion, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + selectTab(textAllServiceChampion, viewAllServiceChampion); + FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, AllServiceChampionFragment.newInstance(mStream, mLiveUid)); + transaction.commit(); + } + }); + + + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.codex_layout), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(GiftWallActivity.this) + .enableDrag(false) + .asCustom(new CodexDialog(GiftWallActivity.this, mStream, mLiveUid, false)) + .show(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.medal_achievement), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(GiftWallActivity.this) + .enableDrag(false) + .asCustom(new MedalAchievementPopup(GiftWallActivity.this, false, mLiveUid)) + .show(); + } + }); + ViewClicksAntiShake.clicksAntiShake(avatar, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + forwardHomePage(); + } + }); + ViewClicksAntiShake.clicksAntiShake(anchorName, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + forwardHomePage(); + } + }); + } + + private void initDate() { + Intent intent = getIntent(); + if (intent == null) { + return; + } + mLiveUid = intent.getStringExtra(Constants.LIVE_UID); + mStream = intent.getStringExtra(Constants.STREAM); + mAnchorName = intent.getStringExtra("mAnchorName"); + mAvatarUrl = intent.getStringExtra("mAvatarUrl"); + isAttention = intent.getIntExtra("isAttention", 0); + + FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, mLiveUid)); + transaction.commit(); + ImgLoader.display(GiftWallActivity.this, mAvatarUrl, avatar); + anchorName.setText(mAnchorName); + } + + private void selectTab(TextView textView, View tab) { + for (TextView view : tabText) { + if (textView == view) { + view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD_ITALIC); + } else { + view.setTypeface(Typeface.SANS_SERIF, Typeface.ITALIC); + } + } + for (View view : tabView) { + view.setVisibility(view == tab ? View.VISIBLE : View.GONE); + } + } + private void forwardHomePage() { + finish(); + RouteUtil.forwardUserHome(mContext, mLiveUid, false, mLiveUid, 0); + } + /** + * 关于点击礼物分类的通知 + */ + @Subscribe(threadMode = ThreadMode.MAIN) + public void onGiftWallItemEvent(GiftWallItemEvent event) { + new XPopup.Builder(this) + .asCustom(new GiftWallItemPopup(this, event.getGiftWallModel(), event.isUnlit(), mLiveUid, mStream)) + .show(); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) { + onBackPressed(); + } +} \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index c52a984e8..50586d85c 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -60,6 +60,7 @@ import com.yunbao.common.dialog.SlideSettingsDialog; import com.yunbao.common.dialog.YoursystemisolderDialog; import com.yunbao.common.event.CustomDrawerPopupEvent; import com.yunbao.common.event.FollowEvent; +import com.yunbao.common.event.GiftWallIlluminateEvent; import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; @@ -90,7 +91,7 @@ import com.yunbao.live.bean.ImUserBean; import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.dialog.LiveFansFragment; import com.yunbao.live.dialog.LiveGameDialogFragment; -import com.yunbao.live.dialog.LiveGiftDialogFragment; +import com.yunbao.live.dialog.LiveGiftPopup; import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveInputDialogFragment; import com.yunbao.live.dialog.LiveMicUserDialogFragment; @@ -443,18 +444,16 @@ public class LiveAudienceActivity extends LiveActivity { */ public void openGiftWindow() { new Handler(Looper.getMainLooper()).post(() -> { + if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) { return; } - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setPkStatus(isPk); - fragment.setLiveGuardInfo(mLiveGuardInfo); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - fragment.setArguments(bundle); - fragment.setOnDismissListener(dialog -> checkMsgRed()); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream) + .setPk(isPk) + .setLiveGuardInfo(mLiveGuardInfo)); }); } @@ -462,16 +461,13 @@ public class LiveAudienceActivity extends LiveActivity { if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) { return; } - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setPkStatus(isPk); - fragment.setLiveGuardInfo(mLiveGuardInfo); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, giftId); - fragment.setArguments(bundle); - fragment.setOnDismissListener(dialog -> checkMsgRed()); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream) + .setPk(isPk) + .setLiveGuardInfo(mLiveGuardInfo) + .setmWishGiftId(giftId)); } public void openGiftWindow(String giftId, String for_by) { @@ -479,19 +475,15 @@ public class LiveAudienceActivity extends LiveActivity { return; } new Handler(Looper.getMainLooper()).post(() -> { - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setPkStatus(isPk); - fragment.setLiveGuardInfo(mLiveGuardInfo); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, giftId); - if (for_by.equals("1")) { - bundle.putString("by", "1"); - } - fragment.setArguments(bundle); - fragment.setOnDismissListener(dialog -> checkMsgRed()); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream) + .setPk(isPk) + .setLiveGuardInfo(mLiveGuardInfo) + .setmWishGiftId(giftId) + .setUname("1"));//setUname==by }); } @@ -1023,18 +1015,29 @@ public class LiveAudienceActivity extends LiveActivity { break; case GIFT_POPUP: - - if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) { - return; - } - LiveGiftDialogFragment liveGiftDialogFragment = new LiveGiftDialogFragment(); - liveGiftDialogFragment.setPkStatus(isPk); - liveGiftDialogFragment.setLiveGuardInfo(mLiveGuardInfo); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - liveGiftDialogFragment.setArguments(bundle); - liveGiftDialogFragment.setOnDismissListener(dialog -> checkMsgRed()); - liveGiftDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + LiveGiftPopup liveGiftPopup = new LiveGiftPopup(); + bundle.putString("mLiveUid", mLiveUid); + bundle.putString("mStream", mStream); + bundle.putString("WishGiftId", event.getmWishGiftId()); + bundle.putBoolean("ContactGift", event.getIsContactGift()); + bundle.putParcelable("GuardInfo", event.getLiveGuardInfo()); + bundle.putBoolean("pk", event.isPk()); + liveGiftPopup.setArguments(bundle); + liveGiftPopup.show(getSupportFragmentManager(), "LiveGiftPopup"); +// new XPopup.Builder(mContext) +// .asCustom(new LiveGiftPopup(mContext, this)) +// .show(); +// if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) { +// return; +// } +// LiveGiftDialogFragment liveGiftDialogFragment = new LiveGiftDialogFragment(); +// liveGiftDialogFragment.setPkStatus(isPk); +// liveGiftDialogFragment.setLiveGuardInfo(mLiveGuardInfo); +// bundle.putString(Constants.LIVE_UID, mLiveUid); +// bundle.putString(Constants.LIVE_STREAM, mStream); +// liveGiftDialogFragment.setArguments(bundle); +// liveGiftDialogFragment.setOnDismissListener(dialog -> checkMsgRed()); +// liveGiftDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); break; case CURRENT_ACTIVITY: String type = event.getModel().getActiveId(); @@ -1430,11 +1433,29 @@ public class LiveAudienceActivity extends LiveActivity { liveInputDialogFragment.setArguments(liveInputBundle); liveInputDialogFragment.show(getSupportFragmentManager(), "LiveInputDialogFragment"); break; + case IS_ATTENTION: + if (manager != null) { + manager.setAttention(event.getLiveType()); + } + + break; + case GIFT_WALL: + if (manager != null) { + manager.showGiftWall(event.getUid()); + } + break; } } + @Subscribe(threadMode = ThreadMode.MAIN) + public void GiftWallIlluminateEvent(GiftWallIlluminateEvent event) { + if (manager != null) { + manager.setGiftWall(String.valueOf(event.getNewNumber()), String.valueOf(event.getMaxNumber())); + } + } + /** * 跳转到消息中心的系统信息web * diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index af28b0cf5..b04de9858 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -296,7 +296,7 @@ public class ZhuangBanActivity extends AbsActivity { Intent intent = new Intent(context, ZhuangBanActivity.class); Log.i("tag", url); intent.putExtra(Constants.URL, url); - if (url.contains("Noble/index.html")) { + if (url.contains("Noble/index.html")||url.contains("RongYuQiang")) { intent.putExtra("title", ""); } context.startActivity(intent); diff --git a/live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java b/live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java new file mode 100644 index 000000000..3c87cc947 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java @@ -0,0 +1,47 @@ +package com.yunbao.live.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftGuideModel; +import com.yunbao.live.views.CodexViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class CodexAdapter extends RecyclerView.Adapter { + private List giftGuideModels = new ArrayList<>(); + private boolean history; + private String mStream, mLiveUid; + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_codex, parent, false); + return new CodexViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + CodexViewHolder codexViewHolder = (CodexViewHolder) holder; + codexViewHolder.showData(giftGuideModels.get(position), history,mStream,mLiveUid); + } + + @Override + public int getItemCount() { + return giftGuideModels.size(); + } + + public void addAllData(List mGiftWall, boolean history, String mStream, String mLiveUid) { + this.history = history; + this.mStream = mStream; + this.mLiveUid = mLiveUid; + giftGuideModels.clear(); + giftGuideModels.addAll(mGiftWall); + notifyDataSetChanged(); + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/CodexItemAdapter.java b/live/src/main/java/com/yunbao/live/adapter/CodexItemAdapter.java new file mode 100644 index 000000000..5913f3b3b --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/CodexItemAdapter.java @@ -0,0 +1,43 @@ +package com.yunbao.live.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.live.views.CodexItemViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class CodexItemAdapter extends RecyclerView.Adapter { + private List giftData = new ArrayList<>(); + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_codex_item, parent, false); + return new CodexItemViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + CodexItemViewHolder codexItemViewHolder = (CodexItemViewHolder) holder; + codexItemViewHolder.showData(giftData.get(position)); + } + + @Override + public int getItemCount() { + return giftData.size(); + } + + public void addAllData(List mGiftWall) { + giftData.clear(); + giftData.addAll(mGiftWall); + notifyDataSetChanged(); + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/FrameGiftAdapter.java b/live/src/main/java/com/yunbao/live/adapter/FrameGiftAdapter.java new file mode 100644 index 000000000..05e78fd3b --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/FrameGiftAdapter.java @@ -0,0 +1,69 @@ +package com.yunbao.live.adapter; + +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.utils.Bus; +import com.yunbao.live.R; +import com.yunbao.live.event.LiveGiftItemEvent; +import com.yunbao.live.views.FrameGiftViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class FrameGiftAdapter extends RecyclerView.Adapter { + private List giftJson = new ArrayList<>(); + private int contextLayoutGiftHeight = 0; + private String mStream, mLiveUid, wishGiftId; + + public FrameGiftAdapter(int contextLayoutGiftHeight, List giftJson, String mStream, String mLiveUid, String wishGiftId) { + this.contextLayoutGiftHeight = contextLayoutGiftHeight; + this.giftJson = giftJson; + this.mStream = mStream; + this.mLiveUid = mLiveUid; + this.wishGiftId = wishGiftId; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_frame_gift, parent, false); + return new FrameGiftViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + + if (!TextUtils.isEmpty(wishGiftId) && TextUtils.equals(giftJson.get(position).getId() + "", wishGiftId)) { + Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(giftJson.get(position))); + } + + FrameGiftViewHolder frameGiftViewHolder = (FrameGiftViewHolder) holder; + frameGiftViewHolder.showData(contextLayoutGiftHeight, giftJson.get(position)); + frameGiftViewHolder.giftSelect(giftJson.get(position), position, mStream, mLiveUid, new FrameGiftViewHolder.FrameGiftClickListener() { + @Override + public void onCallBack(int position, LiveGiftBean model) { + Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(model)); + wishGiftId = null; + } + }); + } + + public void giftSelect(LiveGiftBean model) { + for (int i = 0; i < giftJson.size(); i++) { + giftJson.get(i).setChecked(giftJson.get(i).getId() == model.getId()); + } + notifyDataSetChanged(); + } + + @Override + public int getItemCount() { + return giftJson.size(); + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java b/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java new file mode 100644 index 000000000..898b9da7c --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java @@ -0,0 +1,60 @@ +package com.yunbao.live.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.live.R; +import com.yunbao.live.bean.GiftTopBean; +import com.yunbao.live.views.GiftTitleViewHolder; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class GiftTitleAdapter extends RecyclerView.Adapter { + + List name = new ArrayList<>(); + private int index = 0; + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_top_new, parent, false); + return new GiftTitleViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + GiftTitleViewHolder itemViewHolder = (GiftTitleViewHolder) holder; + itemViewHolder.showData(name.get(position), position, new GiftTitleViewHolder.ClicksCallBack() { + @Override + public void onViewClicks(int mPosition) { + index = mPosition; + notifyDataSetChanged(); + } + }); + itemViewHolder.selectData(index == position); + } + + @Override + public int getItemCount() { + return name.size(); + } + + public void addAllData(List giftTopBeans) { + name.clear(); + name.addAll(giftTopBeans); + notifyDataSetChanged(); + } + + public void uncheck() { + index = -1; + notifyDataSetChanged(); + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java index 777d7714b..3817726cf 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java @@ -35,7 +35,7 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.custom.GiftMarkView; import com.yunbao.live.dialog.SendRendPacketPopup; -import com.yunbao.live.event.LiveGiftDialogEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; import java.io.File; import java.util.List; diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveGiftFragmentPagerAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveGiftFragmentPagerAdapter.java new file mode 100644 index 000000000..934be7fc4 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/LiveGiftFragmentPagerAdapter.java @@ -0,0 +1,33 @@ +package com.yunbao.live.adapter; + +import android.content.Context; + +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; + +import java.util.List; + +public class LiveGiftFragmentPagerAdapter extends FragmentPagerAdapter { + + private List fragmentList; + + + public LiveGiftFragmentPagerAdapter(FragmentManager fm, Context mContext, List fragmentList) { + super(fm); + + this.fragmentList = fragmentList; + + } + + @Override + public Fragment getItem(int i) { + return fragmentList.get(i); + } + + @Override + public int getCount() { + return fragmentList.size(); + } + +} diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveParcelItemAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveParcelItemAdapter.java new file mode 100644 index 000000000..9f06c5816 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/LiveParcelItemAdapter.java @@ -0,0 +1,85 @@ +package com.yunbao.live.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.utils.Bus; +import com.yunbao.live.R; +import com.yunbao.live.event.LiveGiftItemEvent; +import com.yunbao.live.views.LiveParcelItemViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class LiveParcelItemAdapter extends RecyclerView.Adapter { + private List giftJson = new ArrayList<>(); + private int contextLayoutGiftHeight = 0; + private String mStream, mLiveUid; + + public LiveParcelItemAdapter(int contextLayoutGiftHeight, List giftJson, String mStream, String mLiveUid) { + this.contextLayoutGiftHeight = contextLayoutGiftHeight; + this.giftJson = giftJson; + this.mStream = mStream; + this.mLiveUid = mLiveUid; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_live_parcel, parent, false); + return new LiveParcelItemViewHolder(herdView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + LiveParcelItemViewHolder frameGiftViewHolder = (LiveParcelItemViewHolder) holder; + frameGiftViewHolder.showData(contextLayoutGiftHeight, giftJson.get(position)); + frameGiftViewHolder.giftSelect(giftJson.get(position), position, mStream, mLiveUid, new LiveParcelItemViewHolder.FrameGiftClickListener() { + @Override + public void onCallBack(int position, LiveGiftBean model) { + Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(model)); + } + }); + } + + public void giftSelect(LiveGiftBean model) { + for (int i = 0; i < giftJson.size(); i++) { + giftJson.get(i).setChecked(giftJson.get(i).getId() == model.getId()); + } + notifyDataSetChanged(); + } + + public void refreshWrapListAfterSend(LiveGiftBean model) { + for (int i = 0; i < giftJson.size(); i++) { + if (giftJson.get(i).getId() == model.getId()) { + + + String giftNum = giftJson.get(i).getGiftNum(); + int number = 0; + try { + number = Integer.parseInt(giftNum); + } catch (NumberFormatException e) { + e.printStackTrace(); + number = 0; + } + if (number == 1) { + + giftJson.remove(i); + } else { + giftJson.get(i).setGiftNum(String.valueOf(number - 1)); + } + } + } + notifyDataSetChanged(); + } + + @Override + public int getItemCount() { + return giftJson.size(); + } +} diff --git a/live/src/main/java/com/yunbao/live/bean/CoinModel.java b/live/src/main/java/com/yunbao/live/bean/CoinModel.java new file mode 100644 index 000000000..738f09161 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/bean/CoinModel.java @@ -0,0 +1,133 @@ +package com.yunbao.live.bean; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.bean.BaseModel; + +public class CoinModel extends BaseModel { + //钻石余额 + @SerializedName("coin") + private String coin; + //金豆余额 + @SerializedName("gold") + private String gold; + + @SerializedName("uid") + private String uid; + //平台最大等级 + @SerializedName("user_level_max") + private String userLevelMax; + //当前用户等级 + @SerializedName("user_level") + private String userLevel; + //升级下一级需要的经验 + @SerializedName("user_next_level_rewards") + private String userNextLevelRewards; + //当前已经获取到的经验值 + @SerializedName("user_level_current_consumption") + private String userLevelCurrentConsumption; + //升级需要的经验值(总的) + @SerializedName("user_level_upgrades") + private String userLevelUpgrades; + //包裹红点 + @SerializedName("users_pack_red_dot") + private String usersPackRedDot; + + public String getCoin() { + long coinMoney = Long.parseLong(coin); + if (999999999 < coinMoney && coinMoney <= 999999999999L) { + coin = coin.substring(0, coin.length() - 2); + coin = coin + "k"; + } + if (999999999999L < coinMoney && coinMoney <= 999999999999999L) { + coin = coin.substring(0, coin.length() - 2); + coin = coin + "M"; + } + return coin; + } + + public CoinModel setCoin(String coin) { + this.coin = coin; + return this; + } + + public String getGold() { + long goldMoney = Long.parseLong(gold); + if (999999999 < goldMoney && goldMoney <= 999999999999L) { + gold = gold.substring(0, gold.length() - 2); + gold = gold + "k"; + } + if (999999999999L < goldMoney && goldMoney <= 999999999999999L) { + gold = gold.substring(0, gold.length() - 2); + gold = gold + "M"; + } + return gold; + } + + public CoinModel setGold(String gold) { + this.gold = gold; + return this; + } + + public String getUid() { + return uid; + } + + public CoinModel setUid(String uid) { + this.uid = uid; + return this; + } + + public String getUserLevelMax() { + return userLevelMax; + } + + public CoinModel setUserLevelMax(String userLevelMax) { + this.userLevelMax = userLevelMax; + return this; + } + + public String getUserLevel() { + return userLevel; + } + + public CoinModel setUserLevel(String userLevel) { + this.userLevel = userLevel; + return this; + } + + public String getUserNextLevelRewards() { + return userNextLevelRewards; + } + + public CoinModel setUserNextLevelRewards(String userNextLevelRewards) { + this.userNextLevelRewards = userNextLevelRewards; + return this; + } + + public String getUserLevelCurrentConsumption() { + return userLevelCurrentConsumption; + } + + public CoinModel setUserLevelCurrentConsumption(String userLevelCurrentConsumption) { + this.userLevelCurrentConsumption = userLevelCurrentConsumption; + return this; + } + + public String getUserLevelUpgrades() { + return userLevelUpgrades; + } + + public CoinModel setUserLevelUpgrades(String userLevelUpgrades) { + this.userLevelUpgrades = userLevelUpgrades; + return this; + } + + public String getUsersPackRedDot() { + return usersPackRedDot; + } + + public CoinModel setUsersPackRedDot(String usersPackRedDot) { + this.usersPackRedDot = usersPackRedDot; + return this; + } +} diff --git a/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java b/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java index af542556d..e505b5fc9 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java @@ -54,6 +54,87 @@ public class LiveReceiveGiftBean extends BaseModel { private String opentype; private String anchorUid; private boolean isBlindBox = false; + private String namingLiveuid; + private String namingUid; + private String namingLiveName; + private String namingUserName; + private String namingLiveAvatar; + private String namingUserAvatar; + private String namingStatus; + private String namingCoin; + + public String getNamingLiveuid() { + return namingLiveuid; + } + + public LiveReceiveGiftBean setNamingLiveuid(String namingLiveuid) { + this.namingLiveuid = namingLiveuid; + return this; + } + + public String getNamingUid() { + return namingUid; + } + + public LiveReceiveGiftBean setNamingUid(String namingUid) { + this.namingUid = namingUid; + return this; + } + + public String getNamingLiveName() { + return namingLiveName; + } + + public LiveReceiveGiftBean setNamingLiveName(String namingLiveName) { + this.namingLiveName = namingLiveName; + return this; + } + + public String getNamingUserName() { + return namingUserName; + } + + public LiveReceiveGiftBean setNamingUserName(String namingUserName) { + this.namingUserName = namingUserName; + return this; + } + + public String getNamingLiveAvatar() { + return namingLiveAvatar; + } + + public LiveReceiveGiftBean setNamingLiveAvatar(String namingLiveAvatar) { + this.namingLiveAvatar = namingLiveAvatar; + return this; + } + + public String getNamingUserAvatar() { + return namingUserAvatar; + } + + public LiveReceiveGiftBean setNamingUserAvatar(String namingUserAvatar) { + this.namingUserAvatar = namingUserAvatar; + return this; + } + + public String getNamingStatus() { + return namingStatus; + } + + public LiveReceiveGiftBean setNamingStatus(String namingStatus) { + this.namingStatus = namingStatus; + return this; + } + + public String getNamingCoin() { + return namingCoin; + } + + public LiveReceiveGiftBean setNamingCoin(String namingCoin) { + this.namingCoin = namingCoin; + return this; + } + private AllServerNotifyEvent event = new AllServerNotifyEvent(); public AllServerNotifyEvent getEvent() { diff --git a/live/src/main/java/com/yunbao/live/dialog/CodexDialog.java b/live/src/main/java/com/yunbao/live/dialog/CodexDialog.java new file mode 100644 index 000000000..a0e192154 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/CodexDialog.java @@ -0,0 +1,114 @@ +package com.yunbao.live.dialog; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.core.BottomPopupView; +import com.yunbao.common.bean.GiftGuideModel; +import com.yunbao.common.event.CodexEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; +import com.yunbao.live.adapter.CodexAdapter; + +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.List; + +public class CodexDialog extends BottomPopupView { + private String mStream, mLiveUid; + private RecyclerView liveCodex; + private CodexAdapter codexAdapter; + private boolean history; + + public CodexDialog(@NonNull Context context, String mStream, String mLiveUid, boolean history) { + super(context); + this.mLiveUid = mLiveUid; + this.mStream = mStream; + this.history = history; + } + + // 返回自定义弹窗的布局 + @Override + protected int getImplLayoutId() { + return R.layout.dialog_live_codex; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + Bus.getOn(this); + initView(); + initDate(); + } + + private void initDate() { + if (history) { + LiveNetManager.get(getContext()). + getGiftGuideHistory(mLiveUid, new HttpCallback>() { + @Override + public void onSuccess(List data) { + codexAdapter.addAllData(data,history,mStream,mLiveUid); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } else { + LiveNetManager.get(getContext()). + getGiftGuide(mLiveUid, new HttpCallback>() { + @Override + public void onSuccess(List data) { + codexAdapter.addAllData(data,history,mStream,mLiveUid); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + + } + + private void initView() { + liveCodex = findViewById(R.id.live_codex); + codexAdapter = new CodexAdapter(); + liveCodex.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false)); + liveCodex.setAdapter(codexAdapter); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + } + + @Override + protected void onDismiss() { + Bus.getOff(this); + + super.onDismiss(); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onCodexEvent(CodexEvent event) { + + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) { + dismiss(); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java new file mode 100644 index 000000000..5f0db059c --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java @@ -0,0 +1,235 @@ +package com.yunbao.live.dialog; + +import android.content.DialogInterface; +import android.graphics.Typeface; +import android.os.Bundle; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.fragment.app.FragmentTransaction; + +import com.lxj.xpopup.XPopup; +import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.Constants; +import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.event.GiftWallItemEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; +import com.yunbao.common.fragment.AllServiceChampionFragment; +import com.yunbao.common.fragment.GiftWithoutWallFragment; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.CommonHttpUtil; +import com.yunbao.common.interfaces.CommonCallback; +import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; +import com.yunbao.live.activity.LiveActivity; +import com.yunbao.live.event.LiveAudienceEvent; +import com.yunbao.live.views.GiftAlreadyWallFragment; + +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 礼物墙 + */ +public class GiftWallDialog extends AbsDialogFragment { + private LinearLayout layoutLitIcon, layoutUnlitIcon, layoutAllServiceChampion; + private TextView textLitIcon, textUnlitIcon, textAllServiceChampion, anchorName, regularBubble; + private View viewAllServiceChampion, viewUnlitIcon, viewLitIcon, attention; + private RoundedImageView avatar; + private List tabText = new ArrayList<>(); + private List tabView = new ArrayList<>(); + private String mStream, mAnchorName, mLiveUid, mAvatarUrl, toUid; + private int isAttention = 0;//是否关注 0=没关注, + private boolean isLive;//是否正在直播 + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + Bus.getOn(this); + initView(); + initDate(); + } + + private void initView() { + layoutLitIcon = mRootView.findViewById(R.id.layout_lit_icon); + layoutUnlitIcon = mRootView.findViewById(R.id.layout_unlit_icon); + layoutAllServiceChampion = mRootView.findViewById(R.id.layout_all_service_champion); + textLitIcon = mRootView.findViewById(R.id.text_lit_icon); + textUnlitIcon = mRootView.findViewById(R.id.text_unlit_icon); + textAllServiceChampion = mRootView.findViewById(R.id.text_all_service_champion); + viewAllServiceChampion = mRootView.findViewById(R.id.view_all_service_champion); + viewUnlitIcon = mRootView.findViewById(R.id.view_unlit_icon); + viewLitIcon = mRootView.findViewById(R.id.view_lit_icon); + avatar = mRootView.findViewById(R.id.avatar); + attention = mRootView.findViewById(R.id.attention); + anchorName = mRootView.findViewById(R.id.anchor_name); + regularBubble = mRootView.findViewById(R.id.regular_bubble); + tabText.add(textLitIcon); + tabText.add(textUnlitIcon); + tabText.add(textAllServiceChampion); + tabView.add(viewLitIcon); + tabView.add(viewUnlitIcon); + tabView.add(viewAllServiceChampion); + selectTab(textLitIcon, viewLitIcon); + ViewClicksAntiShake.clicksAntiShake(layoutLitIcon, () -> { + selectTab(textLitIcon, viewLitIcon); + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid)); + transaction.commit(); + }); + ViewClicksAntiShake.clicksAntiShake(layoutUnlitIcon, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + selectTab(textUnlitIcon, viewUnlitIcon); + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid, toUid)); + transaction.commit(); + + } + }); + ViewClicksAntiShake.clicksAntiShake(layoutAllServiceChampion, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + selectTab(textAllServiceChampion, viewAllServiceChampion); + + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, AllServiceChampionFragment.newInstance(mStream, mLiveUid)); + transaction.commit(); + } + }); + ViewClicksAntiShake.clicksAntiShake(attention, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + CommonHttpUtil.setAttention(mLiveUid, new CommonCallback() { + @Override + public void callback(Integer isAttention) { + if (isAttention == 1) { + LiveActivity.sendSystemMessage(IMLoginManager.get(getContext()).getUserInfo().getUserNicename() + + getActivity().getString(R.string.live_follow_anchor)); + attention.setVisibility(View.GONE); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.IS_ATTENTION).setLiveType(isAttention)); + } + } + }); + } + }); + ViewClicksAntiShake.clicksAntiShake(regularBubble, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(getContext()) + .asCustom(new RegularIntroducePopup(getContext())) + .show(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.codex_layout), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(getContext()) + .enableDrag(false) + .asCustom(new CodexDialog(getContext(), mStream, mLiveUid, false)) + .show(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.medal_achievement), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(getContext()) + .enableDrag(false) + .asCustom(new MedalAchievementPopup(getContext(), isLive, toUid)) + .show(); + } + }); + } + + private void initDate() { + Bundle bundle = getArguments(); + if (bundle == null) { + return; + } + mLiveUid = bundle.getString(Constants.LIVE_UID); + mStream = bundle.getString(Constants.STREAM); + mAnchorName = bundle.getString("mAnchorName"); + mAvatarUrl = bundle.getString("mAvatarUrl"); + toUid = bundle.getString("toUid"); + isAttention = bundle.getInt("isAttention"); + isLive = bundle.getBoolean("isLive"); + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid)); + transaction.commit(); + ImgLoader.display(getContext(), mAvatarUrl, avatar); + anchorName.setText(mAnchorName); + attention.setVisibility(isAttention == 0 ? View.VISIBLE : View.GONE); + } + + private void selectTab(TextView textView, View tab) { + for (TextView view : tabText) { + if (textView == view) { + view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD_ITALIC); + } else { + view.setTypeface(Typeface.SANS_SERIF, Typeface.ITALIC); + } + } + for (View view : tabView) { + view.setVisibility(view == tab ? View.VISIBLE : View.GONE); + } + } + + @Override + public void onDismiss(DialogInterface dialog) { + super.onDismiss(dialog); + Bus.getOff(this); + + } + + // 返回自定义弹窗的布局 + @Override + protected int getLayoutId() { + return R.layout.dialog_live_gift_wall; + } + + @Override + protected int getDialogStyle() { + return R.style.dialog2; + } + + @Override + protected boolean canCancel() { + return true; + } + + @Override + protected void setWindowAttributes(Window window) { + window.setWindowAnimations(com.yunbao.common.R.style.bottomToTopAnim); + window.setDimAmount(0f);//去掉遮罩层(全透明) + WindowManager.LayoutParams params = window.getAttributes(); + params.width = WindowManager.LayoutParams.MATCH_PARENT; + params.height = WindowManager.LayoutParams.WRAP_CONTENT; + params.gravity = Gravity.BOTTOM; + window.setAttributes(params); + } + + /** + * 关于点击礼物分类的通知 + */ + @Subscribe(threadMode = ThreadMode.MAIN) + public void onGiftWallItemEvent(GiftWallItemEvent event) { + new XPopup.Builder(getActivity()) + .asCustom(new GiftWallItemPopup(getActivity(), event.getGiftWallModel(), event.isUnlit(), mLiveUid, mStream)) + .show(); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) { + dismiss(); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java b/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java new file mode 100644 index 000000000..2f2a138e2 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java @@ -0,0 +1,110 @@ +package com.yunbao.live.dialog; + + +import android.content.Context; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.cardview.widget.CardView; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallGiftDetail; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.event.LiveAudienceEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; + +public class GiftWallItemPopup extends CenterPopupView { + private CardView layout; + private ImageView giftImg, avatar; + private TextView price, giftDetailsBtn, distanceNaming, vacantPositionAwaits, giftDetails, vacantPosition; + private GiftWallModel giftWallModel; + private boolean unlit; + private String mLiveUid, mStream; + + public GiftWallItemPopup(@NonNull Context context, GiftWallModel giftWallModel, + boolean unlit, String mLiveUid, String mStream) { + super(context); + this.giftWallModel = giftWallModel; + this.unlit = unlit; + this.mLiveUid = mLiveUid; + this.mStream = mStream; + } + + @Override + protected int getImplLayoutId() { + return R.layout.popup_gift_wall_item; + } + + @Override + protected void onCreate() { + super.onCreate(); + layout = findViewById(R.id.layout); + giftImg = findViewById(R.id.gift_img); + price = findViewById(R.id.price); + giftDetails = findViewById(R.id.gift_details); + giftDetailsBtn = findViewById(R.id.gift_details_btn); + distanceNaming = findViewById(R.id.distance_naming); + vacantPositionAwaits = findViewById(R.id.vacant_position_awaits); + vacantPosition = findViewById(R.id.vacant_position); + avatar = findViewById(R.id.avatar); + if (unlit) { + giftDetailsBtn.setText(getContext().getText(R.string.send_hem)); + } else { + giftDetailsBtn.setText(getContext().getText(R.string.instant_light)); + } + ImgLoader.display(getContext(), giftWallModel.getGifticon(), giftImg); + giftDetails.setText(giftWallModel.getGiftname()); + price.setText(giftWallModel.getNeedcoin()); + loadData(); + ViewClicksAntiShake.clicksAntiShake(giftDetailsBtn, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream) + .setmWishGiftId(giftWallModel.getId())); + Bus.get().post(new LiveGiftDialogEvent()); + dialog.dismiss(); + } + }); + + } + + public void loadData() { + LiveNetManager.get(getContext()). + giftDetail(mLiveUid, String.valueOf(giftDetails.getId()), new HttpCallback() { + @Override + public void onSuccess(GiftWallGiftDetail data) { + if (data.getUid() == 0) { + ImgLoader.display(getContext(), R.mipmap.icon_vacant_position_awaits, avatar); + vacantPositionAwaits.setText(getContext().getText(R.string.vacant_position_awaits)); + vacantPosition.setText("?"); + } else { + ImgLoader.display(getContext(), data.getAvatar(), avatar); + vacantPositionAwaits.setText(data.getUserNicename()); + vacantPosition.setText(giftWallModel.getGiftname()); + } + if (data.getNamingCoin() == 0) { + distanceNaming.setVisibility(GONE); + } else { + distanceNaming.setVisibility(VISIBLE); + distanceNaming.setText(String.format(getContext().getString(R.string.distance_naming), String.valueOf(data.getNamingCoin()))); + } + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java index fd3fd30e3..ead655723 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java @@ -80,7 +80,7 @@ import com.yunbao.live.bean.GiftTopBean; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.custom.GiftViewPager; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.live.event.LiveGiftDialogEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.utils.ToolsButton; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java new file mode 100644 index 000000000..3e99a8762 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -0,0 +1,1154 @@ +package com.yunbao.live.dialog; + +import static com.yunbao.common.CommonAppConfig.isGetNewWrap; +import static com.yunbao.common.utils.RouteUtil.PATH_COIN; + +import android.app.Dialog; +import android.content.DialogInterface; +import android.graphics.Color; +import android.graphics.Typeface; +import android.os.Bundle; +import android.os.Handler; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.TextUtils; +import android.text.style.ForegroundColorSpan; +import android.util.Log; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import androidx.fragment.app.FragmentTransaction; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.alibaba.android.arouter.launcher.ARouter; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.blankj.utilcode.util.GsonUtils; +import com.lxj.xpopup.XPopup; +import com.opensource.svgaplayer.SVGACallback; +import com.opensource.svgaplayer.SVGADrawable; +import com.opensource.svgaplayer.SVGAImageView; +import com.opensource.svgaplayer.SVGAParser; +import com.opensource.svgaplayer.SVGAVideoEntity; +import com.yunbao.common.CommonAppConfig; +import com.yunbao.common.Constants; +import com.yunbao.common.R; +import com.yunbao.common.bean.BlindBoxInfoModel; +import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.bean.LiveGiftBean2; +import com.yunbao.common.bean.UserBean; +import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.event.GiftNumberEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; +import com.yunbao.common.event.SendBlindGiftEvent; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.utils.AppManager; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.DeviceUtils; +import com.yunbao.common.utils.DialogUitl; +import com.yunbao.common.utils.NobleUtil; +import com.yunbao.common.utils.SVGAViewUtils; +import com.yunbao.common.utils.StringUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.GiftNumberPopup; +import com.yunbao.common.views.weight.MarqueeTextView; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.activity.LiveActivity; +import com.yunbao.live.activity.LiveAudienceActivity; +import com.yunbao.live.adapter.GiftTitleAdapter; +import com.yunbao.live.bean.CoinModel; +import com.yunbao.live.bean.GiftTopBean; +import com.yunbao.live.bean.LiveGuardInfo; +import com.yunbao.live.event.GiftTitleEvent; +import com.yunbao.live.event.LiveAudienceEvent; +import com.yunbao.live.event.LiveGiftItemEvent; +import com.yunbao.live.event.LiveParcelItemRefreshEvent; +import com.yunbao.live.http.LiveHttpUtil; +import com.yunbao.live.views.LiveGiftFragment; +import com.yunbao.live.views.LiveParcelFragment; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +/** + * 直播间新送礼弹窗 + */ +public class LiveGiftPopup extends AbsDialogFragment { + private ImageView gitBackground, nobilityIcon, description, iconArrow, operateImage, namingAvatar; + private JSONArray liveGiftList; + private TextView diamondText, goldText, liveWrap, vipGoldDesc, vipGoldTitle, giftNumber; + private RecyclerView giftTitle; + private GiftTitleAdapter giftTitleAdapter; + private FrameLayout contextLayoutGift; + private String mStream, mLiveUid; + private FrameLayout blindBox, frameBlindTop, noNobility, giftNumberLayout, giftSendLayout, namingLayout; + private ProgressBar progressBlind, progressBlind1, progressBlind2; + private SVGAImageView blindSvga, blindBoxOpen; + private View iconMasking; + private TextView blindNumber, textBlindProgress, textBlindGiftName, liveGiftSend, mLianText, lvStr, leaveHint; + private LinearLayout establishedNobility, levelingLayout; + private View mBtnSendGroup; + private LiveGuardInfo mLiveGuardInfo; + private static final String DEFAULT_COUNT = "1"; + private String mCount = DEFAULT_COUNT; + private String mWishGiftId; + private int isContactGift = 0; + private String by; + private boolean isWrap; + private ProgressBar progressBar; + private MarqueeTextView giftDescription, namingName; + private boolean isPk; + + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + Bus.getOn(this); + initView(); + initDate(); + } + + + @Override + public void onDismiss(DialogInterface dialog) { + super.onDismiss(dialog); + Bus.getOff(this); + + } + + private void initView() { + gitBackground = mRootView.findViewById(R.id.git_background2); + contextLayoutGift = mRootView.findViewById(R.id.context_layout_gift); + diamondText = mRootView.findViewById(R.id.diamond_text); + goldText = mRootView.findViewById(R.id.gold_text); + giftTitle = mRootView.findViewById(R.id.gift_title); + liveWrap = mRootView.findViewById(R.id.live_wrap); + giftDescription = mRootView.findViewById(R.id.gift_description); + namingName = mRootView.findViewById(R.id.naming_name); + blindBox = mRootView.findViewById(R.id.blind_box); + frameBlindTop = mRootView.findViewById(R.id.frame_blind_top); + progressBlind = mRootView.findViewById(R.id.progress_blind1); + progressBlind1 = mRootView.findViewById(R.id.progress_blind2); + progressBlind2 = mRootView.findViewById(R.id.progress_blind3); + iconMasking = mRootView.findViewById(R.id.icon_masking); + blindSvga = mRootView.findViewById(R.id.blind_svga); + blindBoxOpen = mRootView.findViewById(R.id.blind_box_open); + blindNumber = mRootView.findViewById(R.id.blind_number); + textBlindProgress = mRootView.findViewById(R.id.text_blind_progress); + textBlindGiftName = mRootView.findViewById(R.id.text_blind_gift_name); + noNobility = mRootView.findViewById(R.id.no_nobility); + establishedNobility = mRootView.findViewById(R.id.established_nobility); + nobilityIcon = mRootView.findViewById(R.id.nobility_icon); + vipGoldDesc = mRootView.findViewById(R.id.vipGoldDesc); + vipGoldTitle = mRootView.findViewById(R.id.vipGoldTitle); + giftNumber = mRootView.findViewById(R.id.gift_number); + liveGiftSend = mRootView.findViewById(R.id.live_gift_send); + giftNumberLayout = mRootView.findViewById(R.id.gift_number_layout); + mLianText = mRootView.findViewById(R.id.lian_text); + mBtnSendGroup = mRootView.findViewById(R.id.btn_send_lian); + giftSendLayout = mRootView.findViewById(R.id.gift_send_layout); + namingLayout = mRootView.findViewById(R.id.naming_layout); + description = mRootView.findViewById(R.id.description); + lvStr = mRootView.findViewById(R.id.lv_str); + iconArrow = mRootView.findViewById(R.id.icon_arrow); + operateImage = mRootView.findViewById(R.id.operate_image); + namingAvatar = mRootView.findViewById(R.id.naming_avatar); + leaveHint = mRootView.findViewById(R.id.leave_hint); + progressBar = mRootView.findViewById(R.id.progressBar); + levelingLayout = mRootView.findViewById(R.id.leveling_layout); + namingLayout.setVisibility(View.GONE); + //设置礼物弹窗背景 + ImgLoader.displayBlurLive(getContext(), R.drawable.backgroud_custom_gift2, gitBackground); + gitBackground.setAlpha(0.97f); + ImgLoader.display(getContext(), R.mipmap.icon_arrow_right_2, iconArrow); + //礼物分类tab + LinearLayoutManager manager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false); + giftTitle.setLayoutManager(manager); + giftTitleAdapter = new GiftTitleAdapter(); + giftTitle.setAdapter(giftTitleAdapter); + liveWrap.setAlpha(0.5f); + liveWrap.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL); + liveGiftSend.setEnabled(false); + giftNumberLayout.setVisibility(View.INVISIBLE); + giftDescription.setVisibility(View.GONE); + operateImage.setVisibility(View.GONE); + levelingLayout.setVisibility(View.VISIBLE); + //点击包裹 + ViewClicksAntiShake.clicksAntiShake(liveWrap, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + giftTitleAdapter.uncheck(); + liveWrap.setAlpha(1.0f); + liveWrap.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, LiveParcelFragment.newInstance(mStream, mLiveUid)); + transaction.commit(); + isWrap = true; + } + }); + //;连送 + ViewClicksAntiShake.clicksAntiShake(mBtnSendGroup, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + sendGift(); + } + }); + //送礼 + ViewClicksAntiShake.clicksAntiShake(liveGiftSend, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + sendGift(); + } + }); + // 跳转充值 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.diamond_linear), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + forwardMyCoin(0); + } + }); + // 跳转充值 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.gold_layout), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + forwardMyCoin(2); + } + }); + // 盲盒说明 + ViewClicksAntiShake.clicksAntiShake(description, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + StringBuffer htmlUrl = new StringBuffer(); + htmlUrl.append(CommonAppConfig.HOST) + .append("/h5/info/index.html?uid=") + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&no_back=1") + ; + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } + }); + // 跳转贵族 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_luck_gift_tip), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dismiss(); + ((LiveActivity) mContext).openLuckGiftTip(); + } + }); + //用户等级 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.leveling_layout), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + StringBuffer htmlUrl = new StringBuffer(); + htmlUrl.append(CommonAppConfig.HOST) + .append("/h5/Grade/index.html?uid=") + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&for"); + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + bundle.putInt("height", DeviceUtils.getScreenHeight(getActivity()) / 5 * 3); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } + }); + //选择礼物数量 + ViewClicksAntiShake.clicksAntiShake(giftNumberLayout, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + if (liveGiftModel.getType() == 7) return; + new XPopup.Builder(getContext()) + .asCustom(new GiftNumberPopup(getContext())) + .show(); + ImgLoader.display(getContext(), R.mipmap.icon_arrow_down, iconArrow); + } + }); + /** + * 礼物图片运营位跳转 + */ + ViewClicksAntiShake.clicksAntiShake(operateImage, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + StringBuffer htmlUrl = new StringBuffer(); + htmlUrl.append(CommonAppConfig.HOST) + .append(liveGiftModel.getOperateUrl()) + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&for"); + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } + }); + } + + private void initDate() { + Bundle bundle = getArguments(); + if (bundle != null) { + mLiveUid = bundle.getString("mLiveUid"); + mStream = bundle.getString("mStream"); + mLiveGuardInfo = bundle.getParcelable("GuardInfo"); + mWishGiftId = bundle.getString("WishGiftId"); + isContactGift = bundle.getBoolean("ContactGift", false) ? 1 : 0; + by = bundle.getString("by"); + isPk = bundle.getBoolean("pk"); + } + + //判断是否缓存礼物列表 + String giftListJson = CommonAppConfig.getInstance().getGiftListJson(); + if (!TextUtils.isEmpty(giftListJson)) { + try { + liveGiftList = JSON.parseArray(giftListJson); + Bus.getOn(this); + } catch (Exception e) { + e.printStackTrace(); + } + } + if (liveGiftList == null) { + LiveHttpUtil.getNewGiftList(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + JSONObject obj = JSON.parseObject(info[0]); + liveGiftList = obj.getJSONArray("listarray"); + CommonAppConfig.getInstance().setGiftListJson(obj.getString("listarray")); + getCoin(); + goldText.setText(obj.getString("gold")); + diamondText.setText(obj.getString("coin")); + setTitleData(); + + } + } + + @Override + public void onFinish() { +// if (mLoading != null) { +// mLoading.setVisibility(View.INVISIBLE); +// } + } + }); + } else { + getCoin(); + setTitleData(); + } + getBlindBoxInfo(); + loadUserVip(); + } + + //设置礼物类别数据 + private void setTitleData() { + List name = new ArrayList<>(); + for (int i = 0; i < liveGiftList.size(); i++) { + JSONObject data = liveGiftList.getJSONObject(i); + GiftTopBean giftTopBean = new GiftTopBean(); + giftTopBean.setName(data.getString("name")); + name.add(giftTopBean); + } + giftTitleAdapter.addAllData(name); + if (!TextUtils.isEmpty(mWishGiftId) && liveGiftList.size() > 0) { + for (int i = 0; i < liveGiftList.size(); i++) { + JSONObject data = liveGiftList.getJSONObject(i); + String giftJson = data.getString("giftlist"); + List liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class); + for (LiveGiftBean model : liveGiftBeans) { + if (TextUtils.equals(model.getId() + "", mWishGiftId)) { + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, LiveGiftFragment.newInstance(giftJson, + liveGiftList.getJSONObject(i).getString("name"), + mStream, mLiveUid, mWishGiftId)); + transaction.commit(); + } + } + } + } else { + + JSONObject obj2 = liveGiftList.getJSONObject(0); + String giftJson = obj2.getString("giftlist"); + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, LiveGiftFragment.newInstance(giftJson, + liveGiftList.getJSONObject(0).getString("name"), + mStream, mLiveUid, mWishGiftId)); + transaction.commit(); + } + + + } + + /** + * 设置贵族状态 + */ + private void loadUserVip() { + HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") + .params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) + .params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) + .execute(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + JSONObject user = JSONObject.parseObject(info[0]); + int nobleId = user.getIntValue("noble_id"); + int resId = NobleUtil.nobleIdToImageResId(nobleId); + if (resId != -1) { + nobilityIcon.setImageResource(resId); + vipGoldTitle.setText(user.getString("noble_name")); + vipGoldDesc.setText(com.yunbao.live.R.string.live_gift_buy_gold_desc_to); + noNobility.setVisibility(View.GONE); + establishedNobility.setVisibility(View.VISIBLE); + } else { + noNobility.setVisibility(View.VISIBLE); + establishedNobility.setVisibility(View.GONE); + + } + } + } + }); + } + + /** + * 获取砖石和金豆余额 + */ + private void getCoin() { + LiveHttpUtil.getCoin(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + if (!TextUtils.isEmpty(info[0])) { + CoinModel coinModel = GsonUtils.fromJson(info[0], CoinModel.class); + goldText.setText(coinModel.getGold()); + diamondText.setText(coinModel.getCoin()); + lvStr.setText("Lv." + coinModel.getUserLevel()); + int nextLeve = Integer.parseInt(coinModel.getUserLevel()); + int maxLeve = Integer.parseInt(coinModel.getUserLevelMax()); + findViewById(R.id.red_point).setVisibility((!TextUtils.isEmpty(coinModel.getUsersPackRedDot())) && + TextUtils.equals(coinModel.getUsersPackRedDot(), "1") ? View.VISIBLE : View.GONE); + if (maxLeve > nextLeve) { + String leveNext = String.valueOf(nextLeve + 1); + String userNextLevel = coinModel.getUserNextLevelRewards(); + String hint = String.format(getString(R.string.leveling_points), + userNextLevel, leveNext); + int leveNextIndexOf = hint.indexOf(leveNext); + int leveNextSize = leveNext.length(); + int userNextLevelIndexOf = msg.indexOf(userNextLevel); + int userNextLevelSize = userNextLevel.length(); + SpannableStringBuilder builder = new SpannableStringBuilder(); + builder.append(msg); + builder.setSpan(new + ForegroundColorSpan(Color.parseColor("#FFC722")), + leveNextIndexOf, leveNextIndexOf + leveNextSize, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + builder.setSpan(new + ForegroundColorSpan(Color.parseColor("#FFC722")), + userNextLevelIndexOf, userNextLevelIndexOf + userNextLevelSize, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + leaveHint.setText(builder); + } else { + String hint = getString(R.string.reach_the_top); + leaveHint.setText(hint); + progressBar.setMax(10); + progressBar.setProgress(10); + } + + } + + + } + } + }); + } + + /** + * 赠送礼物 + */ + public void sendGift() { + if (liveGiftModel == null) return; + if (liveGiftModel.getTag() != null) { + if (mCount.equals("1")) { + LiveHttpUtil.setFrontTask("sendgift", mLiveUid, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + EventBus.getDefault().post("stop_svga_new_user_gif"); + EventBus.getDefault().post("stop_new_user_gif"); + if (code == 0) { + EventBus.getDefault().post("stop_new_user_gif1"); + } + dismiss(); + } + }); + } else { + ToastUtil.show(com.yunbao.live.R.string.only_one); + } + } else { + if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || liveGiftModel == null) { + return; + } + if (mLiveGuardInfo != null) { + if (liveGiftModel.getMark() == LiveGiftBean2.MARK_GUARD && mLiveGuardInfo.getMyGuardType() != Constants.GUARD_TYPE_YEAR) { + ToastUtil.show(com.yunbao.live.R.string.guard_gift_tip); + return; + } + } + SendGiftCallback callback = new SendGiftCallback(liveGiftModel); + try { + if (!StringUtil.isEmpty(mWishGiftId) && liveGiftModel.getId() != Integer.parseInt(mWishGiftId)) { + isContactGift = 0; + } + } catch (NumberFormatException e) { + isContactGift = 0; + } + if (by != null) { + LiveHttpUtil.sendGift("1", mLiveUid, mStream, liveGiftModel.getId(), mCount, isContactGift, callback); + } else { + LiveHttpUtil.sendGift("0", mLiveUid, mStream, liveGiftModel.getId(), mCount, isContactGift, callback); + } + } + } + + /** + * 跳转到我的钻石 + */ + private void forwardMyCoin(int page) { + dismiss(); + //我们的 + ARouter.getInstance().build(PATH_COIN).withInt("p", page).navigation(); + } + + //连送逻辑 + private int mLianCountDownCount;//连送倒计时的数字 + + private Handler lianSongHandler = new Handler(); + private Runnable lianSongRunnable = new Runnable() { + @Override + public void run() { + if (removeRunnable) { + lianSongHandler.removeCallbacks(lianSongRunnable); + if (mLianText != null) { + mLianText.setText("5s"); + } + mLianCountDownCount = 5; + lianSongHandler.postDelayed(lianSongRunnable, 1000); + removeRunnable = false; + } else { + mLianCountDownCount--; + if (mLianCountDownCount == 0) { + hideLianBtn(); + } else { + if (mLianText != null) { + mLianText.setText(mLianCountDownCount + "s"); + lianSongHandler.postDelayed(lianSongRunnable, 1000); + } + } + } + + } + }; + + /** + * 显示连送按钮 + */ + private boolean mShowLianBtn = false; + private boolean removeRunnable = false; + + private void showLianBtn() { + + + if (mShowLianBtn) { + removeRunnable = true; + } else { + if (mLianText != null) { + mLianText.setText("5s"); + } + mLianCountDownCount = 5; + lianSongHandler.postDelayed(lianSongRunnable, 1000); + mBtnSendGroup.setVisibility(View.VISIBLE); + giftSendLayout.setVisibility(View.INVISIBLE); + mShowLianBtn = true; + } + + + } + + /** + * 隐藏连送按钮 包裹 + */ + private void hideLianBtn() { + mBtnSendGroup.setVisibility(View.INVISIBLE); + giftSendLayout.setVisibility(View.VISIBLE); + lianSongHandler.removeCallbacks(lianSongRunnable); + mShowLianBtn = false; + } + + /** + * 关于点击礼物分类的通知 + */ + @Subscribe(threadMode = ThreadMode.MAIN) + public void onGiftTitleEvent(GiftTitleEvent event) { + liveWrap.setAlpha(0.5f); + liveWrap.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL); + liveGiftSend.setEnabled(false); + giftNumberLayout.setVisibility(View.INVISIBLE); + JSONObject obj2 = liveGiftList.getJSONObject(event.getmPosition()); + String giftJson = obj2.getString("giftlist"); + + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, LiveGiftFragment.newInstance(giftJson, event.getGiftTitle(), mStream, mLiveUid, mWishGiftId)); + transaction.commit(); + isWrap = false; + if (giftSendLayout.getVisibility() == View.INVISIBLE) { + hideLianBtn(); + } + mCount = DEFAULT_COUNT; + giftNumber.setText(mCount); + giftDescription.setVisibility(View.GONE); + levelingLayout.setVisibility(View.VISIBLE); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onGiftNumberEvent(GiftNumberEvent event) { + if (TextUtils.equals(event.getmCount(), "-1")) { + + } else { + mCount = event.getmCount(); + giftNumber.setText(mCount); + } + + } + + /** + * 选中的礼物数据 + * + * @param event + */ + private LiveGiftBean liveGiftModel = null; + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftItemEvent(LiveGiftItemEvent event) { + liveGiftModel = event.getLiveGiftModel(); + + if (!TextUtils.equals(liveGiftModel.getNamingLiveuid(), "0") && !TextUtils.equals(liveGiftModel.getNamingUid(), "0")) { + namingLayout.setVisibility(View.VISIBLE); + ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar); + StringBuffer namingNameText = new StringBuffer(); + namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor)) + .append(liveGiftModel.getNamingLiveName()) + .append(mContext.getText(com.yunbao.live.R.string.the_title_financier)) + .append(liveGiftModel.getNamingUserName()); + namingName.setText(namingNameText.toString()); + } else { + namingLayout.setVisibility(View.GONE); + + } + + if (liveGiftModel.getType() == 7) { + showBlindProgress(liveGiftModel.getBlind_box_type()); + } else { + blindBox.setVisibility(View.INVISIBLE); + mCount = DEFAULT_COUNT; + giftNumber.setText(mCount); + } + liveGiftSend.setEnabled(true); + giftNumberLayout.setVisibility(View.VISIBLE); + mCount = DEFAULT_COUNT; + giftNumber.setText(mCount); + if (giftSendLayout.getVisibility() == View.INVISIBLE) { + hideLianBtn(); + } + if (TextUtils.isEmpty(liveGiftModel.getGiftDescription())) { + giftDescription.setVisibility(View.GONE); + levelingLayout.setVisibility(View.VISIBLE); + } else { + giftDescription.setText(liveGiftModel.getGiftDescription()); + giftDescription.setVisibility(View.VISIBLE); + levelingLayout.setVisibility(View.GONE); + } + if (!TextUtils.isEmpty(liveGiftModel.getOperateImage())) { + operateImage.setVisibility(View.VISIBLE); + ImgLoader.display(getContext(), liveGiftModel.getOperateUrl(), operateImage); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) { + dismiss(); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onSendBlindGiftEvent(SendBlindGiftEvent event) { + if (!TextUtils.equals(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()), event.getUid())) + return; + BlindBoxInfoModel model = null; + for (int i = 0; i < blindBoxInfoModels.size(); i++) { + if (TextUtils.equals(blindBoxInfoModels.get(i).getBlindBoxType(), event.getBoxType())) { + blindBoxInfoModels.get(i).setDressThresholdValue(event.getDressThresholdValue()); + blindBoxInfoModels.get(i).setThresholdValue(event.getThresholdValue()); + model = blindBoxInfoModels.get(i); + } + } + + long userID = IMLoginManager.get(mContext).getUserInfo().getId(); + String boxBlindName; + try { + if (!blindBoxOpen.isAnimating()) { + new SVGAParser(mContext).parse(new URL(model.getBlindBoxSwf()), new SVGAParser.ParseCompletion() { + @Override + public void onComplete(SVGAVideoEntity videoItem) { + blindBoxOpen.setVisibility(View.VISIBLE); + SVGADrawable drawable = new SVGADrawable(videoItem); + blindBoxOpen.setImageDrawable(drawable); + blindBoxOpen.setLoops(1); + blindBoxOpen.startAnimation(); + + } + + @Override + public void onError() { + } + }); + + blindBoxOpen.setCallback(new SVGACallback() { + @Override + public void onPause() { + } + + @Override + public void onFinished() { + blindBoxOpen.clear(); + blindBoxOpen.setVisibility(View.GONE); + Log.e("礼物盲盒", "结束播放"); + } + + @Override + public void onRepeat() { + } + + @Override + public void onStep(int i, double v) { + Log.e("礼物盲盒", "onStep: frame " + i + " percentage " + v); + } + }); + } + + } catch (MalformedURLException e) { + e.printStackTrace(); + } + //判断送礼用户更新送礼用户进度 + if (TextUtils.equals(String.valueOf(userID), event.getUid()) && blindBoxType == Integer.parseInt(event.getBoxType())) { + switch (blindBoxType) { + case 1: + boxBlindName = mContext.getString(R.string.mini_blind_box); + + progressBlind.setMax(Integer.parseInt(model.getThresholdValue())); + progressBlind.setProgress(Integer.parseInt(model.getDressThresholdValue())); + break; + case 2: + boxBlindName = mContext.getString(R.string.collection_blind_box); + + progressBlind1.setMax(Integer.parseInt(model.getThresholdValue())); + progressBlind1.setProgress(Integer.parseInt(model.getDressThresholdValue())); + + break; + default: + boxBlindName = mContext.getString(R.string.pd_blind_box); + progressBlind2.setMax(Integer.parseInt(model.getThresholdValue())); + progressBlind2.setProgress(Integer.parseInt(model.getDressThresholdValue())); + break; + } + //进度下方提示语 + if (TextUtils.equals(model.getThresholdValue(), model.getDressThresholdValue())) { + String individualDressing = mContext.getString(R.string.individual_dressing); + String msg = mContext.getString(R.string.have_already_win); + msg = String.format(msg, model.getThresholdDressName()); + int dressNameIndexOf = msg.indexOf(model.getThresholdDressName()); + int individualDressingIndexOf = msg.indexOf(String.valueOf(individualDressing)); + int dressNameSize = model.getThresholdDressName().length(); + int individualDressingSize = String.valueOf(individualDressing).length(); + SpannableStringBuilder builder = new SpannableStringBuilder(); + builder.append(msg); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), individualDressingIndexOf, individualDressingIndexOf + individualDressingSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + blindNumber.setText(builder); + textBlindProgress.setText(R.string.get_it_done); + } else { + int progress = Integer.parseInt(model.getThresholdValue()) - Integer.parseInt(model.getDressThresholdValue()); + String msg = mContext.getString(R.string.resend_win); + msg = String.format(msg, String.valueOf(progress), model.getThresholdDressName()); + int dressNameIndexOf = msg.indexOf(model.getThresholdDressName()); + int progressIndexOf = msg.indexOf(String.valueOf(progress)); + int dressNameSize = model.getThresholdDressName().length(); + int progressSize = String.valueOf(progress).length(); + SpannableStringBuilder builder = new SpannableStringBuilder(); + builder.append(msg); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), progressIndexOf, progressIndexOf + progressSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + blindNumber.setText(builder); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(model.getDressThresholdValue()) + .append("/") + .append(model.getThresholdValue()); + textBlindProgress.setText(stringBuffer.toString()); + float maskingAlpha = (float) progress / Float.parseFloat(model.getThresholdValue()); + iconMasking.setAlpha(maskingAlpha); + } + if (stringBuilders.size() == 0) { + boxBlindHandler.postDelayed(boxBlindRunnable, 1500); + } + if (!TextUtils.isEmpty(event.getDressName()) && !TextUtils.isEmpty(event.getDressMsg())) { + SpannableStringBuilder stringBuilder = new SpannableStringBuilder(); + String boxBlindMsg = String.format(mContext.getString(R.string.random_availability2), event.getGiftname(), event.getDressName()); + stringBuilder.append(boxBlindMsg); + int dressNameIndex = boxBlindMsg.indexOf(event.getDressName()); + int dressNameSize = event.getDressName().length(); + int giftNameIndex = boxBlindMsg.indexOf(event.getGiftname()); + int giftNameSize = event.getGiftname().length(); + stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getDressColour())), + dressNameIndex, + dressNameIndex + dressNameSize, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getGiftColour())), + giftNameIndex, + giftNameIndex + giftNameSize, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + stringBuilders.add(stringBuilder); + } else { + SpannableStringBuilder stringBuilder = new SpannableStringBuilder(); + String boxBlindMsg = String.format(mContext.getString(R.string.random_availability3), event.getGiftname()); + stringBuilder.append(boxBlindMsg); + int giftNameIndex = boxBlindMsg.indexOf(event.getGiftname()); + int giftNameSize = event.getGiftname().length(); + stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getGiftColour())), + giftNameIndex, + giftNameIndex + giftNameSize, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + stringBuilders.add(stringBuilder); + + } + + + } + } + + private List stringBuilders = new ArrayList<>(); + private Handler boxBlindHandler = new Handler(); + private Runnable boxBlindRunnable = new Runnable() { + @Override + public void run() { + if (stringBuilders != null && stringBuilders.size() > 0) { + SpannableStringBuilder stringBuilder = stringBuilders.get(0); + textBlindGiftName.setText(stringBuilder); + boxBlindHandler.postDelayed(boxBlindRunnable, 1500); + stringBuilders.remove(0); + + } else { + textBlindGiftName.setText(String.format(mContext.getString(R.string.random_availability), blindGiftNamesBuffer.toString())); + } + } + }; + public List blindBoxInfoModels = new ArrayList<>(); + + private void getBlindBoxInfo() { + LiveNetManager.get(mContext) + .getBlindBoxInfo(new com.yunbao.common.http.base.HttpCallback>() { + @Override + public void onSuccess(List data) { + blindBoxInfoModels = data; + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + + /** + * 展示当前盲盒礼物进度 + * + * @param blindBoxType + */ + private StringBuffer blindGiftNamesBuffer = null; + private int blindBoxType; + + private void showBlindProgress(int blindBoxType) { + this.blindBoxType = blindBoxType; + blindGiftNamesBuffer = new StringBuffer(); + BlindBoxInfoModel model = null; + for (BlindBoxInfoModel boxInfoModel : blindBoxInfoModels) { + if (TextUtils.equals(String.valueOf(blindBoxType), boxInfoModel.getBlindBoxType())) { + model = boxInfoModel; + } + } + if (model == null) return; + blindBoxOpen.clear(); + blindBoxOpen.setVisibility(View.GONE); + try { + blindSvga.clear(); + new SVGAParser(mContext).parse(new URL(model.getThresholdEffectSrc()), new SVGAParser.ParseCompletion() { + @Override + public void onComplete(SVGAVideoEntity videoItem) { + SVGADrawable drawable = new SVGADrawable(videoItem); + blindSvga.setImageDrawable(drawable); + SVGAViewUtils.playEndClear(blindSvga, false); + + } + + @Override + public void onError() { + Log.e("errqs", "errl"); + } + }); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + blindBox.setVisibility(View.VISIBLE); + String boxBlindName = ""; + switch (blindBoxType) { + case 1: + boxBlindName = mContext.getString(R.string.mini_blind_box); + progressBlind.setVisibility(View.VISIBLE); + progressBlind1.setVisibility(View.GONE); + progressBlind2.setVisibility(View.GONE); + frameBlindTop.setBackgroundResource(com.yunbao.live.R.mipmap.bg_kirin); + iconMasking.setBackgroundResource(com.yunbao.live.R.mipmap.icon_masking_kirin); + progressBlind.setMax(Integer.parseInt(model.getThresholdValue())); + progressBlind.setProgress(Integer.parseInt(model.getDressThresholdValue())); + textBlindProgress.setTextColor(Color.parseColor("#047771")); + break; + case 2: + boxBlindName = mContext.getString(com.yunbao.live.R.string.collection_blind_box); + progressBlind.setVisibility(View.GONE); + progressBlind1.setVisibility(View.VISIBLE); + progressBlind2.setVisibility(View.GONE); + frameBlindTop.setBackgroundResource(com.yunbao.live.R.mipmap.bg_phoenix); + iconMasking.setBackgroundResource(com.yunbao.live.R.mipmap.icon_masking_phoenix); + progressBlind1.setMax(Integer.parseInt(model.getThresholdValue())); + progressBlind1.setProgress(Integer.parseInt(model.getDressThresholdValue())); + textBlindProgress.setTextColor(Color.parseColor("#6D2E0F")); + + break; + default: + boxBlindName = mContext.getString(com.yunbao.live.R.string.pd_blind_box); + progressBlind.setVisibility(View.GONE); + progressBlind1.setVisibility(View.GONE); + progressBlind2.setVisibility(View.VISIBLE); + frameBlindTop.setBackgroundResource(com.yunbao.live.R.mipmap.bg_dragon); + iconMasking.setBackgroundResource(com.yunbao.live.R.mipmap.icon_masking_dragon); + progressBlind2.setMax(Integer.parseInt(model.getThresholdValue())); + progressBlind2.setProgress(Integer.parseInt(model.getDressThresholdValue())); + textBlindProgress.setTextColor(Color.parseColor("#905E01")); + break; + } + + //进度下方提示语 + if (TextUtils.equals(model.getThresholdValue(), model.getDressThresholdValue())) { + String individualDressing = mContext.getString(com.yunbao.live.R.string.individual_dressing); + String msg = mContext.getString(com.yunbao.live.R.string.have_already_win); + msg = String.format(msg, model.getThresholdDressName()); + int dressNameIndexOf = msg.indexOf(model.getThresholdDressName()); + int individualDressingIndexOf = msg.indexOf(String.valueOf(individualDressing)); + int dressNameSize = model.getThresholdDressName().length(); + int individualDressingSize = String.valueOf(individualDressing).length(); + SpannableStringBuilder builder = new SpannableStringBuilder(); + builder.append(msg); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), individualDressingIndexOf, individualDressingIndexOf + individualDressingSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + blindNumber.setText(builder); + iconMasking.setAlpha(0.f); + } else { + int progress = Integer.parseInt(model.getThresholdValue()) - Integer.parseInt(model.getDressThresholdValue()); + String msg = mContext.getString(com.yunbao.live.R.string.resend_win); + msg = String.format(msg, String.valueOf(progress), model.getThresholdDressName()); + int dressNameIndexOf = msg.indexOf(model.getThresholdDressName()); + int progressIndexOf = msg.indexOf(String.valueOf(progress)); + int dressNameSize = model.getThresholdDressName().length(); + int progressSize = String.valueOf(progress).length(); + SpannableStringBuilder builder = new SpannableStringBuilder(); + builder.append(msg); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), progressIndexOf, progressIndexOf + progressSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + blindNumber.setText(builder); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(model.getDressThresholdValue()) + .append("/") + .append(model.getThresholdValue()); + textBlindProgress.setText(stringBuffer.toString()); + float maskingAlpha = (float) progress / Float.parseFloat(model.getThresholdValue()); + iconMasking.setAlpha(maskingAlpha); + } + //盲盒礼物文字跑马灯 + for (int i = 0; i < model.getItemName().size(); i++) { + blindGiftNamesBuffer + .append(model.getItemName().get(i)); + + if (i != model.getItemName().size() - 1) { + blindGiftNamesBuffer.append(","); + } + } + textBlindGiftName.setText(String.format(mContext.getString(com.yunbao.live.R.string.random_availability), blindGiftNamesBuffer.toString())); + + } + + // 返回自定义弹窗的布局 + @Override + protected int getLayoutId() { + return R.layout.dialog_live_gift_popup; + } + + @Override + protected int getDialogStyle() { + return R.style.dialog2; + } + + @Override + protected boolean canCancel() { + return true; + } + + @Override + protected void setWindowAttributes(Window window) { + window.setWindowAnimations(R.style.bottomToTopAnim); + window.setDimAmount(0f);//去掉遮罩层(全透明) + WindowManager.LayoutParams params = window.getAttributes(); + params.width = WindowManager.LayoutParams.MATCH_PARENT; + params.height = WindowManager.LayoutParams.WRAP_CONTENT; + params.gravity = Gravity.BOTTOM; + window.setAttributes(params); + } + + private class SendGiftCallback extends HttpCallback { + + private LiveGiftBean mGiftBean; + + public SendGiftCallback(LiveGiftBean giftBean) { + mGiftBean = giftBean; + } + + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + if (mGiftBean.getSwf().contains("svga")) { + dismiss(); + } + if (info.length > 0) { + JSONObject obj = JSON.parseObject(info[0]); + String coin = obj.getString("coin"); + String goldCoin = obj.getString("gold"); + UserBean u = CommonAppConfig.getInstance().getUserBean(); + if (u != null) { + u.setLevel(obj.getIntValue("level")); + //送礼物后更新粉丝徽章等级 + u.setMedalLevel(obj.getIntValue("medal_level")); + u.setMedalName(obj.getString("medal_name")); + u.setCoin(coin); + } + if (diamondText != null) { + diamondText.setText(coin); + } + if (goldText != null) { + goldText.setText(goldCoin); + } + if (mGiftBean.getType() == LiveGiftBean2.TYPE_NORMAL && !mGiftBean.getSwf().contains("svga")) { + showLianBtn(); + } + if (mGiftBean.getType() == 7) { + showLianBtn(); + } +// //刷新包裹列表wrap_gift_num -1:表示数量没有变化 +// mObjGiftSendback = obj; + isGetNewWrap = true; + if (isWrap) { + Bus.get().post(new LiveParcelItemRefreshEvent().setLiveGiftModel(liveGiftModel)); + } + } + } else if (code == 1007 && mGiftBean.getType() != 0) { + hideLianBtn(); + dismiss(); + LiveAudienceEvent.LiveAudienceType type = null; + String confirmString = mContext.getString(com.yunbao.live.R.string.dialog_fount_submit); + String tips = msg; + switch (mGiftBean.getType()) { + case 1: + type = LiveAudienceEvent.LiveAudienceType.NOBLE; + tips = mContext.getString(com.yunbao.live.R.string.dialog_live_gift_noble); + confirmString = mContext.getString(com.yunbao.live.R.string.dialog_live_gift_open_noble); + break; + case 2: + type = LiveAudienceEvent.LiveAudienceType.GUARD; + tips = mContext.getString(com.yunbao.live.R.string.dialog_live_gift_guard); + confirmString = mContext.getString(com.yunbao.live.R.string.dialog_live_gift_open_guard); + break; + case 3: + type = LiveAudienceEvent.LiveAudienceType.FAN_CLUB; + tips = mContext.getString(com.yunbao.live.R.string.dialog_live_gift_fans); + confirmString = mContext.getString(com.yunbao.live.R.string.dialog_live_gift_open_fans); + } + LiveAudienceEvent.LiveAudienceType finalType = type; + new DialogUitl.Builder(mContext) + .setView(com.yunbao.live.R.layout.dialog_live_unfollow) + .setConfirmString(confirmString) + .setContent(tips) + .setClickCallback((dialog, content) -> { + LiveAudienceEvent event = new LiveAudienceEvent() + .setType(finalType); + if (finalType == LiveAudienceEvent.LiveAudienceType.GUARD) { + event = event.setObject(""); + } + Bus.get().post(event); + }).build().show(); + + AppManager.runDebugCode(() -> { + Log.i("gifBean", mGiftBean.toString()); + }); + } else if (code == 1001) { + hideLianBtn(); + new DialogUitl.Builder(mContext) + .setView(com.yunbao.live.R.layout.dialog_live_unfollow) + .setConfirmString(getString(com.yunbao.live.R.string.charge)) + .setContent(getString(com.yunbao.live.R.string.insufficient_balance)) + .setClickCallback(new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + forwardMyCoin(0); + } + }).build().show(); + } else { + hideLianBtn(); + ToastUtil.show(msg); + } + } + } + +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index 3d3eb8bbb..73849cca0 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -109,7 +109,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On private TextView mUnion; private TextView mHonorVal; private TextView mNobleTitleVal; - private TextView mLvVal; + private TextView mLvVal, textGiftWall, valueGiftWall; private ImageView mFollowImage; private ImageView mSex; private ImageView good_nub_ico; @@ -121,13 +121,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On private ImageView shawl; private ImageView honorIcon; private ImageView mTitleBg; - private ImageView mSetting; + private ImageView mSetting, iconGiftWall; private UserBean mUserBean; private LinearLayout mGuardLayout; private LinearLayout mUnionLayout; private LinearLayout mNobleIconLayout; private LinearLayout mUserLevelLayout; - private LinearLayout mHonorLayout; + private LinearLayout mHonorLayout, giftWall; private boolean mFollowing; GifImageView btn_live; SVGAImageView gift_svga; @@ -239,6 +239,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On mNobleIconLayout = mRootView.findViewById(R.id.noble_icon_layout); mNobleTitleVal = mRootView.findViewById(R.id.noble_title_val); mHonorLayout = mRootView.findViewById(R.id.honor_layout); + giftWall = mRootView.findViewById(R.id.gift_wall); + textGiftWall = mRootView.findViewById(R.id.text_gift_wall); + valueGiftWall = mRootView.findViewById(R.id.value_gift_wall); + iconGiftWall = mRootView.findViewById(R.id.icon_gift_wall); mTitleBg = mRootView.findViewById(R.id.title_bg); mSetting = mRootView.findViewById(R.id.btn_setting); mLvVal = mRootView.findViewById(R.id.user_card_lv_val); @@ -264,6 +268,14 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On } } });*/ + ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL).setUid(mToUid)); + dismiss(); + } + }); } @@ -344,19 +356,6 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On case SETTING_ACTION_ANC_ADM: mSetting.setVisibility(View.VISIBLE); } - if (isAnchor) { - mGuardLayout.setVisibility(View.VISIBLE); - if (obj.containsKey("user_president_name") && !StringUtil.isEmpty(obj.getString("user_president_name"))) { - mUnion.setText(obj.getString("user_president_name")); - mUnionLayout.setVisibility(View.VISIBLE); - } - mNoble.setVisibility(View.GONE); - mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_lv); - mNobleTitleVal.setText(R.string.live_noble_fens_anchor); - mNobleIconLayout.setBackgroundResource(R.drawable.bg_user_card_fans); - } else { - mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_au_lv); - } mName.setText(obj.getString("user_nicename")); if (mUserBean.getGoodnum() != null && !mUserBean.getGoodnum().equals("")) { if (!isAnchor) { @@ -370,7 +369,34 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On good_nub_ico.setVisibility(View.GONE); mID.setText(mUserBean.getId()); } + giftWall.setBackgroundResource(R.drawable.bg_gift_wall_lv); + ImgLoader.display(mContext, R.drawable.icon_gift_wall, iconGiftWall); + textGiftWall.setText(mContext.getString(R.string.gift_wall)); + valueGiftWall.setText(String.format(mContext.getString(R.string.has_been_lit), obj.getString("gift_wall_lighten_number"))); mSex.setImageResource(CommonIconUtil.getSexIconForUserCard(obj.getIntValue("sex"))); + if (isAnchor) { + mGuardLayout.setVisibility(View.VISIBLE); + if (obj.containsKey("user_president_name") && !StringUtil.isEmpty(obj.getString("user_president_name"))) { + mUnion.setText(obj.getString("user_president_name")); + mUnionLayout.setVisibility(View.VISIBLE); + } + mNoble.setVisibility(View.GONE); + mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_lv); + + mHonorLayout.setBackgroundResource(R.drawable.bg_user_card_honor); + mNobleTitleVal.setText(R.string.live_noble_fens_anchor); + mNobleIconLayout.setBackgroundResource(R.drawable.bg_user_card_fans); + } else { + mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_au_lv); +// giftWall.setBackgroundResource(R.drawable.bg_gift_wall_lv); +// mNobleIconLayout.setBackgroundResource(R.drawable.bg_user_card_fans); +// mHonorLayout.setBackgroundResource(R.drawable.bg_user_card_honor); +// +// ImgLoader.display(mContext, R.drawable.icon_gift_wall, mNobleIcon); +// ImgLoader.display(mContext, R.drawable.icon_gift_wall, mNobleIcon); +// textGiftWall.setText(mContext.getString(R.string.gift_wall)); +// valueGiftWall.setText(String.format(mContext.getString(R.string.has_been_lit), obj.getString("gift_wall_lighten_number"))); + } LevelBean levelBean; if (isAnchor) { levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor()); diff --git a/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java new file mode 100644 index 000000000..e03216756 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java @@ -0,0 +1,123 @@ +package com.yunbao.live.dialog; + +import android.content.Context; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.core.BottomPopupView; +import com.yunbao.common.CommonAppConfig; +import com.yunbao.common.adapter.MedalAchievementAdapter; +import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.bean.MedalAchievementModel; +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.ToastUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; +import com.yunbao.live.activity.ZhuangBanActivity; + +public class MedalAchievementPopup extends BottomPopupView { + private boolean isLive; + private String toUid; + private TextView achievementText; + private RecyclerView achievementList; + private MedalAchievementAdapter medalAchievementAdapter; + + public MedalAchievementPopup(@NonNull Context context, boolean isLive, String toUid) { + super(context); + this.isLive = isLive; + this.toUid = toUid; + } + + // 返回自定义弹窗的布局 + @Override + protected int getImplLayoutId() { + return R.layout.dialog_medal_achievement; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + initView(); + initDate(); + } + + private void initDate() { + if (isLive) { + LiveNetManager.get(getContext()) + .getLiveMedalList(new HttpCallback() { + @Override + public void onSuccess(MedalAchievementModel data) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(data.getMedalLightNumber()) + .append("/") + .append(data.getMedalTotalNumber()); + achievementText.setText(stringBuffer.toString()); + medalAchievementAdapter.addAllData(data.getMedalData()); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } else { + LiveNetManager.get(getContext()) + .getUserMedalList(toUid, new HttpCallback() { + @Override + public void onSuccess(MedalAchievementModel data) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(data.getMedalLightNumber()) + .append("/") + .append(data.getMedalTotalNumber()); + achievementText.setText(stringBuffer.toString()); + medalAchievementAdapter.addAllData(data.getMedalData()); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + } + + private void initView() { + achievementText = findViewById(R.id.achievement_text); + achievementList = findViewById(R.id.achievement_list); + if (isLive) { + achievementList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false)); + } else { + achievementList.setLayoutManager(new GridLayoutManager(getContext(), 4, GridLayoutManager.VERTICAL, false)); + } + medalAchievementAdapter = new MedalAchievementAdapter(); + achievementList.setAdapter(medalAchievementAdapter); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.wall_honor), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + 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()); + ZhuangBanActivity.forward(getContext(), htmlUrl.toString(), false); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/RegularIntroducePopup.java b/live/src/main/java/com/yunbao/live/dialog/RegularIntroducePopup.java new file mode 100644 index 000000000..68d143009 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/RegularIntroducePopup.java @@ -0,0 +1,50 @@ +package com.yunbao.live.dialog; + + +import android.content.Context; +import android.graphics.Color; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.impl.FullScreenPopupView; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; +import com.yunbao.live.utils.LinearGradientFontSpan; + +/** + * 礼物冠名规则 + */ +public class RegularIntroducePopup extends FullScreenPopupView { + private TextView regularTitle; + + public RegularIntroducePopup(@NonNull Context context) { + super(context); + } + + @Override + protected int getImplLayoutId() { + return R.layout.rogular_introduce_popup; + } + + @Override + protected void onCreate() { + super.onCreate(); + regularTitle = findViewById(R.id.regular_title); + String title = getContext().getString(R.string.rule_introduction); + SpannableStringBuilder builder = new SpannableStringBuilder(); + builder.append(title); + builder.setSpan(new LinearGradientFontSpan(Color.parseColor("#ffffff"), + Color.parseColor("#F7FDFF")), 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + regularTitle.setText(builder); + //初始化 + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/event/GiftTitleEvent.java b/live/src/main/java/com/yunbao/live/event/GiftTitleEvent.java new file mode 100644 index 000000000..2330d2e8e --- /dev/null +++ b/live/src/main/java/com/yunbao/live/event/GiftTitleEvent.java @@ -0,0 +1,26 @@ +package com.yunbao.live.event; + +import com.yunbao.common.bean.BaseModel; + +public class GiftTitleEvent extends BaseModel { + private String giftTitle; + private int mPosition; + + public int getmPosition() { + return mPosition; + } + + public GiftTitleEvent setmPosition(int mPosition) { + this.mPosition = mPosition; + return this; + } + + public String getGiftTitle() { + return giftTitle; + } + + public GiftTitleEvent setGiftTitle(String giftTitle) { + this.giftTitle = giftTitle; + return this; + } +} diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 712463b10..ad7dd3660 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -14,6 +14,7 @@ import com.yunbao.common.bean.WishModel; import com.yunbao.common.bean.XydCompleteModel; import com.yunbao.common.event.AllServerNotifyEvent; import com.yunbao.common.event.CustomFullServiceNotifyEvent; +import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.OpenParametersModel; @@ -49,6 +50,75 @@ public class LiveAudienceEvent extends BaseModel { private RedPacketModel redPacketModel; private RedPacketInfoModel redPacketInfoModel; private OlineUserlistModel olineUserlistModel; + private LiveGuardInfo liveGuardInfo; + private String mWishGiftId; + private boolean isContactGift; + private boolean isPk; + public String mStream; + public String mLiveUid,giftId; + + public String getGiftId() { + return giftId; + } + + public LiveAudienceEvent setGiftId(String giftId) { + this.giftId = giftId; + return this; + } + + public String getmStream() { + return mStream; + } + + public LiveAudienceEvent setmStream(String mStream) { + this.mStream = mStream; + return this; + } + + public String getmLiveUid() { + return mLiveUid; + } + + public LiveAudienceEvent setmLiveUid(String mLiveUid) { + this.mLiveUid = mLiveUid; + return this; + } + + public boolean isPk() { + return isPk; + } + + public LiveAudienceEvent setPk(boolean pk) { + isPk = pk; + return this; + } + + public boolean getIsContactGift() { + return isContactGift; + } + + public LiveAudienceEvent setIsContactGift(boolean isContactGift) { + this.isContactGift = isContactGift; + return this; + } + + public String getmWishGiftId() { + return mWishGiftId; + } + + public LiveAudienceEvent setmWishGiftId(String mWishGiftId) { + this.mWishGiftId = mWishGiftId; + return this; + } + + public LiveGuardInfo getLiveGuardInfo() { + return liveGuardInfo; + } + + public LiveAudienceEvent setLiveGuardInfo(LiveGuardInfo liveGuardInfo) { + this.liveGuardInfo = liveGuardInfo; + return this; + } public OlineUserlistModel getOlineUserlistModel() { return olineUserlistModel; @@ -392,7 +462,9 @@ public class LiveAudienceEvent extends BaseModel { BLIND_BOX(68, "盲盒全服通知"), RED_PACKET(69, "RedPacket"), RED_PACKET_SUPER_JACKPOT(70, "超级红包"), - INPUT_DIALOG(71, "输入框"); + INPUT_DIALOG(71, "输入框"), + IS_ATTENTION(72,"是否关注主播"), + GIFT_WALL(73,"礼物墙"); private int type; private String name; diff --git a/live/src/main/java/com/yunbao/live/event/LiveGiftItemEvent.java b/live/src/main/java/com/yunbao/live/event/LiveGiftItemEvent.java new file mode 100644 index 000000000..92aeb97b6 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/event/LiveGiftItemEvent.java @@ -0,0 +1,20 @@ +package com.yunbao.live.event; + +import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.LiveGiftBean; + +/** + * 选中的礼物 + */ +public class LiveGiftItemEvent extends BaseModel { + private LiveGiftBean liveGiftModel; + + public LiveGiftBean getLiveGiftModel() { + return liveGiftModel; + } + + public LiveGiftItemEvent setLiveGiftModel(LiveGiftBean liveGiftModel) { + this.liveGiftModel = liveGiftModel; + return this; + } +} diff --git a/live/src/main/java/com/yunbao/live/event/LiveParcelItemRefreshEvent.java b/live/src/main/java/com/yunbao/live/event/LiveParcelItemRefreshEvent.java new file mode 100644 index 000000000..db6797e23 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/event/LiveParcelItemRefreshEvent.java @@ -0,0 +1,17 @@ +package com.yunbao.live.event; + +import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.LiveGiftBean; + +public class LiveParcelItemRefreshEvent extends BaseModel { + private LiveGiftBean liveGiftModel; + + public LiveGiftBean getLiveGiftModel() { + return liveGiftModel; + } + + public LiveParcelItemRefreshEvent setLiveGiftModel(LiveGiftBean liveGiftModel) { + this.liveGiftModel = liveGiftModel; + return this; + } +} diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 214e22522..9f1937601 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -6,7 +6,6 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.drawable.Drawable; -import android.os.Bundle; import android.os.CountDownTimer; import android.os.Handler; import android.os.Message; @@ -46,6 +45,7 @@ import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.HtmlTagHandler; @@ -53,12 +53,11 @@ import com.yunbao.common.utils.L; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.R; -import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.bean.LiveGiftPrizePoolWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.custom.FrameImageView; -import com.yunbao.live.dialog.LiveGiftDialogFragment; +import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.utils.AllMsgTextRender; @@ -339,14 +338,12 @@ public class LiveGiftAnimPresenter { new Handler().postDelayed(new Runnable() { @Override public void run() { - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, blindBox.getEvent().getBlindBoxId() + ""); - bundle.putBoolean("isContactGift", true); - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream) + .setmWishGiftId(blindBox.getEvent().getBlindBoxId() + "") + .setIsContactGift(true)); } }, 1000); } else { diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 427a8439a..ae0f9eb93 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -36,6 +36,7 @@ import com.yunbao.common.bean.WishModel; import com.yunbao.common.bean.XydCompleteModel; import com.yunbao.common.event.AllServerNotifyEvent; import com.yunbao.common.event.CustomFullServiceNotifyEvent; +import com.yunbao.common.event.GiftWallIlluminateEvent; import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; @@ -704,6 +705,13 @@ public class SocketRyClient { .setType(LiveAudienceEvent.LiveAudienceType.RED_PACKET_SUPER_JACKPOT) .setRedPacketInfoModel(redPacketInfoModel)); break; + case "GiftWallIlluminate": + Log.e("GiftWallIlluminate", map.toString()); + Bus.get().post(new GiftWallIlluminateEvent() + .setNewNumber(map.getInteger("new_number")) + .setMaxNumber(map.getInteger("max_number"))); + break; + } } @@ -1031,6 +1039,10 @@ public class SocketRyClient { receiveGiftBean.setAncherName(map.getString("ancherName")); receiveGiftBean.setHot_num(map.getString("hot_num")); receiveGiftBean.setDrpk_status(map.getString("drpk_status")); + receiveGiftBean.setNamingCoin(map.getString("naming_live_name")); + receiveGiftBean.setNamingLiveName(map.getString("naming_live_name")); + receiveGiftBean.setNamingUid(map.getString("naming_uid")); + receiveGiftBean.setNamingLiveuid(map.getString("naming_liveuid")); receiveGiftBean.setmLiveUId(mLiveUid); receiveGiftBean.setmTypeBuyGuard(false); receiveGiftBean.setAllServerNotify(false); diff --git a/live/src/main/java/com/yunbao/live/views/CodexItemViewHolder.java b/live/src/main/java/com/yunbao/live/views/CodexItemViewHolder.java new file mode 100644 index 000000000..07c4227d4 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/CodexItemViewHolder.java @@ -0,0 +1,55 @@ +package com.yunbao.live.views; + +import android.graphics.Color; +import android.text.TextUtils; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.event.LiveGiftDialogEvent; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.event.LiveAudienceEvent; + +public class CodexItemViewHolder extends RecyclerView.ViewHolder { + private ImageView giftImg; + private TextView giftName, giftWall; + + public CodexItemViewHolder(@NonNull View itemView) { + super(itemView); + giftImg = itemView.findViewById(R.id.gift_img); + giftName = itemView.findViewById(R.id.gift_name); + giftWall = itemView.findViewById(R.id.gift_wall); + } + + public void showData(GiftWallModel giftWallModel) { + ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg); + giftName.setText(giftWallModel.getGiftname()); + giftName.setTextColor(Color.parseColor(giftWallModel.getFontColor())); + giftWall.setSelected(TextUtils.equals(String.valueOf(giftWallModel.getIlluminateStatus()), "1")); + if (TextUtils.equals(String.valueOf(giftWallModel.getIlluminateStatus()), "1")) { + giftWall.setText(itemView.getContext().getString(R.string.received_wall2)); + giftWall.setTextColor(Color.parseColor("#FFFFFF")); + ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new LiveGiftDialogEvent()); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmWishGiftId(giftWallModel.getId()) + .setmLiveUid("") + .setmStream("")); + } + }); + } else { + giftWall.setText(itemView.getContext().getString(R.string.received_wall)); + giftWall.setTextColor(Color.parseColor("#49669F")); + } + } +} diff --git a/live/src/main/java/com/yunbao/live/views/CodexViewHolder.java b/live/src/main/java/com/yunbao/live/views/CodexViewHolder.java new file mode 100644 index 000000000..cc5f42643 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/CodexViewHolder.java @@ -0,0 +1,68 @@ +package com.yunbao.live.views; + +import android.graphics.Color; +import android.text.TextUtils; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.XPopup; +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftGuideModel; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.adapter.CodexItemAdapter; +import com.yunbao.live.dialog.CodexDialog; + +public class CodexViewHolder extends RecyclerView.ViewHolder { + private ImageView codexLayout, titleIcon; + private TextView titleName, weekNumber, weekNumber2; + private RecyclerView giftList; + private CodexItemAdapter codexItemAdapter; + + public CodexViewHolder(@NonNull View itemView) { + super(itemView); + codexLayout = itemView.findViewById(R.id.codex_layout); + titleIcon = itemView.findViewById(R.id.title_icon); + titleName = itemView.findViewById(R.id.title_name); + weekNumber = itemView.findViewById(R.id.week_number); + weekNumber2 = itemView.findViewById(R.id.week_number2); + giftList = itemView.findViewById(R.id.gift_list); + codexItemAdapter = new CodexItemAdapter(); + giftList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false)); + giftList.setAdapter(codexItemAdapter); + } + + public void showData(GiftGuideModel giftGuideModel, boolean history, String mStream, String mLiveUid) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(giftGuideModel.getIlluminateCount()) + .append("/") + .append(giftGuideModel.getIlluminateTotal()); + ImgLoader.display(itemView.getContext(), giftGuideModel.getGuideBackgroundPicturePath(), codexLayout); + ImgLoader.display(itemView.getContext(), giftGuideModel.getGuideNameImgPath(), titleIcon); + titleName.setText(stringBuffer.toString()); + titleName.setTextColor(Color.parseColor(giftGuideModel.getNumber())); + weekNumber.setText(giftGuideModel.getWeekNumber()); + weekNumber.setVisibility(TextUtils.isEmpty(giftGuideModel.getWeekNumber()) ? View.GONE : View.VISIBLE); + if (history) { + weekNumber2.setVisibility(View.GONE); + } else { + weekNumber2.setVisibility(TextUtils.isEmpty(giftGuideModel.getWeekNumber()) ? View.GONE : View.VISIBLE); + } + + codexItemAdapter.addAllData(giftGuideModel.getGiftData()); + ViewClicksAntiShake.clicksAntiShake(weekNumber2, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + new XPopup.Builder(itemView.getContext()) + .enableDrag(false) + .asCustom(new CodexDialog(itemView.getContext(), mStream, mLiveUid,true)) + .show(); + } + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java new file mode 100644 index 000000000..86ce8a3ed --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java @@ -0,0 +1,164 @@ +package com.yunbao.live.views; + +import android.content.Context; +import android.graphics.Color; +import android.text.TextUtils; +import android.util.TypedValue; +import android.view.View; +import android.view.animation.AccelerateDecelerateInterpolator; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.view.animation.LinearInterpolator; +import android.view.animation.ScaleAnimation; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.XPopup; +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.event.LiveGiftDialogEvent; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.interfaces.CommonCallback; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.GiftCacheUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; +import com.yunbao.live.dialog.SendRendPacketPopup; + +import java.io.File; + +public class FrameGiftViewHolder extends RecyclerView.ViewHolder { + private ImageView giftIcon, mPayIco, cornerMark; + private Context mContext; + private TextView giftName, mPrice; + private RelativeLayout giftLayout; + private ScaleAnimation mAnimation; + private LinearLayout mLoadingLayout; + private ImageView mLoading; + + public FrameGiftViewHolder(@NonNull View itemView) { + super(itemView); + mContext = itemView.getContext(); + giftIcon = itemView.findViewById(R.id.gift_icon); + giftName = itemView.findViewById(R.id.gift_name); + mPayIco = itemView.findViewById(R.id.pay_ico); + mPrice = itemView.findViewById(R.id.price); + cornerMark = itemView.findViewById(R.id.corner_mark); + giftLayout = itemView.findViewById(R.id.gift_layout); + mLoadingLayout = itemView.findViewById(R.id.gift_loading_layout); + mLoading = itemView.findViewById(R.id.gift_loading); + + mAnimation = new ScaleAnimation(0.9f, 1.1f, 0.9f, 1.1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); + mAnimation.setInterpolator(new AccelerateDecelerateInterpolator()); + mAnimation.setDuration(400); + mAnimation.setRepeatMode(Animation.REVERSE); + mAnimation.setRepeatCount(-1); + } + + public void showData(int contextLayoutGiftHeight, LiveGiftBean model) { + //设置高度 + itemView.post(new Runnable() { + @Override + public void run() { + GridLayoutManager.LayoutParams linearParams = (GridLayoutManager.LayoutParams) itemView.getLayoutParams(); + linearParams.height = contextLayoutGiftHeight / 2; + itemView.setLayoutParams(linearParams); + } + }); + giftLayout.setSelected(model.isChecked()); + if (model.isChecked()) { + giftIcon.startAnimation(mAnimation); + } + ImgLoader.display(mContext, model.getIcon(), giftIcon); + ImgLoader.display(mContext, model.getCornerMark(), cornerMark); + if (!TextUtils.equals(model.getNamingLiveuid(), "0") && !TextUtils.equals(model.getNamingUid(), "0")) { + giftName.setText(model.getNamingUserName()); + } else { + giftName.setText(model.getName()); + } + + //特殊礼物红包 + if (model.getType() == 9999999) { + mPayIco.setVisibility(View.GONE); + mPrice.setText(mContext.getString(R.string.build_up_popularity)); + mPrice.setTextColor(Color.parseColor("#db8c4a")); + mPrice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 8); + + } else { + mPrice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 11); + mPrice.setTextColor(Color.parseColor("#c8c8c8")); + mPayIco.setVisibility(View.VISIBLE); + //普通礼物 + if (model.getSendType() != null && model.getSendType().equals("1")) { + mPayIco.setImageResource(R.mipmap.gold_coin); + } else { + mPayIco.setImageResource(R.mipmap.diamond); + } + mPrice.setText(model.getPrice()); + } + if (model.getSwf() != null && model.getSwf().isEmpty()) { + mLoadingLayout.setVisibility(View.GONE); + } else { + mLoadingLayout.setVisibility(GiftCacheUtil.checkGiftIsDownload(model.getId()) ? View.GONE : View.VISIBLE); + } + + + } + + public void giftSelect(LiveGiftBean model, int position, String mStream, String mLiveUid, FrameGiftClickListener frameGiftClickListener) { + ViewClicksAntiShake.clicksAntiShake(mLoadingLayout, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + mLoading.setImageResource(R.mipmap.icon_loading_gift); + Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_loading_gift); + animation.setRepeatMode(Animation.RESTART); + animation.setRepeatCount(Animation.INFINITE); + animation.setInterpolator(new LinearInterpolator()); + mLoading.startAnimation(animation); + GiftCacheUtil.getInstance().pause(); + GiftCacheUtil.getInstance().downloadGiftForId(mContext, model, new CommonCallback() { + @Override + public void callback(File bean) { + if (bean == null) { + ToastUtil.show(mContext.getString(R.string.load_failure_2)); + mLoading.setImageResource(R.mipmap.icon_download_gift); + animation.setRepeatCount(0); + animation.setDuration(0); + animation.cancel(); + mLoading.setAnimation(animation); + } else { + mLoadingLayout.setVisibility(View.GONE); + } + GiftCacheUtil.getInstance().restart(); + } + }); + } + }); + ViewClicksAntiShake.clicksAntiShake(giftLayout, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + if (model.getType() == 9999999) { + Bus.get().post(new LiveGiftDialogEvent()); + new XPopup.Builder(mContext) + .asCustom(new SendRendPacketPopup(mContext, mLiveUid)) + .show(); + } else { + if (frameGiftClickListener != null) { + frameGiftClickListener.onCallBack(position, model); + } + } + + } + }); + } + + public interface FrameGiftClickListener { + void onCallBack(int position, LiveGiftBean model); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java b/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java new file mode 100644 index 000000000..ed577b967 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java @@ -0,0 +1,104 @@ +package com.yunbao.live.views; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.adapter.GiftAlreadyWallAdapter; +import com.yunbao.common.bean.GiftAlreadyWallModel; +import com.yunbao.common.fragment.BaseFragment; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.event.LiveAudienceEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; + +/** + * 已点亮礼物墙 + */ +public class GiftAlreadyWallFragment extends BaseFragment { + private String mStream, mLiveUid,toUid; + private LinearLayout giftWallNoData, giftWallData; + private RecyclerView alreadyList; + private GiftAlreadyWallAdapter alreadyWallAdapter; + private TextView litIcon, giftAll; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_gift_already_wall, viewGroup, false); + } + + + @Override + protected void initVariables(Bundle bundle) { + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + toUid = bundle.getString("toUid"); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + giftWallNoData = contentView.findViewById(R.id.gift_wall_no_data); + giftWallData = contentView.findViewById(R.id.gift_wall_data); + alreadyList = contentView.findViewById(R.id.already_list); + litIcon = contentView.findViewById(R.id.lit_icon); + giftAll = contentView.findViewById(R.id.gift_all); + alreadyWallAdapter = new GiftAlreadyWallAdapter(); + alreadyList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false)); + alreadyList.setAdapter(alreadyWallAdapter); + ViewClicksAntiShake.clicksAntiShake(contentView.findViewById(R.id.instant_light), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream)); + Bus.get().post(new LiveGiftDialogEvent()); + } + }); + } + + @Override + protected void loadData() { + LiveNetManager.get(getActivity()). + giftAlreadyWall(mLiveUid,toUid, new HttpCallback() { + @Override + public void onSuccess(GiftAlreadyWallModel data) { + if (data.getGiftWall().size() > 0) { + giftWallNoData.setVisibility(View.GONE); + giftWallData.setVisibility(View.VISIBLE); + alreadyWallAdapter.addAllData(data.getGiftWall()); + litIcon.setText(data.getGiftWallLightenNumber()); + giftAll.setText("/" + data.getGiftWallLightenTotal()); + } else { + giftWallNoData.setVisibility(View.VISIBLE); + giftWallData.setVisibility(View.GONE); + } + } + + @Override + public void onError(String error) { + + } + }); + } + + public static GiftAlreadyWallFragment newInstance(String mStream, String mLiveUid,String toUid) { + GiftAlreadyWallFragment liveGiftFragment = new GiftAlreadyWallFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + bundle.putString("mLiveUid", mLiveUid); + bundle.putString("toUid", toUid); + liveGiftFragment.setArguments(bundle); + return liveGiftFragment; + } +} diff --git a/live/src/main/java/com/yunbao/live/views/GiftTitleViewHolder.java b/live/src/main/java/com/yunbao/live/views/GiftTitleViewHolder.java new file mode 100644 index 000000000..d0732f450 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/GiftTitleViewHolder.java @@ -0,0 +1,50 @@ +package com.yunbao.live.views; + +import android.graphics.Typeface; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.custom.DrawableTextView; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; +import com.yunbao.live.bean.GiftTopBean; +import com.yunbao.live.event.GiftTitleEvent; + +public class GiftTitleViewHolder extends RecyclerView.ViewHolder { + private DrawableTextView name; + + public GiftTitleViewHolder(@NonNull View itemView) { + super(itemView); + name = itemView.findViewById(R.id.name); + } + + public void showData(GiftTopBean giftTopBean, int mPosition, ClicksCallBack callBack) { + name.setText(giftTopBean.getName()); + ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + if (callBack != null) { + callBack.onViewClicks(mPosition); + Bus.get().post(new GiftTitleEvent().setmPosition(mPosition).setGiftTitle(giftTopBean.getName())); + } + } + }); + } + + public void selectData(boolean isSelect) { + if (isSelect) { + name.setAlpha(1.0f); + name.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); + } else { + name.setAlpha(0.5f); + name.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL); + } + } + + public interface ClicksCallBack { + void onViewClicks(int mPosition); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 8d8267731..f613222ae 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -10,7 +10,6 @@ import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.os.Vibrator; -import android.text.TextUtils; import android.util.DisplayMetrics; import android.util.Log; import android.view.LayoutInflater; @@ -20,16 +19,12 @@ import android.view.ViewGroup; import android.view.WindowManager; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.ViewFlipper; import androidx.fragment.app.FragmentActivity; -import com.opensource.svgaplayer.SVGADrawable; -import com.opensource.svgaplayer.SVGAImageView; -import com.opensource.svgaplayer.SVGAParser; -import com.opensource.svgaplayer.SVGAVideoEntity; +import com.lxj.xpopup.XPopup; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.NewPeopleInfo; @@ -39,11 +34,10 @@ import com.yunbao.common.http.API; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; import com.yunbao.common.utils.Bus; -import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ProcessResultUtil; -import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.live.dialog.LiveGiftPopup; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; @@ -200,6 +194,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { ViewClicksAntiShake.clicksAntiShake(giftImage, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)); } @@ -382,6 +377,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { } else if (i == R.id.btn_gift) { openGiftWindow(); + //全屏 } else if (i == R.id.btn_more) { ((LiveActivity) mContext).openMoreWindow(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java b/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java new file mode 100644 index 000000000..6c6103bee --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java @@ -0,0 +1,149 @@ +package com.yunbao.live.views; + +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.ViewTreeObserver; +import android.widget.RadioButton; +import android.widget.RadioGroup; + +import androidx.fragment.app.Fragment; +import androidx.viewpager.widget.ViewPager; + +import com.alibaba.fastjson.JSON; +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.fragment.BaseFragment; +import com.yunbao.live.R; +import com.yunbao.live.adapter.LiveGiftFragmentPagerAdapter; + +import java.util.ArrayList; +import java.util.List; + +/** + * 礼物列表 + */ +public class LiveGiftFragment extends BaseFragment { + private ViewPager fragmentViewpager; + private int pageCount; + private static final int GIFT_COUNT = 8;//每页8个礼物 + private RadioGroup mRadioGroup; + private LiveGiftFragmentPagerAdapter giftFragmentPagerAdapter; + private ArrayList ViewList = new ArrayList<>(); //页卡视图集合 + private List giftJson = new ArrayList<>(); + private int contextLayoutGiftHeight = 0; + private String mStream, mLiveUid, wishGiftId, type; + private int currentPage = 0; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_live_gift, viewGroup, false); + } + + @Override + protected void initVariables(Bundle bundle) { + giftJson = JSON.parseArray(bundle.getString("giftJson"), LiveGiftBean.class); + contextLayoutGiftHeight = bundle.getInt("contextLayoutGiftHeight"); + mStream = bundle.getString("mStream"); + wishGiftId = bundle.getString("wishGiftId"); + mLiveUid = bundle.getString("mLiveUid"); + type = bundle.getString("type"); + pageCount = giftJson.size() / GIFT_COUNT; + if (giftJson.size() % GIFT_COUNT > 0) { + pageCount++; + } + + + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + + fragmentViewpager = contentView.findViewById(R.id.context_layout); + mRadioGroup = contentView.findViewById(R.id.radio_group); + + + fragmentViewpager.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + @Override + public void onGlobalLayout() { + contextLayoutGiftHeight = fragmentViewpager.getHeight(); + Log.e("giftJson", "height=" + contextLayoutGiftHeight); + int fromIndex = 0; + int size = giftJson.size(); + for (int i = 0; i < pageCount; i++) { + int endIndex = fromIndex + GIFT_COUNT; + if (endIndex > size) { + endIndex = size; + } + List liveGiftBeans = new ArrayList<>(); + for (int j = fromIndex; j < endIndex; j++) { + LiveGiftBean bean = giftJson.get(j); + bean.setPage(i); + liveGiftBeans.add(bean); + if (!TextUtils.isEmpty(wishGiftId) && TextUtils.equals(bean.getId() + "", wishGiftId)) { + currentPage = i; + Log.e("LiveGiftItemFragment", type); + } + } + fromIndex = endIndex; + ViewList.add(LiveGiftItemFragment.newInstance(JSON.toJSONString(liveGiftBeans), contextLayoutGiftHeight, mStream, mLiveUid, wishGiftId)); + } + giftFragmentPagerAdapter = new LiveGiftFragmentPagerAdapter(getChildFragmentManager(), getActivity(), ViewList); + fragmentViewpager.setAdapter(giftFragmentPagerAdapter); + + LayoutInflater inflater = LayoutInflater.from(getContext()); + for (int i = 0, size2 = ViewList.size(); i < size2; i++) { + RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.view_gift_indicator, mRadioGroup, false); + radioButton.setId(i + 10000); + if (i == 0) { + radioButton.setChecked(true); + } + mRadioGroup.addView(radioButton); + + } + fragmentViewpager.setCurrentItem(currentPage); + //移除监听 + fragmentViewpager.getViewTreeObserver().removeOnGlobalLayoutListener(this); + } + }); + + fragmentViewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + + } + + @Override + public void onPageSelected(int position) { + if (mRadioGroup != null && mRadioGroup.getChildAt(position) != null) { + ((RadioButton) mRadioGroup.getChildAt(position)).setChecked(true); + } + } + + @Override + public void onPageScrollStateChanged(int state) { + + } + }); + } + + @Override + protected void loadData() { + + } + + public static LiveGiftFragment newInstance(String giftJson, String type, + String mStream, String mLiveUid, String wishGiftId) { + LiveGiftFragment liveGiftFragment = new LiveGiftFragment(); + Bundle bundle = new Bundle(); + bundle.putString("giftJson", giftJson); + bundle.putString("type", type); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + bundle.putString("wishGiftId", wishGiftId); + liveGiftFragment.setArguments(bundle); + return liveGiftFragment; + } +} diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftItemFragment.java b/live/src/main/java/com/yunbao/live/views/LiveGiftItemFragment.java new file mode 100644 index 000000000..f2de5474c --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftItemFragment.java @@ -0,0 +1,82 @@ +package com.yunbao.live.views; + +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.alibaba.fastjson.JSON; +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.fragment.BaseFragment; +import com.yunbao.common.utils.Bus; +import com.yunbao.live.R; +import com.yunbao.live.adapter.FrameGiftAdapter; +import com.yunbao.live.event.LiveGiftItemEvent; + +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.ArrayList; +import java.util.List; + +public class LiveGiftItemFragment extends BaseFragment { + private List giftJson = new ArrayList<>(); + private RecyclerView frameGiftList; + private int contextLayoutGiftHeight = 0; + private FrameGiftAdapter frameGiftAdapter; + private String mStream, mLiveUid, wishGiftId; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_live_gift_item, viewGroup, false); + } + + @Override + protected void initVariables(Bundle bundle) { + giftJson = JSON.parseArray(bundle.getString("giftJson"), LiveGiftBean.class); + contextLayoutGiftHeight = bundle.getInt("contextLayoutGiftHeight"); + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + wishGiftId = bundle.getString("wishGiftId"); + Log.e("giftJson", giftJson.toString()); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + + + frameGiftList = contentView.findViewById(R.id.frame_gift_list); + frameGiftList.setHasFixedSize(true); + frameGiftList.setLayoutManager(new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false)); + frameGiftAdapter = new FrameGiftAdapter(contextLayoutGiftHeight, giftJson, mStream, mLiveUid, wishGiftId); + frameGiftList.setAdapter(frameGiftAdapter); + } + + @Override + protected void loadData() { + + } + + public static LiveGiftItemFragment newInstance(String giftJson, int contextLayoutGiftHeight, + String mStream, String mLiveUid, String wishGiftId) { + LiveGiftItemFragment liveGiftFragment = new LiveGiftItemFragment(); + Bundle bundle = new Bundle(); + bundle.putString("giftJson", giftJson); + bundle.putInt("contextLayoutGiftHeight", contextLayoutGiftHeight); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + bundle.putString("wishGiftId", wishGiftId); + liveGiftFragment.setArguments(bundle); + return liveGiftFragment; + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftItemEvent(LiveGiftItemEvent event) { + frameGiftAdapter.giftSelect(event.getLiveGiftModel()); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java index 65da01f37..a36e27ca8 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java @@ -30,7 +30,7 @@ import com.yunbao.live.utils.LiveTextRender; public class LiveGiftViewHolder extends AbsViewHolder { - private View mRoot; + private View mRoot, root_back; private View mBg; private View mStar; private ImageView mAvatar; @@ -62,6 +62,7 @@ public class LiveGiftViewHolder extends AbsViewHolder { @Override public void init() { mRoot = findViewById(R.id.root); + root_back = findViewById(R.id.root_back); mBg = findViewById(R.id.bg); mStar = findViewById(R.id.star); mAvatar = (ImageView) findViewById(R.id.avatar); @@ -127,7 +128,7 @@ public class LiveGiftViewHolder extends AbsViewHolder { * 显示礼物动画 */ public void show(LiveReceiveGiftBean bean, boolean isSameUser) { - if (bean.getMark()==3) {//这是幸运礼物 + if (bean.getMark() == 3) {//这是幸运礼物 if (!mIdle) { hideNormal(); } @@ -177,6 +178,13 @@ public class LiveGiftViewHolder extends AbsViewHolder { mGiftCount.setText(new LiveTextRender().renderGiftCount(mLianCount)); } mLastGiftKey = bean.getKey(); + if (!TextUtils.equals(bean.getNamingLiveuid(), "0") && !TextUtils.equals(bean.getNamingUid(), "0")) { + root_back.setBackgroundResource(R.drawable.background_naming); + findViewById(R.id.naming_icon).setVisibility(View.VISIBLE); + } else { + root_back.setBackgroundResource(R.mipmap.icon_live_gift_anim_3); + findViewById(R.id.naming_icon).setVisibility(View.GONE); + } if (lian && mGiftCount != null && mAnimation != null) { mGiftCount.startAnimation(mAnimation); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java b/live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java new file mode 100644 index 000000000..3fbbbf257 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java @@ -0,0 +1,162 @@ +package com.yunbao.live.views; + +import android.os.Bundle; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.ViewTreeObserver; +import android.widget.LinearLayout; +import android.widget.RadioButton; +import android.widget.RadioGroup; + +import androidx.fragment.app.Fragment; +import androidx.viewpager.widget.ViewPager; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.fragment.BaseFragment; +import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.utils.GiftCacheUtil; +import com.yunbao.live.R; +import com.yunbao.live.adapter.LiveGiftFragmentPagerAdapter; +import com.yunbao.live.http.LiveHttpUtil; + +import java.util.ArrayList; +import java.util.List; + +public class LiveParcelFragment extends BaseFragment { + private ViewPager fragmentViewpager; + private int pageCount; + private static final int GIFT_COUNT = 8;//每页8个礼物 + private RadioGroup mRadioGroup; + private LiveGiftFragmentPagerAdapter giftFragmentPagerAdapter; + private ArrayList ViewList = new ArrayList<>(); //页卡视图集合 + private List giftJson = new ArrayList<>(); + private int contextLayoutGiftHeight = 0; + private String mStream, mLiveUid; + private LinearLayout parcelDataList, parcelDataNo; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_live_parcel, viewGroup, false); + } + + @Override + protected void initVariables(Bundle bundle) { + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + fragmentViewpager = contentView.findViewById(R.id.context_layout); + mRadioGroup = contentView.findViewById(R.id.radio_group); + parcelDataList = contentView.findViewById(R.id.parcel_data_list); + parcelDataNo = contentView.findViewById(R.id.parcel_data_no); + + fragmentViewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + + } + + @Override + public void onPageSelected(int position) { + if (mRadioGroup != null && mRadioGroup.getChildAt(position) != null) { + ((RadioButton) mRadioGroup.getChildAt(position)).setChecked(true); + } + } + + @Override + public void onPageScrollStateChanged(int state) { + + } + }); + } + + @Override + protected void loadData() { + LiveHttpUtil.getWrapList(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + JSONObject obj = JSON.parseObject(info[0]); + String giftJson = obj.getString("giftlist"); + List list = JSON.parseArray(giftJson, LiveGiftBean.class); + GiftCacheUtil.getInstance().addDownloadList(list); + if (!GiftCacheUtil.getInstance().isDownloading()) { + GiftCacheUtil.getInstance().downloadAllGift(); + } + if (list.size() == 0) { + parcelDataNo.setVisibility(View.VISIBLE); + parcelDataList.setVisibility(View.GONE); + } else { + parcelDataList.setVisibility(View.VISIBLE); + parcelDataNo.setVisibility(View.GONE); + pageCount = list.size() / GIFT_COUNT; + if (list.size() % GIFT_COUNT > 0) { + pageCount++; + } + + fragmentViewpager.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + @Override + public void onGlobalLayout() { + contextLayoutGiftHeight = fragmentViewpager.getHeight(); + Log.e("giftJson", "height=" + contextLayoutGiftHeight); + int fromIndex = 0; + int size = list.size(); + for (int i = 0; i < pageCount; i++) { + int endIndex = fromIndex + GIFT_COUNT; + if (endIndex > size) { + endIndex = size; + } + List liveGiftBeans = new ArrayList<>(); + for (int j = fromIndex; j < endIndex; j++) { + LiveGiftBean bean = list.get(j); + bean.setPage(i); + liveGiftBeans.add(bean); + } + fromIndex = endIndex; + ViewList.add(LiveParcelItemFragment.newInstance(JSON.toJSONString(liveGiftBeans), contextLayoutGiftHeight, mStream, mLiveUid)); + } + giftFragmentPagerAdapter = new LiveGiftFragmentPagerAdapter(getChildFragmentManager(), getActivity(), ViewList); + fragmentViewpager.setAdapter(giftFragmentPagerAdapter); + + LayoutInflater inflater = LayoutInflater.from(getContext()); + for (int i = 0, size2 = ViewList.size(); i < size2; i++) { + RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.view_gift_indicator, mRadioGroup, false); + radioButton.setId(i + 10000); + if (i == 0) { + radioButton.setChecked(true); + } + mRadioGroup.addView(radioButton); + + } + //移除监听 + fragmentViewpager.getViewTreeObserver().removeOnGlobalLayoutListener(this); + } + }); + } + } + } + + @Override + public void onFinish() { +// if (mLoading != null) { +// mLoading.setVisibility(View.INVISIBLE); +// } + } + }); + } + + public static LiveParcelFragment newInstance(String mStream, String mLiveUid) { + LiveParcelFragment liveParcelFragment = new LiveParcelFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + liveParcelFragment.setArguments(bundle); + return liveParcelFragment; + } +} diff --git a/live/src/main/java/com/yunbao/live/views/LiveParcelItemFragment.java b/live/src/main/java/com/yunbao/live/views/LiveParcelItemFragment.java new file mode 100644 index 000000000..7127f6753 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/LiveParcelItemFragment.java @@ -0,0 +1,82 @@ +package com.yunbao.live.views; + +import android.os.Bundle; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.alibaba.fastjson.JSON; +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.fragment.BaseFragment; +import com.yunbao.live.R; +import com.yunbao.live.adapter.LiveParcelItemAdapter; +import com.yunbao.live.event.LiveGiftItemEvent; +import com.yunbao.live.event.LiveParcelItemRefreshEvent; + +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.ArrayList; +import java.util.List; + +public class LiveParcelItemFragment extends BaseFragment { + private List giftJson = new ArrayList<>(); + private RecyclerView frameGiftList; + private int contextLayoutGiftHeight = 0; + private LiveParcelItemAdapter frameGiftAdapter; + private String mStream, mLiveUid; + + @Override + public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { + return layoutInflater.inflate(R.layout.fragment_live_gift_item, viewGroup, false); + } + + @Override + protected void initVariables(Bundle bundle) { + giftJson = JSON.parseArray(bundle.getString("giftJson"), LiveGiftBean.class); + contextLayoutGiftHeight = bundle.getInt("contextLayoutGiftHeight"); + mStream = bundle.getString("mStream"); + mLiveUid = bundle.getString("mLiveUid"); + Log.e("giftJson", giftJson.toString()); + } + + @Override + protected void initViews(Bundle savedInstanceState, View contentView) { + + frameGiftList = contentView.findViewById(R.id.frame_gift_list); + frameGiftList.setHasFixedSize(true); + frameGiftList.setLayoutManager(new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false)); + frameGiftAdapter = new LiveParcelItemAdapter(contextLayoutGiftHeight, giftJson, mStream, mLiveUid); + frameGiftList.setAdapter(frameGiftAdapter); + } + + @Override + protected void loadData() { + + } + + public static LiveParcelItemFragment newInstance(String giftJson, int contextLayoutGiftHeight, String mStream, String mLiveUid) { + LiveParcelItemFragment liveGiftFragment = new LiveParcelItemFragment(); + Bundle bundle = new Bundle(); + bundle.putString("giftJson", giftJson); + bundle.putInt("contextLayoutGiftHeight", contextLayoutGiftHeight); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + liveGiftFragment.setArguments(bundle); + return liveGiftFragment; + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftItemEvent(LiveGiftItemEvent event) { + frameGiftAdapter.giftSelect(event.getLiveGiftModel()); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveParcelItemRefreshEvent(LiveParcelItemRefreshEvent event) { + frameGiftAdapter.refreshWrapListAfterSend(event.getLiveGiftModel()); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/LiveParcelItemViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveParcelItemViewHolder.java new file mode 100644 index 000000000..3353538e2 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/LiveParcelItemViewHolder.java @@ -0,0 +1,138 @@ +package com.yunbao.live.views; + +import android.content.Context; +import android.view.View; +import android.view.animation.AccelerateDecelerateInterpolator; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.view.animation.LinearInterpolator; +import android.view.animation.ScaleAnimation; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.XPopup; +import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.interfaces.CommonCallback; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.GiftCacheUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; +import com.yunbao.live.dialog.SendRendPacketPopup; +import com.yunbao.common.event.LiveGiftDialogEvent; + +import java.io.File; + +public class LiveParcelItemViewHolder extends RecyclerView.ViewHolder { + private ImageView giftIcon, cornerMark; + private Context mContext; + private TextView giftName, mPrice, giftNumber; + private RelativeLayout giftLayout; + private ScaleAnimation mAnimation; + private LinearLayout mLoadingLayout; + private ImageView mLoading; + + public LiveParcelItemViewHolder(@NonNull View itemView) { + super(itemView); + mContext = itemView.getContext(); + giftIcon = itemView.findViewById(R.id.gift_icon); + giftName = itemView.findViewById(R.id.gift_name); + mPrice = itemView.findViewById(R.id.price); + giftLayout = itemView.findViewById(R.id.gift_layout); + giftNumber = itemView.findViewById(R.id.gift_number); + cornerMark = itemView.findViewById(R.id.corner_mark); + mLoadingLayout = itemView.findViewById(R.id.gift_loading_layout); + mLoading = itemView.findViewById(R.id.gift_loading); + + mAnimation = new ScaleAnimation(0.9f, 1.1f, 0.9f, 1.1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); + mAnimation.setInterpolator(new AccelerateDecelerateInterpolator()); + mAnimation.setDuration(400); + mAnimation.setRepeatMode(Animation.REVERSE); + mAnimation.setRepeatCount(-1); + } + + public void showData(int contextLayoutGiftHeight, LiveGiftBean model) { + //设置高度 + itemView.post(new Runnable() { + @Override + public void run() { + GridLayoutManager.LayoutParams linearParams = (GridLayoutManager.LayoutParams) itemView.getLayoutParams(); + linearParams.height = contextLayoutGiftHeight / 2; + itemView.setLayoutParams(linearParams); + } + }); + giftLayout.setSelected(model.isChecked()); + if (model.isChecked()) { + giftIcon.startAnimation(mAnimation); + } + ImgLoader.display(mContext, model.getIcon(), giftIcon); + ImgLoader.display(mContext, model.getCornerMark(), cornerMark); + giftName.setText(model.getName()); + mPrice.setText(model.getEnd_time()); + giftNumber.setText(model.getGiftNum()); + + if (model.getSwf() != null && model.getSwf().isEmpty()) { + mLoadingLayout.setVisibility(View.GONE); + } else { + mLoadingLayout.setVisibility(GiftCacheUtil.checkGiftIsDownload(model.getId()) ? View.GONE : View.VISIBLE); + } + } + + public void giftSelect(LiveGiftBean model, int position, String mStream, String mLiveUid, FrameGiftClickListener frameGiftClickListener) { + ViewClicksAntiShake.clicksAntiShake(mLoadingLayout, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + mLoading.setImageResource(R.mipmap.icon_loading_gift); + Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_loading_gift); + animation.setRepeatMode(Animation.RESTART); + animation.setRepeatCount(Animation.INFINITE); + animation.setInterpolator(new LinearInterpolator()); + mLoading.startAnimation(animation); + GiftCacheUtil.getInstance().pause(); + GiftCacheUtil.getInstance().downloadGiftForId(mContext, model, new CommonCallback() { + @Override + public void callback(File bean) { + if (bean == null) { + ToastUtil.show(mContext.getString(R.string.load_failure_2)); + mLoading.setImageResource(R.mipmap.icon_download_gift); + animation.setRepeatCount(0); + animation.setDuration(0); + animation.cancel(); + mLoading.setAnimation(animation); + } else { + mLoadingLayout.setVisibility(View.GONE); + } + GiftCacheUtil.getInstance().restart(); + } + }); + } + }); + ViewClicksAntiShake.clicksAntiShake(giftLayout, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + if (model.getType() == 9999999) { + Bus.get().post(new LiveGiftDialogEvent()); + new XPopup.Builder(mContext) + .asCustom(new SendRendPacketPopup(mContext, mLiveUid)) + .show(); + } else { + if (frameGiftClickListener != null) { + frameGiftClickListener.onCallBack(position, model); + } + } + + } + }); + } + + public interface FrameGiftClickListener { + void onCallBack(int position, LiveGiftBean model); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index d191a0f3b..2ab379b72 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -147,12 +147,11 @@ import com.yunbao.live.bean.WishlistItemModel; import com.yunbao.live.custom.LiveLightView; import com.yunbao.live.custom.RightGradual; import com.yunbao.live.custom.TopGradual; +import com.yunbao.live.dialog.GiftWallDialog; import com.yunbao.live.dialog.LiveFaceUnityDialogFragment; import com.yunbao.live.dialog.LiveFansMedalDialogFragment; import com.yunbao.live.dialog.LiveGameDialogFragment; -import com.yunbao.live.dialog.LiveGiftDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment; -import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.ReceiveRendPacketPopup; @@ -351,7 +350,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //接口整合新加参数 private GuardUserModel guardUserModel; - private static ViewFlipper flipper; + private static ViewFlipper flipper, wksAndGiftWall; private TextView mRandomPkTimer; //全服通知 @@ -949,6 +948,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mic_view1 = (RelativeLayout) findViewById(R.id.mic_view1); mic_view2 = (RelativeLayout) findViewById(R.id.mic_view2); flipper = (ViewFlipper) findViewById(R.id.hour_rank_list); + wksAndGiftWall = (ViewFlipper) findViewById(R.id.live_wks_and_gift_wall); mic_ico = (ImageView) findViewById(R.id.mic_ico); newMessage = (ImageView) findViewById(R.id.new_message); atMessage = (ImageView) findViewById(R.id.at_message); @@ -1372,7 +1372,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis reloadIM(); // initStarChallengeStatus(); - new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1); + new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1); } @@ -2429,13 +2429,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } }); - //点击打开周星榜 - ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_wks_layout), - () -> { - - Bus.get().post(new LiveAudienceEvent() - .setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS)); - }); +// //点击打开周星榜 +// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_wks_layout), +// () -> { +// +// Bus.get().post(new LiveAudienceEvent() +// .setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS)); +// }); } public static int pkEndIndex = 0; @@ -2658,6 +2658,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } + public void showGiftWall(String toUid) { + GiftWallDialog giftWallDialog = new GiftWallDialog(); + Bundle bundle = new Bundle(); + bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_STREAM, mStream); + bundle.putString("mAnchorName", mAnchorName); + bundle.putString("mAvatarUrl", mAvatarUrl); + bundle.putString("toUid", toUid); + bundle.putInt("isAttention", isAttention); + bundle.putBoolean("isLive", mContext instanceof LiveRyAnchorActivity); + giftWallDialog.setArguments(bundle); + giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog"); + + } + public boolean pkHandler = true; //左上角显示对方主播头像及昵称 @@ -2812,6 +2827,56 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } + /** + * 设置礼物墙和周星榜 + */ + public void setGiftWall(String giftWallLightenNumber, String giftWallLightenTotal) { + if (wksAndGiftWall.getChildCount() > 0) { + wksAndGiftWall.removeAllViews(); + } + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(16), DpUtil.dp2px(16)); + LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + textParams.leftMargin = DpUtil.dp2px(5); + textParams.rightMargin = DpUtil.dp2px(5); + params.leftMargin = DpUtil.dp2px(5); + View weekView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); + ImageView weekViewPic = weekView.findViewById(R.id.wish_pic); + TextView week = weekView.findViewById(R.id.wish_index); + week.setLayoutParams(textParams); + week.setGravity(Gravity.CENTER); + week.setText(mContext.getString(R.string.live_wks)); + weekViewPic.setImageResource(R.mipmap.live_icon_zhouxing); + weekViewPic.setLayoutParams(params); + if (!TextUtils.isEmpty(giftWallLightenNumber) && !TextUtils.isEmpty(giftWallLightenTotal)) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(mContext.getString(R.string.gift_wall)) + .append(giftWallLightenNumber) + .append("/") + .append(giftWallLightenTotal); + View giftWall = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); + ImageView giftWallPic = giftWall.findViewById(R.id.wish_pic); + TextView giftText = giftWall.findViewById(R.id.wish_index); + giftText.setText(stringBuffer.toString()); + giftText.setGravity(Gravity.CENTER); + giftText.setLayoutParams(textParams); + giftWallPic.setImageResource(R.mipmap.icon_gift_wall); + giftWallPic.setLayoutParams(params); + wksAndGiftWall.addView(giftWall); + ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL).setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()))); + } + }); + } + + ViewClicksAntiShake.clicksAntiShake(weekView, () -> Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS))); + wksAndGiftWall.addView(weekView); + wksAndGiftWall.startFlipping(); + new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1); + } /** * 守护信息发生变化 @@ -5069,23 +5134,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onSuccess(LiveAnchorCallMeModel data) { - if (data.getIsGet() == 1) { - new LiveUserAnchorMailBoxWebInfoPopDialog(mContext, mAnchorName, data.getLink()) - .setOnDismissListener(dialog -> loading.dismiss()) - .showDialog(); - return; - } - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setOnDismissListener(dialog -> checkNewLetter() - ); - fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, data.getGiftId() + ""); - bundle.putBoolean("isContactGift", true); - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + loading.dismiss(); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream) + .setmWishGiftId(data.getGiftId() + "") + .setIsContactGift(true)); } @Override @@ -5147,23 +5202,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onSuccess(LiveAnchorCallMeModel data) { - if (data.getIsGet() == 1) { - new LiveUserAnchorMailBoxWebInfoPopDialog(mContext, mAnchorName, data.getLink()) - .setOnDismissListener(dialog -> loading.dismiss()) - .showDialog(); - return; - } - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setOnDismissListener(dialog -> checkNewLetter() - ); - fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, data.getGiftId() + ""); - bundle.putBoolean("isContactGift", true); - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + loading.dismiss(); + + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) + .setmLiveUid(mLiveUid) + .setmStream(mStream) + .setmWishGiftId(data.getGiftId() + "") + .setIsContactGift(true)); + } @Override diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 1be8185f3..3bf3421ec 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -49,6 +49,7 @@ import com.yunbao.common.custom.MyViewPager; import com.yunbao.common.event.AllServerNotifyEvent; import com.yunbao.common.event.FollowEvent; import com.yunbao.common.event.LiveFloatEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; @@ -83,7 +84,6 @@ import com.yunbao.live.dialog.BlowkissDialog; import com.yunbao.live.dialog.NewUserDialog; import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.live.event.LiveGiftDialogEvent; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; @@ -663,6 +663,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setFansNum(fansNum); //红包相关 mLiveRoomViewHolder.setRedPackBtnVisible(Integer.parseInt(data.getEnterRoomInfo().getIsred()) == 1); + //礼物墙相关 + mLiveRoomViewHolder.setGiftWall(data.getEnterRoomInfo().getGiftWallLightenNumber(), data.getEnterRoomInfo().getGiftWallLightenTotal()); } //奖池等级 @@ -1903,6 +1905,18 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } + public void setAttention(int attention) { + if (mLiveRoomViewHolder != null) + mLiveRoomViewHolder.setAttention(attention); + } + + public void showGiftWall(String toUid) { + + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.showGiftWall(toUid); + } + } + /** * 全服喇叭 * @@ -2065,4 +2079,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setRedPacketInfoModel(redPacket); } } + + public void setGiftWall(String giftWallLightenNumber, String giftWallLightenTotal) { + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.setGiftWall(giftWallLightenNumber, giftWallLightenTotal); + } + } } diff --git a/live/src/main/res/drawable/background_gift_select.xml b/live/src/main/res/drawable/background_gift_select.xml new file mode 100644 index 000000000..8e8881c7c --- /dev/null +++ b/live/src/main/res/drawable/background_gift_select.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/background_gift_wall_shape.xml b/live/src/main/res/drawable/background_gift_wall_shape.xml new file mode 100644 index 000000000..652afc29f --- /dev/null +++ b/live/src/main/res/drawable/background_gift_wall_shape.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/background_medal_achievement.xml b/live/src/main/res/drawable/background_medal_achievement.xml new file mode 100644 index 000000000..75f3d9478 --- /dev/null +++ b/live/src/main/res/drawable/background_medal_achievement.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/background_naming.xml b/live/src/main/res/drawable/background_naming.xml new file mode 100644 index 000000000..f2b43bce8 --- /dev/null +++ b/live/src/main/res/drawable/background_naming.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/background_naming_icon.xml b/live/src/main/res/drawable/background_naming_icon.xml new file mode 100644 index 000000000..fb9f5a989 --- /dev/null +++ b/live/src/main/res/drawable/background_naming_icon.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/background_regular.xml b/live/src/main/res/drawable/background_regular.xml new file mode 100644 index 000000000..2f431e6a0 --- /dev/null +++ b/live/src/main/res/drawable/background_regular.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/live/src/main/res/drawable/background_regular_center.xml b/live/src/main/res/drawable/background_regular_center.xml new file mode 100644 index 000000000..9f86dd090 --- /dev/null +++ b/live/src/main/res/drawable/background_regular_center.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/live/src/main/res/drawable/bg_gift_wall_lv.xml b/live/src/main/res/drawable/bg_gift_wall_lv.xml new file mode 100644 index 000000000..afa19e0e1 --- /dev/null +++ b/live/src/main/res/drawable/bg_gift_wall_lv.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_user_card_fans.xml b/live/src/main/res/drawable/bg_user_card_fans.xml index 60ab9e052..0eb0c90c8 100644 --- a/live/src/main/res/drawable/bg_user_card_fans.xml +++ b/live/src/main/res/drawable/bg_user_card_fans.xml @@ -2,7 +2,7 @@ - + diff --git a/live/src/main/res/drawable/bg_user_card_honor.xml b/live/src/main/res/drawable/bg_user_card_honor.xml index 7ad95101b..7940d56ec 100644 --- a/live/src/main/res/drawable/bg_user_card_honor.xml +++ b/live/src/main/res/drawable/bg_user_card_honor.xml @@ -2,7 +2,7 @@ - + diff --git a/live/src/main/res/drawable/bg_user_card_lv.xml b/live/src/main/res/drawable/bg_user_card_lv.xml index 3190220a6..2ee7d3463 100644 --- a/live/src/main/res/drawable/bg_user_card_lv.xml +++ b/live/src/main/res/drawable/bg_user_card_lv.xml @@ -2,7 +2,7 @@ - + diff --git a/live/src/main/res/drawable/icon_gift_wall.png b/live/src/main/res/drawable/icon_gift_wall.png new file mode 100644 index 000000000..d098b121e Binary files /dev/null and b/live/src/main/res/drawable/icon_gift_wall.png differ diff --git a/live/src/main/res/layout/activity_live_gift_wall.xml b/live/src/main/res/layout/activity_live_gift_wall.xml new file mode 100644 index 000000000..e1dce4ddf --- /dev/null +++ b/live/src/main/res/layout/activity_live_gift_wall.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_live_gift_wall.xml b/live/src/main/res/layout/dialog_live_gift_wall.xml new file mode 100644 index 000000000..5ae28e0f1 --- /dev/null +++ b/live/src/main/res/layout/dialog_live_gift_wall.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_medal_achievement.xml b/live/src/main/res/layout/dialog_medal_achievement.xml new file mode 100644 index 000000000..642499974 --- /dev/null +++ b/live/src/main/res/layout/dialog_medal_achievement.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_new_live_user.xml b/live/src/main/res/layout/dialog_new_live_user.xml index b10ddfbd1..505984def 100644 --- a/live/src/main/res/layout/dialog_new_live_user.xml +++ b/live/src/main/res/layout/dialog_new_live_user.xml @@ -401,29 +401,32 @@ + android:gravity="center_vertical"> + android:textSize="11sp" /> + android:textSize="9sp" /> + + + + + + + + + + + + + + android:gravity="center_vertical"> + android:textSize="11sp" /> + android:textSize="9sp" /> + android:gravity="center_vertical"> + android:textSize="11sp" /> + android:textSize="9sp" /> diff --git a/live/src/main/res/layout/fragment_live_gift.xml b/live/src/main/res/layout/fragment_live_gift.xml new file mode 100644 index 000000000..4cbba9e43 --- /dev/null +++ b/live/src/main/res/layout/fragment_live_gift.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/fragment_live_gift_item.xml b/live/src/main/res/layout/fragment_live_gift_item.xml new file mode 100644 index 000000000..d2fae8429 --- /dev/null +++ b/live/src/main/res/layout/fragment_live_gift_item.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/fragment_live_parcel.xml b/live/src/main/res/layout/fragment_live_parcel.xml new file mode 100644 index 000000000..915d8ecfa --- /dev/null +++ b/live/src/main/res/layout/fragment_live_parcel.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/item_frame_gift.xml b/live/src/main/res/layout/item_frame_gift.xml new file mode 100644 index 000000000..b43e18e44 --- /dev/null +++ b/live/src/main/res/layout/item_frame_gift.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/item_gift_top_new.xml b/live/src/main/res/layout/item_gift_top_new.xml new file mode 100644 index 000000000..68309d5a7 --- /dev/null +++ b/live/src/main/res/layout/item_gift_top_new.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/item_live_parcel.xml b/live/src/main/res/layout/item_live_parcel.xml new file mode 100644 index 000000000..c0ff90185 --- /dev/null +++ b/live/src/main/res/layout/item_live_parcel.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/rogular_introduce_popup.xml b/live/src/main/res/layout/rogular_introduce_popup.xml new file mode 100644 index 000000000..b8214a611 --- /dev/null +++ b/live/src/main/res/layout/rogular_introduce_popup.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_gift.xml b/live/src/main/res/layout/view_live_gift.xml index 333498664..8cb71f034 100644 --- a/live/src/main/res/layout/view_live_gift.xml +++ b/live/src/main/res/layout/view_live_gift.xml @@ -8,6 +8,7 @@ android:visibility="invisible"> + diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 7ecea37ba..cf6398703 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -351,7 +351,7 @@ - - - + android:layout_height="20dp" + android:layout_marginStart="0dp" + android:flipInterval="5000" + android:inAnimation="@anim/anim_marquee_in" + android:outAnimation="@anim/anim_marquee_out" /> + + + + + + + + + diff --git a/live/src/main/res/mipmap-xxxhdpi/background_gift_wall_title.png b/live/src/main/res/mipmap-xxxhdpi/background_gift_wall_title.png new file mode 100644 index 000000000..a0743d42b Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/background_gift_wall_title.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/background_giftwall_tab.png b/live/src/main/res/mipmap-xxxhdpi/background_giftwall_tab.png new file mode 100644 index 000000000..4c63afac6 Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/background_giftwall_tab.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/background_regular_title.png b/live/src/main/res/mipmap-xxxhdpi/background_regular_title.png new file mode 100644 index 000000000..1c2e03194 Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/background_regular_title.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/icon_following_anchor.png b/live/src/main/res/mipmap-xxxhdpi/icon_following_anchor.png new file mode 100644 index 000000000..0139f446d Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/icon_following_anchor.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/icon_regular_bubble.png b/live/src/main/res/mipmap-xxxhdpi/icon_regular_bubble.png new file mode 100644 index 000000000..051260ac7 Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/icon_regular_bubble.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/live_icon_leftt_sliding.png b/live/src/main/res/mipmap-xxxhdpi/live_icon_leftt_sliding.png index 1789eab28..ca957ec23 100644 Binary files a/live/src/main/res/mipmap-xxxhdpi/live_icon_leftt_sliding.png and b/live/src/main/res/mipmap-xxxhdpi/live_icon_leftt_sliding.png differ diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index ede574312..cce8ea893 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -162,9 +162,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private MainHomeViewHolder mainHomeViewHolder; private MainHomeCommunityViewHolder mMainHomeCommunityViewHolder; private MainMessageViewHolder mainMessageViewHolder; - private MainHomeVideoViewHolder mainHomeVideoViewHolder; - private MainHomeShopViewHolder mListShopViewHolder; - private ChatListViewHolder mChatListViewHolder; private MainMeViewHolder mMeViewHolder; private AbsMainViewHolder[] mViewHolders; private View mBottom;