6.5.4礼物冠名

This commit is contained in:
18401019693 2023-08-02 16:55:36 +08:00
parent 5afa3bd30b
commit b78fef6adc
29 changed files with 708 additions and 13 deletions

View File

@ -0,0 +1,119 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class GiftGuideModel extends BaseModel {
@SerializedName("guide_name")
private String guideName;
@SerializedName("illuminate_count")
private int illuminateCount;
@SerializedName("already_font")
private String alreadyFont;
@SerializedName("without_font")
private String withoutFont;
@SerializedName("number")
private String number;
@SerializedName("illuminate_total")
private int illuminateTotal;
@SerializedName("week_number")
private String weekNumber;
@SerializedName("guide_name_img_path")
private String guideNameImgPath;
@SerializedName("guide_background_picture_path")
private String guideBackgroundPicturePath;
@SerializedName("gift_data")
private List<GiftWallModel> giftData;
public String getAlreadyFont() {
return alreadyFont;
}
public GiftGuideModel setAlreadyFont(String alreadyFont) {
this.alreadyFont = alreadyFont;
return this;
}
public String getWithoutFont() {
return withoutFont;
}
public GiftGuideModel setWithoutFont(String withoutFont) {
this.withoutFont = withoutFont;
return this;
}
public String getNumber() {
return number;
}
public GiftGuideModel setNumber(String number) {
this.number = number;
return this;
}
public int getIlluminateTotal() {
return illuminateTotal;
}
public GiftGuideModel setIlluminateTotal(int illuminateTotal) {
this.illuminateTotal = illuminateTotal;
return this;
}
public String getWeekNumber() {
return weekNumber;
}
public GiftGuideModel setWeekNumber(String weekNumber) {
this.weekNumber = weekNumber;
return this;
}
public String getGuideNameImgPath() {
return guideNameImgPath;
}
public GiftGuideModel setGuideNameImgPath(String guideNameImgPath) {
this.guideNameImgPath = guideNameImgPath;
return this;
}
public String getGuideBackgroundPicturePath() {
return guideBackgroundPicturePath;
}
public GiftGuideModel setGuideBackgroundPicturePath(String guideBackgroundPicturePath) {
this.guideBackgroundPicturePath = guideBackgroundPicturePath;
return this;
}
public String getGuideName() {
return guideName;
}
public GiftGuideModel setGuideName(String guideName) {
this.guideName = guideName;
return this;
}
public int getIlluminateCount() {
return illuminateCount;
}
public GiftGuideModel setIlluminateCount(int illuminateCount) {
this.illuminateCount = illuminateCount;
return this;
}
public List<GiftWallModel> getGiftData() {
return giftData;
}
public GiftGuideModel setGiftData(List<GiftWallModel> giftData) {
this.giftData = giftData;
return this;
}
}

View File

@ -70,6 +70,29 @@ public class GiftWallModel extends BaseModel {
@SerializedName("naming_coin_max")
private String namingCoinMax;
@SerializedName("illuminate_status")
private int illuminateStatus;
@SerializedName("font_color")
private String fontColor;
public String getFontColor() {
return fontColor;
}
public GiftWallModel setFontColor(String fontColor) {
this.fontColor = fontColor;
return this;
}
public int getIlluminateStatus() {
return illuminateStatus;
}
public GiftWallModel setIlluminateStatus(int illuminateStatus) {
this.illuminateStatus = illuminateStatus;
return this;
}
public String getNamingCoinMax() {
return namingCoinMax;
}

View File

@ -0,0 +1,6 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
public class CodexEvent extends BaseModel {
}

View File

@ -1,4 +1,4 @@
package com.yunbao.live.event;
package com.yunbao.common.event;
public class LiveGiftDialogEvent {
}

View File

@ -13,6 +13,7 @@ import com.yunbao.common.bean.DiscountsModel;
import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.FaceBookUpModel;
import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftWallGiftDetail;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.bean.HourRank;
@ -873,5 +874,19 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Gift.lastMonthGiftNaming")
Observable<ResponseModel<List<GiftWallModel>>> lastMonthGiftNaming();
/**
* 礼物墙上月冠名
*
* @return
*/
@GET("/api/public/?service=Gift.getGiftGuide")
Observable<ResponseModel<List<GiftGuideModel>>> getGiftGuide(
@Query("liveuid") String liveUid
);
@GET("/api/public/?service=Gift.getGiftGuideHistory")
Observable<ResponseModel<List<GiftGuideModel>>> getGiftGuideHistory(
@Query("liveuid") String liveUid
);
}

View File

@ -14,6 +14,7 @@ import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.DiscountsModel;
import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftWallGiftDetail;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.bean.HttpCallbackModel;
@ -1909,6 +1910,50 @@ public class LiveNetManager {
}).isDisposed();
}
public void getGiftGuide(String liveUid, HttpCallback<List<GiftGuideModel>> callback) {
API.get().pdLiveApi(mContext)
.getGiftGuide(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<GiftGuideModel>>>() {
@Override
public void accept(ResponseModel<List<GiftGuideModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.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 getGiftGuideHistory(String liveUid, HttpCallback<List<GiftGuideModel>> callback) {
API.get().pdLiveApi(mContext)
.getGiftGuideHistory(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<GiftGuideModel>>>() {
@Override
public void accept(ResponseModel<List<GiftGuideModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.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();
}
/**
* 直播间取消网络请求
*/

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="false">
<shape>
<gradient android:angle="90" android:endColor="#BBD3FF" android:startColor="#E6EEFF" />
<corners android:radius="10dp" />
</shape>
</item>
<item android:state_selected="true">
<shape>
<gradient android:angle="90" android:endColor="#FF7917" android:startColor="#FCD16E" />
<corners android:radius="10dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<corners
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp" />
</shape>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<corners
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
</shape>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="524dp"
android:layout_gravity="bottom"
android:background="@drawable/background_dialog_live_codex"
android:orientation="vertical">
<ImageView
android:id="@+id/close_btn"
android:layout_width="8dp"
android:layout_height="14dp"
android:layout_margin="13dp"
android:src="@mipmap/icon_regular_black" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/live_codex"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:paddingBottom="15dp" />
</LinearLayout>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="115dp"
android:layout_marginTop="13dp"
android:orientation="vertical">
<ImageView
android:id="@+id/codex_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/title_icon"
android:layout_width="47dp"
android:layout_height="52dp"
android:layout_marginTop="26dp" />
<TextView
android:id="@+id/title_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="@string/regular_bubble"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/gift_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="4dp" />
</LinearLayout>
<TextView
android:id="@+id/week_number"
android:layout_width="71dp"
android:layout_height="22dp"
android:background="@drawable/background_codex_top"
android:gravity="center"
android:textColor="#B74D0F"
android:textSize="14sp" />
<TextView
android:id="@+id/week_number2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="2dp"
android:layout_marginEnd="10dp"
android:text="@string/last_month_winner_hint2"
android:textColor="#B74D0F"
android:textSize="11sp" />
</FrameLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/gift_img"
android:layout_width="43dp"
android:layout_height="43dp"
android:layout_marginTop="12dp" />
<TextView
android:id="@+id/gift_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/regular_bubble"
android:textSize="11sp" />
<TextView
android:id="@+id/gift_wall"
android:layout_width="50dp"
android:layout_height="20dp"
android:layout_marginTop="6dp"
android:background="@drawable/background_codex_item_btn"
android:gravity="center" />
</LinearLayout>

View File

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 472 B

View File

@ -1291,5 +1291,8 @@ Limited ride And limited avatar frame</string>
<string name="winner_of_the_month">本月得主</string>
<string name="last_month_winner">上月得主</string>
<string name="last_month_winner_hint">上月奪得最終禮物冠名權用戶將獲得該禮物一個月專屬冠名皮膚</string>
<string name="last_month_winner_hint2">近期點亮</string>
<string name="received_wall">已獲得</string>
<string name="received_wall2">去點亮</string>
</resources>

View File

@ -0,0 +1,47 @@
package com.yunbao.live.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.live.views.CodexViewHolder;
import java.util.ArrayList;
import java.util.List;
public class CodexAdapter extends RecyclerView.Adapter {
private List<GiftGuideModel> giftGuideModels = new ArrayList<>();
private boolean history;
private String mStream, mLiveUid;
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_codex, parent, false);
return new CodexViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
CodexViewHolder codexViewHolder = (CodexViewHolder) holder;
codexViewHolder.showData(giftGuideModels.get(position), history,mStream,mLiveUid);
}
@Override
public int getItemCount() {
return giftGuideModels.size();
}
public void addAllData(List<GiftGuideModel> mGiftWall, boolean history, String mStream, String mLiveUid) {
this.history = history;
this.mStream = mStream;
this.mLiveUid = mLiveUid;
giftGuideModels.clear();
giftGuideModels.addAll(mGiftWall);
notifyDataSetChanged();
}
}

View File

@ -0,0 +1,43 @@
package com.yunbao.live.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.live.views.CodexItemViewHolder;
import java.util.ArrayList;
import java.util.List;
public class CodexItemAdapter extends RecyclerView.Adapter {
private List<GiftWallModel> giftData = new ArrayList<>();
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_codex_item, parent, false);
return new CodexItemViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
CodexItemViewHolder codexItemViewHolder = (CodexItemViewHolder) holder;
codexItemViewHolder.showData(giftData.get(position));
}
@Override
public int getItemCount() {
return giftData.size();
}
public void addAllData(List<GiftWallModel> mGiftWall) {
giftData.clear();
giftData.addAll(mGiftWall);
notifyDataSetChanged();
}
}

View File

@ -35,7 +35,7 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.custom.GiftMarkView;
import com.yunbao.live.dialog.SendRendPacketPopup;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import java.io.File;
import java.util.List;

View File

@ -0,0 +1,114 @@
package com.yunbao.live.dialog;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.core.BottomPopupView;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.event.CodexEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.adapter.CodexAdapter;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
public class CodexDialog extends BottomPopupView {
private String mStream, mLiveUid;
private RecyclerView liveCodex;
private CodexAdapter codexAdapter;
private boolean history;
public CodexDialog(@NonNull Context context, String mStream, String mLiveUid, boolean history) {
super(context);
this.mLiveUid = mLiveUid;
this.mStream = mStream;
this.history = history;
}
// 返回自定义弹窗的布局
@Override
protected int getImplLayoutId() {
return R.layout.dialog_live_codex;
}
// 执行初始化操作比如findView设置点击或者任何你弹窗内的业务逻辑
@Override
protected void onCreate() {
super.onCreate();
Bus.getOn(this);
initView();
initDate();
}
private void initDate() {
if (history) {
LiveNetManager.get(getContext()).
getGiftGuideHistory(mLiveUid, new HttpCallback<List<GiftGuideModel>>() {
@Override
public void onSuccess(List<GiftGuideModel> data) {
codexAdapter.addAllData(data,history,mStream,mLiveUid);
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} else {
LiveNetManager.get(getContext()).
getGiftGuide(mLiveUid, new HttpCallback<List<GiftGuideModel>>() {
@Override
public void onSuccess(List<GiftGuideModel> data) {
codexAdapter.addAllData(data,history,mStream,mLiveUid);
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
}
private void initView() {
liveCodex = findViewById(R.id.live_codex);
codexAdapter = new CodexAdapter();
liveCodex.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
liveCodex.setAdapter(codexAdapter);
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dialog.dismiss();
}
});
}
@Override
protected void onDismiss() {
Bus.getOff(this);
super.onDismiss();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCodexEvent(CodexEvent event) {
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) {
dismiss();
}
}

View File

@ -18,7 +18,6 @@ import com.yunbao.common.Constants;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.event.GiftWallItemEvent;
import com.yunbao.common.fragment.AllServiceChampionFragment;
import com.yunbao.live.views.GiftAlreadyWallFragment;
import com.yunbao.common.fragment.GiftWithoutWallFragment;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpUtil;
@ -29,7 +28,8 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.live.views.GiftAlreadyWallFragment;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@ -130,6 +130,15 @@ public class GiftWallDialog extends AbsDialogFragment {
.show();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.codex_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new XPopup.Builder(getContext())
.enableDrag(false)
.asCustom(new CodexDialog(getContext(), mStream, mLiveUid,false))
.show();
}
});
}
private void initDate() {

View File

@ -19,7 +19,7 @@ import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
public class GiftWallItemPopup extends CenterPopupView {
private CardView layout;

View File

@ -80,7 +80,7 @@ import com.yunbao.live.bean.GiftTopBean;
import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.custom.GiftViewPager;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.utils.ToolsButton;

View File

@ -74,7 +74,7 @@ import com.yunbao.live.bean.GiftTopBean;
import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.event.GiftTitleEvent;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.live.event.LiveGiftItemEvent;
import com.yunbao.live.event.LiveParcelItemRefreshEvent;
import com.yunbao.live.http.LiveHttpUtil;

View File

@ -0,0 +1,55 @@
package com.yunbao.live.views;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.event.LiveAudienceEvent;
public class CodexItemViewHolder extends RecyclerView.ViewHolder {
private ImageView giftImg;
private TextView giftName, giftWall;
public CodexItemViewHolder(@NonNull View itemView) {
super(itemView);
giftImg = itemView.findViewById(R.id.gift_img);
giftName = itemView.findViewById(R.id.gift_name);
giftWall = itemView.findViewById(R.id.gift_wall);
}
public void showData(GiftWallModel giftWallModel) {
ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg);
giftName.setText(giftWallModel.getGiftname());
giftName.setTextColor(Color.parseColor(giftWallModel.getFontColor()));
giftWall.setSelected(TextUtils.equals(String.valueOf(giftWallModel.getIlluminateStatus()), "1"));
if (TextUtils.equals(String.valueOf(giftWallModel.getIlluminateStatus()), "1")) {
giftWall.setText(itemView.getContext().getString(R.string.received_wall2));
giftWall.setTextColor(Color.parseColor("#FFFFFF"));
ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
Bus.get().post(new LiveGiftDialogEvent());
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
.setmWishGiftId(giftWallModel.getId())
.setmLiveUid("")
.setmStream(""));
}
});
} else {
giftWall.setText(itemView.getContext().getString(R.string.received_wall));
giftWall.setTextColor(Color.parseColor("#49669F"));
}
}
}

View File

@ -0,0 +1,68 @@
package com.yunbao.live.views;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.R;
import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.adapter.CodexItemAdapter;
import com.yunbao.live.dialog.CodexDialog;
public class CodexViewHolder extends RecyclerView.ViewHolder {
private ImageView codexLayout, titleIcon;
private TextView titleName, weekNumber, weekNumber2;
private RecyclerView giftList;
private CodexItemAdapter codexItemAdapter;
public CodexViewHolder(@NonNull View itemView) {
super(itemView);
codexLayout = itemView.findViewById(R.id.codex_layout);
titleIcon = itemView.findViewById(R.id.title_icon);
titleName = itemView.findViewById(R.id.title_name);
weekNumber = itemView.findViewById(R.id.week_number);
weekNumber2 = itemView.findViewById(R.id.week_number2);
giftList = itemView.findViewById(R.id.gift_list);
codexItemAdapter = new CodexItemAdapter();
giftList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
giftList.setAdapter(codexItemAdapter);
}
public void showData(GiftGuideModel giftGuideModel, boolean history, String mStream, String mLiveUid) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(giftGuideModel.getIlluminateCount())
.append("/")
.append(giftGuideModel.getIlluminateTotal());
ImgLoader.display(itemView.getContext(), giftGuideModel.getGuideBackgroundPicturePath(), codexLayout);
ImgLoader.display(itemView.getContext(), giftGuideModel.getGuideNameImgPath(), titleIcon);
titleName.setText(stringBuffer.toString());
titleName.setTextColor(Color.parseColor(giftGuideModel.getNumber()));
weekNumber.setText(giftGuideModel.getWeekNumber());
weekNumber.setVisibility(TextUtils.isEmpty(giftGuideModel.getWeekNumber()) ? View.GONE : View.VISIBLE);
if (history) {
weekNumber2.setVisibility(View.GONE);
} else {
weekNumber2.setVisibility(TextUtils.isEmpty(giftGuideModel.getWeekNumber()) ? View.GONE : View.VISIBLE);
}
codexItemAdapter.addAllData(giftGuideModel.getGiftData());
ViewClicksAntiShake.clicksAntiShake(weekNumber2, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new XPopup.Builder(itemView.getContext())
.enableDrag(false)
.asCustom(new CodexDialog(itemView.getContext(), mStream, mLiveUid,true))
.show();
}
});
}
}

View File

@ -28,7 +28,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.dialog.SendRendPacketPopup;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import java.io.File;

View File

@ -19,7 +19,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
/**
* 已点亮礼物墙

View File

@ -26,7 +26,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.dialog.SendRendPacketPopup;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import java.io.File;

View File

@ -8,7 +8,6 @@ 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;
@ -81,11 +80,10 @@ 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;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.live.event.LiveRoomChangeEvent;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;

View File

@ -48,6 +48,7 @@
android:background="@mipmap/background_giftwall_tab">
<TextView
android:id="@+id/codex_layout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"