6.5.4礼物冠名
This commit is contained in:
@@ -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<GiftWallModel> 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<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -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<GiftWallModel> 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<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<GiftWallModel> giftWall;
|
||||
@SerializedName("gift_wall_lighten_number")
|
||||
private String giftWallLightenNumber;
|
||||
@SerializedName("gift_wall_lighten_total")
|
||||
private String giftWallLightenTotal;
|
||||
|
||||
public List<GiftWallModel> getGiftWall() {
|
||||
return giftWall;
|
||||
}
|
||||
|
||||
public GiftAlreadyWallModel setGiftWall(List<GiftWallModel> 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;
|
||||
}
|
||||
}
|
||||
336
common/src/main/java/com/yunbao/common/bean/GiftWallModel.java
Normal file
336
common/src/main/java/com/yunbao/common/bean/GiftWallModel.java
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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<GiftAlreadyWallModel>() {
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -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<GiftAlreadyWallModel>() {
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -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<ResponseModel<GiftAlreadyWallModel>> giftAlreadyWall(
|
||||
@Query("liveuid") String liveUid
|
||||
);
|
||||
|
||||
/**
|
||||
* 礼物墙未点亮
|
||||
*/
|
||||
@GET("/api/public/?service=Gift.giftWithoutWall")
|
||||
Observable<ResponseModel<GiftAlreadyWallModel>> giftWithoutWall(
|
||||
@Query("liveuid") String liveUid
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -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<GiftAlreadyWallModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.giftAlreadyWall(liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<GiftAlreadyWallModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<GiftAlreadyWallModel> giftAlreadyWallModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(giftAlreadyWallModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<GiftAlreadyWallModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.giftWithoutWall(liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<GiftAlreadyWallModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<GiftAlreadyWallModel> giftAlreadyWallModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(giftAlreadyWallModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user