新版守护,空页面,列表页面。守护类型开通页面。开通时间页面

This commit is contained in:
18401019693
2024-03-06 14:24:04 +08:00
parent 8af7f907eb
commit 6870037683
64 changed files with 2484 additions and 74 deletions

View File

@@ -0,0 +1,46 @@
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.views.LiveBuyGuardPrivilegeViewHolder;
import java.util.ArrayList;
import java.util.List;
public class LiveBuyGuardPrivilegeAdapter extends RecyclerView.Adapter {
List<String> guardPrivilege = new ArrayList<>();
public void setGuardPrivilege(List<String> privilege) {
guardPrivilege.clear();
guardPrivilege.addAll(privilege);
notifyDataSetChanged();
}
public LiveBuyGuardPrivilegeAdapter(List<String> guardPrivilege) {
this.guardPrivilege = guardPrivilege;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_buy_guard_privilege_item, parent, false);
return new LiveBuyGuardPrivilegeViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
LiveBuyGuardPrivilegeViewHolder buyGuardSelectViewHolder = (LiveBuyGuardPrivilegeViewHolder) holder;
buyGuardSelectViewHolder.setData(guardPrivilege.get(position));
}
@Override
public int getItemCount() {
return guardPrivilege.size();
}
}

View File

@@ -0,0 +1,48 @@
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.GuardPriceModel;
import com.yunbao.common.views.LiveBuyGuardSelectViewHolder;
import java.util.ArrayList;
import java.util.List;
public class LiveBuyGuardSelectAdapter extends RecyclerView.Adapter {
List<GuardPriceModel> price = new ArrayList<>();
public LiveBuyGuardSelectAdapter(List<GuardPriceModel> price) {
this.price = price;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_buy_guard_slelect_item, parent, false);
return new LiveBuyGuardSelectViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
LiveBuyGuardSelectViewHolder buyGuardSelectViewHolder = (LiveBuyGuardSelectViewHolder) holder;
buyGuardSelectViewHolder.setData(price.get(position), liveBuyGuardSelectClickListener);
}
@Override
public int getItemCount() {
return price.size();
}
private LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener;
public LiveBuyGuardSelectAdapter setLiveBuyGuardSelectClickListener(LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener) {
this.liveBuyGuardSelectClickListener = liveBuyGuardSelectClickListener;
return this;
}
}

View File

@@ -0,0 +1,136 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class GuardDataTipModel extends BaseModel {
/**
* {
* "guard_name": "星之守護", // 守护名称
* "guard_type": 1, // 守护类型
* "close_img": "https://ceshi.yaoulive.com/data/upload/20240304/guard_xing_close.png", // 未开通图标
* "open_img": "https://ceshi.yaoulive.com/data/upload/20240304/guard_xing_open.png", // 已开通图标
* "is_open": true, // 是否开通 是.true 否.false
* "price": { // 价格
* {
* "opening_time": "1個月", // 开通时长
* "original_price": "188000", // 原价
* "discount_price": "", // 折扣价
* "discount": "", // 折扣
* "price_key": 1
* },
* {
* "opening_time": "3個月",
* "original_price": "564000",
* "discount_price": "398000",
* "discount": "7.1折",
* "price_key": 3
* },
* {
* "opening_time": "6個月",
* "original_price": "1128000",
* "discount_price": "738000",
* "discount": "6.5折",
* "price_key": 6
* },
* {
* "opening_time": "12個月",
* "original_price": "2256000",
* "discount_price": "1314000",
* "discount": "5.8折",
* "price_key": 12
* }
* ],
* "guard_privilege": [
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_2.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_3.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_2.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_3.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_1.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_2.png",
* "https://ceshi.yaoulive.com/data/upload/20240304/tequan_3.png"
* ]
* }
*/
@SerializedName("guard_name")
private String guardName;
@SerializedName("guard_type")
private int guardType;
@SerializedName("close_img")
private String closeImg;
@SerializedName("open_img")
private String openImg;
@SerializedName("is_open")
private boolean isOpen;
@SerializedName("price")
private List<GuardPriceModel> price;
@SerializedName("guard_privilege")
private List<String> guardPrivilege;
public String getGuardName() {
return guardName;
}
public GuardDataTipModel setGuardName(String guardName) {
this.guardName = guardName;
return this;
}
public int getGuardType() {
return guardType;
}
public GuardDataTipModel setGuardType(int guardType) {
this.guardType = guardType;
return this;
}
public String getCloseImg() {
return closeImg;
}
public GuardDataTipModel setCloseImg(String closeImg) {
this.closeImg = closeImg;
return this;
}
public String getOpenImg() {
return openImg;
}
public GuardDataTipModel setOpenImg(String openImg) {
this.openImg = openImg;
return this;
}
public boolean isOpen() {
return isOpen;
}
public GuardDataTipModel setOpen(boolean open) {
isOpen = open;
return this;
}
public List<GuardPriceModel> getPrice() {
return price;
}
public GuardDataTipModel setPrice(List<GuardPriceModel> price) {
this.price = price;
return this;
}
public List<String> getGuardPrivilege() {
return guardPrivilege;
}
public GuardDataTipModel setGuardPrivilege(List<String> guardPrivilege) {
this.guardPrivilege = guardPrivilege;
return this;
}
}

View File

@@ -0,0 +1,31 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class GuardGetGuardOpenInfoModel extends BaseModel {
@SerializedName("user_info")
private GuardUserInfoModel userInfo;
@SerializedName("guard_data")
private List<GuardDataTipModel> guardData;
public GuardUserInfoModel getUserInfo() {
return userInfo;
}
public GuardGetGuardOpenInfoModel setUserInfo(GuardUserInfoModel userInfo) {
this.userInfo = userInfo;
return this;
}
public List<GuardDataTipModel> getGuardData() {
return guardData;
}
public GuardGetGuardOpenInfoModel setGuardData(List<GuardDataTipModel> guardData) {
this.guardData = guardData;
return this;
}
}

View File

@@ -0,0 +1,131 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GuardGetGuardUserInfoModel extends BaseModel {
/**
* "info": {
* "uid": "98923", // 用户ID
* "user_avatar": "https://downs.yaoulive.com/20230706/0572c0f694601f4d2695cd210effbe93.jpeg?imageView2/2/w/600/h/600", // 用户头像链接
* "liveuid": "98889", // 主播ID
* "live_avatar": "https://ceshi.yaoulive.com/data/upload/20230522/20230526102906.png", // 主播头像链接
* "guard_type": 0, // 守护类型 0.未开通 1.星之守护 2.王之守护 3.神之守护
* "exp": 0, // 守护经验值
* "level": 0, // 守护等级
* "endtime": 0, // 到期时间
* "user_language": "chinese",
* "live_language": "chinese"
* }
* }
*/
@SerializedName("uid")
private String uid;
@SerializedName("user_avatar")
private String userAvatar;
@SerializedName("liveuid")
private String liveuid;
@SerializedName("live_avatar")
private String liveAvatar;
@SerializedName("guard_type")
private int guardType;
@SerializedName("exp")
private int exp;
@SerializedName("level")
private int level;
@SerializedName("endtime")
private int endtime;
@SerializedName("user_language")
private String userLanguage;
@SerializedName("live_language")
private String liveLanguage;
public String getUid() {
return uid;
}
public GuardGetGuardUserInfoModel setUid(String uid) {
this.uid = uid;
return this;
}
public String getUserAvatar() {
return userAvatar;
}
public GuardGetGuardUserInfoModel setUserAvatar(String userAvatar) {
this.userAvatar = userAvatar;
return this;
}
public String getLiveuid() {
return liveuid;
}
public GuardGetGuardUserInfoModel setLiveuid(String liveuid) {
this.liveuid = liveuid;
return this;
}
public String getLiveAvatar() {
return liveAvatar;
}
public GuardGetGuardUserInfoModel setLiveAvatar(String liveAvatar) {
this.liveAvatar = liveAvatar;
return this;
}
public int getGuardType() {
return guardType;
}
public GuardGetGuardUserInfoModel setGuardType(int guardType) {
this.guardType = guardType;
return this;
}
public int getExp() {
return exp;
}
public GuardGetGuardUserInfoModel setExp(int exp) {
this.exp = exp;
return this;
}
public int getLevel() {
return level;
}
public GuardGetGuardUserInfoModel setLevel(int level) {
this.level = level;
return this;
}
public int getEndtime() {
return endtime;
}
public GuardGetGuardUserInfoModel setEndtime(int endtime) {
this.endtime = endtime;
return this;
}
public String getUserLanguage() {
return userLanguage;
}
public GuardGetGuardUserInfoModel setUserLanguage(String userLanguage) {
this.userLanguage = userLanguage;
return this;
}
public String getLiveLanguage() {
return liveLanguage;
}
public GuardGetGuardUserInfoModel setLiveLanguage(String liveLanguage) {
this.liveLanguage = liveLanguage;
return this;
}
}

View File

@@ -0,0 +1,70 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GuardPriceModel extends BaseModel {
/**
* {
* "opening_time": "1個月", // 开通时长
* "original_price": "188000", // 原价
* "discount_price": "", // 折扣价
* "discount": "", // 折扣
* "price_key": 1
* }
*/
@SerializedName("opening_time")
private String openingTime;
@SerializedName("original_price")
private String originalPrice;
@SerializedName("discount_price")
private String discountPrice;
@SerializedName("discount")
private String discount;
@SerializedName("price_key")
private int priceKey;
public String getOpeningTime() {
return openingTime;
}
public GuardPriceModel setOpeningTime(String openingTime) {
this.openingTime = openingTime;
return this;
}
public String getOriginalPrice() {
return originalPrice;
}
public GuardPriceModel setOriginalPrice(String originalPrice) {
this.originalPrice = originalPrice;
return this;
}
public String getDiscountPrice() {
return discountPrice;
}
public GuardPriceModel setDiscountPrice(String discountPrice) {
this.discountPrice = discountPrice;
return this;
}
public String getDiscount() {
return discount;
}
public GuardPriceModel setDiscount(String discount) {
this.discount = discount;
return this;
}
public int getPriceKey() {
return priceKey;
}
public GuardPriceModel setPriceKey(int priceKey) {
this.priceKey = priceKey;
return this;
}
}

View File

@@ -0,0 +1,131 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GuardUserInfoModel extends BaseModel {
/**
* {
* "user_info": { // 用户开通信息
* "uid": "98888", // 用户ID
* "user_avatar": "https://downs.yaoulive.com/mannine.png", // 用户头像链接
* "liveuid": "98889", // 主播ID
* "live_avatar": "https://ceshi.yaoulive.com/data/upload/20230522/20230526102906.png", // 主播头像链接
* "guard_type": 1, // 守护类型
* "exp": 0, // 经验值
* "level": 1, // 等级
* "endtime": 1710145929, // 到期时间
* "user_language": "chinese", // 用户语言
* "live_language": "chinese" // 主播语言
* }
*/
@SerializedName("uid")
private String uid;
@SerializedName("user_avatar")
private String userAvatar;
@SerializedName("liveuid")
private String liveuid;
@SerializedName("live_avatar")
private String liveAvatar;
@SerializedName("guard_type")
private int guardType;
@SerializedName("exp")
private int exp;
@SerializedName("level")
private int level;
@SerializedName("endtime")
private int endtime;
@SerializedName("user_language")
private String userLanguage;
@SerializedName("live_language")
private String liveLanguage;
public String getUid() {
return uid;
}
public GuardUserInfoModel setUid(String uid) {
this.uid = uid;
return this;
}
public String getUserAvatar() {
return userAvatar;
}
public GuardUserInfoModel setUserAvatar(String userAvatar) {
this.userAvatar = userAvatar;
return this;
}
public String getLiveuid() {
return liveuid;
}
public GuardUserInfoModel setLiveuid(String liveuid) {
this.liveuid = liveuid;
return this;
}
public String getLiveAvatar() {
return liveAvatar;
}
public GuardUserInfoModel setLiveAvatar(String liveAvatar) {
this.liveAvatar = liveAvatar;
return this;
}
public int getGuardType() {
return guardType;
}
public GuardUserInfoModel setGuardType(int guardType) {
this.guardType = guardType;
return this;
}
public int getExp() {
return exp;
}
public GuardUserInfoModel setExp(int exp) {
this.exp = exp;
return this;
}
public int getLevel() {
return level;
}
public GuardUserInfoModel setLevel(int level) {
this.level = level;
return this;
}
public int getEndtime() {
return endtime;
}
public GuardUserInfoModel setEndtime(int endtime) {
this.endtime = endtime;
return this;
}
public String getUserLanguage() {
return userLanguage;
}
public GuardUserInfoModel setUserLanguage(String userLanguage) {
this.userLanguage = userLanguage;
return this;
}
public String getLiveLanguage() {
return liveLanguage;
}
public GuardUserInfoModel setLiveLanguage(String liveLanguage) {
this.liveLanguage = liveLanguage;
return this;
}
}

View File

@@ -0,0 +1,127 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.content.DialogInterface;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
import com.yunbao.common.adapter.LiveBuyGuardSelectAdapter;
import com.yunbao.common.bean.GuardPriceModel;
import com.yunbao.common.views.LiveBuyGuardSelectViewHolder;
import java.util.ArrayList;
import java.util.List;
public class LiveBuyGuardSelectPopup extends AttachPopupView {
private int mType;
private DialogInterface.OnDismissListener onDismissListener;
private LiveBuyGuardSelectListener buyGuardSelectListener;
List<GuardPriceModel> price = new ArrayList<>();
LiveBuyGuardSelectAdapter liveBuyGuardSelectAdapter;
RecyclerView live_buy_guard_list;
public LiveBuyGuardSelectPopup(@NonNull Context context, List<GuardPriceModel> mPrice) {
super(context);
price = mPrice;
}
protected int getImplLayoutId() {
return R.layout.view_live_buy_guard_slelect;
}
@Override
protected void onCreate() {
live_buy_guard_list = findViewById(R.id.live_buy_guard_list);
liveBuyGuardSelectAdapter = new LiveBuyGuardSelectAdapter(price);
live_buy_guard_list.setAdapter(liveBuyGuardSelectAdapter);
live_buy_guard_list.setLayoutManager(new LinearLayoutManager(getContext()));
liveBuyGuardSelectAdapter.setLiveBuyGuardSelectClickListener(new LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener() {
@Override
public void onClickListener(GuardPriceModel guardPriceModel) {
dialog.dismiss();
if (onDismissListener != null) {
onDismissListener.onDismiss(null);
}
if (buyGuardSelectListener != null) {
buyGuardSelectListener.onLiveBuyGuardSelectListener(guardPriceModel);
}
}
});
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.one_month), new ViewClicksAntiShake.ViewClicksCallBack() {
// @Override
// public void onViewClicks() {
// dialog.dismiss();
// if (onDismissListener != null) {
// onDismissListener.onDismiss(null);
// }
// if (buyGuardSelectListener != null) {
// buyGuardSelectListener.onLiveBuyGuardSelectListener(0);
// }
// }
// });
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.tree_month), new ViewClicksAntiShake.ViewClicksCallBack() {
// @Override
// public void onViewClicks() {
// dialog.dismiss();
// if (onDismissListener != null) {
// onDismissListener.onDismiss(null);
// }
// if (buyGuardSelectListener != null) {
// buyGuardSelectListener.onLiveBuyGuardSelectListener(1);
// }
// }
// });
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.six_month), new ViewClicksAntiShake.ViewClicksCallBack() {
// @Override
// public void onViewClicks() {
// dialog.dismiss();
// if (onDismissListener != null) {
// onDismissListener.onDismiss(null);
// }
// if (buyGuardSelectListener != null) {
// buyGuardSelectListener.onLiveBuyGuardSelectListener(2);
// }
// }
// });
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.one_two_month), new ViewClicksAntiShake.ViewClicksCallBack() {
// @Override
// public void onViewClicks() {
// dialog.dismiss();
// if (onDismissListener != null) {
// onDismissListener.onDismiss(null);
// }
// if (buyGuardSelectListener != null) {
// buyGuardSelectListener.onLiveBuyGuardSelectListener(3);
// }
// }
// });
}
public LiveBuyGuardSelectPopup setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
this.onDismissListener = onDismissListener;
return this;
}
public LiveBuyGuardSelectPopup setBuyGuardSelectListener(LiveBuyGuardSelectListener buyGuardSelectListener) {
this.buyGuardSelectListener = buyGuardSelectListener;
return this;
}
@Override
protected void onDismiss() {
super.onDismiss();
if (onDismissListener != null) {
onDismissListener.onDismiss(null);
}
}
public interface LiveBuyGuardSelectListener {
void onLiveBuyGuardSelectListener(GuardPriceModel guardPriceModel);
}
}

View File

@@ -26,6 +26,8 @@ import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftNamingInfoModel;
import com.yunbao.common.bean.GiftWallGiftDetail;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
import com.yunbao.common.bean.HourRank;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.IMLoginModel;
@@ -1162,4 +1164,9 @@ public interface PDLiveApi {
@GET("/api/public/?service=Sudgameserver.getRoomMicStatus")
Observable<ResponseModel<RoomMicStatusModel>> getRoomMicStatus();
@GET("/api/public/?service=Guard.getGuardUserInfo")
Observable<ResponseModel<GuardGetGuardUserInfoModel>> getGuardUserInfo(@Query("liveuid") String liveUid);
@GET("/api/public/?service=Guard.getGuardOpenInfo")
Observable<ResponseModel<GuardGetGuardOpenInfoModel>> getGuardOpenInfo(@Query("liveuid") String liveUid);
}

View File

@@ -27,6 +27,8 @@ import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftNamingInfoModel;
import com.yunbao.common.bean.GiftWallGiftDetail;
import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.LinkMicUserBean;
import com.yunbao.common.bean.LinkMicUserBeanV2;
@@ -2770,7 +2772,7 @@ public class LiveNetManager {
}).isDisposed();
}
public void addChatCount(String stream,HttpCallback<HttpCallbackModel> callback) {
public void addChatCount(String stream, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.addChatCount(stream)
.subscribeOn(Schedulers.io())
@@ -2931,6 +2933,54 @@ public class LiveNetManager {
}
public void getGuardUserInfo(String liveUid, HttpCallback<GuardGetGuardUserInfoModel> callback) {
API.get().pdLiveApi(mContext)
.getGuardUserInfo(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<GuardGetGuardUserInfoModel>>() {
@Override
public void accept(ResponseModel<GuardGetGuardUserInfoModel> guardGetGuardUserInfoModelResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(guardGetGuardUserInfoModelResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void getGuardOpenInfo(String liveUid, HttpCallback<GuardGetGuardOpenInfoModel> callback) {
API.get().pdLiveApi(mContext)
.getGuardOpenInfo(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<GuardGetGuardOpenInfoModel>>() {
@Override
public void accept(ResponseModel<GuardGetGuardOpenInfoModel> guardGetGuardOpenInfoModelResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(guardGetGuardOpenInfoModelResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
/**
* 直播间取消网络请求
*/

View File

@@ -0,0 +1,25 @@
package com.yunbao.common.views;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.glide.ImgLoader;
public class LiveBuyGuardPrivilegeViewHolder extends RecyclerView.ViewHolder {
ImageView guard_privilege;
public LiveBuyGuardPrivilegeViewHolder(@NonNull View itemView) {
super(itemView);
guard_privilege = itemView.findViewById(R.id.guard_privilege);
}
public void setData(String url) {
Log.e("LiveBuyGuardPrivilege", url);
ImgLoader.display(itemView.getContext(), url, guard_privilege);
}
}

View File

@@ -0,0 +1,37 @@
package com.yunbao.common.views;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.GuardPriceModel;
public class LiveBuyGuardSelectViewHolder extends RecyclerView.ViewHolder {
TextView opening_time, discount;
public LiveBuyGuardSelectViewHolder(@NonNull View itemView) {
super(itemView);
opening_time = itemView.findViewById(R.id.opening_time);
discount = itemView.findViewById(R.id.discount);
}
public void setData(GuardPriceModel guardPriceModel,LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener) {
opening_time.setText(String.valueOf(guardPriceModel.getOpeningTime()));
discount.setText(String.valueOf(guardPriceModel.getDiscount()));
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (liveBuyGuardSelectClickListener!=null){
liveBuyGuardSelectClickListener.onClickListener(guardPriceModel);
}
}
});
}
public interface LiveBuyGuardSelectClickListener{
void onClickListener(GuardPriceModel guardPriceModel);
}
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="#120C07"
android:startColor="#3F2D05"
android:type="linear" />
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
</shape>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="#09050F"
android:startColor="#3F3B34"
android:type="linear" />
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp" />
<stroke
android:width="0.5dp"
android:color="#D9D9D9" />
<solid android:color="#CC0C0D1A" />
</shape>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="#110F22"
android:startColor="#37398E"
android:type="linear" />
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
</shape>

View File

@@ -0,0 +1,16 @@
<?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="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/guard_privilege"
android:layout_marginTop="10dp"
android:src="@mipmap/tequan_1"
android:scaleType="fitXY"
android:layout_width="match_parent"
android:layout_marginStart="9dp"
android:layout_height="83dp" />
</LinearLayout>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="120dp"
android:background="@drawable/bg_live_buy_guard_select"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/live_buy_guard_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:itemCount="4"
tools:listitem="@layout/view_live_buy_guard_slelect_item" />
</LinearLayout>

View File

@@ -0,0 +1,30 @@
<?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="30dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/opening_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="19dp"
android:layout_weight="1"
android:gravity="center"
android:text="@string/one_month"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="19dp"
android:layout_weight="1"
android:gravity="center"
android:text="7.1折"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -1459,4 +1459,26 @@ Limited ride And limited avatar frame</string>
<string name="guard_buy_type_1">【星之守护】</string>
<string name="guardian_privilege">守護團特權</string>
<string name="be_their_exclusive_guardian">成爲TA的專屬守護 為TA保駕護航</string>
<string name="not_yet_open">暫未開通</string>
<string name="tas_guardian_group">TA的守護團 ></string>
<string name="open_the_kings_guard">開通王之守護</string>
<string name="renew_the_kings_guard">續費王之守護</string>
<string name="open_the_start_guard">開通星之守護</string>
<string name="renew_the_start_guard">續費星之守護</string>
<string name="open_the_god_guard">開通神之守護</string>
<string name="renew_the_god_guard">續費神之守護</string>
<string name="one_month">1個月</string>
<string name="tree_month">3個月</string>
<string name="six_month">6個月</string>
<string name="one_two_month">12個月</string>
<string name="guardian_for_your_favorite_anchor">快爲您喜歡的主播開通守護吧!</string>
<string name="guardian_task">守護任務</string>
<string name="my_graud_grade">我的等級 ></string>
<string name="no_one_guarding_the_anchor_yet">還沒人守護主播快來守護TA吧~</string>
<string name="this_week_contribution">本周貢獻值</string>
<string name="contribution">貢獻度</string>
<string name="have_opened">已開通</string>
</resources>