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/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/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/GiftWallModel.java b/common/src/main/java/com/yunbao/common/bean/GiftWallModel.java new file mode 100644 index 000000000..83cbb6359 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/GiftWallModel.java @@ -0,0 +1,336 @@ +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; + + 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/dialog/GiftWallItemPopup.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallItemPopup.java new file mode 100644 index 000000000..c3a09ee04 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallItemPopup.java @@ -0,0 +1,25 @@ +package com.yunbao.common.dialog; + + +import android.content.Context; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; + +public class GiftWallItemPopup extends CenterPopupView { + public GiftWallItemPopup(@NonNull Context context) { + super(context); + } + + @Override + protected int getImplLayoutId() { + return R.layout.popup_gift_wall_item; + } + + @Override + protected void onCreate() { + super.onCreate(); + } +} diff --git a/common/src/main/java/com/yunbao/common/fragment/GiftAlreadyWallFragment.java b/common/src/main/java/com/yunbao/common/fragment/GiftAlreadyWallFragment.java new file mode 100644 index 000000000..ae1d4f378 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/fragment/GiftAlreadyWallFragment.java @@ -0,0 +1,85 @@ +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 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.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; + +/** + * 已点亮礼物墙 + */ +public class GiftAlreadyWallFragment extends BaseFragment { + private String mStream, mLiveUid; + 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"); + } + + @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); + } + + @Override + protected void loadData() { + LiveNetManager.get(getActivity()). + giftAlreadyWall(mLiveUid, 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) { + GiftAlreadyWallFragment liveGiftFragment = new GiftAlreadyWallFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + liveGiftFragment.setArguments(bundle); + return liveGiftFragment; + } +} 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..25bb35261 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.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 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; + 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"); + } + + @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, 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) { + GiftWithoutWallFragment liveGiftFragment = new GiftWithoutWallFragment(); + Bundle bundle = new Bundle(); + bundle.putString("mStream", mStream); + bundle.putString("mLiveUid", mLiveUid); + liveGiftFragment.setArguments(bundle); + return liveGiftFragment; + } +} 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 ab99cf322..248c73191 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,7 @@ 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.HourRank; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.IMLoginModel; @@ -830,4 +831,20 @@ public interface PDLiveApi { @Query("red_packet_id") String redPacketId ); + /** + * 礼物墙已点亮 + */ + @GET("/api/public/?service=Gift.giftAlreadyWall") + Observable> giftAlreadyWall( + @Query("liveuid") String liveUid + ); + + /** + * 礼物墙未点亮 + */ + @GET("/api/public/?service=Gift.giftWithoutWall") + Observable> giftWithoutWall( + @Query("liveuid") String liveUid + ); + } 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..39959de77 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,7 @@ 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.HttpCallbackModel; import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LinkMicUserBeanV2; @@ -1796,6 +1797,49 @@ public class LiveNetManager { }).isDisposed(); } + public void giftAlreadyWall(String liveUid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .giftAlreadyWall(liveUid) + .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, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .giftWithoutWall(liveUid) + .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(); + } + /** * 直播间取消网络请求 */ 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..b7244cd9b --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java @@ -0,0 +1,28 @@ +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 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); + } +} 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..4685e441d --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java @@ -0,0 +1,39 @@ +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.lxj.xpopup.XPopup; +import com.yunbao.common.R; +import com.yunbao.common.bean.GiftWallModel; +import com.yunbao.common.dialog.GiftWallItemPopup; +import com.yunbao.common.glide.ImgLoader; +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() { + new XPopup.Builder(itemView.getContext()) + .asCustom(new GiftWallItemPopup(itemView.getContext())) + .show(); + } + }); + } +} 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/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/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/fragment_gift_already_wall.xml b/common/src/main/res/layout/fragment_gift_already_wall.xml new file mode 100644 index 000000000..55ebffda9 --- /dev/null +++ b/common/src/main/res/layout/fragment_gift_already_wall.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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/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/popup_gift_wall_item.xml b/common/src/main/res/layout/popup_gift_wall_item.xml new file mode 100644 index 000000000..02b2826d6 --- /dev/null +++ b/common/src/main/res/layout/popup_gift_wall_item.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file 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_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/icon_arrow_right.png b/common/src/main/res/mipmap-xxhdpi/icon_arrow_right_2.png similarity index 100% rename from common/src/main/res/mipmap-xxhdpi/icon_arrow_right.png rename to common/src/main/res/mipmap-xxhdpi/icon_arrow_right_2.png 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/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 26fdf25f2..96bd3694f 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1251,8 +1251,37 @@ Limited ride And limited avatar frame Red successfully %s experience upgrade,%s receive rewards You have reached the highest level! - There\\\'s nothing in the package yet + 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,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 08a2d1069..9134aec0e 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1248,4 +1248,33 @@ 恭喜,你已達到最高等級 包裹中暫無物品哦 自定義數量 + 禮物墻 + 已點亮%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 b19b12c49..d0f6ba525 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1247,4 +1247,33 @@ 恭喜,你已達到最高等級 包裹中暫無物品哦 自定義數量 + 禮物墻 + 已點亮%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 535ce85c2..de2da757d 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1248,6 +1248,35 @@ 恭喜,你已達到最高等級 包裹中暫無物品哦 自定義數量 + 禮物墻 + 已點亮%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 cff72ab76..4faaf5e62 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1251,7 +1251,37 @@ Limited ride And limited avatar frame number >Red successfully %s experience upgrade,%s receive rewards - There\\\'s nothing in the package yet + 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,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 + 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/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index b786ce6f4..7b9a56dbc 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -90,7 +90,6 @@ 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; @@ -1433,6 +1432,17 @@ 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(); + } + break; } 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..37b88a0d5 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java @@ -0,0 +1,202 @@ +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.fragment.GiftAlreadyWallFragment; +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.GiftTitleEvent; +import com.yunbao.live.event.LiveAudienceEvent; + +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; + private int isAttention = 0;//是否关注 0=没关注, + + @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)); + 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)); + transaction.commit(); + + } + }); + ViewClicksAntiShake.clicksAntiShake(layoutAllServiceChampion, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + selectTab(textAllServiceChampion, viewAllServiceChampion); + } + }); + 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(); + } + }); + } + + 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"); + isAttention = bundle.getInt("isAttention"); + + FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); + transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid)); + 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 onGiftTitleEvent(GiftTitleEvent event) { + + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 4e09bb882..04302b225 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -57,6 +57,7 @@ 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; @@ -175,7 +176,7 @@ public class LiveGiftPopup extends AbsDialogFragment { //设置礼物弹窗背景 ImgLoader.displayBlurLive(getContext(), R.drawable.backgroud_custom_gift2, gitBackground); gitBackground.setAlpha(0.97f); - ImgLoader.display(getContext(), R.mipmap.icon_arrow_right, iconArrow); + ImgLoader.display(getContext(), R.mipmap.icon_arrow_right_2, iconArrow); //礼物分类tab LinearLayoutManager manager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false); giftTitle.setLayoutManager(manager); @@ -239,7 +240,9 @@ public class LiveGiftPopup extends AbsDialogFragment { .append("/h5/info/index.html?uid=") .append(userInfo.getId()) .append("&token=") - .append(userInfo.getToken()); + .append(userInfo.getToken()) + .append("&no_back=1") + ; Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); LiveHDDialogFragment fragment = new LiveHDDialogFragment(); @@ -269,6 +272,7 @@ public class LiveGiftPopup extends AbsDialogFragment { .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"); @@ -301,6 +305,7 @@ public class LiveGiftPopup extends AbsDialogFragment { .append("&for"); Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); fragment.setArguments(bundle); fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); 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..09233e892 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)); + 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/RegularIntroducePopup.java b/live/src/main/java/com/yunbao/live/dialog/RegularIntroducePopup.java new file mode 100644 index 000000000..b1f992dc3 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/RegularIntroducePopup.java @@ -0,0 +1,36 @@ +package com.yunbao.live.dialog; + + +import android.content.Context; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.impl.FullScreenPopupView; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; + +/** + * 礼物冠名规则 + */ +public class RegularIntroducePopup extends FullScreenPopupView { + public RegularIntroducePopup(@NonNull Context context) { + super(context); + } + + @Override + protected int getImplLayoutId() { + return R.layout.rogular_introduce_popup; + } + + @Override + protected void onCreate() { + super.onCreate(); + //初始化 + 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/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 7c62ecdf4..ad7dd3660 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -462,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/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 00f2fd4df..beb8f40d1 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -147,11 +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.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; @@ -350,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; //全服通知 @@ -948,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); @@ -1371,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); } @@ -2428,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; @@ -2657,6 +2658,18 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } + public void showGiftWall() { + 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.putInt("isAttention", isAttention); + giftWallDialog.setArguments(bundle); + giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog"); + } + public boolean pkHandler = true; //左上角显示对方主播头像及昵称 @@ -2811,6 +2824,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)); + } + }); + } + + 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); + } /** * 守护信息发生变化 @@ -5073,7 +5136,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP) .setmLiveUid(mLiveUid) .setmStream(mStream) - .setmWishGiftId(data.getGiftId() + "") + .setmWishGiftId(data.getGiftId() + "") .setIsContactGift(true)); } 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..a8d471f4a 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -8,6 +8,7 @@ import android.app.Dialog; import android.content.Intent; import android.content.res.Configuration; import android.graphics.drawable.AnimationDrawable; +import android.os.Bundle; import android.os.CountDownTimer; import android.os.Handler; import android.text.TextUtils; @@ -80,6 +81,7 @@ import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.OpenParametersModel; import com.yunbao.live.dialog.BlowkissDialog; +import com.yunbao.live.dialog.GiftWallDialog; import com.yunbao.live.dialog.NewUserDialog; import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LiveAudienceEvent; @@ -663,6 +665,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 +1907,18 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } + public void setAttention(int attention) { + if (mLiveRoomViewHolder != null) + mLiveRoomViewHolder.setAttention(attention); + } + + public void showGiftWall() { + + if (mLiveRoomViewHolder!=null){ + mLiveRoomViewHolder.showGiftWall(); + } + } + /** * 全服喇叭 * 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/dialog_live_gift_wall.xml b/live/src/main/res/layout/dialog_live_gift_wall.xml new file mode 100644 index 000000000..cc3eb7cd0 --- /dev/null +++ b/live/src/main/res/layout/dialog_live_gift_wall.xml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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/rogular_introduce_popup.xml b/live/src/main/res/layout/rogular_introduce_popup.xml new file mode 100644 index 000000000..8b354e0cc --- /dev/null +++ b/live/src/main/res/layout/rogular_introduce_popup.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 7e621c3d3..bdd47344d 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-hdpi/background_gift_wall_item.png b/live/src/main/res/mipmap-hdpi/background_gift_wall_item.png new file mode 100644 index 000000000..cc3c0faf7 Binary files /dev/null and b/live/src/main/res/mipmap-hdpi/background_gift_wall_item.png differ 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..536cf6788 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_black.png b/live/src/main/res/mipmap-xxxhdpi/icon_regular_black.png new file mode 100644 index 000000000..397c175cc Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/icon_regular_black.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/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;