合并6.8.0代码
This commit is contained in:
BIN
common/src/main/assets/gift_live_naming_bg.svga
Normal file
BIN
common/src/main/assets/gift_live_naming_bg.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/gift_live_naming_title_cn.svga
Normal file
BIN
common/src/main/assets/gift_live_naming_title_cn.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/gift_live_naming_title_en.svga
Normal file
BIN
common/src/main/assets/gift_live_naming_title_en.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/gift_wall_gift_info_light.svga
Normal file
BIN
common/src/main/assets/gift_wall_gift_info_light.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/gift_wall_light_up.svga
Normal file
BIN
common/src/main/assets/gift_wall_light_up.svga
Normal file
Binary file not shown.
@@ -20,6 +20,7 @@ public class Constants {
|
||||
public static final String AVATAR = "avatar";
|
||||
public static final String SIGN = "sign";
|
||||
public static final String TO_UID = "toUid";
|
||||
public static final String TO_UNAME = "toUserName";
|
||||
public static final String INTOINDEX = "intoIndex";
|
||||
public static final String FROM_LIVE_ROOM = "fromLiveRoom";
|
||||
public static final String TO_NAME = "toName";
|
||||
@@ -150,6 +151,7 @@ public class Constants {
|
||||
public static final String SOCKET_LIVE_DRPK_RANDOM = "LiveRandomPK";//随机PK
|
||||
public static final String SOCKET_LEAVE_ROOM = "disconnect";//用户离开房间
|
||||
public static final String SOCKET_LIVE_END = "StartEndLive";//主播关闭直播
|
||||
public static final String SOCKET_LIVE_END_CLOSE = "StartEndLiveClose";//主播关闭直播
|
||||
public static final String SOCKET_SYSTEM = "SystemNot";//系统消息
|
||||
public static final String UP_USER_LIST = "upuserlist";//更新用戶列表
|
||||
public static final String LIAN_MAI = "LivePKDRLM";//用户连麦
|
||||
|
||||
@@ -12,25 +12,30 @@ import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.DisplayCutout;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.Window;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -301,6 +306,25 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
return getCurrentNavigationBarHeight(((Activity) context));
|
||||
}
|
||||
|
||||
public static int getNavigationStatusBarHeight(Context context) {
|
||||
int notchHeight = 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
WindowInsets windowInsets = ((Activity) context).getWindow().getDecorView().getRootWindowInsets();
|
||||
if (windowInsets != null) {
|
||||
DisplayCutout displayCutout = windowInsets.getDisplayCutout();
|
||||
if (displayCutout != null) {
|
||||
notchHeight = displayCutout.getSafeInsetTop();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (notchHeight != 0) {
|
||||
return notchHeight;
|
||||
}
|
||||
Rect rect = new Rect();
|
||||
((Activity) context).getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
|
||||
return rect.top;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全面屏(是否开启全面屏开关 0 关闭 1 开启)
|
||||
*
|
||||
|
||||
@@ -88,6 +88,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
public void setStatusBar() {
|
||||
super.setStatusBar();
|
||||
// getWindow().setStatusBarColor(Color.parseColor("#FFFFFF"));
|
||||
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
@@ -147,8 +148,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (url.contains("for")) {
|
||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||
}
|
||||
|
||||
|
||||
view.loadUrl("javascript:setTop(" + DpUtil.dp2px(15) + ")");
|
||||
if(url.startsWith(HtmlConfig.SHOP)){
|
||||
//商店页不做动态变换
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.BaseViewHolder> {
|
||||
private Context context;
|
||||
public Context context;
|
||||
public List<T> data;
|
||||
|
||||
public BaseAdapter(Context context, List<T> data) {
|
||||
@@ -34,7 +34,7 @@ public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.Ba
|
||||
return data == null ? 0 : data.size();
|
||||
}
|
||||
|
||||
public abstract void convert(BaseViewHolder holder, T t);
|
||||
public abstract void convert(BaseViewHolder holder, T item);
|
||||
|
||||
public abstract int getItemLayoutId();
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.Ba
|
||||
|
||||
private OnItemClickListener onItemClickListener;
|
||||
|
||||
private void setOnItemClickListener(OnItemClickListener onItemClickListener){
|
||||
public void setOnItemClickListener(OnItemClickListener onItemClickListener){
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
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.UserMedalListModel;
|
||||
import com.yunbao.common.bean.UserMedalListModel;
|
||||
import com.yunbao.common.event.GiftNumberEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.GiftNumber;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallAchieveAdapter extends RecyclerView.Adapter {
|
||||
private List<UserMedalListModel> giftQuantityModels;
|
||||
private Context mContext;
|
||||
private OnItemClickListener onItemClickListener;
|
||||
|
||||
public GiftWallAchieveAdapter(List<UserMedalListModel> giftQuantityModels, Context context) {
|
||||
this.giftQuantityModels = giftQuantityModels;
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_gift_wall_achieve_item, parent, false);
|
||||
return new GiftWallAchieveViewHolder(robotSayHelloView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftWallAchieveViewHolder giftWallAchieveViewHolder = (GiftWallAchieveViewHolder) holder;
|
||||
giftWallAchieveViewHolder.showData(giftQuantityModels.get(position));
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftQuantityModels.size();
|
||||
}
|
||||
|
||||
class GiftWallAchieveViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView achieveName;
|
||||
private ImageView achieveImg;
|
||||
|
||||
private ImageView achieveImgLock;
|
||||
|
||||
public GiftWallAchieveViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(getAdapterPosition());
|
||||
}
|
||||
}
|
||||
});
|
||||
achieveName = itemView.findViewById(R.id.achieveName);
|
||||
achieveImg = itemView.findViewById(R.id.achieve_img);
|
||||
achieveImgLock = itemView.findViewById(R.id.achieve_img_lock);
|
||||
}
|
||||
|
||||
public void showData(UserMedalListModel quantityModel) {
|
||||
achieveName.setText(quantityModel.getDressName());
|
||||
ImgLoader.display(mContext, quantityModel.getDisplaySrc(), achieveImg);
|
||||
achieveImgLock.setVisibility(quantityModel.getDressStatus().equals("1") ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int position);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWallGiftInfoListItemAdapter.VH> {
|
||||
List<GiftWallInfoBean.Data> data = new ArrayList<>();
|
||||
boolean isAnchor;
|
||||
int list_type = 1;
|
||||
private boolean isLiveRoom;
|
||||
private boolean isStar;
|
||||
int giftStatus;
|
||||
private String anchorName;
|
||||
private String anchorAvatar;
|
||||
|
||||
public void setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
}
|
||||
|
||||
public void setAnchorAvatar(String anchorAvatar) {
|
||||
this.anchorAvatar = anchorAvatar;
|
||||
}
|
||||
|
||||
public void setGiftStatus(int giftStatus) {
|
||||
this.giftStatus = giftStatus;
|
||||
}
|
||||
|
||||
public void setAnchor(boolean anchor) {
|
||||
isAnchor = anchor;
|
||||
}
|
||||
|
||||
public void setList_type(int list_type) {
|
||||
this.list_type = list_type;
|
||||
}
|
||||
|
||||
public void setLiveRoom(boolean liveRoom) {
|
||||
isLiveRoom = liveRoom;
|
||||
}
|
||||
|
||||
public void setStar(boolean star) {
|
||||
isStar = star;
|
||||
}
|
||||
|
||||
public void setData(List<GiftWallInfoBean.Data> data) {
|
||||
if (data == null) {
|
||||
data = new ArrayList<>();
|
||||
}
|
||||
if (data.isEmpty()) {
|
||||
GiftWallInfoBean.Data tmp = new GiftWallInfoBean.Data();
|
||||
tmp.setId(-1);
|
||||
data.add(tmp);
|
||||
}
|
||||
this.data = data;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_dialog_gift_wall_gift_info, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
holder.setData(data.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
TextView tv_rank, user_name, tv_rename, anchor_name;
|
||||
RoundedImageView avatar, avatar2;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tv_rank = itemView.findViewById(R.id.tv_rank);
|
||||
user_name = itemView.findViewById(R.id.user_name);
|
||||
tv_rename = itemView.findViewById(R.id.tv_rename);
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
avatar2 = itemView.findViewById(R.id.avatar2);
|
||||
anchor_name = itemView.findViewById(R.id.item_anchor_name);
|
||||
}
|
||||
|
||||
public void setData(GiftWallInfoBean.Data data, int position) {
|
||||
user_name.setText("");
|
||||
anchor_name.setText("");
|
||||
tv_rank.setText("");
|
||||
avatar.setVisibility(View.INVISIBLE);
|
||||
avatar2.setVisibility(View.INVISIBLE);
|
||||
if (data.getId() == -1) {
|
||||
tv_rank.setText("");
|
||||
tv_rename.setText("");
|
||||
user_name.setTextColor(Color.parseColor("#A2A2A2"));
|
||||
avatar.setVisibility(View.GONE);
|
||||
if (list_type == 1) {
|
||||
user_name.setText(WordUtil.getNewString(R.string.dialog_gift_wall_assistance_wait));
|
||||
} else if (!isStar) {
|
||||
user_name.setText(WordUtil.getNewString(R.string.dialog_gift_wall_classic_wait));
|
||||
} else {
|
||||
user_name.setText(WordUtil.getNewString(R.string.dialog_gift_wall_tab2_list_wait));
|
||||
}
|
||||
return;
|
||||
}
|
||||
anchor_name.setVisibility(View.GONE);
|
||||
if (isStar && list_type == 2) {
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(itemView.getContext(), data.getLive_avatar(), avatar);
|
||||
anchor_name.setText(data.getLive_user_name());
|
||||
if (data.getGift_hall_rank_hide() == 1 && !data.getUser_id().equals(IMLoginManager.get(itemView.getContext()).getUserInfo().getId() + "")) {
|
||||
avatar2.setImageResource(R.mipmap.hide);
|
||||
user_name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
} else {
|
||||
ImgLoader.display(itemView.getContext(), data.getAvatar(), avatar2);
|
||||
user_name.setText(data.getUser_name());
|
||||
}
|
||||
anchor_name.setVisibility(View.VISIBLE);
|
||||
avatar2.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
avatar2.setVisibility(View.INVISIBLE);
|
||||
anchor_name.setVisibility(View.GONE);
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
if (data.getGift_hall_rank_hide() == 1 && !data.getUser_id().equals(IMLoginManager.get(itemView.getContext()).getUserInfo().getId() + "")) {
|
||||
avatar.setImageResource(R.mipmap.hide);
|
||||
user_name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
} else {
|
||||
ImgLoader.display(itemView.getContext(), data.getAvatar(), avatar);
|
||||
user_name.setText(data.getUser_name());
|
||||
}
|
||||
}
|
||||
user_name.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
tv_rank.setText(String.format(Locale.getDefault(), "%d", (position + 1)));
|
||||
tv_rank.setTextColor(Color.parseColor("#FCC755"));
|
||||
tv_rank.setTextSize(20);
|
||||
tv_rename.setText(String.format(Locale.getDefault(), "%s", (data.getGift_hall_send_numForString())));
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowInsets;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallBean;
|
||||
import com.yunbao.common.dialog.GiftWallGiftInfoDialog;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.base.ACache;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallMainTab1List2Adapter extends RecyclerView.Adapter<GiftWallMainTab1List2Adapter.VH> {
|
||||
Context mContext;
|
||||
List<GiftWallBean.Gift> list;
|
||||
boolean isStar;
|
||||
SVGAVideoEntity drawable;
|
||||
String toUid;
|
||||
String anchorId;
|
||||
boolean isAnchor;
|
||||
private boolean isLiveRoom;
|
||||
|
||||
public GiftWallMainTab1List2Adapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setToUid(String toUid) {
|
||||
this.toUid = toUid;
|
||||
}
|
||||
|
||||
public void setAnchor(boolean anchor) {
|
||||
isAnchor = anchor;
|
||||
}
|
||||
|
||||
public void setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
}
|
||||
|
||||
public void setList(List<GiftWallBean.Gift> list) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setDrawable(SVGAVideoEntity drawable) {
|
||||
this.drawable = drawable;
|
||||
}
|
||||
|
||||
public void setStar(boolean star) {
|
||||
isStar = star;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
return new VH(LayoutInflater.from(mContext).inflate(R.layout.item_gift_wall_man_tab1_list_2, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
holder.setData(list.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewAttachedToWindow(@NonNull VH holder) {
|
||||
super.onViewAttachedToWindow(holder);
|
||||
holder.giftBg.startAnimation();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewDetachedFromWindow(@NonNull VH holder) {
|
||||
super.onViewDetachedFromWindow(holder);
|
||||
holder.giftBg.stopAnimation();
|
||||
|
||||
}
|
||||
|
||||
public void setLiveRoom(boolean isLiveRoom) {
|
||||
this.isLiveRoom = isLiveRoom;
|
||||
}
|
||||
|
||||
public void addList(List<GiftWallBean.Gift> gifts) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
int index = list.size() - 1;
|
||||
list.addAll(gifts);
|
||||
notifyItemRangeChanged(index, gifts.size());
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
SVGAImageView giftBg;
|
||||
ImageView gift_soles;
|
||||
ImageView giftImage;
|
||||
TextView gift_name;
|
||||
TextView gift_status;
|
||||
ProgressBar progressBar;
|
||||
|
||||
public VH(View itemView) {
|
||||
super(itemView);
|
||||
giftBg = itemView.findViewById(R.id.gift_bg);
|
||||
gift_soles = itemView.findViewById(R.id.gift_soles);
|
||||
giftImage = itemView.findViewById(R.id.gift);
|
||||
gift_name = itemView.findViewById(R.id.gift_name);
|
||||
gift_status = itemView.findViewById(R.id.gift_status);
|
||||
progressBar = itemView.findViewById(R.id.progressBar);
|
||||
}
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
public void setData(GiftWallBean.Gift gift, int position) {
|
||||
gift_name.setText(WordUtil.isNewZh() ? gift.getGift_name() : gift.getGift_name_en());
|
||||
ImgLoader.display(itemView.getContext(), gift.getGift_icon(), giftImage, 40, 40);
|
||||
giftBg.setClearsAfterDetached(false);
|
||||
giftBg.setClearsAfterStop(false);
|
||||
progressBar.setVisibility(View.GONE);
|
||||
if (isAnchor) {
|
||||
progressBar.setMax(gift.getIlluminate_num());
|
||||
progressBar.setProgress(gift.getGift_hall_send_num());
|
||||
}else{
|
||||
progressBar.setMax(1);
|
||||
}
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
if (gift.getIlluminate_status() == 1) {
|
||||
gift_status.setText(String.format("%s%s", WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_up), gift.getGift_hall_send_numForString()));
|
||||
gift_status.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
gift_soles.setImageResource(getSolesrRes());
|
||||
if (drawable != null) {
|
||||
giftBg.post(() -> {
|
||||
giftBg.setImageDrawable(new SVGADrawable(drawable));
|
||||
giftBg.setLoops(0);
|
||||
giftBg.startAnimation();
|
||||
});
|
||||
}
|
||||
if(!isAnchor){
|
||||
progressBar.setProgress(1);
|
||||
}
|
||||
} else {
|
||||
if (isAnchor) {
|
||||
gift_status.setText(String.format("%s %s/%s",
|
||||
WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_down2),
|
||||
gift.getGift_hall_send_numForString(),
|
||||
gift.getIlluminate_num()
|
||||
));
|
||||
} else {
|
||||
progressBar.setProgress(0);
|
||||
gift_status.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_down));
|
||||
}
|
||||
gift_status.setTextColor(Color.parseColor("#01071A"));
|
||||
gift_soles.setImageResource(getUnSolesrRes());
|
||||
giftBg.setImageResource(R.mipmap.gift_wall_main_item_bg1);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new GiftWallGiftInfoDialog(mContext, gift.getGift_id() + "", toUid, isAnchor)
|
||||
.setFullWindows(!isLiveRoom)
|
||||
.setLiveRoom(isLiveRoom)
|
||||
.setAnchorId(anchorId)
|
||||
.setStar(isStar)
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int getSolesrRes() {
|
||||
return isStar ? R.mipmap.gift_wall_main_item_select : R.mipmap.gift_wall_main_item_select1;
|
||||
}
|
||||
|
||||
private int getUnSolesrRes() {
|
||||
return isStar ? R.mipmap.gift_wall_main_item_unselect : R.mipmap.gift_wall_main_item_unselect1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.DecodeFormat;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallBean;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.bean.JsWishBean;
|
||||
import com.yunbao.common.dialog.GiftWallGiftInfoDialog;
|
||||
import com.yunbao.common.dialog.GiftWallMainTab2ClassicInfoDialog;
|
||||
import com.yunbao.common.dialog.GiftWallTab2List2Dialog;
|
||||
import com.yunbao.common.event.ClosePopupDialogEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GiftWallMainTab2ListAdapter extends RecyclerView.Adapter<GiftWallMainTab2ListAdapter.VH> {
|
||||
Context mContext;
|
||||
List<GiftWallTab2Bean.Gift> list;
|
||||
boolean isStar;
|
||||
String toUid;
|
||||
String anchorId;
|
||||
boolean isAnchor;
|
||||
private boolean isLiveRoom;
|
||||
boolean isNowRank;
|
||||
|
||||
public GiftWallMainTab2ListAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setNowRank(boolean nowRank) {
|
||||
isNowRank = nowRank;
|
||||
}
|
||||
|
||||
public void setToUid(String toUid) {
|
||||
this.toUid = toUid;
|
||||
}
|
||||
|
||||
public void setAnchor(boolean anchor) {
|
||||
isAnchor = anchor;
|
||||
}
|
||||
|
||||
public void setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
}
|
||||
|
||||
public void setList(List<GiftWallTab2Bean.Gift> list) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addList(List<GiftWallTab2Bean.Gift> gifts) {
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
int index = list.size() - 1;
|
||||
list.addAll(gifts);
|
||||
notifyItemRangeChanged(index, gifts.size());
|
||||
}
|
||||
|
||||
|
||||
public void setStar(boolean star) {
|
||||
isStar = star;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isStar) {
|
||||
return new VH(LayoutInflater.from(mContext).inflate(R.layout.item_gift_wall_man_tab2_list_1, parent, false));
|
||||
}
|
||||
return new VH(LayoutInflater.from(mContext).inflate(R.layout.item_gift_wall_man_tab2_list_2, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
holder.setData(list.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewAttachedToWindow(@NonNull VH holder) {
|
||||
super.onViewAttachedToWindow(holder);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewDetachedFromWindow(@NonNull VH holder) {
|
||||
super.onViewDetachedFromWindow(holder);
|
||||
|
||||
}
|
||||
|
||||
public void setLiveRoom(boolean isLiveRoom) {
|
||||
this.isLiveRoom = isLiveRoom;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
list.clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
ImageView gift;
|
||||
TextView gift_name;
|
||||
TextView gift_number;
|
||||
RoundedImageView user1Avatar, user2Avatar;
|
||||
TextView anchor_nickname;
|
||||
TextView user_nickname;
|
||||
TextView tv_wait;
|
||||
View imageView8;
|
||||
|
||||
public VH(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
gift = itemView.findViewById(R.id.gift);
|
||||
gift_name = itemView.findViewById(R.id.gift_name);
|
||||
gift_number = itemView.findViewById(R.id.gift_number);
|
||||
user1Avatar = itemView.findViewById(R.id.user1_avatar);
|
||||
user2Avatar = itemView.findViewById(R.id.user2_avatar);
|
||||
anchor_nickname = itemView.findViewById(R.id.anchor_nickname);
|
||||
user_nickname = itemView.findViewById(R.id.user_nickname);
|
||||
tv_wait = itemView.findViewById(R.id.tv_wait);
|
||||
imageView8 = itemView.findViewById(R.id.imageView8);
|
||||
}
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
public void setData(GiftWallTab2Bean.Gift giftData, int position) {
|
||||
gift_name.setText(WordUtil.isNewZh() ? giftData.getGiftName() : giftData.getGiftNameEn());
|
||||
display(itemView.getContext(), giftData.getGiftIcon(), gift, -1,-1);
|
||||
if (!StringUtil.isEmpty(giftData.getNamingLiveNicename(), giftData.getNamingUserNicename())) {
|
||||
anchor_nickname.setVisibility(View.VISIBLE);
|
||||
user_nickname.setVisibility(View.VISIBLE);
|
||||
gift_number.setVisibility(View.VISIBLE);
|
||||
user1Avatar.setVisibility(View.VISIBLE);
|
||||
user2Avatar.setVisibility(View.VISIBLE);
|
||||
imageView8.setVisibility(View.VISIBLE);
|
||||
tv_wait.setVisibility(View.GONE);
|
||||
gift_number.setText(String.format(Locale.getDefault(), "%d", giftData.getGiftHallSendNum()));
|
||||
if (giftData.getNamingLiveActiveRankHide() == 1 && giftData.getNamingLiveId()!= IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
user1Avatar.setImageResource(R.mipmap.hide);
|
||||
anchor_nickname.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
} else {
|
||||
display(mContext, giftData.getNamingLiveAvatar(), user1Avatar, 60, 60);
|
||||
anchor_nickname.setText(giftData.getNamingLiveNicename());
|
||||
}
|
||||
if (giftData.getNamingUserActiveRankHide() == 1&& giftData.getNamingUserId()!= IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
user2Avatar.setImageResource(R.mipmap.hide);
|
||||
user_nickname.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
} else {
|
||||
display(mContext, giftData.getNamingUserAvatar(), user2Avatar, 60, 60);
|
||||
user_nickname.setText(giftData.getNamingUserNicename());
|
||||
}
|
||||
} else {
|
||||
user1Avatar.setVisibility(View.GONE);
|
||||
user2Avatar.setVisibility(View.GONE);
|
||||
anchor_nickname.setVisibility(View.GONE);
|
||||
user_nickname.setVisibility(View.GONE);
|
||||
gift_number.setVisibility(View.GONE);
|
||||
imageView8.setVisibility(View.GONE);
|
||||
tv_wait.setVisibility(View.VISIBLE);
|
||||
itemView.setOnClickListener(null);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, () -> {
|
||||
if (isStar) {
|
||||
if (isNowRank) {
|
||||
if (StringUtil.isEmpty(giftData.getNamingLiveNicename(), giftData.getNamingUserNicename()) && isLiveRoom) {
|
||||
Bus.get().post(new JsWishBean(giftData.getGiftId() + ""));
|
||||
Bus.get().post(new ClosePopupDialogEvent());
|
||||
} else {
|
||||
new GiftWallGiftInfoDialog(mContext, giftData.getGiftId() + "", toUid, isAnchor)
|
||||
.setFullWindows(!isLiveRoom)
|
||||
.setAnchorId(anchorId)
|
||||
.setTab2Enter(true)
|
||||
.setLiveRoom(isLiveRoom)
|
||||
.setStar(isStar)
|
||||
.showDialog();
|
||||
}
|
||||
} else {
|
||||
new GiftWallMainTab2ClassicInfoDialog(mContext, giftData, isAnchor).setFullWindows(!isLiveRoom).showDialog();
|
||||
}
|
||||
} else {
|
||||
if (isNowRank) {
|
||||
new GiftWallGiftInfoDialog(mContext, giftData.getGiftId() + "", toUid, isAnchor)
|
||||
.setFullWindows(!isLiveRoom)
|
||||
.setAnchorId(anchorId)
|
||||
.setTab2Enter(true)
|
||||
.setLiveRoom(isLiveRoom)
|
||||
.setStar(isStar)
|
||||
.showDialog();
|
||||
} else {
|
||||
new GiftWallTab2List2Dialog(mContext).setGift(giftData).showDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void display(Context context, String url, ImageView imageView, int width, int height) {
|
||||
imageView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
RequestBuilder<Drawable> builder = Glide.with(context)
|
||||
.load(url);
|
||||
|
||||
if (width != -1 && height != -1) {
|
||||
builder = builder.override(width, height);
|
||||
}
|
||||
builder
|
||||
.thumbnail(1.0f)
|
||||
.format(DecodeFormat.PREFER_RGB_565)
|
||||
.skipMemoryCache(true)
|
||||
.addListener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
||||
imageView.setImageDrawable(null);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.into(imageView);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallMainTab2ClassicInfoBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GiftWallTab2GiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWallTab2GiftInfoListItemAdapter.VH> {
|
||||
List<GiftWallMainTab2ClassicInfoBean.GiftData> data = new ArrayList<>();
|
||||
|
||||
public void setData(List<GiftWallMainTab2ClassicInfoBean.GiftData> data) {
|
||||
if (data == null || data.isEmpty()) {
|
||||
data = new ArrayList<>();
|
||||
GiftWallMainTab2ClassicInfoBean.GiftData giftData=new GiftWallMainTab2ClassicInfoBean.GiftData();
|
||||
giftData.setUserId("-1");
|
||||
data.add(giftData);
|
||||
}
|
||||
this.data = data;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_dialog_gift_wall_tab2_gift_info, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
holder.setData(data.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
TextView tv_rank, user_name, tv_rename;
|
||||
RoundedImageView avatar;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tv_rank = itemView.findViewById(R.id.tv_rank);
|
||||
user_name = itemView.findViewById(R.id.user_name);
|
||||
tv_rename = itemView.findViewById(R.id.tv_rename);
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
}
|
||||
|
||||
public void setData(GiftWallMainTab2ClassicInfoBean.GiftData data, int position) {
|
||||
tv_rank.setText(String.format(Locale.getDefault(), "%d", (position + 4)));
|
||||
tv_rank.setTextColor(Color.parseColor("#FCC755"));
|
||||
tv_rank.setTextSize(20);
|
||||
tv_rename.setText(String.format(Locale.getDefault(), "%s", (data.getGiftHallSendNumForString())));
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
if (data.getActiveRankHide() == 1) {
|
||||
user_name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
avatar.setImageResource(R.mipmap.hide);
|
||||
} else {
|
||||
user_name.setText(data.getUserName());
|
||||
ImgLoader.display(itemView.getContext(), data.getAvatar(), avatar);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(avatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if(data.getActiveRankHide()==0){
|
||||
RouteUtil.forwardUserHome(itemView.getContext(), String.valueOf(data.getUserId()), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -36,7 +37,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
return new InteractionGamesChildViewHolder(runGamesView,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,6 +52,9 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
if (activityID != 0) {
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild));
|
||||
if(model.getSudGameIsNew().equals("1")){
|
||||
SpUtil.getInstance().setLiveGameId(model.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,11 +31,16 @@ public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
|
||||
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
holder.itemView.setLayoutParams(layoutParams);
|
||||
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.event.LiveNewRoleEvent;
|
||||
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.views.InteractionGamesChildBottomViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -34,14 +34,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
return new InteractionGamesChildBottomViewHolder(runGamesView,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
|
||||
InteractionGamesChildBottomViewHolder childViewHolder = (InteractionGamesChildBottomViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildBottomViewHolder.InteractionGamesCallBack() {
|
||||
@Override
|
||||
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
||||
|
||||
@@ -52,6 +52,9 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
.setInteractionID(activityID)
|
||||
.setChild(child)
|
||||
.setInteraction(true));
|
||||
if(model.getSudGameIsNew().equals("1")){
|
||||
SpUtil.getInstance().setLiveGameId(model.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,12 +63,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
|
||||
child.clear();
|
||||
/* if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
|
||||
@@ -39,13 +39,14 @@ public class LiveNewRolerPopupAdapter extends RecyclerView.Adapter {
|
||||
switch (viewType) {
|
||||
case FUN_GAMES:
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_new_roler_fun_games_view, parent, false);
|
||||
return new LiveNewRoleFunGamesViewHolder(runGamesView);
|
||||
return new LiveNewRoleFunGamesViewHolder(runGamesView,mContext);
|
||||
case RIGHTS_INTERESTS:
|
||||
//特权
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_roler_ights_interests, parent, false);
|
||||
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed);
|
||||
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed,mContext);
|
||||
default:
|
||||
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_interaction_games_view, parent, false);
|
||||
return new LiveNewRoleInteractionGamesViewHolder(gamesView);
|
||||
return new LiveNewRoleInteractionGamesViewHolder(gamesView,mContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,15 @@ public class NewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view2, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,false,mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
|
||||
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
holder.itemView.setLayoutParams(layoutParams);
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameAdapter extends BaseAdapter<SudSettleBean> {
|
||||
public SudGameAdapter(Context context, List<SudSettleBean> data) {
|
||||
super(context, data);
|
||||
}
|
||||
|
||||
private AppCompatImageView sub_rank_image;
|
||||
private RoundedImageView sub_head;
|
||||
private AppCompatTextView sub_rank_text,sub_name,sub_score;
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void convert(BaseAdapter<SudSettleBean>.BaseViewHolder holder, SudSettleBean item) {
|
||||
sub_rank_image = (AppCompatImageView) holder.getView(R.id.sub_rank_image);
|
||||
sub_rank_text = (AppCompatTextView) holder.getView(R.id.sub_rank_text);
|
||||
sub_head = (RoundedImageView) holder.getView(R.id.sub_head);
|
||||
sub_name = (AppCompatTextView) holder.getView(R.id.sub_name);
|
||||
sub_score = (AppCompatTextView) holder.getView(R.id.sub_score);
|
||||
|
||||
switch (item.getRank()){
|
||||
case 1:
|
||||
sub_rank_text.setVisibility(View.GONE);
|
||||
sub_rank_image.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setImageResource(R.mipmap.sub_1);
|
||||
break;
|
||||
case 2:
|
||||
sub_rank_text.setVisibility(View.GONE);
|
||||
sub_rank_image.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setImageResource(R.mipmap.sub_2);
|
||||
break;
|
||||
case 3:
|
||||
sub_rank_text.setVisibility(View.GONE);
|
||||
sub_rank_image.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setImageResource(R.mipmap.sub_3);
|
||||
break;
|
||||
default:
|
||||
sub_rank_text.setVisibility(View.VISIBLE);
|
||||
sub_rank_image.setVisibility(View.GONE);
|
||||
sub_rank_text.setText(String.valueOf(item.getRank()));
|
||||
break;
|
||||
}
|
||||
|
||||
ImgLoader.display(context, item.getAvatar_url(),sub_head);
|
||||
sub_name.setText(item.getNick_name());
|
||||
if (item.getWin_num()>0){
|
||||
sub_score.setText("+"+item.getWin_num());
|
||||
}else {
|
||||
sub_score.setText(String.valueOf(item.getWin_num()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemLayoutId() {
|
||||
return R.layout.view_sub_rank;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class BanDownLiveEvent extends BaseModel{
|
||||
private String reason,reasonContent,content,timer;
|
||||
|
||||
public BanDownLiveEvent() {
|
||||
}
|
||||
|
||||
public BanDownLiveEvent(String reason, String reasonContent, String content, String timer) {
|
||||
this.reason = reason;
|
||||
this.reasonContent = reasonContent;
|
||||
this.content = content;
|
||||
this.timer = timer;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getReasonContent() {
|
||||
return reasonContent;
|
||||
}
|
||||
|
||||
public void setReasonContent(String reasonContent) {
|
||||
this.reasonContent = reasonContent;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getTimer() {
|
||||
return timer;
|
||||
}
|
||||
|
||||
public void setTimer(String timer) {
|
||||
this.timer = timer;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
|
||||
public class CheckLiveModel extends BaseModel {
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GiftNamingInfoModel extends BaseModel {
|
||||
@@ -44,9 +47,9 @@ public class GiftNamingInfoModel extends BaseModel {
|
||||
private String giftStartTime;
|
||||
@SerializedName("gift_end_time")
|
||||
private String giftEndTime;
|
||||
@SerializedName("naming_liveuid")
|
||||
@SerializedName("naming_live_id")
|
||||
private String namingLiveuid;
|
||||
@SerializedName("naming_uid")
|
||||
@SerializedName("naming_user_id")
|
||||
private String namingUid;
|
||||
@SerializedName("naming_live_name")
|
||||
private String namingLiveName;
|
||||
@@ -68,6 +71,28 @@ public class GiftNamingInfoModel extends BaseModel {
|
||||
private String namingLiveCoin;
|
||||
@SerializedName("isweek")
|
||||
private String isweek;
|
||||
@JSONField(name = "naming_user_gift_hall_rank_hide")
|
||||
@SerializedName("naming_user_gift_hall_rank_hide")
|
||||
private int naming_user_gift_hall_rank_hide;
|
||||
@JSONField(name = "naming_live_gift_hall_rank_hide")
|
||||
@SerializedName("naming_live_gift_hall_rank_hide")
|
||||
private int naming_live_gift_hall_rank_hide;
|
||||
|
||||
public int getNaming_user_gift_hall_rank_hide() {
|
||||
return naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setNaming_user_gift_hall_rank_hide(int naming_user_gift_hall_rank_hide) {
|
||||
this.naming_user_gift_hall_rank_hide = naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public int getNaming_live_gift_hall_rank_hide() {
|
||||
return naming_live_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setNaming_live_gift_hall_rank_hide(int naming_live_gift_hall_rank_hide) {
|
||||
this.naming_live_gift_hall_rank_hide = naming_live_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
@@ -304,6 +329,10 @@ public class GiftNamingInfoModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getNamingStatus() {
|
||||
//后端反馈 namingStatus 已经无效了,需要判断冠名主播id和冠名用户id是否为0
|
||||
if(TextUtils.equals(namingLiveuid,"0")||TextUtils.equals(namingUid,"0")){
|
||||
return "0";
|
||||
}
|
||||
return namingStatus;
|
||||
}
|
||||
|
||||
|
||||
261
common/src/main/java/com/yunbao/common/bean/GiftWallBean.java
Normal file
261
common/src/main/java/com/yunbao/common/bean/GiftWallBean.java
Normal file
@@ -0,0 +1,261 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallBean extends BaseModel {
|
||||
private IlluminateData illuminate_data;
|
||||
private int gift_hall_rank_hide;
|
||||
|
||||
|
||||
public GiftWallBean() {
|
||||
}
|
||||
|
||||
public IlluminateData getIlluminate_data() {
|
||||
return illuminate_data;
|
||||
}
|
||||
|
||||
public void setIlluminate_data(IlluminateData illuminate_data) {
|
||||
this.illuminate_data = illuminate_data;
|
||||
}
|
||||
|
||||
public int getGift_hall_rank_hide() {
|
||||
return gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setGift_hall_rank_hide(int gift_hall_rank_hide) {
|
||||
this.gift_hall_rank_hide = gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public static class IlluminateData {
|
||||
private List<Gift> week_star_data;
|
||||
private List<Gift> gift_data;
|
||||
private int week_gift_illuminate_num;
|
||||
private int week_star_gift_num;
|
||||
private int gift_illuminate_num;
|
||||
private int gift_num;
|
||||
private String gift_hall_start_date;
|
||||
private String gift_hall_end_date;
|
||||
|
||||
|
||||
public IlluminateData() {
|
||||
}
|
||||
|
||||
public String getGift_hall_start_date() {
|
||||
if (!StringUtil.isEmpty("gift_hall_start_date")) {
|
||||
gift_hall_start_date = gift_hall_start_date.replace("-", "/");
|
||||
}
|
||||
return gift_hall_start_date;
|
||||
}
|
||||
|
||||
public void setGift_hall_start_date(String gift_hall_start_date) {
|
||||
this.gift_hall_start_date = gift_hall_start_date;
|
||||
}
|
||||
|
||||
public String getGift_hall_end_date() {
|
||||
if (!StringUtil.isEmpty("gift_hall_end_date")) {
|
||||
gift_hall_end_date = gift_hall_end_date.replace("-", "/");
|
||||
}
|
||||
return gift_hall_end_date;
|
||||
}
|
||||
|
||||
public void setGift_hall_end_date(String gift_hall_end_date) {
|
||||
this.gift_hall_end_date = gift_hall_end_date;
|
||||
}
|
||||
|
||||
public List<Gift> getWeek_star_data() {
|
||||
return week_star_data;
|
||||
}
|
||||
|
||||
public void setWeek_star_data(List<Gift> week_star_data) {
|
||||
this.week_star_data = week_star_data;
|
||||
}
|
||||
|
||||
public List<Gift> getGift_data() {
|
||||
return gift_data;
|
||||
}
|
||||
|
||||
public void setGift_data(List<Gift> gift_data) {
|
||||
this.gift_data = gift_data;
|
||||
}
|
||||
|
||||
public int getWeek_gift_illuminate_num() {
|
||||
return week_gift_illuminate_num;
|
||||
}
|
||||
|
||||
public void setWeek_gift_illuminate_num(int week_gift_illuminate_num) {
|
||||
this.week_gift_illuminate_num = week_gift_illuminate_num;
|
||||
}
|
||||
|
||||
public int getWeek_star_gift_num() {
|
||||
return week_star_gift_num;
|
||||
}
|
||||
|
||||
public void setWeek_star_gift_num(int week_star_gift_num) {
|
||||
this.week_star_gift_num = week_star_gift_num;
|
||||
}
|
||||
|
||||
public int getGift_illuminate_num() {
|
||||
return gift_illuminate_num;
|
||||
}
|
||||
|
||||
public void setGift_illuminate_num(int gift_illuminate_num) {
|
||||
this.gift_illuminate_num = gift_illuminate_num;
|
||||
}
|
||||
|
||||
public int getGift_num() {
|
||||
return gift_num;
|
||||
}
|
||||
|
||||
public void setGift_num(int gift_num) {
|
||||
this.gift_num = gift_num;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Gift {
|
||||
private int gift_id;
|
||||
private int sendtype;
|
||||
private String gift_name;
|
||||
private long need_coin; // 注意:这里可能需要更改为long类型,因为666666超过了int的最大值
|
||||
private String gift_icon;
|
||||
private int week_start_level;
|
||||
private int illuminate_num;
|
||||
private int gift_hall_type;
|
||||
private String gift_name_en;
|
||||
private String gift_hall_start; // 使用Java 8的LocalDate来处理日期
|
||||
private String gift_hall_end;
|
||||
private int gift_hall_send_num;
|
||||
private int illuminate_status;
|
||||
private long needcoin_total;
|
||||
|
||||
public Gift() {
|
||||
}
|
||||
|
||||
public String getGift_hall_start() {
|
||||
if (!StringUtil.isEmpty(gift_hall_start)) {
|
||||
gift_hall_start = gift_hall_start.replace("-", "/");
|
||||
}
|
||||
return gift_hall_start;
|
||||
}
|
||||
|
||||
public String getGift_hall_end() {
|
||||
if (!StringUtil.isEmpty(gift_hall_end)) {
|
||||
gift_hall_end = gift_hall_end.replace("-", "/");
|
||||
}
|
||||
return gift_hall_end;
|
||||
}
|
||||
|
||||
public int getGift_id() {
|
||||
return gift_id;
|
||||
}
|
||||
|
||||
public void setGift_id(int gift_id) {
|
||||
this.gift_id = gift_id;
|
||||
}
|
||||
|
||||
public int getSendtype() {
|
||||
return sendtype;
|
||||
}
|
||||
|
||||
public void setSendtype(int sendtype) {
|
||||
this.sendtype = sendtype;
|
||||
}
|
||||
|
||||
public String getGift_name() {
|
||||
return gift_name;
|
||||
}
|
||||
|
||||
public void setGift_name(String gift_name) {
|
||||
this.gift_name = gift_name;
|
||||
}
|
||||
|
||||
public long getNeed_coin() {
|
||||
return need_coin;
|
||||
}
|
||||
|
||||
public void setNeed_coin(long need_coin) {
|
||||
this.need_coin = need_coin;
|
||||
}
|
||||
|
||||
public String getGift_icon() {
|
||||
return gift_icon;
|
||||
}
|
||||
|
||||
public void setGift_icon(String gift_icon) {
|
||||
this.gift_icon = gift_icon;
|
||||
}
|
||||
|
||||
public int getWeek_start_level() {
|
||||
return week_start_level;
|
||||
}
|
||||
|
||||
public void setWeek_start_level(int week_start_level) {
|
||||
this.week_start_level = week_start_level;
|
||||
}
|
||||
|
||||
public int getIlluminate_num() {
|
||||
return illuminate_num;
|
||||
}
|
||||
|
||||
public void setIlluminate_num(int illuminate_num) {
|
||||
this.illuminate_num = illuminate_num;
|
||||
}
|
||||
|
||||
public int getGift_hall_type() {
|
||||
return gift_hall_type;
|
||||
}
|
||||
|
||||
public void setGift_hall_type(int gift_hall_type) {
|
||||
this.gift_hall_type = gift_hall_type;
|
||||
}
|
||||
|
||||
public String getGift_name_en() {
|
||||
return gift_name_en;
|
||||
}
|
||||
|
||||
public void setGift_name_en(String gift_name_en) {
|
||||
this.gift_name_en = gift_name_en;
|
||||
}
|
||||
|
||||
public void setGift_hall_start(String gift_hall_start) {
|
||||
this.gift_hall_start = gift_hall_start;
|
||||
}
|
||||
|
||||
|
||||
public void setGift_hall_end(String gift_hall_end) {
|
||||
this.gift_hall_end = gift_hall_end;
|
||||
}
|
||||
|
||||
public int getGift_hall_send_num() {
|
||||
return gift_hall_send_num;
|
||||
}
|
||||
|
||||
public String getGift_hall_send_numForString() {
|
||||
if (gift_hall_send_num > 999) {
|
||||
return "999+";
|
||||
}
|
||||
return gift_hall_send_num + "";
|
||||
}
|
||||
|
||||
public void setGift_hall_send_num(int gift_hall_send_num) {
|
||||
this.gift_hall_send_num = gift_hall_send_num;
|
||||
}
|
||||
|
||||
public int getIlluminate_status() {
|
||||
return illuminate_status;
|
||||
}
|
||||
|
||||
public void setIlluminate_status(int illuminate_status) {
|
||||
this.illuminate_status = illuminate_status;
|
||||
}
|
||||
|
||||
public long getNeedcoin_total() {
|
||||
return needcoin_total;
|
||||
}
|
||||
|
||||
public void setNeedcoin_total(long needcoin_total) {
|
||||
this.needcoin_total = needcoin_total;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallForUserBean extends BaseModel {
|
||||
private List<Gift> illuminate_data;
|
||||
private int active_rank_hide;
|
||||
|
||||
public GiftWallForUserBean() {
|
||||
}
|
||||
|
||||
public List<Gift> getIlluminate_data() {
|
||||
return illuminate_data;
|
||||
}
|
||||
|
||||
public void setIlluminate_data(List<Gift> illuminate_data) {
|
||||
this.illuminate_data = illuminate_data;
|
||||
}
|
||||
|
||||
public int getActive_rank_hide() {
|
||||
return active_rank_hide;
|
||||
}
|
||||
|
||||
public void setActive_rank_hide(int active_rank_hide) {
|
||||
this.active_rank_hide = active_rank_hide;
|
||||
}
|
||||
|
||||
public static class Gift {
|
||||
private String giftname;
|
||||
private String giftname_en;
|
||||
private String gifticon;
|
||||
private int needcoin;
|
||||
private int needcoin_total;
|
||||
private int gift_hall_send_num;
|
||||
private int illuminate_status;
|
||||
private int gift_id;
|
||||
private int id;
|
||||
|
||||
public Gift() {
|
||||
}
|
||||
|
||||
public String getGiftname() {
|
||||
return giftname;
|
||||
}
|
||||
|
||||
public void setGiftname(String giftname) {
|
||||
this.giftname = giftname;
|
||||
}
|
||||
|
||||
public String getGiftname_en() {
|
||||
return giftname_en;
|
||||
}
|
||||
|
||||
public void setGiftname_en(String giftname_en) {
|
||||
this.giftname_en = giftname_en;
|
||||
}
|
||||
|
||||
public String getGifticon() {
|
||||
return gifticon;
|
||||
}
|
||||
|
||||
public void setGifticon(String gifticon) {
|
||||
this.gifticon = gifticon;
|
||||
}
|
||||
|
||||
public int getNeedcoin() {
|
||||
return needcoin;
|
||||
}
|
||||
|
||||
public void setNeedcoin(int needcoin) {
|
||||
this.needcoin = needcoin;
|
||||
}
|
||||
|
||||
public int getNeedcoin_total() {
|
||||
return needcoin_total;
|
||||
}
|
||||
|
||||
public void setNeedcoin_total(int needcoin_total) {
|
||||
this.needcoin_total = needcoin_total;
|
||||
}
|
||||
|
||||
public int getGift_hall_send_num() {
|
||||
return gift_hall_send_num;
|
||||
}
|
||||
|
||||
public void setGift_hall_send_num(int gift_hall_send_num) {
|
||||
this.gift_hall_send_num = gift_hall_send_num;
|
||||
}
|
||||
|
||||
public int getIlluminate_status() {
|
||||
return illuminate_status;
|
||||
}
|
||||
|
||||
public void setIlluminate_status(int illuminate_status) {
|
||||
this.illuminate_status = illuminate_status;
|
||||
}
|
||||
|
||||
public int getGift_id() {
|
||||
return gift_id;
|
||||
}
|
||||
|
||||
public void setGift_id(int gift_id) {
|
||||
this.gift_id = gift_id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallInfoBean extends BaseModel {
|
||||
@SerializedName("gift_info")
|
||||
private GiftInfo gift_info;
|
||||
@SerializedName("data")
|
||||
private List<Data> data;
|
||||
@SerializedName("is_me")
|
||||
private int is_me;
|
||||
|
||||
// 一般情况下,我们会添加getter和setter方法,但根据你的要求,这里省略
|
||||
|
||||
|
||||
@JSONField(name = "gift_info")
|
||||
public GiftInfo getGift_info() {
|
||||
return gift_info;
|
||||
}
|
||||
|
||||
@JSONField(name = "gift_info")
|
||||
public void setGift_info(GiftInfo gift_info) {
|
||||
this.gift_info = gift_info;
|
||||
}
|
||||
|
||||
@JSONField(name = "data")
|
||||
public List<Data> getData() {
|
||||
/* if (data == null || data.isEmpty()) {
|
||||
data = new ArrayList<>();
|
||||
for (int i = 0; i < 20; i++) {
|
||||
Data item = new Data();
|
||||
item.setId(i);
|
||||
item.setActive_rank_hide(i % 4 == 0 ? 0 : 1);
|
||||
item.setUser_name("用户:" + i);
|
||||
item.setGift_hall_send_num(RandomUtil.nextInt(100000));
|
||||
item.setAvatar("https://downs.yaoulive.com/manfive.png");
|
||||
data.add(item);
|
||||
}
|
||||
}*/
|
||||
return data;
|
||||
}
|
||||
|
||||
@JSONField(name = "data")
|
||||
public void setData(List<Data> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getIs_me() {
|
||||
return is_me;
|
||||
}
|
||||
|
||||
public void setIs_me(int is_me) {
|
||||
this.is_me = is_me;
|
||||
}
|
||||
|
||||
// 嵌套类:GiftInfo
|
||||
public static class GiftInfo {
|
||||
@SerializedName("gift_name")
|
||||
private String giftname;
|
||||
@SerializedName("gift_name_en")
|
||||
private String giftname_en;
|
||||
@SerializedName("gift_icon")
|
||||
private String gifticon;
|
||||
@SerializedName("need_coin")
|
||||
private int needcoin;
|
||||
@SerializedName("needcoin_total")
|
||||
private String needcoin_total;
|
||||
@SerializedName("gift_hall_send_num")
|
||||
private String gift_hall_send_num;
|
||||
@SerializedName("illuminate_num")
|
||||
private int illuminate_num;
|
||||
@SerializedName("illuminate_status")
|
||||
private int illuminate_status;
|
||||
@SerializedName("gift_id")
|
||||
private int gift_id;
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("gift_hall_start_date")
|
||||
private String gift_hall_start; // 使用Java 8的LocalDate来处理日期
|
||||
@SerializedName("gift_hall_end_date")
|
||||
private String gift_hall_end;
|
||||
@SerializedName("user_gift_hall_send_num")
|
||||
private int user_gift_hall_send_num;
|
||||
@SerializedName("gift_status")
|
||||
private int gift_status;
|
||||
@SerializedName("sendtype")
|
||||
private int sendtype;//0默认钻石购买,1金币购买
|
||||
|
||||
public int getSendtype() {
|
||||
return sendtype;
|
||||
}
|
||||
|
||||
public void setSendtype(int sendtype) {
|
||||
this.sendtype = sendtype;
|
||||
}
|
||||
|
||||
public int getGift_status() {
|
||||
return gift_status;
|
||||
}
|
||||
|
||||
public void setGift_status(int gift_status) {
|
||||
this.gift_status = gift_status;
|
||||
}
|
||||
|
||||
public int getUser_gift_hall_send_num() {
|
||||
return user_gift_hall_send_num;
|
||||
}
|
||||
|
||||
public void setUser_gift_hall_send_num(int user_gift_hall_send_num) {
|
||||
this.user_gift_hall_send_num = user_gift_hall_send_num;
|
||||
}
|
||||
|
||||
@JSONField(name = "gift_hall_start_date")
|
||||
public void setGift_hall_start(String gift_hall_start) {
|
||||
this.gift_hall_start = gift_hall_start;
|
||||
}
|
||||
@JSONField(name = "gift_hall_start_date")
|
||||
public String getGift_hall_start() {
|
||||
if(!StringUtil.isEmpty(gift_hall_start)){
|
||||
gift_hall_start=gift_hall_start.replace("-","/");
|
||||
}
|
||||
return gift_hall_start;
|
||||
}
|
||||
@JSONField(name = "gift_hall_end_date")
|
||||
public String getGift_hall_end() {
|
||||
if(!StringUtil.isEmpty(gift_hall_end)){
|
||||
gift_hall_end=gift_hall_end.replace("-","/");
|
||||
}
|
||||
return gift_hall_end;
|
||||
}
|
||||
|
||||
public void setGift_hall_end(String gift_hall_end) {
|
||||
this.gift_hall_end = gift_hall_end;
|
||||
}
|
||||
|
||||
// 同样地,这里省略getter和setter方法
|
||||
|
||||
public String getGiftname() {
|
||||
return giftname;
|
||||
}
|
||||
|
||||
public void setGiftname(String giftname) {
|
||||
this.giftname = giftname;
|
||||
}
|
||||
|
||||
public String getGiftname_en() {
|
||||
return giftname_en;
|
||||
}
|
||||
|
||||
public void setGiftname_en(String giftname_en) {
|
||||
this.giftname_en = giftname_en;
|
||||
}
|
||||
|
||||
public String getGifticon() {
|
||||
return gifticon;
|
||||
}
|
||||
|
||||
public void setGifticon(String gifticon) {
|
||||
this.gifticon = gifticon;
|
||||
}
|
||||
|
||||
public int getNeedcoin() {
|
||||
return needcoin;
|
||||
}
|
||||
|
||||
public void setNeedcoin(int needcoin) {
|
||||
this.needcoin = needcoin;
|
||||
}
|
||||
|
||||
public String getNeedcoin_total() {
|
||||
return needcoin_total;
|
||||
}
|
||||
|
||||
public void setNeedcoin_total(String needcoin_total) {
|
||||
this.needcoin_total = needcoin_total;
|
||||
}
|
||||
|
||||
public int getIlluminate_num() {
|
||||
return illuminate_num;
|
||||
}
|
||||
|
||||
public void setIlluminate_num(int illuminate_num) {
|
||||
this.illuminate_num = illuminate_num;
|
||||
}
|
||||
|
||||
public String getGift_hall_send_num() {
|
||||
if (StringUtil.isEmpty(gift_hall_send_num)) {
|
||||
gift_hall_send_num = "0";
|
||||
}
|
||||
return gift_hall_send_num;
|
||||
}
|
||||
|
||||
public void setGift_hall_send_num(String gift_hall_send_num) {
|
||||
this.gift_hall_send_num = gift_hall_send_num;
|
||||
}
|
||||
|
||||
public int getIlluminate_status() {
|
||||
return illuminate_status;
|
||||
}
|
||||
|
||||
public void setIlluminate_status(int illuminate_status) {
|
||||
this.illuminate_status = illuminate_status;
|
||||
}
|
||||
|
||||
public int getGift_id() {
|
||||
return gift_id;
|
||||
}
|
||||
|
||||
public void setGift_id(int gift_id) {
|
||||
this.gift_id = gift_id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
// 嵌套类:Data
|
||||
public static class Data {
|
||||
private int gift_hall_send_num;
|
||||
private String user_name;
|
||||
private String avatar;
|
||||
String user_id;
|
||||
private int id;
|
||||
private int gift_hall_rank_hide;
|
||||
private String create_time;
|
||||
private String live_id;
|
||||
private String live_user_name;
|
||||
private String live_avatar;
|
||||
|
||||
|
||||
// 同样地,这里省略getter和setter方法
|
||||
|
||||
public String getUser_id() {
|
||||
if(StringUtil.isEmpty(user_id)){
|
||||
return "0";
|
||||
}
|
||||
return user_id;
|
||||
}
|
||||
|
||||
public void setUser_id(String user_id) {
|
||||
this.user_id = user_id;
|
||||
}
|
||||
|
||||
public String getLive_id() {
|
||||
return live_id;
|
||||
}
|
||||
|
||||
public void setLive_id(String live_id) {
|
||||
this.live_id = live_id;
|
||||
}
|
||||
|
||||
public String getLive_user_name() {
|
||||
return live_user_name;
|
||||
}
|
||||
|
||||
public void setLive_user_name(String live_user_name) {
|
||||
this.live_user_name = live_user_name;
|
||||
}
|
||||
|
||||
public String getLive_avatar() {
|
||||
return live_avatar;
|
||||
}
|
||||
|
||||
public void setLive_avatar(String live_avatar) {
|
||||
this.live_avatar = live_avatar;
|
||||
}
|
||||
|
||||
public int getGift_hall_send_num() {
|
||||
return gift_hall_send_num;
|
||||
}
|
||||
public String getGift_hall_send_numForString() {
|
||||
if(gift_hall_send_num>999999){
|
||||
return "999999+";
|
||||
}else{
|
||||
return String.valueOf(gift_hall_send_num);
|
||||
}
|
||||
}
|
||||
public void setGift_hall_send_num(int gift_hall_send_num) {
|
||||
this.gift_hall_send_num = gift_hall_send_num;
|
||||
}
|
||||
|
||||
public String getUser_name() {
|
||||
return user_name;
|
||||
}
|
||||
|
||||
public void setUser_name(String user_name) {
|
||||
this.user_name = user_name;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getGift_hall_rank_hide() {
|
||||
return gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setGift_hall_rank_hide(int gift_hall_rank_hide) {
|
||||
this.gift_hall_rank_hide = gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public String getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(String create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
|
||||
@SerializedName("gift_info")
|
||||
private GiftInfo giftInfo;
|
||||
|
||||
@SerializedName("data")
|
||||
private List<GiftData> data;
|
||||
|
||||
@SerializedName("is_me")
|
||||
private int isMe;
|
||||
|
||||
// 如果需要,可以添加无参构造器、getter和setter(这里省略)
|
||||
|
||||
public GiftInfo getGiftInfo() {
|
||||
return giftInfo;
|
||||
}
|
||||
|
||||
public void setGiftInfo(GiftInfo giftInfo) {
|
||||
this.giftInfo = giftInfo;
|
||||
}
|
||||
|
||||
public List<GiftData> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<GiftData> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getIsMe() {
|
||||
return isMe;
|
||||
}
|
||||
|
||||
public void setIsMe(int isMe) {
|
||||
this.isMe = isMe;
|
||||
}
|
||||
|
||||
// 内部类:GiftInfo
|
||||
public static class GiftInfo {
|
||||
|
||||
@SerializedName("gift_id")
|
||||
private int giftId;
|
||||
|
||||
@SerializedName("sendtype")
|
||||
private int sendType;
|
||||
|
||||
@SerializedName("gift_name")
|
||||
private String giftName;
|
||||
|
||||
@SerializedName("need_coin")
|
||||
private int needCoin;
|
||||
|
||||
@SerializedName("gift_icon")
|
||||
private String giftIcon;
|
||||
|
||||
@SerializedName("week_star_level")
|
||||
private int weekStarLevel;
|
||||
|
||||
@SerializedName("illuminate_num")
|
||||
private int illuminateNum;
|
||||
|
||||
@SerializedName("gift_hall_type")
|
||||
private int giftHallType;
|
||||
|
||||
@SerializedName("gift_name_en")
|
||||
private String giftNameEn;
|
||||
|
||||
@SerializedName("gift_hall_start")
|
||||
private String giftHallStart;
|
||||
|
||||
@SerializedName("gift_hall_end")
|
||||
private String giftHallEnd;
|
||||
|
||||
@SerializedName("gift_hall_start_date")
|
||||
private String giftHallStartDate;
|
||||
|
||||
@SerializedName("gift_hall_end_date")
|
||||
private String giftHallEndDate;
|
||||
|
||||
@SerializedName("user_gift_hall_send_num")
|
||||
private int userGiftHallSendNum;
|
||||
|
||||
@SerializedName("needcoin_total")
|
||||
private int needcoinTotal;
|
||||
|
||||
@SerializedName("gift_hall_send_num")
|
||||
private int giftHallSendNum;
|
||||
|
||||
@SerializedName("illuminate_status")
|
||||
private int illuminateStatus;
|
||||
|
||||
@SerializedName("naming_live_id")
|
||||
private int namingLiveId;
|
||||
|
||||
@SerializedName("naming_live_nicename")
|
||||
private String namingLiveNicename;
|
||||
|
||||
@SerializedName("naming_live_avatar")
|
||||
private String namingLiveAvatar;
|
||||
|
||||
@SerializedName("naming_live_gift_hall_rank_hide")
|
||||
private int namingLiveActiveRankHide;
|
||||
|
||||
@SerializedName("naming_user_id")
|
||||
private int namingUserId;
|
||||
|
||||
@SerializedName("naming_user_nicename")
|
||||
private String namingUserNicename;
|
||||
|
||||
@SerializedName("naming_user_avatar")
|
||||
private String namingUserAvatar;
|
||||
|
||||
@SerializedName("naming_user_gift_hall_rank_hide")
|
||||
private int namingUserActiveRankHide;
|
||||
|
||||
// 如果需要,可以添加无参构造器、getter和setter(这里省略)
|
||||
|
||||
public int getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(int giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public int getSendType() {
|
||||
return sendType;
|
||||
}
|
||||
|
||||
public void setSendType(int sendType) {
|
||||
this.sendType = sendType;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public void setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
}
|
||||
|
||||
public int getNeedCoin() {
|
||||
return needCoin;
|
||||
}
|
||||
|
||||
public void setNeedCoin(int needCoin) {
|
||||
this.needCoin = needCoin;
|
||||
}
|
||||
|
||||
public String getGiftIcon() {
|
||||
return giftIcon;
|
||||
}
|
||||
|
||||
public void setGiftIcon(String giftIcon) {
|
||||
this.giftIcon = giftIcon;
|
||||
}
|
||||
|
||||
public int getWeekStarLevel() {
|
||||
return weekStarLevel;
|
||||
}
|
||||
|
||||
public void setWeekStarLevel(int weekStarLevel) {
|
||||
this.weekStarLevel = weekStarLevel;
|
||||
}
|
||||
|
||||
public int getIlluminateNum() {
|
||||
return illuminateNum;
|
||||
}
|
||||
|
||||
public void setIlluminateNum(int illuminateNum) {
|
||||
this.illuminateNum = illuminateNum;
|
||||
}
|
||||
|
||||
public int getGiftHallType() {
|
||||
return giftHallType;
|
||||
}
|
||||
|
||||
public void setGiftHallType(int giftHallType) {
|
||||
this.giftHallType = giftHallType;
|
||||
}
|
||||
|
||||
public String getGiftNameEn() {
|
||||
return giftNameEn;
|
||||
}
|
||||
|
||||
public void setGiftNameEn(String giftNameEn) {
|
||||
this.giftNameEn = giftNameEn;
|
||||
}
|
||||
|
||||
public String getGiftHallStart() {
|
||||
return giftHallStart;
|
||||
}
|
||||
|
||||
public void setGiftHallStart(String giftHallStart) {
|
||||
this.giftHallStart = giftHallStart;
|
||||
}
|
||||
|
||||
public String getGiftHallEnd() {
|
||||
return giftHallEnd;
|
||||
}
|
||||
|
||||
public void setGiftHallEnd(String giftHallEnd) {
|
||||
this.giftHallEnd = giftHallEnd;
|
||||
}
|
||||
|
||||
public String getGiftHallStartDate() {
|
||||
return giftHallStartDate;
|
||||
}
|
||||
|
||||
public void setGiftHallStartDate(String giftHallStartDate) {
|
||||
this.giftHallStartDate = giftHallStartDate;
|
||||
}
|
||||
|
||||
public String getGiftHallEndDate() {
|
||||
return giftHallEndDate;
|
||||
}
|
||||
|
||||
public void setGiftHallEndDate(String giftHallEndDate) {
|
||||
this.giftHallEndDate = giftHallEndDate;
|
||||
}
|
||||
|
||||
public int getUserGiftHallSendNum() {
|
||||
return userGiftHallSendNum;
|
||||
}
|
||||
|
||||
public void setUserGiftHallSendNum(int userGiftHallSendNum) {
|
||||
this.userGiftHallSendNum = userGiftHallSendNum;
|
||||
}
|
||||
|
||||
public int getNeedcoinTotal() {
|
||||
return needcoinTotal;
|
||||
}
|
||||
|
||||
public void setNeedcoinTotal(int needcoinTotal) {
|
||||
this.needcoinTotal = needcoinTotal;
|
||||
}
|
||||
|
||||
public int getGiftHallSendNum() {
|
||||
return giftHallSendNum;
|
||||
}
|
||||
|
||||
public void setGiftHallSendNum(int giftHallSendNum) {
|
||||
this.giftHallSendNum = giftHallSendNum;
|
||||
}
|
||||
|
||||
public int getIlluminateStatus() {
|
||||
return illuminateStatus;
|
||||
}
|
||||
|
||||
public void setIlluminateStatus(int illuminateStatus) {
|
||||
this.illuminateStatus = illuminateStatus;
|
||||
}
|
||||
|
||||
public int getNamingLiveId() {
|
||||
return namingLiveId;
|
||||
}
|
||||
|
||||
public void setNamingLiveId(int namingLiveId) {
|
||||
this.namingLiveId = namingLiveId;
|
||||
}
|
||||
|
||||
public String getNamingLiveNicename() {
|
||||
return namingLiveNicename;
|
||||
}
|
||||
|
||||
public void setNamingLiveNicename(String namingLiveNicename) {
|
||||
this.namingLiveNicename = namingLiveNicename;
|
||||
}
|
||||
|
||||
public String getNamingLiveAvatar() {
|
||||
return namingLiveAvatar;
|
||||
}
|
||||
|
||||
public void setNamingLiveAvatar(String namingLiveAvatar) {
|
||||
this.namingLiveAvatar = namingLiveAvatar;
|
||||
}
|
||||
|
||||
public int getNamingLiveActiveRankHide() {
|
||||
return namingLiveActiveRankHide;
|
||||
}
|
||||
|
||||
public void setNamingLiveActiveRankHide(int namingLiveActiveRankHide) {
|
||||
this.namingLiveActiveRankHide = namingLiveActiveRankHide;
|
||||
}
|
||||
|
||||
public int getNamingUserId() {
|
||||
return namingUserId;
|
||||
}
|
||||
|
||||
public void setNamingUserId(int namingUserId) {
|
||||
this.namingUserId = namingUserId;
|
||||
}
|
||||
|
||||
public String getNamingUserNicename() {
|
||||
return namingUserNicename;
|
||||
}
|
||||
|
||||
public void setNamingUserNicename(String namingUserNicename) {
|
||||
this.namingUserNicename = namingUserNicename;
|
||||
}
|
||||
|
||||
public String getNamingUserAvatar() {
|
||||
return namingUserAvatar;
|
||||
}
|
||||
|
||||
public void setNamingUserAvatar(String namingUserAvatar) {
|
||||
this.namingUserAvatar = namingUserAvatar;
|
||||
}
|
||||
|
||||
public int getNamingUserActiveRankHide() {
|
||||
return namingUserActiveRankHide;
|
||||
}
|
||||
|
||||
public void setNamingUserActiveRankHide(int namingUserActiveRankHide) {
|
||||
this.namingUserActiveRankHide = namingUserActiveRankHide;
|
||||
}
|
||||
}
|
||||
|
||||
// 内部类:GiftData
|
||||
public static class GiftData {
|
||||
|
||||
@SerializedName("gift_hall_send_num")
|
||||
private int giftHallSendNum;
|
||||
|
||||
@SerializedName("live_id")
|
||||
private int liveId;
|
||||
|
||||
@SerializedName("live_user_name")
|
||||
private String liveUserName;
|
||||
|
||||
@SerializedName("live_avatar")
|
||||
private String liveAvatar;
|
||||
|
||||
@SerializedName("user_name")
|
||||
private String userName;
|
||||
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
|
||||
@SerializedName("user_id")
|
||||
private String userId;
|
||||
|
||||
@SerializedName("active_rank_hide")
|
||||
private int activeRankHide;
|
||||
|
||||
@SerializedName("create_time")
|
||||
private String createTime;
|
||||
@SerializedName("naming_user_gift_hall_rank_hide")
|
||||
private int naming_user_gift_hall_rank_hide;
|
||||
|
||||
// 如果需要,可以添加无参构造器、getter和setter(这里省略)
|
||||
|
||||
public int getNaming_user_gift_hall_rank_hide() {
|
||||
return naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setNaming_user_gift_hall_rank_hide(int naming_user_gift_hall_rank_hide) {
|
||||
this.naming_user_gift_hall_rank_hide = naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public int getGiftHallSendNum() {
|
||||
return giftHallSendNum;
|
||||
}
|
||||
public String getGiftHallSendNumForString() {
|
||||
if(giftHallSendNum>999999){
|
||||
return "999999+";
|
||||
}
|
||||
return giftHallSendNum+"";
|
||||
}
|
||||
|
||||
public void setGiftHallSendNum(int giftHallSendNum) {
|
||||
this.giftHallSendNum = giftHallSendNum;
|
||||
}
|
||||
|
||||
public int getLiveId() {
|
||||
return liveId;
|
||||
}
|
||||
|
||||
public void setLiveId(int liveId) {
|
||||
this.liveId = liveId;
|
||||
}
|
||||
|
||||
public String getLiveUserName() {
|
||||
return liveUserName;
|
||||
}
|
||||
|
||||
public void setLiveUserName(String liveUserName) {
|
||||
this.liveUserName = liveUserName;
|
||||
}
|
||||
|
||||
public String getLiveAvatar() {
|
||||
return liveAvatar;
|
||||
}
|
||||
|
||||
public void setLiveAvatar(String liveAvatar) {
|
||||
this.liveAvatar = liveAvatar;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
if(StringUtil.isEmpty(userId)){
|
||||
return "0";
|
||||
}
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getActiveRankHide() {
|
||||
return activeRankHide;
|
||||
}
|
||||
|
||||
public void setActiveRankHide(int activeRankHide) {
|
||||
this.activeRankHide = activeRankHide;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWallTab2Bean extends BaseModel{
|
||||
|
||||
|
||||
@SerializedName("illuminate_data")
|
||||
private IlluminateData illuminateData;
|
||||
@SerializedName("gift_hall_start_date")
|
||||
private String gift_hall_start_date;
|
||||
@SerializedName("gift_hall_end_date")
|
||||
private String gift_hall_end_date;
|
||||
|
||||
public GiftWallTab2Bean() {
|
||||
}
|
||||
|
||||
public IlluminateData getIlluminateData() {
|
||||
return illuminateData;
|
||||
}
|
||||
|
||||
public void setIlluminateData(IlluminateData illuminateData) {
|
||||
this.illuminateData = illuminateData;
|
||||
}
|
||||
|
||||
public String getGift_hall_start_date() {
|
||||
return gift_hall_start_date;
|
||||
}
|
||||
|
||||
public void setGift_hall_start_date(String gift_hall_start_date) {
|
||||
this.gift_hall_start_date = gift_hall_start_date;
|
||||
}
|
||||
|
||||
public String getGift_hall_end_date() {
|
||||
return gift_hall_end_date;
|
||||
}
|
||||
|
||||
public void setGift_hall_end_date(String gift_hall_end_date) {
|
||||
this.gift_hall_end_date = gift_hall_end_date;
|
||||
}
|
||||
|
||||
public static class IlluminateData{
|
||||
@SerializedName("week_start_data")
|
||||
private List<Gift> weekStartData;
|
||||
@SerializedName("gift_data")
|
||||
private List<Gift> giftData;
|
||||
|
||||
public IlluminateData() {
|
||||
}
|
||||
|
||||
public List<Gift> getWeekStartData() {
|
||||
return weekStartData;
|
||||
}
|
||||
|
||||
public void setWeekStartData(List<Gift> weekStartData) {
|
||||
this.weekStartData = weekStartData;
|
||||
}
|
||||
|
||||
public List<Gift> getGiftData() {
|
||||
return giftData;
|
||||
}
|
||||
|
||||
public void setGiftData(List<Gift> giftData) {
|
||||
this.giftData = giftData;
|
||||
}
|
||||
}
|
||||
public static class Gift{
|
||||
@SerializedName("gift_id")
|
||||
public int giftId;
|
||||
|
||||
@SerializedName("sendtype")
|
||||
public int sendType;
|
||||
|
||||
@SerializedName("gift_name")
|
||||
public String giftName;
|
||||
|
||||
@SerializedName("need_coin")
|
||||
public int needCoin;
|
||||
|
||||
@SerializedName("gift_icon")
|
||||
public String giftIcon;
|
||||
|
||||
@SerializedName("week_star_level")
|
||||
public int weekStarLevel;
|
||||
|
||||
@SerializedName("illuminate_num")
|
||||
public int illuminateNum;
|
||||
|
||||
@SerializedName("gift_hall_type")
|
||||
public int giftHallType;
|
||||
|
||||
@SerializedName("gift_name_en")
|
||||
public String giftNameEn;
|
||||
|
||||
@SerializedName("gift_hall_start")
|
||||
public String giftHallStart;
|
||||
|
||||
@SerializedName("gift_hall_end")
|
||||
public String giftHallEnd;
|
||||
|
||||
@SerializedName("naming_live_id")
|
||||
public int namingLiveId;
|
||||
|
||||
@SerializedName("naming_live_nicename")
|
||||
public String namingLiveNicename;
|
||||
|
||||
@SerializedName("gift_hall_send_num")
|
||||
public int giftHallSendNum;
|
||||
|
||||
@SerializedName("naming_live_avatar")
|
||||
public String namingLiveAvatar;
|
||||
|
||||
@SerializedName("naming_live_active_rank_hide")
|
||||
public int namingLiveActiveRankHide;
|
||||
|
||||
@SerializedName("illuminate_status")
|
||||
public int illuminateStatus;
|
||||
|
||||
@SerializedName("naming_user_id")
|
||||
public int namingUserId;
|
||||
|
||||
@SerializedName("naming_user_nicename")
|
||||
public String namingUserNicename;
|
||||
|
||||
@SerializedName("naming_user_avatar")
|
||||
public String namingUserAvatar;
|
||||
|
||||
@SerializedName("naming_user_gift_hall_rank_hide")
|
||||
public int namingUserActiveRankHide;
|
||||
|
||||
@SerializedName("needcoin_total")
|
||||
public long needCoinTotal;
|
||||
|
||||
public int getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(int giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public int getSendType() {
|
||||
return sendType;
|
||||
}
|
||||
|
||||
public void setSendType(int sendType) {
|
||||
this.sendType = sendType;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public void setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
}
|
||||
|
||||
public int getNeedCoin() {
|
||||
return needCoin;
|
||||
}
|
||||
|
||||
public void setNeedCoin(int needCoin) {
|
||||
this.needCoin = needCoin;
|
||||
}
|
||||
|
||||
public String getGiftIcon() {
|
||||
return giftIcon;
|
||||
}
|
||||
|
||||
public void setGiftIcon(String giftIcon) {
|
||||
this.giftIcon = giftIcon;
|
||||
}
|
||||
|
||||
public int getWeekStarLevel() {
|
||||
return weekStarLevel;
|
||||
}
|
||||
|
||||
public void setWeekStarLevel(int weekStarLevel) {
|
||||
this.weekStarLevel = weekStarLevel;
|
||||
}
|
||||
|
||||
public int getIlluminateNum() {
|
||||
return illuminateNum;
|
||||
}
|
||||
|
||||
public void setIlluminateNum(int illuminateNum) {
|
||||
this.illuminateNum = illuminateNum;
|
||||
}
|
||||
|
||||
public int getGiftHallType() {
|
||||
return giftHallType;
|
||||
}
|
||||
|
||||
public void setGiftHallType(int giftHallType) {
|
||||
this.giftHallType = giftHallType;
|
||||
}
|
||||
|
||||
public String getGiftNameEn() {
|
||||
return giftNameEn;
|
||||
}
|
||||
|
||||
public void setGiftNameEn(String giftNameEn) {
|
||||
this.giftNameEn = giftNameEn;
|
||||
}
|
||||
|
||||
public String getGiftHallStart() {
|
||||
return giftHallStart;
|
||||
}
|
||||
|
||||
public void setGiftHallStart(String giftHallStart) {
|
||||
this.giftHallStart = giftHallStart;
|
||||
}
|
||||
|
||||
public String getGiftHallEnd() {
|
||||
return giftHallEnd;
|
||||
}
|
||||
|
||||
public void setGiftHallEnd(String giftHallEnd) {
|
||||
this.giftHallEnd = giftHallEnd;
|
||||
}
|
||||
|
||||
public int getNamingLiveId() {
|
||||
return namingLiveId;
|
||||
}
|
||||
|
||||
public void setNamingLiveId(int namingLiveId) {
|
||||
this.namingLiveId = namingLiveId;
|
||||
}
|
||||
|
||||
public String getNamingLiveNicename() {
|
||||
return namingLiveNicename;
|
||||
}
|
||||
|
||||
public void setNamingLiveNicename(String namingLiveNicename) {
|
||||
this.namingLiveNicename = namingLiveNicename;
|
||||
}
|
||||
|
||||
public int getGiftHallSendNum() {
|
||||
return giftHallSendNum;
|
||||
}
|
||||
|
||||
public void setGiftHallSendNum(int giftHallSendNum) {
|
||||
this.giftHallSendNum = giftHallSendNum;
|
||||
}
|
||||
|
||||
public String getNamingLiveAvatar() {
|
||||
return namingLiveAvatar;
|
||||
}
|
||||
|
||||
public void setNamingLiveAvatar(String namingLiveAvatar) {
|
||||
this.namingLiveAvatar = namingLiveAvatar;
|
||||
}
|
||||
|
||||
public int getNamingLiveActiveRankHide() {
|
||||
return namingLiveActiveRankHide;
|
||||
}
|
||||
|
||||
public void setNamingLiveActiveRankHide(int namingLiveActiveRankHide) {
|
||||
this.namingLiveActiveRankHide = namingLiveActiveRankHide;
|
||||
}
|
||||
|
||||
public int getIlluminateStatus() {
|
||||
return illuminateStatus;
|
||||
}
|
||||
|
||||
public void setIlluminateStatus(int illuminateStatus) {
|
||||
this.illuminateStatus = illuminateStatus;
|
||||
}
|
||||
|
||||
public int getNamingUserId() {
|
||||
return namingUserId;
|
||||
}
|
||||
|
||||
public void setNamingUserId(int namingUserId) {
|
||||
this.namingUserId = namingUserId;
|
||||
}
|
||||
|
||||
public String getNamingUserNicename() {
|
||||
return namingUserNicename;
|
||||
}
|
||||
|
||||
public void setNamingUserNicename(String namingUserNicename) {
|
||||
this.namingUserNicename = namingUserNicename;
|
||||
}
|
||||
|
||||
public String getNamingUserAvatar() {
|
||||
return namingUserAvatar;
|
||||
}
|
||||
|
||||
public void setNamingUserAvatar(String namingUserAvatar) {
|
||||
this.namingUserAvatar = namingUserAvatar;
|
||||
}
|
||||
|
||||
public int getNamingUserActiveRankHide() {
|
||||
return namingUserActiveRankHide;
|
||||
}
|
||||
|
||||
public void setNamingUserActiveRankHide(int namingUserActiveRankHide) {
|
||||
this.namingUserActiveRankHide = namingUserActiveRankHide;
|
||||
}
|
||||
|
||||
public long getNeedCoinTotal() {
|
||||
return needCoinTotal;
|
||||
}
|
||||
|
||||
public void setNeedCoinTotal(long needCoinTotal) {
|
||||
this.needCoinTotal = needCoinTotal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,30 @@ public class GuardPriceModel extends BaseModel {
|
||||
private String discount;
|
||||
@SerializedName("price_key")
|
||||
private int priceKey;
|
||||
@SerializedName("coupon_discount")
|
||||
private String couponDiscount;
|
||||
@SerializedName("coupon_discount_en")
|
||||
private String couponDiscountEn;
|
||||
@SerializedName("coupon_discount_price")
|
||||
private String couponDiscountPrice;
|
||||
@SerializedName("coupon_id")
|
||||
private String couponId;
|
||||
|
||||
public String getCouponDiscount() {
|
||||
return couponDiscount;
|
||||
}
|
||||
|
||||
public String getCouponId() {
|
||||
return couponId;
|
||||
}
|
||||
|
||||
public String getCouponDiscountEn() {
|
||||
return couponDiscountEn;
|
||||
}
|
||||
|
||||
public String getCouponDiscountPrice() {
|
||||
return couponDiscountPrice;
|
||||
}
|
||||
|
||||
public String getOpeningTime() {
|
||||
return openingTime;
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.annotation.NonNull;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
@@ -141,14 +142,14 @@ public class LiveAnchorCallMeModel extends BaseModel {
|
||||
|
||||
public static class AppBean {
|
||||
private String number;
|
||||
private int isShow;
|
||||
private String isShow;
|
||||
|
||||
public AppBean() {
|
||||
}
|
||||
|
||||
public AppBean(String number, int isShow) {
|
||||
this.number = number;
|
||||
this.isShow = isShow;
|
||||
this.isShow = isShow + "";
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
@@ -160,11 +161,14 @@ public class LiveAnchorCallMeModel extends BaseModel {
|
||||
}
|
||||
|
||||
public int getIsShow() {
|
||||
return isShow;
|
||||
if (StringUtil.isEmpty(isShow)) {
|
||||
return 0;
|
||||
}
|
||||
return Integer.parseInt(isShow);
|
||||
}
|
||||
|
||||
public void setIsShow(int isShow) {
|
||||
this.isShow = isShow;
|
||||
this.isShow = isShow + "";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.view.View;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/12.
|
||||
@@ -52,9 +53,9 @@ public class LiveGiftBean {
|
||||
|
||||
@JSONField(name = "operate_url")
|
||||
private String operateUrl;
|
||||
@JSONField(name = "naming_liveuid")
|
||||
@JSONField(name = "naming_live_id")
|
||||
private String namingLiveuid;
|
||||
@JSONField(name = "naming_uid")
|
||||
@JSONField(name = "naming_user_id")
|
||||
private String namingUid;
|
||||
@JSONField(name = "naming_live_name")
|
||||
private String namingLiveName;
|
||||
@@ -74,6 +75,28 @@ public class LiveGiftBean {
|
||||
private int blindBoxTicket;
|
||||
@JSONField(name = "blind_box_ticket_id")
|
||||
private int blindBoxTicketId;
|
||||
@JSONField(name = "naming_user_gift_hall_rank_hide")
|
||||
@SerializedName("naming_user_gift_hall_rank_hide")
|
||||
private int naming_user_gift_hall_rank_hide;
|
||||
@JSONField(name = "naming_live_gift_hall_rank_hide")
|
||||
@SerializedName("naming_live_gift_hall_rank_hide")
|
||||
private int naming_live_gift_hall_rank_hide;
|
||||
|
||||
public int getNaming_user_gift_hall_rank_hide() {
|
||||
return naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setNaming_user_gift_hall_rank_hide(int naming_user_gift_hall_rank_hide) {
|
||||
this.naming_user_gift_hall_rank_hide = naming_user_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public int getNaming_live_gift_hall_rank_hide() {
|
||||
return naming_live_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public void setNaming_live_gift_hall_rank_hide(int naming_live_gift_hall_rank_hide) {
|
||||
this.naming_live_gift_hall_rank_hide = naming_live_gift_hall_rank_hide;
|
||||
}
|
||||
|
||||
public boolean isPageGift() {
|
||||
return isPageGift;
|
||||
@@ -146,6 +169,9 @@ public class LiveGiftBean {
|
||||
}
|
||||
|
||||
public String getNamingUid() {
|
||||
if(StringUtil.isEmpty(namingUid)){
|
||||
namingUid="0";
|
||||
}
|
||||
return namingUid;
|
||||
}
|
||||
|
||||
@@ -288,6 +314,9 @@ public class LiveGiftBean {
|
||||
}
|
||||
|
||||
public String getSwf() {
|
||||
if(StringUtil.isEmpty(swf)){
|
||||
swf="";
|
||||
}
|
||||
return swf;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.common.bean;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -122,7 +123,7 @@ public class OpenAdModel extends BaseModel {
|
||||
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||
url = CommonAppConfig.HOST + (url.startsWith("/") ? url : "/" + url);
|
||||
}
|
||||
return url;
|
||||
return url+"&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
}
|
||||
|
||||
public String getOriginalUrl() {
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class SudGameInfoBean {
|
||||
private String uid;//玩家id
|
||||
private String nick_name;//玩家昵称
|
||||
private String avatar_url;//玩家头像
|
||||
private String gender;//玩家性别
|
||||
private int is_ai;//是否是ai
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNick_name() {
|
||||
return nick_name;
|
||||
}
|
||||
|
||||
public void setNick_name(String nick_name) {
|
||||
this.nick_name = nick_name;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public void setAvatar_url(String avatar_url) {
|
||||
this.avatar_url = avatar_url;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getIs_ai() {
|
||||
return is_ai;
|
||||
}
|
||||
|
||||
public void setIs_ai(int is_ai) {
|
||||
this.is_ai = is_ai;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SudGameInfoBean{" +
|
||||
"uid=" + uid +
|
||||
", nick_name='" + nick_name + '\'' +
|
||||
", avatar_url='" + avatar_url + '\'' +
|
||||
", gender='" + gender + '\'' +
|
||||
", is_ai=" + is_ai +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class SudGameScoreBean extends BaseModel{
|
||||
private int golden_bean_remaining_balance;//
|
||||
private int room_sill;//房间的金豆门槛
|
||||
private int room_ticket;//收取的门票费
|
||||
private int room_win_num;//赢家获得的金豆
|
||||
private int game_mode;//1.双人对战 2.多人游戏
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SudGameScoreBean{" +
|
||||
"golden_bean_remaining_balance=" + golden_bean_remaining_balance +
|
||||
", room_sill=" + room_sill +
|
||||
", room_ticket=" + room_ticket +
|
||||
", room_win_num=" + room_win_num +
|
||||
", game_mode=" + game_mode +
|
||||
'}';
|
||||
}
|
||||
|
||||
public int getGame_mode() {
|
||||
return game_mode;
|
||||
}
|
||||
|
||||
public void setGame_mode(int game_mode) {
|
||||
this.game_mode = game_mode;
|
||||
}
|
||||
|
||||
public int getGolden_bean_remaining_balance() {
|
||||
return golden_bean_remaining_balance;
|
||||
}
|
||||
|
||||
public void setGolden_bean_remaining_balance(int golden_bean_remaining_balance) {
|
||||
this.golden_bean_remaining_balance = golden_bean_remaining_balance;
|
||||
}
|
||||
|
||||
public int getRoom_sill() {
|
||||
return room_sill;
|
||||
}
|
||||
|
||||
public void setRoom_sill(int room_sill) {
|
||||
this.room_sill = room_sill;
|
||||
}
|
||||
|
||||
public int getRoom_ticket() {
|
||||
return room_ticket;
|
||||
}
|
||||
|
||||
public void setRoom_ticket(int room_ticket) {
|
||||
this.room_ticket = room_ticket;
|
||||
}
|
||||
|
||||
public int getRoom_win_num() {
|
||||
return room_win_num;
|
||||
}
|
||||
|
||||
public void setRoom_win_num(int room_win_num) {
|
||||
this.room_win_num = room_win_num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SudSettleBean {
|
||||
private String uid;//玩家id
|
||||
private String nick_name;//玩家昵称
|
||||
private String avatar_url;//玩家头像
|
||||
private int rank;//玩家排名
|
||||
private int win_num;//赢得或者失去的金豆
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNick_name() {
|
||||
return nick_name;
|
||||
}
|
||||
|
||||
public void setNick_name(String nick_name) {
|
||||
this.nick_name = nick_name;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public void setAvatar_url(String avatar_url) {
|
||||
this.avatar_url = avatar_url;
|
||||
}
|
||||
|
||||
public int getRank() {
|
||||
return rank;
|
||||
}
|
||||
|
||||
public void setRank(int rank) {
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
public int getWin_num() {
|
||||
return win_num;
|
||||
}
|
||||
|
||||
public void setWin_num(int win_num) {
|
||||
this.win_num = win_num;
|
||||
}
|
||||
|
||||
|
||||
public SudSettleBean(String uid, String nick_name, String avatar_url, int rank, int win_num) {
|
||||
this.uid = uid;
|
||||
this.nick_name = nick_name;
|
||||
this.avatar_url = avatar_url;
|
||||
this.rank = rank;
|
||||
this.win_num = win_num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SudSettleBean{" +
|
||||
"uid='" + uid + '\'' +
|
||||
", nick_name='" + nick_name + '\'' +
|
||||
", avatar_url='" + avatar_url + '\'' +
|
||||
", rank=" + rank +
|
||||
", win_num=" + win_num +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.stx.xhb.androidx.entity.BaseBannerInfo;
|
||||
|
||||
public class UserMedalModel extends BaseModel {
|
||||
public class UserMedalModel extends BaseModel implements BaseBannerInfo {
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("display_src")
|
||||
@@ -13,9 +14,26 @@ public class UserMedalModel extends BaseModel {
|
||||
private String dressDescription;
|
||||
@SerializedName("sort")
|
||||
private String sort;
|
||||
@SerializedName("use_status")
|
||||
private String use_status;
|
||||
@SerializedName("dress_status")
|
||||
private String dressStatus;
|
||||
|
||||
@SerializedName("users_dress_id")
|
||||
private String users_dress_id;
|
||||
|
||||
public String getUsersDressId() {
|
||||
return users_dress_id;
|
||||
}
|
||||
|
||||
public String getUseStatus() {
|
||||
return use_status;
|
||||
}
|
||||
|
||||
public void setUse_status(String use_status) {
|
||||
this.use_status = use_status;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -69,4 +87,14 @@ public class UserMedalModel extends BaseModel {
|
||||
this.dressStatus = dressStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getXBannerUrl() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getXBannerTitle() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.yunbao.common.custom;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.stx.xhb.androidx.transformers.BasePageTransformer;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
public class LiveGifWallAchieveWearTransformer extends BasePageTransformer {
|
||||
/**
|
||||
* author: xiaohaibin.
|
||||
* time: 2018/10/9
|
||||
* mail:xhb_199409@163.com
|
||||
* github:https://github.com/xiaohaibin
|
||||
* describe: 适用于一屏显示多个模式
|
||||
*/
|
||||
private float mMinScale = 0.85f;
|
||||
private float mMinAlpha = 1f;
|
||||
|
||||
public LiveGifWallAchieveWearTransformer() {
|
||||
}
|
||||
|
||||
public LiveGifWallAchieveWearTransformer(float minAlpha, float minScale) {
|
||||
setMinAlpha(minAlpha);
|
||||
setMinScale(minScale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleInvisiblePage(View view, float position) {
|
||||
// ViewCompat.setAlpha(view, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleLeftPage(View view, float position) {
|
||||
float scale = Math.max(mMinScale, 1 + position);
|
||||
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||
view.setTranslationX(horzMargin - vertMargin / 2);
|
||||
view.setScaleX(scale);
|
||||
view.setScaleY( scale);
|
||||
L.e("handleLeftPage scale:"+scale);
|
||||
// view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
view.setAlpha(1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleRightPage(View view, float position) {
|
||||
float scale = Math.max(mMinScale, 1 - position);
|
||||
float vertMargin = view.getHeight() * (1 - scale) / 2;
|
||||
float horzMargin = view.getWidth() * (1 - scale) / 2;
|
||||
view.setTranslationX( -horzMargin + vertMargin / 2);
|
||||
view.setScaleX( scale);
|
||||
|
||||
view.setScaleY( scale);
|
||||
L.e("handleRightPage scale:"+scale);
|
||||
// view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
|
||||
view.setAlpha(1f);
|
||||
}
|
||||
|
||||
public void setMinAlpha(float minAlpha) {
|
||||
if (minAlpha >= 0.6f && minAlpha <= 1.0f) {
|
||||
mMinAlpha = minAlpha;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMinScale(float minScale) {
|
||||
if (minScale >= 0.6f && minScale <= 1.0f) {
|
||||
mMinScale = minScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,11 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
|
||||
public abstract void buildDialog(XPopup.Builder builder);
|
||||
public abstract int bindLayoutId();
|
||||
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return bindLayoutId();
|
||||
@@ -36,4 +41,24 @@ public abstract class AbsDialogCenterPopupWindow extends CenterPopupView {
|
||||
buildDialog(builder);
|
||||
builder.asCustom(this).show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismiss监听
|
||||
*/
|
||||
private OnDismissListener onDismissListener;
|
||||
public interface OnDismissListener{
|
||||
void onDismiss();
|
||||
}
|
||||
|
||||
public void setOnDismissListener(OnDismissListener onDismissListener) {
|
||||
this.onDismissListener = onDismissListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if (onDismissListener != null){
|
||||
onDismissListener.onDismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.event.ClosePopupDialogEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
/**
|
||||
* 底部弹窗
|
||||
@@ -16,12 +21,20 @@ public abstract class AbsDialogPopupWindow extends BottomPopupView {
|
||||
public AbsDialogPopupWindow(@NonNull Context context) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
Bus.getOn(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://github.com/li-xiaojun/XPopup/wiki/5.-%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE">参考配置</a>
|
||||
*/
|
||||
public abstract void buildDialog(XPopup.Builder builder);
|
||||
|
||||
public abstract int bindLayoutId();
|
||||
|
||||
@Override
|
||||
@@ -36,4 +49,16 @@ public abstract class AbsDialogPopupWindow extends BottomPopupView {
|
||||
buildDialog(builder);
|
||||
builder.asCustom(this).show();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onWishSendGift(ClosePopupDialogEvent bean) {
|
||||
if(bean.getId()==null) {
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
if(bean.getId().equals(getTag())) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallAchieveAdapter;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.bean.UserMedalListModel;
|
||||
import com.yunbao.common.fragment.GiftWallMainTab1Fragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物墙-荣誉成就
|
||||
*/
|
||||
public class GiftWallAchieveDialog extends AbsDialogPopupWindow {
|
||||
|
||||
private ImageView mIvBg;
|
||||
private ImageView mIvBack;
|
||||
private TextView numCount;
|
||||
private boolean isFullWindows;
|
||||
private RecyclerView mRecyclerView;
|
||||
private GiftWallAchieveAdapter giftWallAchieveAdapter;
|
||||
private String toUid;
|
||||
private boolean isAnchor;
|
||||
private View topBar;
|
||||
private TextView honor;
|
||||
private ImageView top_icon;
|
||||
|
||||
private List<UserMedalListModel> userMedalListModelList = new ArrayList<>();
|
||||
|
||||
public GiftWallAchieveDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public GiftWallAchieveDialog setFullWindows(boolean fullWindows) {
|
||||
isFullWindows = fullWindows;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public GiftWallAchieveDialog setAnchor(boolean anchor) {
|
||||
isAnchor = anchor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallAchieveDialog setToUid(String toUid) {
|
||||
this.toUid = toUid;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall_achieve;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight();
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvBack = findViewById(R.id.iv_back);
|
||||
mRecyclerView = findViewById(R.id.recyclerView);
|
||||
mRecyclerView.setLayoutManager(new GridLayoutManager(mContext, 3, GridLayoutManager.VERTICAL, false));
|
||||
numCount = findViewById(R.id.numCount);
|
||||
topBar = findViewById(R.id.top_bar);
|
||||
honor = findViewById(R.id.honor);
|
||||
top_icon = findViewById(R.id.top_icon);
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) top_icon.getLayoutParams();
|
||||
params.width = DpUtil.dp2px(WordUtil.isNewZh() ? 65 : 130);
|
||||
top_icon.setLayoutParams(params);
|
||||
mIvBack.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(honor, () -> {
|
||||
StringBuffer htmlUrl = new StringBuffer();
|
||||
IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo();
|
||||
htmlUrl.append(CommonAppConfig.HOST).append("/h5/shequ/index.html#/h5/shequ/RongYuQiang?").append("touid=").append(toUid).append("&token=").append(userInfo.getToken()).append("&uid=").append(userInfo.getId()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0);
|
||||
RouteUtil.forwardLiveZhuangBanActivity(htmlUrl.toString(), true);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
if (isFullWindows) {
|
||||
mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
ViewGroup.LayoutParams params1 = topBar.getLayoutParams();
|
||||
params1.height = DpUtil.dp2px(35);
|
||||
;
|
||||
topBar.setLayoutParams(params1);
|
||||
} else {
|
||||
mIvBg.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
}
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
LiveNetManager.get(getContext()).getGiftHallMedalList(toUid, isAnchor ? "1" : "2", new HttpCallback<MedalAchievementModel>() {
|
||||
@Override
|
||||
public void onSuccess(MedalAchievementModel data) {
|
||||
numCount.setText(data.getMedalLightNumber() + "/" + data.getMedalTotalNumber());
|
||||
userMedalListModelList = data.getMedalData();
|
||||
giftWallAchieveAdapter = new GiftWallAchieveAdapter(userMedalListModelList, mContext);
|
||||
giftWallAchieveAdapter.setOnItemClickListener(new GiftWallAchieveAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(int position) {
|
||||
GiftWallAchieveWearDialog giftWallAchieveWearDialog = new GiftWallAchieveWearDialog(mContext, toUid, isAnchor, userMedalListModelList.get(position).getDressInfo(), new GiftWallAchieveWearDialog.UserUseDressSuccess() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
initData();
|
||||
}
|
||||
});
|
||||
giftWallAchieveWearDialog.showDialog();
|
||||
}
|
||||
});
|
||||
mRecyclerView.setAdapter(giftWallAchieveAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.stx.xhb.androidx.XBanner;
|
||||
import com.stx.xhb.androidx.transformers.BasePageTransformer;
|
||||
import com.stx.xhb.androidx.transformers.Transformer;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserMedalModel;
|
||||
import com.yunbao.common.custom.LiveGifWallAchieveWearTransformer;
|
||||
import com.yunbao.common.custom.LiveGuardScalePageTransformer;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物墙-荣誉成就
|
||||
*/
|
||||
public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow {
|
||||
|
||||
private ImageView mIvBg;
|
||||
private ImageView mIvBack;
|
||||
private boolean isFullWindows;
|
||||
private String toUid;
|
||||
private XBanner xBanner;
|
||||
private TextView textAchieveName;
|
||||
private TextView textAchieveHint;
|
||||
private TextView btnConfirm;
|
||||
private int selectPosition = 0;
|
||||
private boolean isAnchor;
|
||||
|
||||
String putOn = WordUtil.isNewZh() ? "佩戴" : "wearing";
|
||||
String wearing = WordUtil.isNewZh() ? "已佩戴" : "worn";
|
||||
private List<UserMedalModel> achieveWearModels = new ArrayList<>();
|
||||
private UserUseDressSuccess userUseDressSuccess;
|
||||
private int useIndex = 0;
|
||||
|
||||
public GiftWallAchieveWearDialog(@NonNull Context context, String toUid, boolean isAnchor, List<UserMedalModel> achieveWearModels, UserUseDressSuccess userUseDressSuccess) {
|
||||
super(context);
|
||||
this.toUid = toUid;
|
||||
this.isAnchor = isAnchor;
|
||||
this.achieveWearModels = achieveWearModels;
|
||||
this.userUseDressSuccess = userUseDressSuccess;
|
||||
for (int i = 0; i < this.achieveWearModels.size(); i++) {
|
||||
if ("1".equals(this.achieveWearModels.get(i).getUseStatus())) {
|
||||
useIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GiftWallAchieveWearDialog setFullWindows(boolean fullWindows) {
|
||||
isFullWindows = fullWindows;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallAchieveWearDialog setToUid(String toUid) {
|
||||
this.toUid = toUid;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall_achieve_wear;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight();
|
||||
}
|
||||
return ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvBack = findViewById(R.id.iv_back);
|
||||
xBanner = findViewById(R.id.gift_wall_achieve_banner);
|
||||
textAchieveName = findViewById(R.id.text_achieve_name);
|
||||
textAchieveHint = findViewById(R.id.text_achieve_hint);
|
||||
btnConfirm = findViewById(R.id.btn_confirm);
|
||||
findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
btnConfirm.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (achieveWearModels.get(selectPosition).getUseStatus().equals("0") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) {
|
||||
LiveNetManager.get(mContext).userUseDress(
|
||||
achieveWearModels.get(selectPosition).getUsersDressId(), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show(data.getMsg());
|
||||
if (data.getCode() == 0) {
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
u.setMedal_no_display_src(achieveWearModels.get(selectPosition).getDisplaySrc());
|
||||
CommonAppConfig.getInstance().setUserBean(u);
|
||||
if (userUseDressSuccess != null) {
|
||||
userUseDressSuccess.onSuccess();
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
btnConfirm.setVisibility(CommonAppConfig.getInstance().getUid().equals(toUid) ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
/*RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mIvBack.getLayoutParams();
|
||||
if (isFullWindows) {
|
||||
params.width=DpUtil.dp2px(20);
|
||||
mIvBack.setVisibility(View.VISIBLE);
|
||||
mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
params.width=DpUtil.dp2px(1);
|
||||
mIvBack.setVisibility(View.INVISIBLE);
|
||||
mIvBg.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
}
|
||||
mIvBack.setLayoutParams(params);*/
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setWearInfo() {
|
||||
textAchieveName.setText(achieveWearModels.get(selectPosition).getDressName());
|
||||
textAchieveHint.setText(achieveWearModels.get(selectPosition).getDressDescription());
|
||||
btnConfirm.setText(achieveWearModels.get(selectPosition).getUseStatus().equals("1") ? wearing : putOn);
|
||||
if (achieveWearModels.get(selectPosition).getUseStatus().equals("0") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) {
|
||||
btnConfirm.setBackground(getResources().getDrawable(R.drawable.gift_wall_achieve_wear_sure));
|
||||
} else {
|
||||
btnConfirm.setBackground(getResources().getDrawable(R.drawable.gift_wall_achieve_wear_disable));
|
||||
}
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
setWearInfo();
|
||||
xBanner.setBannerData(R.layout.dialog_gift_wall_achieve_wear_item, achieveWearModels);
|
||||
//xBanner.setCustomPageTransformer(new LiveGuardScalePageTransformer());
|
||||
xBanner.setCustomPageTransformer(new LiveGifWallAchieveWearTransformer());
|
||||
xBanner.setIsClipChildrenMode(true);
|
||||
//xBanner.setCustomPageTransformer(BasePageTransformer.getPageTransformer(Transformer.Zoom));
|
||||
xBanner.getViewPager().setOffscreenPageLimit(3);
|
||||
xBanner.loadImage(new XBanner.XBannerAdapter() {
|
||||
@Override
|
||||
public void loadBanner(XBanner banner, Object model, View view, int position) {
|
||||
UserMedalModel guardBannerModel = ((UserMedalModel) model);
|
||||
ImageView wearImg = view.findViewById(R.id.wearImg);
|
||||
ImageView notUnlocked = view.findViewById(R.id.notUnlocked);
|
||||
ImgLoader.display(getContext(), guardBannerModel.getDisplaySrc(), wearImg);
|
||||
notUnlocked.setVisibility(guardBannerModel.getDressStatus().equals("1") ? VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
xBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int i, float v, int i1) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int i) {
|
||||
selectPosition = i;
|
||||
setWearInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int i) {
|
||||
|
||||
}
|
||||
});
|
||||
// xBanner.getViewPager().setCurrentItem(useIndex); //自动定位到已佩戴到的勋章
|
||||
}
|
||||
|
||||
public interface UserUseDressSuccess {
|
||||
void onSuccess();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallBean;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.fragment.GiftWallMainTab1Fragment;
|
||||
import com.yunbao.common.fragment.GiftWallMainTab2Fragment;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.CustomEllipsizeTextView;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 礼物墙
|
||||
*/
|
||||
public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
|
||||
private ImageView mIvBg;
|
||||
private ImageView mIvTips;
|
||||
private ImageView mIvBack;
|
||||
private CustomEllipsizeTextView mTvUserName;
|
||||
private View mAchievement;
|
||||
private TextView mTvTab1, mTvTab2;
|
||||
private ViewPager2 mViewPager;
|
||||
private LinearLayout mIvTabsLayout;
|
||||
private List<BaseFragment> fragments = new ArrayList<>();
|
||||
private String anchorId;
|
||||
|
||||
private boolean isFullWindows;
|
||||
String toUserId;
|
||||
String userName;
|
||||
boolean isAnchor;
|
||||
boolean isTab2;
|
||||
|
||||
public GiftWallDialog(@NonNull Context context, String toUserId, String userName, String anchorId, boolean isAnchor) {
|
||||
super(context);
|
||||
this.toUserId = toUserId;
|
||||
this.isAnchor = isAnchor;
|
||||
this.userName = userName;
|
||||
this.anchorId = anchorId;
|
||||
}
|
||||
|
||||
public GiftWallDialog setFullWindows(boolean fullWindows) {
|
||||
isFullWindows = fullWindows;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallDialog setTab2(boolean isTab2) {
|
||||
this.isTab2 = isTab2;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight() - DpUtil.dp2px(10);
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvTips = findViewById(R.id.v_tips);
|
||||
mIvBack = findViewById(R.id.iv_back);
|
||||
mTvUserName = findViewById(R.id.user_name);
|
||||
mAchievement = findViewById(R.id.v_achievement);
|
||||
mTvTab1 = findViewById(R.id.tab1);
|
||||
mTvTab2 = findViewById(R.id.tab2);
|
||||
mViewPager = findViewById(R.id.viewPager2);
|
||||
mIvTabsLayout = findViewById(R.id.tab_layout);
|
||||
|
||||
mTvUserName.setText(String.format(Locale.getDefault(), "%s%s",
|
||||
userName,
|
||||
WordUtil.isNewZh() ? "的禮物展館" : "'s Gift Hall"
|
||||
));
|
||||
|
||||
fragments.add(new GiftWallMainTab1Fragment().setToUserId(toUserId).setAnchor(isAnchor).setAnchorId(anchorId).setLiveRoom(!isFullWindows).setOnItemClickListener(new OnItemClickListener<GiftWallBean>() {
|
||||
@Override
|
||||
public void onItemClick(GiftWallBean bean, int position) {
|
||||
if (position == 1) {
|
||||
if (toUserId.equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
mAchievement.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mAchievement.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
} else {
|
||||
mAchievement.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}));
|
||||
fragments.add(new GiftWallMainTab2Fragment().setToUserId(toUserId).setAnchorId(anchorId).setAnchor(isAnchor).setLiveRoom(!isFullWindows));
|
||||
mViewPager.setAdapter(new FragmentStateAdapter((FragmentActivity) mContext) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragments.size();
|
||||
}
|
||||
});
|
||||
mViewPager.setUserInputEnabled(false);
|
||||
mViewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
super.onPageSelected(position);
|
||||
fragments.get(position).updateData();
|
||||
if (position == 0) {
|
||||
mTvUserName.setTextColor(Color.parseColor("#6BCDFF"));
|
||||
} else {
|
||||
mTvUserName.setTextColor(Color.parseColor("#FFCF94"));
|
||||
if (isTab2) {
|
||||
((GiftWallMainTab2Fragment) fragments.get(position)).setTab2();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (isTab2) {
|
||||
mViewPager.setCurrentItem(1);
|
||||
}
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(mTvTab1, () -> {
|
||||
mIvBg.setImageResource(R.mipmap.bg_gift_wall_main_root);
|
||||
mIvTabsLayout.setBackgroundResource(R.mipmap.icon_gift_wall_main_switch_main);
|
||||
mTvTab1.setTextColor(Color.parseColor("#9CE7FF"));
|
||||
mTvTab1.setTextSize(16);
|
||||
mTvTab1.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
|
||||
|
||||
mTvTab2.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
mTvTab2.setTextSize(14);
|
||||
mTvTab2.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
|
||||
mViewPager.setCurrentItem(0, false);
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(mTvTab2, () -> {
|
||||
|
||||
mIvBg.setImageResource(R.mipmap.bg_gift_wall_main_root2);
|
||||
mIvTabsLayout.setBackgroundResource(R.mipmap.icon_gift_wall_main_switch_full);
|
||||
mTvTab1.setTextColor(Color.parseColor("#FDF5EE"));
|
||||
mTvTab1.setTextSize(14);
|
||||
mTvTab1.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
|
||||
|
||||
mTvTab2.setTextColor(Color.parseColor("#FFC593"));
|
||||
if (WordUtil.isNewZh()) {
|
||||
mTvTab2.setTextSize(16);
|
||||
} else {
|
||||
mTvTab2.setTextSize(14.5f);
|
||||
}
|
||||
mTvTab2.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
|
||||
mViewPager.setCurrentItem(1, false);
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(mAchievement, () -> {
|
||||
new GiftWallAchieveDialog(mContext).setFullWindows(isFullWindows).setAnchor(isAnchor).setToUid(toUserId).showDialog();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvTips, () -> {
|
||||
new GiftWallRuleDialog(mContext).setFullWindows(isFullWindows).showDialog();
|
||||
});
|
||||
resetWindows();
|
||||
if (isTab2) {
|
||||
mTvTab2.callOnClick();
|
||||
}
|
||||
}
|
||||
|
||||
private void resetWindows() {
|
||||
if (isFullWindows) {
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.v_achievement).getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(47);
|
||||
findViewById(R.id.v_achievement).setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) mIvBack.getLayoutParams();
|
||||
if (isFullWindows) {
|
||||
params.width = DpUtil.dp2px(20);
|
||||
mIvBack.setVisibility(View.VISIBLE);
|
||||
mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
params.width = DpUtil.dp2px(1);
|
||||
mIvBack.setVisibility(View.INVISIBLE);
|
||||
mIvBg.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
}
|
||||
mIvBack.setLayoutParams(params);
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,478 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallGiftInfoListItemAdapter;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.JsWishBean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.event.ClosePopupDialogEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
private boolean isFullWindows;
|
||||
private ImageView mIvBg;
|
||||
private ImageView mIvBack;
|
||||
TextView giftName;
|
||||
ImageView gift;
|
||||
SVGAImageView gift_bg;
|
||||
TextView diamond_text;
|
||||
TextView gift_tv_progress;
|
||||
TextView gift_tv_max;
|
||||
ProgressBar gift_progress;
|
||||
Button gift_btn;
|
||||
Button tab1, tab2;
|
||||
ImageView tips_timer;
|
||||
TextView tv_list_title;
|
||||
RoundedImageView avatar;
|
||||
TextView user_name;
|
||||
TextView send_num;
|
||||
TextView btn_one;
|
||||
Button btn_one_tips;
|
||||
Button btn_lighten;
|
||||
View tab_layout;
|
||||
View bottom_layout;
|
||||
View gift_schedule;
|
||||
ImageView diamond_icon;
|
||||
|
||||
GiftWallGiftInfoListItemAdapter adapter;
|
||||
RecyclerView recyclerView;
|
||||
|
||||
String giftId;
|
||||
String toUserId;
|
||||
String anchorId;
|
||||
boolean isAnchor;
|
||||
int gift_hall_type = 1;
|
||||
int list_type = 2;
|
||||
private boolean isLiveRoom;
|
||||
String time;
|
||||
private boolean isStar;
|
||||
private boolean isTab2Enter = false;
|
||||
|
||||
|
||||
public GiftWallGiftInfoDialog(Context context, String giftId, String toUserId, boolean isAnchor) {
|
||||
super(context);
|
||||
this.giftId = giftId;
|
||||
this.toUserId = toUserId;
|
||||
this.isAnchor = isAnchor;
|
||||
}
|
||||
|
||||
public GiftWallGiftInfoDialog setFullWindows(boolean fullWindows) {
|
||||
isFullWindows = fullWindows;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallGiftInfoDialog setTab2Enter(boolean tab2Enter) {
|
||||
isTab2Enter = tab2Enter;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallGiftInfoDialog setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallGiftInfoDialog setLiveRoom(boolean isLiveRoom) {
|
||||
this.isLiveRoom = isLiveRoom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallGiftInfoDialog setStar(boolean isStar) {
|
||||
this.isStar = isStar;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight();
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall_gift_info;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvBack = findViewById(R.id.iv_back);
|
||||
diamond_icon = findViewById(R.id.diamond_icon);
|
||||
giftName = findViewById(R.id.gift_name);
|
||||
gift = findViewById(R.id.gift);
|
||||
diamond_text = findViewById(R.id.diamond_text);
|
||||
gift_tv_progress = findViewById(R.id.gift_tv_progress);
|
||||
gift_tv_max = findViewById(R.id.gift_tv_max);
|
||||
gift_progress = findViewById(R.id.gift_progress);
|
||||
gift_btn = findViewById(R.id.gift_btn);
|
||||
tab1 = findViewById(R.id.tab1);
|
||||
tab2 = findViewById(R.id.tab2);
|
||||
tips_timer = findViewById(R.id.tips_timer);
|
||||
tv_list_title = findViewById(R.id.tv_list_title);
|
||||
avatar = findViewById(R.id.bottom_avatar);
|
||||
user_name = findViewById(R.id.bottom_user_name);
|
||||
send_num = findViewById(R.id.send_num);
|
||||
btn_one = findViewById(R.id.btn_one);
|
||||
btn_one_tips = findViewById(R.id.btn_one_tips);
|
||||
gift_bg = findViewById(R.id.gift_bg);
|
||||
btn_lighten = findViewById(R.id.btn_lighten);
|
||||
recyclerView = findViewById(R.id.recyclerView);
|
||||
tab_layout = findViewById(R.id.tab_layout);
|
||||
bottom_layout = findViewById(R.id.bottom_layout);
|
||||
gift_schedule = findViewById(R.id.gift_schedule);
|
||||
adapter = new GiftWallGiftInfoListItemAdapter();
|
||||
adapter.setAnchor(isAnchor);
|
||||
adapter.setLiveRoom(isLiveRoom);
|
||||
adapter.setStar(isStar);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x00000000, 0, 10));
|
||||
|
||||
initTabText();
|
||||
|
||||
findViewById(R.id.item_anchor_name).setVisibility(View.GONE);
|
||||
ViewClicksAntiShake.clicksAntiShake(tab1, () -> {
|
||||
|
||||
btn_one.setVisibility(View.GONE);
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
|
||||
tab1.setBackgroundResource(R.drawable.gift_wall_gift_info_list_btn_up);
|
||||
tab1.setTextColor(Color.parseColor("#31326D"));
|
||||
|
||||
tab2.setBackgroundResource(R.drawable.gift_wall_gift_info_list_btn_down);
|
||||
tab2.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
list_type = 1;
|
||||
adapter.setList_type(list_type);
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_assistance_user));
|
||||
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_assistance_star));
|
||||
initData();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(tab2, () -> {
|
||||
btn_one.setVisibility(View.VISIBLE);
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
|
||||
tab2.setBackgroundResource(R.drawable.gift_wall_gift_info_list_btn_up);
|
||||
tab2.setTextColor(Color.parseColor("#31326D"));
|
||||
|
||||
tab1.setBackgroundResource(R.drawable.gift_wall_gift_info_list_btn_down);
|
||||
tab1.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
list_type = 2;
|
||||
adapter.setList_type(list_type);
|
||||
initTabText();
|
||||
initData();
|
||||
});
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext())
|
||||
.atView(tips_timer);
|
||||
builder.hasShadowBg(false);
|
||||
tips_timer.setTag(builder);
|
||||
ViewClicksAntiShake.clicksAntiShake(tips_timer, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
XPopup.Builder b = (XPopup.Builder) tips_timer.getTag();
|
||||
b.asCustom(new GiftWallMainTab1TipsDialog(mContext, new OnItemClickListener<Integer>() {
|
||||
@Override
|
||||
public void onItemClick(Integer bean, int position) {
|
||||
|
||||
}
|
||||
}).setTime(time)).show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(btn_one, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new JsWishBean(giftId));//setUname==by
|
||||
Bus.get().post(new ClosePopupDialogEvent());
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(gift_btn, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new JsWishBean(giftId));//setUname==by
|
||||
Bus.get().post(new ClosePopupDialogEvent());
|
||||
}
|
||||
});
|
||||
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) mIvBack.getLayoutParams();
|
||||
if (isFullWindows) {
|
||||
params.width = DpUtil.dp2px(20);
|
||||
mIvBack.setVisibility(View.VISIBLE);
|
||||
mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
params.width = DpUtil.dp2px(20);
|
||||
mIvBack.setVisibility(View.VISIBLE);
|
||||
mIvBg.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
}
|
||||
mIvBack.setLayoutParams(params);
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
|
||||
resetWindows();
|
||||
}
|
||||
|
||||
private void initTabText() {
|
||||
if (isStar) {
|
||||
tab2.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_star));
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename1));
|
||||
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename_value1));
|
||||
tv_list_title.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_star));
|
||||
} else {
|
||||
tab2.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_champion));
|
||||
tv_list_title.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_title_champion));
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename));
|
||||
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename_value));
|
||||
}
|
||||
}
|
||||
|
||||
private void resetWindows() {
|
||||
if (isFullWindows) {
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.gift_name).getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(47);
|
||||
findViewById(R.id.gift_name).setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
void initData() {
|
||||
adapter.setList_type(list_type);
|
||||
if (isAnchor) {
|
||||
if (isStar) {
|
||||
gift_hall_type = 2;
|
||||
} else {
|
||||
gift_hall_type = 1;
|
||||
}
|
||||
LiveNetManager.get(mContext)
|
||||
.liveGiftHallDetail(toUserId, giftId, gift_hall_type, list_type, new HttpCallback<GiftWallInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
LiveNetManager.get(mContext)
|
||||
.singleUserGiftHallDetail(toUserId, giftId, new HttpCallback<GiftWallInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void initData(GiftWallInfoBean giftBean) {
|
||||
giftName.setText(WordUtil.isNewZh() ? giftBean.getGift_info().getGiftname() : giftBean.getGift_info().getGiftname_en());
|
||||
ImgLoader.display(mContext, giftBean.getGift_info().getGifticon(), gift);
|
||||
diamond_text.setText(String.format(Locale.getDefault(), "%d", giftBean.getGift_info().getNeedcoin()));
|
||||
gift_tv_max.setText(String.format(Locale.getDefault(), "/%s", giftBean.getGift_info().getIlluminate_num()));
|
||||
gift_tv_progress.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getGift_hall_send_num()));
|
||||
gift_progress.setMax(giftBean.getGift_info().getIlluminate_num());
|
||||
gift_progress.setProgress(Integer.parseInt(giftBean.getGift_info().getGift_hall_send_num()));
|
||||
if (giftBean.getGift_info().getSendtype() == 0) {
|
||||
diamond_icon.setImageResource(R.mipmap.diamond);
|
||||
} else {
|
||||
diamond_icon.setImageResource(R.mipmap.gold_coin);
|
||||
}
|
||||
if (giftBean.getGift_info().getIlluminate_status() == 1) {
|
||||
gift_btn.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_top_btn_continue));
|
||||
btn_lighten.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_up));
|
||||
btn_lighten.setBackgroundResource(R.drawable.gift_wall_gift_info_lighten);
|
||||
} else {
|
||||
gift_btn.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_top_btn_to));
|
||||
btn_lighten.setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_down));
|
||||
btn_lighten.setBackgroundResource(R.drawable.gift_wall_gift_info_un_lighten);
|
||||
}
|
||||
adapter.setGiftStatus(giftBean.getGift_info().getIlluminate_status());
|
||||
/**
|
||||
* 如果对方是主播,要有点亮标记。
|
||||
* 如果对方是用户,不要有点亮标记
|
||||
*
|
||||
*/
|
||||
if (isAnchor) {
|
||||
tab_layout.setVisibility(View.VISIBLE);
|
||||
bottom_layout.setVisibility(View.VISIBLE);
|
||||
tv_list_title.setVisibility(View.GONE);
|
||||
if (isTab2Enter) {
|
||||
tab_layout.setVisibility(View.GONE);
|
||||
bottom_layout.setVisibility(View.GONE);
|
||||
tv_list_title.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
tab_layout.setVisibility(View.GONE);
|
||||
bottom_layout.setVisibility(View.GONE);
|
||||
tv_list_title.setVisibility(View.VISIBLE);
|
||||
gift_progress.setVisibility(View.GONE);
|
||||
gift_schedule.setVisibility(View.GONE);
|
||||
if (isTab2Enter || ((!toUserId.equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) && !isTab2Enter)) {
|
||||
gift_btn.setVisibility(View.GONE);
|
||||
} else {
|
||||
System.out.println("---------------显示 " + toUserId + " " + IMLoginManager.get(mContext).getUserInfo().getId() + "|" + isTab2Enter);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isLiveRoom || giftBean.getGift_info().getGift_status() == 0) {
|
||||
gift_btn.setEnabled(false);
|
||||
btn_one.setEnabled(false);
|
||||
gift_btn.setBackgroundResource(R.drawable.gift_wall_gift_info_btn_un);
|
||||
btn_one.setBackgroundResource(R.drawable.gift_wall_gift_info_btn_un);
|
||||
}
|
||||
adapter.setData(giftBean.getData());
|
||||
time = (WordUtil.isNewZh() ? "榜單結算時間:" : "Settlement time:") + giftBean.getGift_info().getGift_hall_start() + " - " + giftBean.getGift_info().getGift_hall_end();
|
||||
ImgLoader.display(mContext, IMLoginManager.get(mContext).getUserInfo().getAvatar(), avatar);
|
||||
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
|
||||
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getUser_gift_hall_send_num()));
|
||||
|
||||
String tmp = "";
|
||||
if (giftBean.getGift_info().getIlluminate_status() != 1) {//未點亮
|
||||
btn_one.setText(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_light);
|
||||
tmp = String.format(Locale.getDefault(), "%s", (giftBean.getGift_info().getIlluminate_num() - Integer.parseInt(giftBean.getGift_info().getGift_hall_send_num())));
|
||||
setTips(tmp);
|
||||
} else {//冠名/摘星
|
||||
if (isStar) {
|
||||
loadStar(giftBean);
|
||||
} else {
|
||||
loadChampion(giftBean);
|
||||
}
|
||||
}
|
||||
|
||||
initAnim();
|
||||
}
|
||||
|
||||
private void setTips(String tmp) {
|
||||
btn_one_tips.setVisibility(View.VISIBLE);
|
||||
btn_one_tips.setText(String.format(Locale.getDefault(), "%s%s%s"
|
||||
, WordUtil.isNewZh() ? "需 " : "Need ",
|
||||
tmp,
|
||||
WordUtil.isNewZh() ? "" : ""));
|
||||
}
|
||||
|
||||
private void loadChampion(GiftWallInfoBean giftBean) {
|
||||
int tmp = 0;
|
||||
int mySend = giftBean.getGift_info().getUser_gift_hall_send_num();
|
||||
if (giftBean.getData() != null && !giftBean.getData().isEmpty()) {
|
||||
tmp = giftBean.getData().get(0).getGift_hall_send_num() - giftBean.getGift_info().getUser_gift_hall_send_num() + 1;
|
||||
}
|
||||
System.out.println("冠名数据 我发的 = " + mySend + " 检测的 = " + tmp + " 第一名id = " + giftBean.getData().get(0).getUser_id() + " 我的id = " + IMLoginManager.get(mContext).getUserInfo().getId());
|
||||
if (mySend > tmp || giftBean.getData().get(0).getUser_id().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get));
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
} else {
|
||||
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion));
|
||||
setTips(String.valueOf(tmp));
|
||||
}
|
||||
}
|
||||
|
||||
private void loadStar(GiftWallInfoBean giftBean) {
|
||||
int tmp = 0;
|
||||
int mySend = giftBean.getGift_info().getUser_gift_hall_send_num();
|
||||
if (giftBean.getData() != null && !giftBean.getData().isEmpty()) {
|
||||
tmp = giftBean.getData().get(0).getGift_hall_send_num() - giftBean.getGift_info().getUser_gift_hall_send_num() + 1;
|
||||
}
|
||||
if (mySend > tmp || giftBean.getData().get(0).getUser_id().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_star_get));
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
} else {
|
||||
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_star));
|
||||
setTips(String.valueOf(tmp));
|
||||
}
|
||||
}
|
||||
|
||||
void initAnim() {
|
||||
if (gift.getTag() != null) {
|
||||
return;
|
||||
}
|
||||
// 创建一个向上移动的动画
|
||||
ObjectAnimator upAnimator = ObjectAnimator.ofFloat(gift, "translationY", 0f, -10f); // 假设 10f 是你想要移动的距离(注意:这里使用的是像素值,而不是 dp)
|
||||
upAnimator.setDuration(1000); // 设置动画时长为 1000 毫秒(即 1 秒)
|
||||
// 创建一个向下移动的动画
|
||||
ObjectAnimator downAnimator = ObjectAnimator.ofFloat(gift, "translationY", -10f, 0f);
|
||||
downAnimator.setDuration(1000); // 同样设置动画时长为 1 秒
|
||||
// 设置动画监听器以在向上动画结束后开始向下动画(如果需要的话)
|
||||
upAnimator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
super.onAnimationEnd(animation);
|
||||
// 在这里开始向下动画
|
||||
downAnimator.start();
|
||||
}
|
||||
});
|
||||
downAnimator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
super.onAnimationEnd(animation);
|
||||
gift.postDelayed(upAnimator::start, 1000);
|
||||
}
|
||||
});
|
||||
// 开始向上动画
|
||||
upAnimator.start();
|
||||
gift.setTag("start");
|
||||
|
||||
new SVGAParser(getContext()).decodeFromAssets("gift_wall_gift_info_light.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@NonNull SVGAVideoEntity videoItem) {
|
||||
gift_bg.setImageDrawable(new SVGADrawable(videoItem));
|
||||
gift_bg.setLoops(0);
|
||||
gift_bg.startAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
System.err.println("-------------SVGA报错了");
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class GiftWallMainTab1List2SpinnerDialog extends AttachPopupView {
|
||||
TextView all, up, down;
|
||||
OnItemClickListener<Integer> listener;
|
||||
int type=0;
|
||||
|
||||
public GiftWallMainTab1List2SpinnerDialog(@NonNull Context context,int type, OnItemClickListener<Integer> listener) {
|
||||
super(context);
|
||||
this.listener = listener;
|
||||
this.type=type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
listener.onItemClick(-1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_gift_wall_main_tab1_list2_spinner;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
all = findViewById(R.id.spinner_all);
|
||||
up = findViewById(R.id.spinner_up);
|
||||
down = findViewById(R.id.spinner_down);
|
||||
if(type==1){
|
||||
up.setText(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get);
|
||||
down.setText(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get_un);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(all, () -> {
|
||||
listener.onItemClick(0, 0);
|
||||
dismiss();
|
||||
});
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(up, () -> {
|
||||
listener.onItemClick(1, 0);
|
||||
dismiss();
|
||||
});
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(down, () -> {
|
||||
listener.onItemClick(2, 0);
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class GiftWallMainTab1TipsDialog extends AttachPopupView {
|
||||
TextView tips;
|
||||
OnItemClickListener<Integer> listener;
|
||||
String time;
|
||||
|
||||
public GiftWallMainTab1TipsDialog(@NonNull Context context, OnItemClickListener<Integer> listener) {
|
||||
super(context);
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public GiftWallMainTab1TipsDialog setTime(String time) {
|
||||
this.time = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
listener.onItemClick(-1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_gift_wall_main_tab1_tips;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
tips = findViewById(R.id.tips);
|
||||
tips.setText(time);
|
||||
ViewClicksAntiShake.clicksAntiShake(tips, () -> {
|
||||
listener.onItemClick(0, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallTab2GiftInfoListItemAdapter;
|
||||
import com.yunbao.common.bean.GiftWallMainTab2ClassicInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.fragment.GiftWallMainTab1Fragment;
|
||||
import com.yunbao.common.fragment.GiftWallMainTab2Fragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.CustomEllipsizeTextView;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
|
||||
private ImageView mIvBg;
|
||||
private ImageView mIvTips;
|
||||
private ImageView mIvBack;
|
||||
private ImageView mIvGift;
|
||||
private RoundedImageView user_avatar;
|
||||
private TextView mTvUserName;
|
||||
private TextView star_value;
|
||||
private RoundedImageView user_avatar_1, user_avatar_2, user_avatar_3;
|
||||
private TextView user_name_1, user_name_2, user_name_3;
|
||||
private TextView user_value_1, user_value_2, user_value_3;
|
||||
private TextView gift_name;
|
||||
private View mAchievement;
|
||||
private TextView mTvTab1, mTvTab2;
|
||||
private ViewPager2 mViewPager;
|
||||
private LinearLayout mIvTabsLayout;
|
||||
private List<BaseFragment> fragments = new ArrayList<>();
|
||||
private RecyclerView recyclerView;
|
||||
GiftWallTab2GiftInfoListItemAdapter adapter;
|
||||
private boolean isFullWindows;
|
||||
GiftWallTab2Bean.Gift gift;
|
||||
String userName;
|
||||
boolean isAnchor;
|
||||
|
||||
public GiftWallMainTab2ClassicInfoDialog(@NonNull Context context, GiftWallTab2Bean.Gift gift, boolean isAnchor) {
|
||||
super(context);
|
||||
this.gift = gift;
|
||||
this.isAnchor = isAnchor;
|
||||
|
||||
}
|
||||
|
||||
public GiftWallMainTab2ClassicInfoDialog setFullWindows(boolean fullWindows) {
|
||||
isFullWindows = fullWindows;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall_tab2_classic_info;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight();
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
}
|
||||
|
||||
void initData() {
|
||||
LiveNetManager.get(mContext).lastAllGiftHallWeekStarDetail(gift.getGiftId() + "", gift.getNamingLiveId() + "", new HttpCallback<GiftWallMainTab2ClassicInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallMainTab2ClassicInfoBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initData(GiftWallMainTab2ClassicInfoBean data) {
|
||||
ImgLoader.display(mContext, data.getGiftInfo().getGiftIcon(), mIvGift);
|
||||
if (data.getGiftInfo().getNamingLiveActiveRankHide() == 0 || data.getGiftInfo().getNamingLiveId() == IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
ImgLoader.display(mContext, data.getGiftInfo().getNamingLiveAvatar(), user_avatar);
|
||||
mTvUserName.setText(data.getGiftInfo().getNamingLiveNicename());
|
||||
} else {
|
||||
user_avatar.setImageResource(R.mipmap.hide);
|
||||
mTvUserName.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
}
|
||||
gift_name.setText(WordUtil.isNewZh() ? data.getGiftInfo().getGiftName() : data.getGiftInfo().getGiftNameEn());
|
||||
star_value.setText(String.format(Locale.getDefault(), "%d", data.getGiftInfo().getGiftHallSendNum()));
|
||||
int max = data.getData().size() > 3 ? 3 : 0;
|
||||
if (max != 0) {
|
||||
adapter.setData(data.getData().subList(max, data.getData().size()));
|
||||
}
|
||||
for (int i = 0; i < data.getData().size() && i < 3; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
setTopData(data.getData().get(0), user_avatar_1, user_name_1, user_value_1);
|
||||
break;
|
||||
case 1:
|
||||
setTopData(data.getData().get(1), user_avatar_2, user_name_2, user_value_2);
|
||||
break;
|
||||
case 2:
|
||||
setTopData(data.getData().get(2), user_avatar_3, user_name_3, user_value_3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(user_avatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (data.getGiftInfo().getNamingLiveActiveRankHide() == 0) {
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(data.getGiftInfo().getNamingLiveId()), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void setTopData(GiftWallMainTab2ClassicInfoBean.GiftData data, ImageView avatar, TextView name, TextView value) {
|
||||
if (data.getNaming_user_gift_hall_rank_hide() == 1 && Integer.parseInt(data.getUserId()) != IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
avatar.setImageResource(R.mipmap.hide);
|
||||
name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
return;
|
||||
}
|
||||
ImgLoader.display(mContext, data.getAvatar(), avatar);
|
||||
name.setText(data.getUserName());
|
||||
value.setText(String.format(Locale.getDefault(), "%d", data.getGiftHallSendNum()));
|
||||
ViewClicksAntiShake.clicksAntiShake(avatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (data.getActiveRankHide() == 0) {
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(data.getUserId()), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvTips = findViewById(R.id.v_tips);
|
||||
mIvBack = findViewById(R.id.iv_back);
|
||||
mTvUserName = findViewById(R.id.anchor_name);
|
||||
mAchievement = findViewById(R.id.v_achievement);
|
||||
mTvTab1 = findViewById(R.id.tab1);
|
||||
mTvTab2 = findViewById(R.id.tab2);
|
||||
mViewPager = findViewById(R.id.viewPager2);
|
||||
mIvTabsLayout = findViewById(R.id.tab_layout);
|
||||
mIvGift = findViewById(R.id.gift);
|
||||
gift_name = findViewById(R.id.gift_name);
|
||||
user_avatar = findViewById(R.id.user_avatar);
|
||||
star_value = findViewById(R.id.star_value);
|
||||
user_avatar_1 = findViewById(R.id.user_avatar_1);
|
||||
user_avatar_2 = findViewById(R.id.user_avatar_2);
|
||||
user_avatar_3 = findViewById(R.id.user_avatar_3);
|
||||
user_name_1 = findViewById(R.id.user_name_1);
|
||||
user_name_2 = findViewById(R.id.user_name_2);
|
||||
user_name_3 = findViewById(R.id.user_name_3);
|
||||
user_value_1 = findViewById(R.id.user_value_1);
|
||||
user_value_2 = findViewById(R.id.user_value_2);
|
||||
user_value_3 = findViewById(R.id.user_value_3);
|
||||
recyclerView = findViewById(R.id.recycler_view);
|
||||
adapter = new GiftWallTab2GiftInfoListItemAdapter();
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x000, 0, DpUtil.dp2px(2)));
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
initData();
|
||||
resetWindows();
|
||||
}
|
||||
|
||||
private void resetWindows() {
|
||||
if (isFullWindows) {
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.iv_back).getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(47);
|
||||
findViewById(R.id.iv_back).setLayoutParams(params);
|
||||
params = (ConstraintLayout.LayoutParams) findViewById(R.id.scrollView).getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(47);
|
||||
findViewById(R.id.scrollView).setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallAchieveAdapter;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.bean.UserMedalListModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物墙-規則
|
||||
*/
|
||||
public class GiftWallRuleDialog extends AbsDialogPopupWindow {
|
||||
|
||||
private ImageView mIvBg;
|
||||
private ImageView mIvBack;
|
||||
private ImageView iv_rule;
|
||||
private boolean isFullWindows;
|
||||
private View topBar;
|
||||
public GiftWallRuleDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public GiftWallRuleDialog setFullWindows(boolean fullWindows) {
|
||||
isFullWindows = fullWindows;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall_rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight();
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
}
|
||||
|
||||
void initView() {
|
||||
mIvBg = findViewById(R.id.iv_root_bg);
|
||||
mIvBack = findViewById(R.id.iv_back);
|
||||
iv_rule= findViewById(R.id.iv_rule);
|
||||
topBar = findViewById(R.id.top_bar);
|
||||
mIvBack.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
if (isFullWindows) {
|
||||
mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
ViewGroup.LayoutParams params1 = topBar.getLayoutParams();
|
||||
params1.height= DpUtil.dp2px(35);;
|
||||
topBar.setLayoutParams(params1);
|
||||
} else {
|
||||
mIvBg.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
}
|
||||
ImgLoader.displayDrawable(mContext, WordUtil.isNewZh() ? "https://downs.yaoulive.com/%E4%B8%AD%E6%96%87%E8%A7%84%E5%88%99.png" : "https://downs.yaoulive.com/%E8%8B%B1%E6%96%87%E8%A7%84%E5%88%99.png", -1, -1, new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
iv_rule.setImageDrawable(drawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class GiftWallTab2List2Dialog extends AbsDialogCenterPopupWindow {
|
||||
RoundedImageView user1Avatar, user2Avatar;
|
||||
TextView user1Name, user2Name;
|
||||
ImageView giftImage;
|
||||
TextView giftName;
|
||||
TextView titleValue;
|
||||
|
||||
GiftWallTab2Bean.Gift gift;
|
||||
|
||||
public GiftWallTab2List2Dialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public GiftWallTab2List2Dialog setGift(GiftWallTab2Bean.Gift gift) {
|
||||
this.gift = gift;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_gift_wall_tab2_list2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
user1Avatar = findViewById(R.id.user1_avatar);
|
||||
user2Avatar = findViewById(R.id.user2_avatar);
|
||||
user1Name = findViewById(R.id.user1_name);
|
||||
user2Name = findViewById(R.id.user2_name);
|
||||
giftImage = findViewById(R.id.gift);
|
||||
titleValue = findViewById(R.id.title_value);
|
||||
giftName = findViewById(R.id.gift_name);
|
||||
|
||||
ImgLoader.display(mContext, gift.getGiftIcon(), giftImage);
|
||||
if (gift.getNamingLiveActiveRankHide() == 0 || gift.getNamingLiveId()== IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
ImgLoader.display(mContext, gift.getNamingLiveAvatar(), user2Avatar);
|
||||
user2Name.setText(gift.getNamingLiveNicename());
|
||||
} else {
|
||||
user2Avatar.setImageResource(R.mipmap.hide);
|
||||
user2Name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
}
|
||||
if (gift.getNamingUserActiveRankHide() == 0|| gift.getNamingUserId()== IMLoginManager.get(mContext).getUserInfo().getId()) {
|
||||
ImgLoader.display(mContext, gift.getNamingUserAvatar(), user1Avatar);
|
||||
user1Name.setText(gift.getNamingUserNicename());
|
||||
} else {
|
||||
user1Avatar.setImageResource(R.mipmap.hide);
|
||||
user1Name.setText(WordUtil.getNewString(R.string.mystery_man));
|
||||
}
|
||||
|
||||
|
||||
giftName.setText(WordUtil.isNewZh() ? gift.getGiftName() : gift.getGiftNameEn());
|
||||
titleValue.setText(String.format(Locale.getDefault(), "%d", gift.getGiftHallSendNum()));
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(user1Avatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (gift.getNamingUserActiveRankHide() == 0) {
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(gift.getNamingUserId()), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(user2Avatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (gift.getNamingLiveActiveRankHide() == 0) {
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(gift.getNamingLiveId()), 0);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class GuardBuyCouponTipsDialog {
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param coin 钻石
|
||||
* @param content 购买类型名称
|
||||
* @param simpleCallback
|
||||
*/
|
||||
public static void showBuyOrRenewDialog(Context context, String coupon, String coin, String content,
|
||||
DialogUitl.SimpleCallback3 simpleCallback) {
|
||||
if (context instanceof Activity) {
|
||||
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final Dialog dialog = new Dialog(context, R.style.dialog2);
|
||||
dialog.setContentView(R.layout.dialog_guard_buy_coupon_tips);
|
||||
dialog.setCancelable(true);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
TextView btn_confirm = dialog.findViewById(R.id.btn_confirm);
|
||||
TextView content2 = dialog.findViewById(R.id.content2);
|
||||
|
||||
Spanned tips;
|
||||
if (WordUtil.isNewZh()) {
|
||||
tips = Html.fromHtml("<font color='#FFE0BF'>您有一張</font>"
|
||||
+ "<font color='#FF9937'>" + content + "優惠券</font><br>"
|
||||
+ "<font color='#FFE0BF'>開通/續費" + content + "(1個月)時,</font><br><font color='#FFE0BF'>可享</font>"
|
||||
+ "<strong><font color='#FF9937'>" + coupon + "折</font></strong>"
|
||||
+ "<font color='#FFE0BF'>優惠 (折後:</font>"
|
||||
+ "<font color='#FF9937'>" + coin + "鑽</font>)<br>"
|
||||
+ "<font color='#FFE0BF'>是否使用優惠券?</font>");
|
||||
} else {
|
||||
tips = Html.fromHtml("<font color='#FFE0BF'>You have a </font>"
|
||||
+ "<font color='#FF9937'>" + content + " coupon</font>"
|
||||
+ "<font color='#FFE0BF'> When activating/renewing " + content + "(1 month), you can enjoy a</font>"
|
||||
+ "<strong><font color='#FF9937'> " + coupon + "% </font></strong>"
|
||||
+ "<font color='#FFE0BF'>discount (After folding:</font>"
|
||||
+ "<font color='#FF9937'>" + coin + " diamonds</font>"
|
||||
+ "<font color='#FFE0BF'>)Do you want to use coupons?</font>");
|
||||
}
|
||||
content2.setText(tips);
|
||||
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.findViewById(R.id.btn_cancel1).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
simpleCallback.onCancel();
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
btn_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
simpleCallback.onConfirmClick(dialog);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class GuardBuyTipsNewDialog {
|
||||
/**
|
||||
* @param context
|
||||
*/
|
||||
public static void showBuyOrRenewDialog(Context context) {
|
||||
if (context instanceof Activity) {
|
||||
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final Dialog dialog = new Dialog(context, R.style.dialog2);
|
||||
dialog.setContentView(R.layout.dialog_guard_buy_tips);
|
||||
dialog.setCancelable(true);
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
TextView btn_confirm = dialog.findViewById(R.id.btn_confirm);
|
||||
btn_confirm.setText(WordUtil.isNewZh() ? "確認" : "Confirm");
|
||||
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -16,6 +20,7 @@ import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
@@ -26,18 +31,19 @@ import java.math.BigDecimal;
|
||||
* 战令等级 经验
|
||||
*/
|
||||
public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current, expText;
|
||||
private TextView orderLevelDiamond, balanceDiamond, current, expText;
|
||||
private int currentExperience, totalExperience;//当前经验,全部经验
|
||||
private String buyExp = "100", currentLevel, balance;
|
||||
private String buyExp = "1", currentLevel, balance;
|
||||
private ProgressBar progressBar;
|
||||
private OrderLevelCallback orderLevelCallback;
|
||||
private long maxExp;
|
||||
private BattlePassUserInfoBean userInfoBean;
|
||||
private Context mContext;
|
||||
private EditText orderLevel;
|
||||
|
||||
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
|
||||
int mCurrentExperience, int mTotalExperience,
|
||||
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
||||
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean, int mCurrentExperience, int mTotalExperience, String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
this.userInfoBean = userInfoBean;
|
||||
currentExperience = mCurrentExperience;
|
||||
totalExperience = mTotalExperience;
|
||||
@@ -67,15 +73,15 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
progressBar.setProgress(currentExperience);
|
||||
expText.setText(String.format("%s/%s", userInfoBean.getBattlePassExp(), userInfoBean.getNextLevelExp()));
|
||||
current.setText(String.format("Lv%s", currentLevel));
|
||||
balanceDiamond.setText(balance);
|
||||
balanceDiamond.setText((WordUtil.isNewZh() ? "剩餘:" : "Balance:") + balance);
|
||||
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp > 100) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("100"));
|
||||
if (exp > 1) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("1"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
|
||||
orderLevelDiamond.setText("00 = " + buyExp + "00");
|
||||
orderLevel.setText(buyExp);
|
||||
}
|
||||
}
|
||||
@@ -84,15 +90,14 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
float exp = new BigDecimal(buyExp).floatValue();
|
||||
if (exp < maxExp && exp < 10000) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("100"));
|
||||
if (exp < maxExp && (exp + 1) < 10000) {
|
||||
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("1"));
|
||||
buyExp = String.valueOf(buyExpBigDecimal.intValue());
|
||||
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
|
||||
orderLevelDiamond.setText("00 = " + buyExp + "00");
|
||||
orderLevel.setText(buyExp);
|
||||
} else if (exp >= maxExp) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "经验已滿" : "Experience full");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "經驗超出,僅需" + maxExp + "經驗可達滿级" : "Exp exceeds.Only " + maxExp + " exp is needed to reach the max level.");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@@ -101,40 +106,68 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
orderLevel.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
buyExp = charSequence.toString();
|
||||
orderLevelDiamond.setText("00 = " + charSequence.toString() + "00");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.buying_experience), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.buyingExperiencePoint(buyExp, new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
|
||||
}
|
||||
dialog.dismiss();
|
||||
int input = 0;
|
||||
try {
|
||||
input = Integer.parseInt(orderLevel.getText().toString());
|
||||
} catch (Exception e) {
|
||||
input = 0;
|
||||
}
|
||||
if (StringUtil.isEmpty(orderLevel.getText().toString()) || input == 0) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "輸入数字不可為0" : "The input number cannot be 0");
|
||||
return;
|
||||
}
|
||||
if (Integer.parseInt(orderLevel.getText().toString() + "00") <= maxExp) {
|
||||
LiveNetManager.get(getContext()).buyingExperiencePoint(buyExp + "00", new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(102, error);
|
||||
}
|
||||
dialog.dismiss();
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (orderLevelCallback != null) {
|
||||
orderLevelCallback.onCallback(102, error);
|
||||
}
|
||||
});
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "經驗超出,僅需" + maxExp + "經驗可達滿级" : "Exp exceeds.Only " + maxExp + " exp is needed to reach the max level.");
|
||||
}
|
||||
}
|
||||
});
|
||||
IMLoginManager.get(getContext()).updateUserCoin(new OnItemClickListener<JSONObject>() {
|
||||
@Override
|
||||
public void onItemClick(JSONObject bean, int position) {
|
||||
if (bean != null) {
|
||||
balance = bean.getString("coin");
|
||||
balanceDiamond.setText((WordUtil.isNewZh() ? "剩餘:" : "Balance:") + balance);
|
||||
}
|
||||
}
|
||||
});
|
||||
IMLoginManager.get(getContext())
|
||||
.updateUserCoin(new OnItemClickListener<JSONObject>() {
|
||||
@Override
|
||||
public void onItemClick(JSONObject bean, int position) {
|
||||
if (bean != null) {
|
||||
balance = bean.getString("coin");
|
||||
balanceDiamond.setText(balance);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface OrderLevelCallback {
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双人小游戏结算弹窗
|
||||
*/
|
||||
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
public SudGameDoubleDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_sub_double;
|
||||
}
|
||||
|
||||
private AppCompatImageView sub_win_hat,sub_leave,sub_again,sub_title;
|
||||
private RoundedImageView sub_win_head,sub_loss_head;
|
||||
private AppCompatTextView sub_win_name,sub_win_score,sub_loss_name,sub_loss_score,sub_time;
|
||||
private CountDownTimer countDownTimer;
|
||||
private List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||
private boolean containMe;
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.dismissOnTouchOutside(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
sub_title = findViewById(R.id.sub_title);//弹窗标题
|
||||
sub_win_hat = findViewById(R.id.sub_win_hat);//胜利皇冠(平局隐藏)
|
||||
sub_leave = findViewById(R.id.sub_leave);//离开按钮
|
||||
sub_again = findViewById(R.id.sub_again);//再来一局按钮
|
||||
sub_win_head = findViewById(R.id.sub_win_head);//胜利方头像
|
||||
sub_loss_head = findViewById(R.id.sub_loss_head);//失败方头像
|
||||
sub_win_name = findViewById(R.id.sub_win_name);//胜利方昵称
|
||||
sub_win_score = findViewById(R.id.sub_win_score);//胜利方分数
|
||||
sub_loss_name = findViewById(R.id.sub_loss_name);//失败方昵称
|
||||
sub_loss_score = findViewById(R.id.sub_loss_score);//失败方分数
|
||||
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||
|
||||
|
||||
initData();
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
}else {
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||
}
|
||||
|
||||
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||
sub_again.setOnClickListener(v-> {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
destroyDialog();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initData() {
|
||||
if (settleBeans.size() == 2){
|
||||
sortByWinNum(settleBeans);
|
||||
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
|
||||
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
|
||||
checkMe(sudSettleBean1.getUid(),sudSettleBean2.getUid());//判断这场对局是不是包含自己
|
||||
|
||||
// 检查是否是当前用户
|
||||
boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
|
||||
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
|
||||
boolean isZh = WordUtil.isNewZh();
|
||||
|
||||
if (containMe) {
|
||||
// 当前用户在游戏中
|
||||
SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
|
||||
SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
|
||||
|
||||
ImgLoader.display(mContext, winBean.getAvatar_url(), sub_win_head);
|
||||
ImgLoader.display(mContext, lossBean.getAvatar_url(), sub_loss_head);
|
||||
sub_win_name.setText(winBean.getNick_name());
|
||||
sub_loss_name.setText(lossBean.getNick_name());
|
||||
|
||||
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
|
||||
|
||||
if (isDraw) {
|
||||
// 平局
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
||||
sub_win_hat.setVisibility(View.GONE);
|
||||
} else {
|
||||
// 胜利或失败
|
||||
sub_title.setImageResource(isZh ? (isFirstMe ? R.mipmap.sub_win_zh : R.mipmap.sub_loss_zh) : (isFirstMe ? R.mipmap.sub_win_en : R.mipmap.sub_loss_en));
|
||||
sub_win_hat.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
// 当前用户不在游戏中
|
||||
ImgLoader.display(mContext, sudSettleBean1.getAvatar_url(), sub_win_head);
|
||||
ImgLoader.display(mContext, sudSettleBean2.getAvatar_url(), sub_loss_head);
|
||||
sub_win_name.setText(sudSettleBean1.getNick_name());
|
||||
sub_loss_name.setText(sudSettleBean2.getNick_name());
|
||||
|
||||
sub_win_score.setText(sudSettleBean1.getWin_num() > 0 ? "+" + sudSettleBean1.getWin_num() : String.valueOf(sudSettleBean1.getWin_num()));
|
||||
sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num()));
|
||||
|
||||
if (isDraw) {
|
||||
// 平局
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
||||
sub_win_hat.setVisibility(View.GONE);
|
||||
} else {
|
||||
// 非当前用户的胜利
|
||||
sub_title.setImageResource(isZh ? R.mipmap.sub_win_zh : R.mipmap.sub_win_en);
|
||||
sub_win_hat.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkMe(String id1,String id2){
|
||||
containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
//关闭倒计时
|
||||
countDownTimer = new CountDownTimer(10000, 1000){
|
||||
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
sub_time.setText(String.valueOf((l+500)/1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
destroyDialog();
|
||||
}
|
||||
}.start();
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setSudSettleList(List<SudSettleBean> data){
|
||||
settleBeans.clear();
|
||||
settleBeans.addAll(data);
|
||||
LogUtils.e("yqw=====>"+settleBeans);
|
||||
}
|
||||
|
||||
private void sortByWinNum(List<SudSettleBean> list){
|
||||
// 按照胜利数排序 settleBeans 列表
|
||||
Collections.sort(list, (bean1, bean2) -> {
|
||||
return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
|
||||
});
|
||||
}
|
||||
|
||||
private void destroyDialog(){
|
||||
dismiss();
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.SudGameAdapter;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 多人小游戏弹窗
|
||||
*/
|
||||
public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
|
||||
public SudGameMultipleDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_sub_multiple;
|
||||
}
|
||||
|
||||
private RecyclerView sub_recycle_rank;
|
||||
private AppCompatImageView sub_leave,sub_again,sub_title;
|
||||
private AppCompatTextView sub_time;
|
||||
private CountDownTimer countDownTimer;
|
||||
private SudGameAdapter sudGameAdapter;
|
||||
private final List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.dismissOnTouchOutside(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
sub_recycle_rank = findViewById(R.id.sub_recycle_rank);//分数排名
|
||||
sub_leave = findViewById(R.id.sub_leave);//离开按钮
|
||||
sub_again = findViewById(R.id.sub_again);//再来一局按钮
|
||||
sub_title = findViewById(R.id.sub_title);//弹窗标题
|
||||
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
sub_title.setImageResource(R.mipmap.sub_over_zh);
|
||||
}else {
|
||||
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||
sub_title.setImageResource(R.mipmap.sub_over_en);
|
||||
}
|
||||
|
||||
sub_leave.setOnClickListener(v-> destroyDialog());
|
||||
sub_again.setOnClickListener(v-> {
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
destroyDialog();
|
||||
});
|
||||
|
||||
//设置排名数据
|
||||
sudGameAdapter = new SudGameAdapter(mContext,settleBeans);
|
||||
sub_recycle_rank.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
sub_recycle_rank.setAdapter(sudGameAdapter);
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
//关闭倒计时
|
||||
countDownTimer = new CountDownTimer(10000, 1000){
|
||||
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
sub_time.setText(String.valueOf((l+500)/1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
destroyDialog();
|
||||
}
|
||||
}.start();
|
||||
sudGameAdapter.notifyDataSetChanged();
|
||||
// limitItem();
|
||||
}
|
||||
|
||||
public void setSudSettleList(List<SudSettleBean> data){
|
||||
settleBeans.clear();
|
||||
settleBeans.addAll(data);
|
||||
}
|
||||
|
||||
//设置最多显示的高度
|
||||
private void limitItem(){
|
||||
sub_recycle_rank.post(() -> {
|
||||
View itemView = sub_recycle_rank.getChildAt(0);
|
||||
if (itemView != null){
|
||||
int height = (int) (itemView.getHeight()*3.5);
|
||||
ViewGroup.LayoutParams layoutParams = sub_recycle_rank.getLayoutParams();
|
||||
layoutParams.height = height;
|
||||
sub_recycle_rank.setLayoutParams(layoutParams);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void destroyDialog(){
|
||||
dismiss();
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class SudLoadDialog extends AbsDialogCenterPopupWindow{
|
||||
public SudLoadDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
private LinearLayoutCompat sud_load_bg;
|
||||
private AppCompatImageView sud_load,sud_load_skip,sud_load_again;
|
||||
private ProgressBar sud_load_bar_double,sud_load_bar_multiple;
|
||||
private int isDouble = 0;//游戏模式 1:双人对战 2:多人游戏
|
||||
private int clickStatus = 0;//0:什么都不点击 1:点击跳过 2:点击再来一局
|
||||
|
||||
public int getClickStatus() {
|
||||
return clickStatus;
|
||||
}
|
||||
|
||||
public void setClickStatus(int clickStatus) {
|
||||
this.clickStatus = clickStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.dismissOnTouchOutside(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_sud_load;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
sud_load_bg = findViewById(R.id.sud_load_bg);
|
||||
sud_load = findViewById(R.id.sud_load);
|
||||
sud_load_skip = findViewById(R.id.sud_load_skip);
|
||||
sud_load_again = findViewById(R.id.sud_load_again);
|
||||
sud_load_bar_double = findViewById(R.id.sud_load_bar_double);
|
||||
sud_load_bar_multiple = findViewById(R.id.sud_load_bar_multiple);
|
||||
|
||||
if (WordUtil.isNewZh()){
|
||||
sud_load.setImageResource(R.mipmap.sud_load_zh);
|
||||
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_zh);
|
||||
sud_load_again.setImageResource(R.mipmap.sub_again_zh);
|
||||
}else {
|
||||
sud_load.setImageResource(R.mipmap.sud_load_en);
|
||||
sud_load_skip.setImageResource(R.mipmap.sud_load_skip_en);
|
||||
sud_load_again.setImageResource(R.mipmap.sub_again_en);
|
||||
}
|
||||
|
||||
sud_load_skip.setOnClickListener(v->{
|
||||
clickStatus = 1;
|
||||
dismiss();
|
||||
});
|
||||
|
||||
sud_load_again.setOnClickListener(v->{
|
||||
clickStatus = 2;
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
if (isDouble == 1){
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_double));
|
||||
sud_load_bar_double.setVisibility(View.VISIBLE);
|
||||
sud_load_bar_multiple.setVisibility(View.GONE);
|
||||
}else {
|
||||
sud_load_bg.setBackground(ContextCompat.getDrawable(mContext,R.mipmap.sud_load_bg_multiple));
|
||||
sud_load_bar_double.setVisibility(View.GONE);
|
||||
sud_load_bar_multiple.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
// if (this.isShow()){
|
||||
// dismiss();
|
||||
// }
|
||||
// },10000);
|
||||
}
|
||||
|
||||
public void setDouble(int isDouble){
|
||||
this.isDouble = isDouble;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,22 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
|
||||
public class CheckRemainingBalanceEvent extends BaseModel {
|
||||
public int seatIndex=0;
|
||||
private String SudMGPMGState;
|
||||
private boolean subReady = false;//是否直接自动准备
|
||||
private SudMGPMGState.MGCommonGameSettle mgCommonGameSettle;//结算数据
|
||||
|
||||
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle() {
|
||||
return mgCommonGameSettle;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setMgCommonGameSettle(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
|
||||
this.mgCommonGameSettle = mgCommonGameSettle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudMGPMGState() {
|
||||
return SudMGPMGState;
|
||||
@@ -23,4 +35,13 @@ public class CheckRemainingBalanceEvent extends BaseModel {
|
||||
this.seatIndex = seatIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CheckRemainingBalanceEvent setSubReady(boolean subReady){
|
||||
this.subReady = subReady;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getSubReady(){
|
||||
return subReady;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class ClosePopupDialogEvent extends BaseModel {
|
||||
public Object id=null;
|
||||
|
||||
public ClosePopupDialogEvent(Object id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public ClosePopupDialogEvent() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallMainTab1List2Adapter;
|
||||
import com.yunbao.common.bean.GiftWallBean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.dialog.GiftWallMainTab1List2SpinnerDialog;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class GiftWallMainTab1Fragment extends BaseFragment {
|
||||
TextView classicGiftsTitle, starGiftsTitle;
|
||||
TextView classicGiftsNumber, starGiftsNumber;
|
||||
RecyclerView recyclerView1, recyclerView2;
|
||||
View spinner;
|
||||
TextView spinnerText;
|
||||
ImageView spinnerImage;
|
||||
|
||||
GiftWallMainTab1List2Adapter list1Adapter, list2Adapter;
|
||||
|
||||
int screen;
|
||||
String toUserId;
|
||||
String anchorId;
|
||||
boolean isAnchor;
|
||||
boolean isLiveRoom;
|
||||
SVGAVideoEntity drawable;
|
||||
View classic_layout, star_layout;
|
||||
TextView show_time;
|
||||
View show_time_layout;
|
||||
View hideLayout;
|
||||
View appbar;
|
||||
|
||||
OnItemClickListener<GiftWallBean> onItemClickListener;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
||||
return inflater.inflate(R.layout.fragment_gift_wall_man_tab_1, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
public GiftWallMainTab1Fragment setToUserId(String toUserId) {
|
||||
this.toUserId = toUserId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab1Fragment setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab1Fragment setAnchor(boolean anchor) {
|
||||
isAnchor = anchor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab1Fragment setLiveRoom(boolean liveRoom) {
|
||||
isLiveRoom = liveRoom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab1Fragment setOnItemClickListener(OnItemClickListener<GiftWallBean> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateData() {
|
||||
super.updateData();
|
||||
if (list1Adapter != null) {
|
||||
list1Adapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
if (list2Adapter != null) {
|
||||
list2Adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
if (isAnchor) {
|
||||
LiveNetManager.get(getContext())
|
||||
.liveGiftHall(toUserId, screen, new HttpCallback<GiftWallBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
LiveNetManager.get(getContext())
|
||||
.singleUserGiftHall(toUserId, screen, new HttpCallback<GiftWallBean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallBean data) {
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void initData(GiftWallBean bean) {
|
||||
onItemClickListener.onItemClick(bean, bean.getGift_hall_rank_hide());
|
||||
if (bean.getGift_hall_rank_hide() == 1 && !toUserId.equals(IMLoginManager.get(getContext()).getUserInfo().getId() + "")) {
|
||||
hideLayout.setVisibility(View.VISIBLE);
|
||||
appbar.setVisibility(View.GONE);
|
||||
classic_layout.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
hideLayout.setVisibility(View.GONE);
|
||||
appbar.setVisibility(View.VISIBLE);
|
||||
classic_layout.setVisibility(View.VISIBLE);
|
||||
|
||||
list1Adapter.setDrawable(drawable);
|
||||
list1Adapter.setList(bean.getIlluminate_data().getWeek_star_data());
|
||||
list2Adapter.setList(bean.getIlluminate_data().getGift_data());
|
||||
list1Adapter.setLiveRoom(isLiveRoom);
|
||||
list2Adapter.setLiveRoom(isLiveRoom);
|
||||
|
||||
starGiftsNumber.setText(String.format(Locale.getDefault(), "%s%d/%d",
|
||||
WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_up),
|
||||
bean.getIlluminate_data().getWeek_gift_illuminate_num(),
|
||||
bean.getIlluminate_data().getWeek_star_gift_num()
|
||||
));
|
||||
classicGiftsNumber.setText(String.format(Locale.getDefault(), "%s%d/%d",
|
||||
WordUtil.getNewString(R.string.dialog_gift_wall_list_spinner_up),
|
||||
bean.getIlluminate_data().getGift_illuminate_num(),
|
||||
bean.getIlluminate_data().getGift_num()
|
||||
));
|
||||
if (bean.getIlluminate_data().getWeek_star_data() != null) {
|
||||
show_time.setText(String.format(Locale.getDefault(), "%s%s - %s",
|
||||
WordUtil.getNewString(R.string.dialog_gift_wall_time_now),
|
||||
bean.getIlluminate_data().getGift_hall_start_date(),
|
||||
bean.getIlluminate_data().getGift_hall_end_date()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
classicGiftsTitle = contentView.findViewById(R.id.classic_gifts_title);
|
||||
classicGiftsNumber = contentView.findViewById(R.id.classic_gifts_number);
|
||||
recyclerView1 = contentView.findViewById(R.id.recyclerView1);
|
||||
recyclerView2 = contentView.findViewById(R.id.recyclerView2);
|
||||
starGiftsTitle = contentView.findViewById(R.id.star_gifts_title);
|
||||
starGiftsNumber = contentView.findViewById(R.id.star_gifts_number);
|
||||
spinner = contentView.findViewById(R.id.classic_gift_spinner);
|
||||
spinnerText = contentView.findViewById(R.id.classic_gift_spinner_text);
|
||||
spinnerImage = contentView.findViewById(R.id.classic_gift_spinner_ic);
|
||||
classic_layout = contentView.findViewById(R.id.classic_layout);
|
||||
star_layout = contentView.findViewById(R.id.star_layout);
|
||||
show_time = contentView.findViewById(R.id.show_time);
|
||||
show_time_layout = contentView.findViewById(R.id.show_time_layout);
|
||||
hideLayout = contentView.findViewById(R.id.hideLayout);
|
||||
appbar = contentView.findViewById(R.id.appbar);
|
||||
|
||||
list1Adapter = new GiftWallMainTab1List2Adapter(getContext());
|
||||
list2Adapter = new GiftWallMainTab1List2Adapter(getContext());
|
||||
|
||||
list1Adapter.setToUid(toUserId);
|
||||
list2Adapter.setToUid(toUserId);
|
||||
list1Adapter.setAnchor(isAnchor);
|
||||
list2Adapter.setAnchor(isAnchor);
|
||||
list1Adapter.setAnchorId(anchorId);
|
||||
list2Adapter.setAnchorId(anchorId);
|
||||
list1Adapter.setStar(true);
|
||||
|
||||
recyclerView1.setAdapter(list1Adapter);
|
||||
recyclerView2.setAdapter(list2Adapter);
|
||||
|
||||
recyclerView1.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(10), DpUtil.dp2px(5)));
|
||||
recyclerView2.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(2), DpUtil.dp2px(5)));
|
||||
|
||||
starGiftsTitle.getPaint().setShader(new LinearGradient(0, 0, 0, classicGiftsTitle.getPaint().getTextSize(),
|
||||
Color.parseColor("#FEE8C6"), Color.parseColor("#FFD5A3"), Shader.TileMode.CLAMP));
|
||||
|
||||
classicGiftsTitle.getPaint().setShader(new LinearGradient(0, 0, 0, classicGiftsTitle.getPaint().getTextSize(),
|
||||
Color.parseColor("#A0E9FF"), Color.parseColor("#72D1FF"), Shader.TileMode.CLAMP));
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext())
|
||||
.atView(spinner);
|
||||
spinner.setTag(builder);
|
||||
|
||||
if (!isAnchor) {
|
||||
show_time_layout.setVisibility(View.GONE);
|
||||
star_layout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(spinner, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
spinnerImage.setRotation(180);
|
||||
((XPopup.Builder) spinner.getTag()).asCustom(new GiftWallMainTab1List2SpinnerDialog(getContext(), 0, new OnItemClickListener<Integer>() {
|
||||
@Override
|
||||
public void onItemClick(Integer bean, int position) {
|
||||
if (bean > -1) {
|
||||
screen = bean;
|
||||
initData();
|
||||
}
|
||||
switch (bean) {
|
||||
case 0:
|
||||
spinnerText.setText(R.string.dialog_gift_wall_list_spinner_all);
|
||||
break;
|
||||
case 1:
|
||||
spinnerText.setText(R.string.dialog_gift_wall_list_spinner_up);
|
||||
break;
|
||||
case 2:
|
||||
spinnerText.setText(R.string.dialog_gift_wall_list_spinner_down);
|
||||
break;
|
||||
}
|
||||
spinnerImage.setRotation(0);
|
||||
}
|
||||
})).show();
|
||||
|
||||
}
|
||||
});
|
||||
new SVGAParser(getContext()).decodeFromAssets("gift_wall_light_up.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@NonNull SVGAVideoEntity videoItem) {
|
||||
GiftWallMainTab1Fragment.this.drawable = videoItem;
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
System.err.println("-------------SVGA报错了");
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.angcyo.tablayout.DslTabLayout;
|
||||
import com.angcyo.tablayout.DslTabLayoutConfig;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftWallMainTab2ListAdapter;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.dialog.GiftWallMainTab1List2SpinnerDialog;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function4;
|
||||
|
||||
public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
TextView classicGiftsTitle, starGiftsTitle;
|
||||
RecyclerView recyclerView1, recyclerView2;
|
||||
View spinner;
|
||||
TextView spinnerText;
|
||||
ImageView spinnerImage;
|
||||
GiftWallMainTab2ListAdapter list1Adapter, list2Adapter;
|
||||
TextView show_time;
|
||||
DslTabLayout tabLayout;
|
||||
TextView dslTab1, dslTab2;
|
||||
|
||||
|
||||
int screen;
|
||||
int type = 1;
|
||||
String toUserId;
|
||||
String anchorId;
|
||||
boolean isAnchor;
|
||||
private boolean isLiveRoom;
|
||||
private boolean isTab2;
|
||||
|
||||
public GiftWallMainTab2Fragment setToUserId(String toUserId) {
|
||||
this.toUserId = toUserId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab2Fragment setAnchorId(String anchorId) {
|
||||
this.anchorId = anchorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab2Fragment setAnchor(boolean anchor) {
|
||||
isAnchor = anchor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftWallMainTab2Fragment setLiveRoom(boolean liveRoom) {
|
||||
isLiveRoom = liveRoom;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
||||
return inflater.inflate(R.layout.fragment_gift_wall_man_tab_2, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
classicGiftsTitle = contentView.findViewById(R.id.classic_gifts_title);
|
||||
recyclerView1 = contentView.findViewById(R.id.recyclerView1);
|
||||
recyclerView2 = contentView.findViewById(R.id.recyclerView2);
|
||||
starGiftsTitle = contentView.findViewById(R.id.star_gifts_title);
|
||||
spinner = contentView.findViewById(R.id.classic_gift_spinner);
|
||||
spinnerText = contentView.findViewById(R.id.classic_gift_spinner_text);
|
||||
spinnerImage = contentView.findViewById(R.id.classic_gift_spinner_ic);
|
||||
show_time = contentView.findViewById(R.id.show_time);
|
||||
tabLayout = findViewById(R.id.tab_layout);
|
||||
dslTab1 = findViewById(R.id.dsl_tab1);
|
||||
dslTab2 = findViewById(R.id.dsl_tab2);
|
||||
|
||||
list1Adapter = new GiftWallMainTab2ListAdapter(getContext());
|
||||
list2Adapter = new GiftWallMainTab2ListAdapter(getContext());
|
||||
|
||||
list1Adapter.setToUid(toUserId);
|
||||
list2Adapter.setToUid(toUserId);
|
||||
list1Adapter.setAnchor(isAnchor);
|
||||
list2Adapter.setAnchor(isAnchor);
|
||||
list1Adapter.setAnchorId(anchorId);
|
||||
list2Adapter.setAnchorId(anchorId);
|
||||
list1Adapter.setLiveRoom(isLiveRoom);
|
||||
list2Adapter.setLiveRoom(isLiveRoom);
|
||||
list1Adapter.setStar(true);
|
||||
|
||||
recyclerView1.setAdapter(list1Adapter);
|
||||
recyclerView2.setAdapter(list2Adapter);
|
||||
|
||||
|
||||
//recyclerView1.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(3), DpUtil.dp2px(5)));
|
||||
//recyclerView2.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(3), DpUtil.dp2px(5)));
|
||||
|
||||
starGiftsTitle.getPaint().setShader(new LinearGradient(0, 0, 0, classicGiftsTitle.getPaint().getTextSize(),
|
||||
Color.parseColor("#FEE8C6"), Color.parseColor("#FFD5A3"), Shader.TileMode.CLAMP));
|
||||
|
||||
classicGiftsTitle.getPaint().setShader(new LinearGradient(0, 0, 0, classicGiftsTitle.getPaint().getTextSize(),
|
||||
Color.parseColor("#A0E9FF"), Color.parseColor("#72D1FF"), Shader.TileMode.CLAMP));
|
||||
|
||||
setDslTabColor(dslTab1, dslTab2);
|
||||
|
||||
tabLayout.configTabLayoutConfig(new Function1<DslTabLayoutConfig, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(DslTabLayoutConfig dslTabLayoutConfig) {
|
||||
dslTabLayoutConfig.setOnSelectItemView(new Function4<View, Integer, Boolean, Boolean, Boolean>() {
|
||||
@Override
|
||||
public Boolean invoke(View itemView, Integer index, Boolean select, Boolean fromUser) {
|
||||
//当需要选中itemView时, 触发的回调.
|
||||
//返回true, 拦截库中的默认处理.
|
||||
return index == (type - 1);
|
||||
}
|
||||
});
|
||||
dslTabLayoutConfig.setOnSelectViewChange(new Function4<View, List<? extends View>, Boolean, Boolean, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(View fromView, List<? extends View> selectViewList, Boolean select, Boolean fromUser) {
|
||||
//fromView 表示之前选中的view, 多选模式不支持.
|
||||
//selectViewList 表示目前选中view的集合, 单选模式列表里面只有一个,可以使用selectViewList.get(0)获取.
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
dslTabLayoutConfig.setOnSelectIndexChange(new Function4<Integer, List<Integer>, Boolean, Boolean, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(Integer fromIndex, List<Integer> selectIndexList, Boolean select, Boolean fromUser) {
|
||||
//参考setOnSelectViewChange
|
||||
//只不过对象从view,变成了view在ViewGroup中的索引
|
||||
if (isTab2 && fromIndex == -1) {
|
||||
fromIndex = 1;
|
||||
} else if (fromIndex == 0) {
|
||||
fromIndex = 1;
|
||||
} else {
|
||||
fromIndex = 0;
|
||||
}
|
||||
|
||||
setDslTabColor(fromIndex == 0 ? dslTab1 : dslTab2, fromIndex == 1 ? dslTab1 : dslTab2);
|
||||
type = (fromIndex + 1);
|
||||
list1Adapter.setNowRank(fromIndex == 0);
|
||||
list2Adapter.setNowRank(fromIndex == 0);
|
||||
screen = 0;
|
||||
spinnerText.setText(R.string.dialog_gift_wall_list_spinner_all);
|
||||
initData();
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
XPopup.Builder builder = new XPopup.Builder(getContext())
|
||||
.atView(spinner);
|
||||
spinner.setTag(builder);
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(spinner, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
spinnerImage.setRotation(180);
|
||||
((XPopup.Builder) spinner.getTag()).asCustom(new GiftWallMainTab1List2SpinnerDialog(getContext(), 1, new OnItemClickListener<Integer>() {
|
||||
@Override
|
||||
public void onItemClick(Integer bean, int position) {
|
||||
if (bean > -1) {
|
||||
screen = bean;
|
||||
initData();
|
||||
}
|
||||
switch (bean) {
|
||||
case 0:
|
||||
spinnerText.setText(R.string.dialog_gift_wall_list_spinner_all);
|
||||
break;
|
||||
case 1:
|
||||
spinnerText.setText(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get);
|
||||
break;
|
||||
case 2:
|
||||
spinnerText.setText(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get_un);
|
||||
break;
|
||||
}
|
||||
spinnerImage.setRotation(0);
|
||||
}
|
||||
})).show();
|
||||
|
||||
}
|
||||
});
|
||||
if (isTab2) {
|
||||
tabLayout.onPageSelected(1);
|
||||
} else {
|
||||
initData();
|
||||
}
|
||||
}
|
||||
|
||||
void setDslTabColor(TextView select, TextView unSelect) {
|
||||
select.getPaint().setShader(new LinearGradient(0, 0, 0, select.getPaint().getTextSize(),
|
||||
Color.parseColor("#FEE0B6"), Color.parseColor("#FFCF95"), Shader.TileMode.CLAMP));
|
||||
unSelect.setTextColor(Color.parseColor("#FFEED8"));
|
||||
unSelect.getPaint().setShader(null);
|
||||
}
|
||||
|
||||
void initData() {
|
||||
list1Adapter.clear();
|
||||
list2Adapter.clear();
|
||||
if (type == 2) {
|
||||
spinner.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
spinner.setVisibility(View.VISIBLE);
|
||||
}
|
||||
LiveNetManager.get(getContext())
|
||||
.allGiftHall(String.valueOf(type), new HttpCallback<GiftWallTab2Bean>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallTab2Bean data) {
|
||||
if (screen != 0) {
|
||||
filtrationData(data);
|
||||
}
|
||||
initData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void filtrationData(GiftWallTab2Bean bean) {
|
||||
Iterator<GiftWallTab2Bean.Gift> iterator = bean.getIlluminateData().getGiftData().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
GiftWallTab2Bean.Gift next = iterator.next();
|
||||
if (screen == 1 && next.getIlluminateStatus() != 1) {//已点亮
|
||||
iterator.remove();
|
||||
} else if (screen == 2 && next.getIlluminateStatus() == 1) {//未点亮
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initData(GiftWallTab2Bean bean) {
|
||||
list1Adapter.setList(bean.getIlluminateData().getWeekStartData());
|
||||
list2Adapter.setList(bean.getIlluminateData().getGiftData());
|
||||
show_time.setText(String.format(Locale.getDefault(), "%s%s - %s",
|
||||
WordUtil.getNewString(type == 1 ? R.string.dialog_gift_wall_time_now : R.string.dialog_gift_wall_time_old),
|
||||
bean.getGift_hall_start_date(),
|
||||
bean.getGift_hall_end_date()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
|
||||
public void setTab2() {
|
||||
isTab2 = true;
|
||||
}
|
||||
}
|
||||
@@ -243,10 +243,11 @@ public class LiveHttpUtil {
|
||||
/**
|
||||
* 举报用户 + 图片
|
||||
*/
|
||||
public static void setReport(String touid, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) {
|
||||
public static void setReport(String touid,String report_argument, String content, File file1, File file2, File file3, String videoId, HttpCallback callback) {
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.setReport", LiveHttpConsts.SET_REPORT)
|
||||
.isMultipart(true)
|
||||
.params("touid", touid)
|
||||
.params("report_argument", report_argument)
|
||||
.params("content", content);
|
||||
if (file1 != null) {
|
||||
request.params("file1", file1);
|
||||
|
||||
@@ -29,8 +29,12 @@ import com.yunbao.common.bean.FirstLoginBean;
|
||||
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
||||
import com.yunbao.common.bean.GiftGuideModel;
|
||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||
import com.yunbao.common.bean.GiftWallBean;
|
||||
import com.yunbao.common.bean.GiftWallGiftDetail;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallMainTab2ClassicInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
|
||||
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||
@@ -65,7 +69,6 @@ import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankGiftResultBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.PrankProgressBean;
|
||||
@@ -84,6 +87,8 @@ import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.ShareBean;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.bean.SudgameCodeModel;
|
||||
@@ -1038,6 +1043,22 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=Sudgame.getCode")
|
||||
Observable<ResponseModel<List<SudgameCodeModel>>> getCode();
|
||||
|
||||
/**
|
||||
* 获取房间金豆门槛和赢家获得的金豆
|
||||
*/
|
||||
@GET("/api/public/?service=Sudgameserver.checkRemainingBalance")
|
||||
Observable<ResponseModel<SudGameScoreBean>> getScore(
|
||||
@Query("room_id") String roomId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取游戏中玩家的信息
|
||||
*/
|
||||
@GET("/api/public/?service=Sudgameserver.getGameUser")
|
||||
Observable<ResponseModel<List<SudGameInfoBean>>> getSudGameInfo(
|
||||
@Query("room_id") String roomId
|
||||
);
|
||||
|
||||
/**
|
||||
* 创建游戏房
|
||||
*
|
||||
@@ -1335,7 +1356,7 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<GuardGetGuardOpenInfoModel>> getGuardOpenInfo(@Query("liveuid") String liveUid);
|
||||
|
||||
@GET("/api/public/?service=Guard.openGuard")
|
||||
Observable<ResponseModel<Object>> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey, @Query("stream") String stream);
|
||||
Observable<ResponseModel<Object>> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey, @Query("stream") String stream,@Query("coupon_type") String coupon_type,@Query("coupon_id") String coupon_id);
|
||||
|
||||
@GET("/api/public/?service=Guard.sendMoneyLong")
|
||||
Observable<ResponseModel<Object>> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum);
|
||||
@@ -1410,4 +1431,62 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<QiniuLog>> getPrankList(
|
||||
@Query("type")String type
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Gift.getGiftHallMedalList")
|
||||
Observable<ResponseModel<MedalAchievementModel>> getGiftHallMedalList(@Query("to_uid") String liveUid,@Query("type")String type);
|
||||
|
||||
@GET("/api/public/?service=Gift.useMedal")
|
||||
Observable<ResponseModel<List<BaseModel>>> userUseDress(@Query("users_dress_id")String users_dress_id,@Query("dress_type")int dress_type);
|
||||
/**
|
||||
* 个人展馆
|
||||
*/
|
||||
@GET("/api/public/?service=Gift.singleUserGiftHall")
|
||||
Observable<ResponseModel<GiftWallBean>> singleUserGiftHall(
|
||||
@Query("user_id")String userId,
|
||||
@Query("screen")int screen
|
||||
);
|
||||
|
||||
/**
|
||||
* 主播展馆
|
||||
*/
|
||||
@GET("/api/public/?service=Gift.liveGiftHall")
|
||||
Observable<ResponseModel<GiftWallBean>> liveGiftHall(
|
||||
@Query("live_id")String userId,
|
||||
@Query("screen")int screen
|
||||
);
|
||||
|
||||
/**
|
||||
* 个人展馆详情
|
||||
*/
|
||||
@GET("/api/public/?service=Gift.singleUserGiftHallDetail")
|
||||
Observable<ResponseModel<GiftWallInfoBean>> singleUserGiftHallDetail(
|
||||
@Query("user_id")String userId,
|
||||
@Query("gift_id")String gift_id
|
||||
);
|
||||
|
||||
/**
|
||||
* 主播展馆详情
|
||||
*/
|
||||
@GET("/api/public/?service=Gift.liveGiftHallDetail")
|
||||
Observable<ResponseModel<GiftWallInfoBean>> liveGiftHallDetail(
|
||||
@Query("live_id")String live_id,
|
||||
@Query("gift_id")String gift_id,
|
||||
@Query("gift_hall_type")int gift_hall_type,
|
||||
@Query("list_type")int list_type
|
||||
);
|
||||
|
||||
/**
|
||||
* 全站展馆
|
||||
*/
|
||||
@GET("/api/public/?service=Gift.allGiftHall")
|
||||
Observable<ResponseModel<GiftWallTab2Bean>> allGiftHall(
|
||||
@Query("type")String type
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Gift.lastAllGiftHallWeekStarDetail")
|
||||
Observable<ResponseModel<GiftWallMainTab2ClassicInfoBean>> lastAllGiftHallWeekStarDetail(
|
||||
@Query("gift_id")String giftId,
|
||||
@Query("live_uid")String liveUid
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -33,8 +33,12 @@ import com.yunbao.common.bean.FirstLoginBean;
|
||||
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
||||
import com.yunbao.common.bean.GiftGuideModel;
|
||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||
import com.yunbao.common.bean.GiftWallBean;
|
||||
import com.yunbao.common.bean.GiftWallGiftDetail;
|
||||
import com.yunbao.common.bean.GiftWallInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallMainTab2ClassicInfoBean;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.bean.GiftWallTab2Bean;
|
||||
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
|
||||
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
||||
@@ -67,7 +71,6 @@ import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankGiftResultBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.PrankProgressBean;
|
||||
@@ -84,6 +87,8 @@ import com.yunbao.common.bean.SendMoneyLongModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.ShareBean;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.bean.SudgameCodeModel;
|
||||
@@ -116,7 +121,6 @@ import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
|
||||
/**
|
||||
@@ -900,9 +904,9 @@ public class LiveNetManager {
|
||||
/**
|
||||
* 获取转盘整蛊列表
|
||||
*/
|
||||
public void getPrankGiftList(String mLiveUid, String prank_type,HttpCallback<PrankGiftResultBean> callback) {
|
||||
public void getPrankGiftList(String mLiveUid, String prank_type, HttpCallback<PrankGiftResultBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.prankList(mLiveUid,prank_type)
|
||||
.prankList(mLiveUid, prank_type)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel -> {
|
||||
@@ -922,28 +926,28 @@ public class LiveNetManager {
|
||||
/**
|
||||
* 获取整蛊进度列表
|
||||
*/
|
||||
public void getPrankProgressList(String mLiveUid, HttpCallback<PrankProgressBean> callback){
|
||||
public void getPrankProgressList(String mLiveUid, HttpCallback<PrankProgressBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPrankProgressList(mLiveUid)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel->{
|
||||
if (callback != null){
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
},throwable->{
|
||||
if (callback != null){
|
||||
}, throwable -> {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
} ).isDisposed();
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼物整蛊
|
||||
*/
|
||||
public void setPrankGift(String mLiveUid, String status, String prank_json,String prank_type,String is_cleared, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||
public void setPrankGift(String mLiveUid, String status, String prank_json, String prank_type, String is_cleared, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setPrank(mLiveUid, status, prank_json, prank_type,is_cleared)
|
||||
.setPrank(mLiveUid, status, prank_json, prank_type, is_cleared)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel -> {
|
||||
@@ -2312,6 +2316,48 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间金豆门槛和赢家获得的金豆
|
||||
* @param roomId
|
||||
* @param callback
|
||||
*/
|
||||
public void getScore(String roomId,HttpCallback<SudGameScoreBean> callback){
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getScore(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(sudGameScoreBeanResponseModel -> {
|
||||
if (callback != null){
|
||||
callback.onSuccess(sudGameScoreBeanResponseModel.getData().getInfo());
|
||||
}
|
||||
}, throwable -> {
|
||||
if (callback != null){
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取游戏中所有玩家的信息
|
||||
* @param roomId
|
||||
* @param callback
|
||||
*/
|
||||
public void getSudGameInfo(String roomId,HttpCallback<List<SudGameInfoBean>> callback){
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getSudGameInfo(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(infoModel->{
|
||||
if (callback != null){
|
||||
callback.onSuccess(infoModel.getData().getInfo());
|
||||
}
|
||||
},throwable -> {
|
||||
if (callback != null){
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
||||
@@ -3032,9 +3078,9 @@ public class LiveNetManager {
|
||||
|
||||
}
|
||||
|
||||
public void openGuard(String liveUid, String guardType, String priceKey, String stream, HttpCallback<String> callback) {
|
||||
public void openGuard(String liveUid, String guardType, String priceKey, String stream,String coupon_type,String couponId, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.openGuard(liveUid, guardType, priceKey, stream)
|
||||
.openGuard(liveUid, guardType, priceKey, stream,coupon_type,couponId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@@ -3251,7 +3297,7 @@ public class LiveNetManager {
|
||||
String payload
|
||||
, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createGameOrder(roomId, cmd, value, gameId, fromUid, toUid,payload)
|
||||
.createGameOrder(roomId, cmd, value, gameId, fromUid, toUid, payload)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@@ -3299,12 +3345,139 @@ public class LiveNetManager {
|
||||
|
||||
}
|
||||
|
||||
public void singleUserGiftHall(String userId, int screen, HttpCallback<GiftWallBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.singleUserGiftHall(userId, screen)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.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 liveGiftHall(String userId, int screen, HttpCallback<GiftWallBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.liveGiftHall(userId, screen)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.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 singleUserGiftHallDetail(String userId, String giftId, HttpCallback<GiftWallInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.singleUserGiftHallDetail(userId, giftId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.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 liveGiftHallDetail(String liveId, String giftId, int gift_hall_type, int list_type, HttpCallback<GiftWallInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.liveGiftHallDetail(liveId, giftId, gift_hall_type, list_type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.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 allGiftHall(String type, HttpCallback<GiftWallTab2Bean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.allGiftHall(type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.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 lastAllGiftHallWeekStarDetail(String giftId, String liveUid, HttpCallback<GiftWallMainTab2ClassicInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.lastAllGiftHallWeekStarDetail(giftId, liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.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();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报日志相关
|
||||
* @param type 1为查询,3为删除
|
||||
*
|
||||
* @param type 1为查询,3为删除
|
||||
* @param callback
|
||||
*/
|
||||
public void getLogUpdateStatus(String type, HttpCallback<QiniuLog>callback) {
|
||||
public void getLogUpdateStatus(String type, HttpCallback<QiniuLog> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPrankList(type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -3325,6 +3498,7 @@ public class LiveNetManager {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getPdluserFriend(int p, HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPdluserFriend(p)
|
||||
@@ -3554,7 +3728,7 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void anchorClickFinish(String mLiveId, String giftId, HttpCallback<List<BaseModel>>callback) {
|
||||
public void anchorClickFinish(String mLiveId, String giftId, HttpCallback<List<BaseModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.anchorClickFinish(mLiveId, giftId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -4016,6 +4190,54 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getGiftHallMedalList(String toUid, String type, HttpCallback<MedalAchievementModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getGiftHallMedalList(toUid, type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<MedalAchievementModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<MedalAchievementModel> 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 userUseDress( String usersDressId, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.userUseDress(usersDressId,3)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BaseModel>> responseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
HttpCallbackModel model = new HttpCallbackModel();
|
||||
model.setCode(responseModel.getData().getCode());
|
||||
model.setMsg(responseModel.getData().getMsg());
|
||||
callback.onSuccess(model);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
private MultipartBody.Part createUploadFile(File file) {
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
|
||||
@@ -128,9 +128,9 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
language = "zh";
|
||||
}
|
||||
if (!getBoolean(KEY_LANGUAGE, !TextUtils.equals(language, "zh"))) {
|
||||
return Locale.SIMPLIFIED_CHINESE;
|
||||
return Locale.CHINA;
|
||||
} else {
|
||||
return new Locale("en", "rUS");
|
||||
return Locale.ROOT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class HwBuilder {
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
invite.getClass().getMethod("pay", String.class).invoke(invite, changeid);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class HwBuilder {
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
invite.getClass().getMethod("consume").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,13 +49,13 @@ public class HwBuilder {
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getPayResult(Intent intent) {
|
||||
JSONObject object;
|
||||
JSONObject object = null;
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_huawei.utils.HuaWeiPayManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
object = (JSONObject) invite.getClass().getMethod("getPayResult", Intent.class).invoke(invite, intent);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.view.ViewTreeObserver;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
||||
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
||||
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
||||
@@ -17,11 +18,13 @@ import com.yunbao.common.sud.decorator.SudFSTAPPDecorator;
|
||||
import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||
import com.yunbao.common.sud.state.MGStateResponse;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.SudJsonUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import tech.sud.logger.LogUtils;
|
||||
import tech.sud.mgp.core.ISudFSMStateHandle;
|
||||
import tech.sud.mgp.core.ISudFSTAPP;
|
||||
import tech.sud.mgp.core.ISudListenerInitSDK;
|
||||
@@ -111,6 +114,9 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
||||
String appKey = getAppKey();
|
||||
boolean testEnv = isTestEnv();
|
||||
// 初始化sdk
|
||||
if(BuildConfig.DEBUG) {
|
||||
SudMGP.setLogLevel(Log.DEBUG);
|
||||
}
|
||||
SudMGP.initSDK(activity, appId, appKey, testEnv, new ISudListenerInitSDK() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
@@ -480,4 +486,13 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
||||
return sudFSMMGDecorator.getSudFSMMGCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏结算状态
|
||||
*/
|
||||
@Override
|
||||
public void onGameMGCommonGameSettle(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameSettle model) {
|
||||
LogUtils.e("yqw=====>"+model);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,13 @@ import android.view.View;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.PrankProgressBean;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.bean.SudgameCodeModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
@@ -15,9 +20,14 @@ import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import tech.sud.mgp.core.ISudFSMMG;
|
||||
import tech.sud.mgp.core.ISudFSMStateHandle;
|
||||
@@ -62,6 +72,22 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
public String languageCode = "zh-TW";
|
||||
|
||||
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
||||
private SudGameScoreBean sudGameScoreBean;//房间金豆的门槛和赢家奖励
|
||||
private List<SudGameInfoBean> sudGameInfoBeanList = new ArrayList<>();//玩家信息
|
||||
public final MutableLiveData<List<SudSettleBean>> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
|
||||
|
||||
public void setSudGameInfoBeanList(List<SudGameInfoBean> sudGameInfoBeanList) {
|
||||
this.sudGameInfoBeanList = sudGameInfoBeanList;
|
||||
}
|
||||
|
||||
|
||||
public SudGameScoreBean getSudGameScoreBean() {
|
||||
return sudGameScoreBean;
|
||||
}
|
||||
|
||||
public void setSudGameScoreBean(SudGameScoreBean sudGameScoreBean) {
|
||||
this.sudGameScoreBean = sudGameScoreBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 向接入方服务器获取code
|
||||
@@ -70,7 +96,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
||||
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
languageCode = "zh-TW";
|
||||
}else {
|
||||
} else {
|
||||
languageCode = "en-US";
|
||||
}
|
||||
// TODO: 2022/6/10 注意,这里是演示使用OkHttpClient请求hello-sud服务
|
||||
@@ -147,6 +173,81 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间的金豆数量和赢家获得的金豆
|
||||
*/
|
||||
public void getScore(String roomId, Activity activity) {
|
||||
LiveNetManager.get(activity).getScore(roomId, new HttpCallback<SudGameScoreBean>() {
|
||||
@Override
|
||||
public void onSuccess(SudGameScoreBean data) {
|
||||
sudGameScoreBean = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 进行排名和结算
|
||||
*/
|
||||
public void sudGameRank(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
|
||||
List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||
int playerNum = mgCommonGameSettle.results.size();//玩家人数
|
||||
int winnerNUm = countWinners(mgCommonGameSettle.results);//第一名人数
|
||||
int winNum;//赢得或者失去的金豆
|
||||
// 构建结算信息
|
||||
for (SudMGPMGState.MGCommonGameSettle.PlayerResult playerResult : mgCommonGameSettle.results) {
|
||||
String uid = playerResult.uid;
|
||||
int rank = playerResult.rank;
|
||||
SudGameInfoBean sudGameInfoBean = findGameInfoBean(uid);
|
||||
if (sudGameInfoBean == null) return;
|
||||
|
||||
if (sudGameScoreBean.getGame_mode() == 1) {
|
||||
//双人游戏
|
||||
if (winnerNUm == 1){
|
||||
winNum = (rank == 1) ? (int) (sudGameScoreBean.getRoom_sill() * 0.8) : -sudGameScoreBean.getRoom_sill();
|
||||
}else {
|
||||
winNum = -sudGameScoreBean.getRoom_ticket();
|
||||
}
|
||||
} else {
|
||||
//多人游戏
|
||||
if (rank == 1){
|
||||
winNum = (playerNum*sudGameScoreBean.getRoom_win_num()-winnerNUm*sudGameScoreBean.getRoom_sill())/winnerNUm;
|
||||
}else {
|
||||
winNum = -sudGameScoreBean.getRoom_sill();
|
||||
}
|
||||
}
|
||||
settleBeans.add(new SudSettleBean(uid,sudGameInfoBean.getNick_name(),sudGameInfoBean.getAvatar_url(),rank,winNum));
|
||||
}
|
||||
// 更新LiveData
|
||||
listMutableLiveData.setValue(settleBeans);
|
||||
}
|
||||
|
||||
// 统计第一名的玩家数量
|
||||
private int countWinners(List<SudMGPMGState.MGCommonGameSettle.PlayerResult> results) {
|
||||
int count = 0;
|
||||
for (SudMGPMGState.MGCommonGameSettle.PlayerResult result : results) {
|
||||
if (result.rank == 1) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
// 根据uid查找对应的游戏信息Bean
|
||||
private SudGameInfoBean findGameInfoBean(String uid) {
|
||||
for (SudGameInfoBean sudGameInfoBean : sudGameInfoBeanList) {
|
||||
if (sudGameInfoBean.getUid().equals(uid)) {
|
||||
return sudGameInfoBean;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置当前用户id(接入方定义)
|
||||
*/
|
||||
@@ -255,7 +356,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
@Override
|
||||
public void onGameMGCommonGameState(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameState model) {
|
||||
super.onGameMGCommonGameState(handle, model);
|
||||
Log.e("QuickStartGameViewModel",model.toString());
|
||||
Log.e("QuickStartGameViewModel", model.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ package com.yunbao.common.sud.decorator;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
@@ -177,11 +178,11 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
} else {
|
||||
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
|
||||
}
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(mgCommonGameSettle));
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
|
||||
SudMGPMGState.MGCommonSelfClickJoinBtn mgCommonSelfClickJoinBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickJoinBtn.class);
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSeatIndex(mgCommonSelfClickJoinBtn.seatIndex).setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN).setSubReady(false));
|
||||
// if (listener == null) {
|
||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
// } else {
|
||||
@@ -258,7 +259,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
||||
// } else {
|
||||
// listener.onGameMGCommonSelfClickGameSettleAgainBtn(handle, mgCommonSelfClickGameSettleAgainBtn);
|
||||
// }
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN));
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SOUND_LIST: // 13. 游戏上报游戏中的声音列表(2021-12-30新增,现在只支持碰碰我最强)
|
||||
SudMGPMGState.MGCommonGameSoundList mgCommonGameSoundList = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSoundList.class);
|
||||
|
||||
@@ -170,6 +170,15 @@ public class SudMGPMGState implements Serializable {
|
||||
// 游戏结果玩家列表
|
||||
public List<PlayerResult> results;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MGCommonGameSettle{" +
|
||||
"gameMode=" + gameMode +
|
||||
", gameRoundId='" + gameRoundId + '\'' +
|
||||
", results=" + results +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏结果玩家定义
|
||||
*/
|
||||
@@ -181,6 +190,19 @@ public class SudMGPMGState implements Serializable {
|
||||
public int isEscaped; // 是否逃跑 1:逃跑 0:非逃跑
|
||||
public String killerId; // 杀自己的玩家的id
|
||||
public int isAI; // 是否是AI玩家,1为AI
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PlayerResult{" +
|
||||
"uid='" + uid + '\'' +
|
||||
", rank=" + rank +
|
||||
", award=" + award +
|
||||
", score=" + score +
|
||||
", isEscaped=" + isEscaped +
|
||||
", killerId='" + killerId + '\'' +
|
||||
", isAI=" + isAI +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ public class AndroidBug5497Workaround {
|
||||
public void onGlobalLayout() {
|
||||
possiblyResizeChildOfContent();
|
||||
int heightDiff = mChildOfContent.getRootView().getHeight() - mChildOfContent.getHeight();
|
||||
System.out.println("heightDiff = " + heightDiff);
|
||||
if (heightDiff < 100) {
|
||||
frameLayoutParams.height = defHeight;
|
||||
mChildOfContent.requestLayout();
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
|
||||
import com.yunbao.common.BuildConfig;
|
||||
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GoogleUtils {
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
flag = (boolean) googlePay.getClass().getMethod("getGoogleService").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
@@ -88,13 +88,13 @@ public class GoogleUtils {
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getLoginResult(Intent intent) {
|
||||
JSONObject object;
|
||||
JSONObject object = null;
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleManage");
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
object = (JSONObject) invite.getClass().getMethod("getLoginResult", Intent.class).invoke(invite, intent);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return object;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class GoogleUtils {
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
googlePay.getClass().getMethod("initGooglePay").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,10 @@ public class GoogleUtils {
|
||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
adId = (String) invite.getClass().getMethod("getAdid").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
|
||||
/*throw new RuntimeException(e);*/
|
||||
}
|
||||
return adId;
|
||||
}
|
||||
@@ -133,7 +136,7 @@ public class GoogleUtils {
|
||||
try {
|
||||
googlePay.getClass().getMethod("checkSku", String.class).invoke(googlePay, skuId);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +151,7 @@ public class GoogleUtils {
|
||||
try {
|
||||
googlePay.getClass().getMethod("initResultCode").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
timer = new Timer();
|
||||
@@ -171,7 +174,7 @@ public class GoogleUtils {
|
||||
billingListener.onPayFailed(mActivity.getString(R.string.pay_fail));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -184,7 +187,7 @@ public class GoogleUtils {
|
||||
Object invite = clz.getConstructor(Context.class).newInstance(context);
|
||||
invite.getClass().getMethod("initializeApp").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +205,7 @@ public class GoogleUtils {
|
||||
timer.cancel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -215,7 +218,7 @@ public class GoogleUtils {
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(activity);
|
||||
googlePay.getClass().getMethod("initToken").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +240,7 @@ public class GoogleUtils {
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
googlePay.getClass().getMethod("consumeAll").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +253,7 @@ public class GoogleUtils {
|
||||
.getMethod("setFirebaseCrashData", String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class)
|
||||
.invoke(googlePay, uid, userData, isGoogle, cpu, runTime, enterRoom, slidingRoom, playSvga, ActivitySize);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +271,7 @@ public class GoogleUtils {
|
||||
timer.cancel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -645,9 +645,13 @@ public class JavascriptInterfaceUtils {
|
||||
.setMethod("androidFansGroupInfo"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼物墙
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl, int isAnchor) {
|
||||
RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0, isAnchor == 1);
|
||||
// RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0, isAnchor == 1);
|
||||
new com.yunbao.common.dialog.GiftWallDialog(mContext, mLiveUid,mAnchorName, null,isAnchor==1).setFullWindows(true).showDialog();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
|
||||
@@ -9,6 +9,11 @@ import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
*/
|
||||
@@ -50,4 +55,5 @@ public class L {
|
||||
public static void e(Exception e) {
|
||||
Log.e("Exception", e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,13 +13,14 @@ import java.util.List;
|
||||
public class SVGAViewUtils {
|
||||
private final static List<SVGAImageView> SVGA_CACHE = new ArrayList<>();
|
||||
|
||||
public static void playEndClear(SVGAImageView svga, boolean isClear, SVGACallback callback) {
|
||||
public static void playEndClear(SVGAImageView svga, boolean isClear,int loop, SVGACallback callback) {
|
||||
if (!isClear) {
|
||||
if (!SVGA_CACHE.contains(svga)) {
|
||||
SVGA_CACHE.add(svga);
|
||||
}
|
||||
}
|
||||
CrashSaveBean.getInstance().addPlaySvga();
|
||||
svga.setLoops(loop);
|
||||
svga.setCallback(new SVGACallback() {
|
||||
@Override
|
||||
public void onPause() {
|
||||
@@ -72,9 +73,11 @@ public class SVGAViewUtils {
|
||||
}
|
||||
SVGA_CACHE.clear();
|
||||
}
|
||||
|
||||
public static void playEndClear(SVGAImageView svga, boolean isClear, SVGACallback callback) {
|
||||
playEndClear(svga, isClear,1, null);
|
||||
}
|
||||
public static void playEndClear(SVGAImageView svga, boolean isClear) {
|
||||
playEndClear(svga, isClear, null);
|
||||
playEndClear(svga, isClear,null);
|
||||
}
|
||||
|
||||
public static void playEndClear(SVGAImageView svga) {
|
||||
|
||||
@@ -4,8 +4,13 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -37,9 +42,8 @@ public class SpUtil {
|
||||
public static final String ANCHOR_PK_TIME = "anchorPkTime";
|
||||
//播放短视频上下滑动引导页
|
||||
public static final String READ_VIDEO_GUIDE = "readVideoGuide";
|
||||
|
||||
public static final String MESSAGE_SYS_DEL = "FIRST_DEL";
|
||||
|
||||
public static final String LIVE_GAME_NEWED_LIST = "LIVE_GAME_NEWED_LIST";
|
||||
|
||||
public SpUtil() {
|
||||
mSharedPreferences = CommonAppContext.sInstance.getSharedPreferences("SharedPreferences", Context.MODE_PRIVATE);
|
||||
@@ -56,6 +60,41 @@ public class SpUtil {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public static void setLiveGameId(String gameId) {
|
||||
String gameMap = getStringValue(LIVE_GAME_NEWED_LIST);
|
||||
List<String> gameNewList;
|
||||
gameNewList = JSONArray.parseArray(gameMap, String.class);
|
||||
L.eSw("gameMap:" + gameMap);
|
||||
if (gameNewList == null) {
|
||||
gameNewList = new ArrayList<>();
|
||||
}
|
||||
for (int i = 0; i < gameNewList.size(); i++) {
|
||||
if (gameNewList.get(i).equals(gameId)) {
|
||||
gameNewList.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
gameNewList.add(gameId);
|
||||
setStringValue(LIVE_GAME_NEWED_LIST, new Gson().toJson(gameNewList));
|
||||
}
|
||||
|
||||
public static boolean isLiveGameNew(String gameId) {
|
||||
String gameMap = getStringValue(LIVE_GAME_NEWED_LIST);
|
||||
List<String> gameNewList = new ArrayList<>();
|
||||
gameNewList = JSONArray.parseArray(gameMap, String.class);
|
||||
if (gameNewList == null) {
|
||||
gameNewList = new ArrayList<>();
|
||||
}
|
||||
boolean isNew = false;
|
||||
for (int i = 0; i < gameNewList.size(); i++) {
|
||||
if (gameNewList.get(i).equals(gameId)) {
|
||||
isNew = true;
|
||||
}
|
||||
}
|
||||
return !isNew;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存一个字符串
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.text.Layout;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
public class CustomEllipsizeTextView extends AppCompatTextView {
|
||||
|
||||
public CustomEllipsizeTextView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public CustomEllipsizeTextView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public CustomEllipsizeTextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
CharSequence text = getText();
|
||||
float measureText = getPaint().measureText(text, 0, text.length());
|
||||
if (measureText > getMeasuredWidth() && text.length() > 5) {
|
||||
CharSequence end = text.subSequence(text.length() - 5, text.length());
|
||||
CharSequence start = text.subSequence(0, text.length() - 5);
|
||||
CharSequence newCharSequence = getAutoText(start, end, getPaint());
|
||||
setText(newCharSequence);
|
||||
}
|
||||
}
|
||||
|
||||
private CharSequence getAutoText(CharSequence start, CharSequence end, TextPaint paint) {
|
||||
CharSequence text = TextUtils.concat(start.subSequence(0, start.length() - 1), "...", end);
|
||||
if (paint.measureText(text, 0, text.length()) > getMeasuredWidth()) {
|
||||
return getAutoText(start.subSequence(0, start.length() - 1), end, paint);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class InteractionGamesChildBottomViewHolder extends RecyclerView.ViewHolder {
|
||||
private RoundedImageView funGamePic;
|
||||
private TextView funGameName;
|
||||
private Context mContext;
|
||||
|
||||
public InteractionGamesChildBottomViewHolder(@NonNull View itemView, Context context) {
|
||||
super(itemView);
|
||||
this.mContext = context;
|
||||
funGamePic = itemView.findViewById(R.id.fun_game_pic);
|
||||
funGameName = itemView.findViewById(R.id.fun_game_name);
|
||||
}
|
||||
|
||||
public void setData(CustomSidebarChildModel model, boolean rigts) {
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
|
||||
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
itemView.setLayoutParams(layoutParams);
|
||||
if (rigts) {
|
||||
ImgLoader.display(itemView.getContext(), model.getIcon(), funGamePic);
|
||||
} else {
|
||||
ImgLoader.display(itemView.getContext(), model.getResIcon(), funGamePic);
|
||||
}
|
||||
funGameName.setText(model.getTitle());
|
||||
if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")&& SpUtil.isLiveGameNew(model.getId())){
|
||||
itemView.findViewById(R.id.icon_new_game).setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
itemView.findViewById(R.id.icon_new_game).setVisibility(View.GONE);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (interactionGamesCallBack != null) {
|
||||
interactionGamesCallBack.onItemViewClicks(model, rigts);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private InteractionGamesCallBack interactionGamesCallBack;
|
||||
|
||||
public void setItemViewClicks(InteractionGamesCallBack callBack) {
|
||||
interactionGamesCallBack = callBack;
|
||||
}
|
||||
|
||||
public interface InteractionGamesCallBack {
|
||||
void onItemViewClicks(CustomSidebarChildModel model, boolean rigts);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +1,48 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView funGamePic;
|
||||
private RoundedImageView funGamePic;
|
||||
private TextView funGameName;
|
||||
private Context mContext;
|
||||
|
||||
public InteractionGamesChildViewHolder(@NonNull View itemView) {
|
||||
public InteractionGamesChildViewHolder(@NonNull View itemView,Context mContext) {
|
||||
super(itemView);
|
||||
this.mContext = mContext;
|
||||
funGamePic = itemView.findViewById(R.id.fun_game_pic);
|
||||
funGameName = itemView.findViewById(R.id.fun_game_name);
|
||||
}
|
||||
|
||||
public void setData(CustomSidebarChildModel model, boolean rigts) {
|
||||
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int)
|
||||
(mContext.getResources().getDisplayMetrics().widthPixels / 4.5),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
itemView.setLayoutParams(layoutParams);
|
||||
|
||||
if (rigts) {
|
||||
ImgLoader.display(itemView.getContext(), model.getIcon(), funGamePic);
|
||||
} else {
|
||||
ImgLoader.display(itemView.getContext(), model.getResIcon(), funGamePic);
|
||||
}
|
||||
|
||||
|
||||
funGameName.setText(model.getTitle());
|
||||
if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")){
|
||||
if (!TextUtils.isEmpty(model.getSudGameIsNew())&&TextUtils.equals(model.getSudGameIsNew(),"1")&& SpUtil.isLiveGameNew(model.getId())){
|
||||
itemView.findViewById(R.id.icon_new_game).setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
itemView.findViewById(R.id.icon_new_game).setVisibility(View.GONE);
|
||||
@@ -45,8 +53,6 @@ public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
if (interactionGamesCallBack != null) {
|
||||
interactionGamesCallBack.onItemViewClicks(model, rigts);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -25,21 +27,22 @@ public class LiveNewRoleFunGamesViewHolder extends RecyclerView.ViewHolder {
|
||||
private RecyclerView childList;
|
||||
private ImageView selectMoreIcon;
|
||||
boolean isShowMore = true;
|
||||
private Context mContext;
|
||||
|
||||
public LiveNewRoleFunGamesViewHolder(@NonNull View itemView) {
|
||||
public LiveNewRoleFunGamesViewHolder(@NonNull View itemView, Context context) {
|
||||
super(itemView);
|
||||
this.mContext = context;
|
||||
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
|
||||
childList = itemView.findViewById(R.id.child_list);
|
||||
selectMoreIcon = itemView.findViewById(R.id.select_more_icon);
|
||||
selectMore = itemView.findViewById(R.id.select_more);
|
||||
funGamesAdapter = new NewRoleFunGamesAdapter(itemView.getContext(),true);
|
||||
funGamesAdapter = new NewRoleFunGamesAdapter(itemView.getContext(), true);
|
||||
childList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
childList.setAdapter(funGamesAdapter);
|
||||
|
||||
}
|
||||
|
||||
public void setData(CustomSidebarInfoModel model) {
|
||||
|
||||
List<CustomSidebarChildModel> sidebarChildModels = model.getChild();
|
||||
itemView.findViewById(R.id.select_more_layout).setVisibility(sidebarChildModels.size() >= 8 ? View.VISIBLE : View.GONE);
|
||||
sendGoodGift.setText(model.getTitle());
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
@@ -21,14 +23,14 @@ public class LiveNewRoleInteractionGamesViewHolder extends RecyclerView.ViewHold
|
||||
private RecyclerView childList;
|
||||
private ImageView selectMoreIcon;
|
||||
boolean isShowMore = true;
|
||||
|
||||
public LiveNewRoleInteractionGamesViewHolder(@NonNull View itemView) {
|
||||
public LiveNewRoleInteractionGamesViewHolder(@NonNull View itemView, Context context) {
|
||||
super(itemView);
|
||||
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
|
||||
childList = itemView.findViewById(R.id.child_list);
|
||||
selectMoreIcon = itemView.findViewById(R.id.select_more_icon);
|
||||
funGamesAdapter = new LiveNewRoleInteractionGamesAdapter(itemView.getContext(), true);
|
||||
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4));
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
|
||||
childList.setLayoutManager(layoutManager);
|
||||
childList.setAdapter(funGamesAdapter);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
@@ -21,19 +24,21 @@ public class LiveNewRoleRigtsInterestsViewHolder extends RecyclerView.ViewHolder
|
||||
private TextView sendGoodGift;
|
||||
private RecyclerView childList;
|
||||
private boolean showRed = false;
|
||||
public LiveNewRoleRigtsInterestsViewHolder(@NonNull View itemView,boolean showRed) {
|
||||
private Context mContext;
|
||||
public LiveNewRoleRigtsInterestsViewHolder(@NonNull View itemView, boolean showRed,Context mContext) {
|
||||
super(itemView);
|
||||
this.mContext = mContext;
|
||||
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
|
||||
childList = itemView.findViewById(R.id.child_list);
|
||||
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
|
||||
childList = itemView.findViewById(R.id.child_list);
|
||||
funGamesAdapter = new LiveNewRoleFunGamesAdapter(itemView.getContext(), false,showRed);
|
||||
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4));
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false);
|
||||
childList.setLayoutManager(layoutManager);
|
||||
childList.setAdapter(funGamesAdapter);
|
||||
}
|
||||
|
||||
public void setData(CustomSidebarInfoModel model) {
|
||||
|
||||
sendGoodGift.setText(model.getTitle());
|
||||
funGamesAdapter.updateData(generateData());
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.yunbao.common.views;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -11,6 +13,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
@@ -19,7 +22,11 @@ import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.dialog.SudGameDoubleDialog;
|
||||
import com.yunbao.common.dialog.SudGameMultipleDialog;
|
||||
import com.yunbao.common.dialog.SudLoadDialog;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.event.HideShowEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
@@ -31,9 +38,11 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||
import com.yunbao.common.sud.state.SudMGPAPPState;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
@@ -57,6 +66,9 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
private TextView gameTitle, roomName, roomNumber;
|
||||
private RoundedImageView mAvatar;
|
||||
private boolean selfClick = false;
|
||||
private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗
|
||||
private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗
|
||||
private SudLoadDialog sudLoadDialog;//加载弹窗
|
||||
|
||||
public LiveSudGamePopup(@NonNull Context context, long interactionID, String liveUid) {
|
||||
super(context);
|
||||
@@ -69,7 +81,22 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
mCreateSudRoomModel = createSudRoomModel;
|
||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
||||
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),getActivity());
|
||||
IMLoginManager.get(context).setSudGame("");
|
||||
|
||||
// 设置游戏安全操作区域
|
||||
GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel();
|
||||
gameViewRectModel.left = 0;
|
||||
gameViewRectModel.top = DpUtil.dp2px(50); //游戏安全区域
|
||||
gameViewRectModel.right = 0;
|
||||
gameViewRectModel.bottom = DpUtil.dp2px(30);
|
||||
gameViewModel.gameViewRectModel = gameViewRectModel;
|
||||
|
||||
//初始化结算弹窗
|
||||
sudGameDoubleDialog = new SudGameDoubleDialog(context);//双人游戏
|
||||
sudGameMultipleDialog = new SudGameMultipleDialog(context);//多人游戏
|
||||
sudLoadDialog = new SudLoadDialog(context);//加载弹窗
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@@ -98,7 +125,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
gameTitle.setText(mCreateSudRoomModel.getSudGameName());
|
||||
roomName.setText(mCreateSudRoomModel.getRoomName());
|
||||
roomNumber.setText(mCreateSudRoomModel.getSudGameRoomId());
|
||||
ImgLoader.display(getContext(), mCreateSudRoomModel.getAvatar(), mAvatar);
|
||||
//ImgLoader.display(getContext(), mCreateSudRoomModel.getAvatar(), mAvatar);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.exit), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
@@ -166,6 +193,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.gameSettle.hide = true;//是否隐藏结算界面(false: 显示; true: 隐藏,默认为 false)
|
||||
|
||||
gameConfigModel.ui.lobby_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
@@ -173,6 +201,29 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
gameConfigModel.ui.start_btn.custom = true;
|
||||
// SudMGP平台64bit游戏ID
|
||||
gameViewModel.switchGame((Activity) getContext(), mLiveUid, mInteractionID);
|
||||
|
||||
//游戏结算结束
|
||||
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
|
||||
if (sudLoadDialog.getClickStatus() == 0) {
|
||||
sudLoadDialog.dismiss();
|
||||
if (gameViewModel.getSudGameScoreBean().getGame_mode() == 1) {
|
||||
//双人游戏
|
||||
sudGameDoubleDialog.setSudSettleList(sudSettleBeans);
|
||||
sudGameDoubleDialog.showDialog();
|
||||
} else {
|
||||
//多人游戏
|
||||
sudGameMultipleDialog.setSudSettleList(sudSettleBeans);
|
||||
sudGameMultipleDialog.showDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//加载弹窗监听
|
||||
sudLoadDialog.setOnDismissListener(() -> {
|
||||
if (sudLoadDialog.getClickStatus() == 2){
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
@@ -225,11 +276,14 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
switch (event.getSudMGPMGState()) {
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||
LiveNetManager.get(getContext()).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
//获取筹码信息,检查是否足够
|
||||
LiveNetManager.get(getContext()).getScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<SudGameScoreBean>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getGoldenBeanRemainingBalance() == 1) {
|
||||
public void onSuccess(SudGameScoreBean data) {
|
||||
if (data.getGolden_bean_remaining_balance() == 1) {
|
||||
gameViewModel.setSudGameScoreBean(data);
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfReady(event.getSubReady());
|
||||
} else {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
@@ -251,9 +305,31 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||
//结算状态
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
sudLoadDialog.setClickStatus(0);
|
||||
sudLoadDialog.setDouble(gameViewModel.getSudGameScoreBean().getGame_mode());
|
||||
sudLoadDialog.showDialog();
|
||||
//获取用户信息
|
||||
LiveNetManager.get(getContext()).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudGameInfoBean> data) {
|
||||
if (!data.isEmpty()){
|
||||
gameViewModel.setSudGameInfoBeanList(data);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle());
|
||||
}else {
|
||||
ToastUtil.show(getContext().getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||
//点击开始游戏
|
||||
LiveNetManager.get(getContext()).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
||||
mCreateSudRoomModel.getSudGameRoomId(), new
|
||||
HttpCallback<CheckRemainingBalance>() {
|
||||
@@ -279,9 +355,9 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameStatus(SubGameEvent event) {
|
||||
if (event.getType() == 0) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -27,8 +29,10 @@ public class NewRoleFunGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
private View red_point;
|
||||
private boolean showRed = false;
|
||||
private View total_image_red_point;
|
||||
public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed) {
|
||||
private Context mContext;
|
||||
public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed, Context mContext) {
|
||||
super(itemView);
|
||||
this.mContext = mContext;
|
||||
this.showRed = showRed;
|
||||
funGamePic = itemView.findViewById(R.id.fun_game_pic);
|
||||
funGameName = itemView.findViewById(R.id.fun_game_name);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class RigtsInterestsViewHolder extends RecyclerView.ViewHolder {
|
||||
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
|
||||
childList = itemView.findViewById(R.id.child_list);
|
||||
funGamesAdapter = new FunGamesAdapter(itemView.getContext(), false);
|
||||
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 3));
|
||||
childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4));
|
||||
childList.setAdapter(funGamesAdapter);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -25,15 +26,19 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
|
||||
private FrameLayout user_layout;
|
||||
private RoundedImageView sud_game_user;
|
||||
private LinearLayout layout;
|
||||
private TextView userName;
|
||||
private FrameLayout vacancy_sud_gameLayout;
|
||||
|
||||
public SudGameUserListViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
vacancy_sud_game = itemView.findViewById(R.id.vacancy_sud_game);
|
||||
vacancy_sud_gameLayout = itemView.findViewById(R.id.vacancy_sud_gameLayout);
|
||||
sud_game_user = itemView.findViewById(R.id.sud_game_user);
|
||||
user_layout = itemView.findViewById(R.id.user_layout);
|
||||
mic_status = itemView.findViewById(R.id.mic_status);
|
||||
layout = itemView.findViewById(R.id.layout);
|
||||
game_status = itemView.findViewById(R.id.game_status);
|
||||
userName= itemView.findViewById(R.id.userName);
|
||||
}
|
||||
|
||||
public void upData(SudGameUserModel sudGameUserModel, SudGameUserListAdapter.SudGameSmallCallBack sudGameSmallCallBack, int position) {
|
||||
@@ -46,7 +51,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
|
||||
// }
|
||||
// });
|
||||
if (sudGameUserModel.isNullUser()) {
|
||||
vacancy_sud_game.setVisibility(View.VISIBLE);
|
||||
vacancy_sud_gameLayout.setVisibility(View.VISIBLE);
|
||||
user_layout.setVisibility(View.GONE);
|
||||
ViewClicksAntiShake.clicksAntiShake(vacancy_sud_game, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
@@ -55,7 +60,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
vacancy_sud_game.setVisibility(View.GONE);
|
||||
vacancy_sud_gameLayout.setVisibility(View.GONE);
|
||||
user_layout.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display2(itemView.getContext(), sudGameUserModel.getAvatar(), sud_game_user);
|
||||
if (sudGameUserModel.getMicStatus() == 2) {
|
||||
@@ -71,6 +76,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
|
||||
} else {
|
||||
game_status.setVisibility(View.GONE);
|
||||
}
|
||||
userName.setText(sudGameUserModel.getUserNicename());
|
||||
ViewClicksAntiShake.clicksAntiShake(user_layout, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.BitmapUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -56,6 +57,8 @@ public class NobleNoticeView extends FrameLayout {
|
||||
private HorizontalScrollView contextLayout;
|
||||
private RelativeLayout scrollLayout;
|
||||
private ImageView nobleIcon;
|
||||
private String anchorUid;
|
||||
private String mLiveId;
|
||||
|
||||
public NobleNoticeView(@NonNull Context context) {
|
||||
super(context);
|
||||
@@ -97,9 +100,11 @@ public class NobleNoticeView extends FrameLayout {
|
||||
});
|
||||
}
|
||||
|
||||
public NobleNoticeView setRootView(String uHead, String userNameStr, String anchorNicknameStr, String anchorUid) {
|
||||
public NobleNoticeView setRootView(String uHead, String userNameStr, String anchorNicknameStr, String anchorUid,String mLiveId) {
|
||||
this.uhead = uHead;
|
||||
this.anchorNicknameStr = anchorNicknameStr.trim();
|
||||
this.anchorUid = anchorUid;
|
||||
this.mLiveId = mLiveId;
|
||||
userName.setText(userNameStr);
|
||||
anchorNickname.setText(anchorNicknameStr.trim());
|
||||
if (TextUtils.isEmpty(anchorNicknameStr.trim())) {
|
||||
@@ -112,6 +117,10 @@ public class NobleNoticeView extends FrameLayout {
|
||||
findViewById(R.id.anchor_nickname).setVisibility(VISIBLE);
|
||||
openNoble.setText(mContext.getString(R.string.open_noble));
|
||||
}
|
||||
if(anchorUid.equals(mLiveId)){
|
||||
L.eSw("showBuyVipMessage:"+anchorUid+"__"+mLiveId);
|
||||
gotoRoomView.setVisibility(GONE);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -352,13 +361,15 @@ public class NobleNoticeView extends FrameLayout {
|
||||
gotoRoomView.setLayoutParams(layoutParams);
|
||||
contextLayout.setLayoutParams(contextLayoutParams);
|
||||
if (!TextUtils.isEmpty(anchorNicknameStr)) {
|
||||
gotoRoomView.setVisibility(VISIBLE);
|
||||
if(mLiveId.equals(anchorUid)){
|
||||
gotoRoomView.setVisibility(GONE);
|
||||
}else{
|
||||
gotoRoomView.setVisibility(VISIBLE);
|
||||
}
|
||||
findViewById(R.id.in).setVisibility(VISIBLE);
|
||||
findViewById(R.id.anchor_nickname).setVisibility(VISIBLE);
|
||||
}
|
||||
contextLayout.setVisibility(VISIBLE);
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
6
common/src/main/res/drawable/anim_loading_double.xml
Normal file
6
common/src/main/res/drawable/anim_loading_double.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@mipmap/sud_load_double"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
/>
|
||||
6
common/src/main/res/drawable/anim_loading_multiple.xml
Normal file
6
common/src/main/res/drawable/anim_loading_multiple.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@mipmap/sud_load_multiple"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
/>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="360dp" />
|
||||
<corners android:radius="10dp" />
|
||||
<solid android:color="#B3414141" />
|
||||
</shape>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" />
|
||||
<solid android:color="#201E1A" />
|
||||
<solid android:color="#292929" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="7dp" />
|
||||
<solid android:color="#B3414141" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="20dp"/>
|
||||
<solid android:color="#7776B1"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="20dp"/>
|
||||
<solid android:color="#FEE2BC"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="1dp"
|
||||
android:bottomRightRadius="6dp"
|
||||
android:topLeftRadius="5dp"
|
||||
android:topRightRadius="6dp" />
|
||||
<gradient android:angle="0"
|
||||
android:endColor="#FCC755"
|
||||
android:startColor="#FCC755" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
13
common/src/main/res/drawable/gift_wall_gift_info_btn.xml
Normal file
13
common/src/main/res/drawable/gift_wall_gift_info_btn.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="8dp"/>
|
||||
<gradient
|
||||
android:startColor="#B0F1FF"
|
||||
android:endColor="#69CDFF"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
13
common/src/main/res/drawable/gift_wall_gift_info_btn_un.xml
Normal file
13
common/src/main/res/drawable/gift_wall_gift_info_btn_un.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="8dp"/>
|
||||
<gradient
|
||||
android:startColor="#A6A6B3"
|
||||
android:endColor="#A6A6B3"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
13
common/src/main/res/drawable/gift_wall_gift_info_lighten.xml
Normal file
13
common/src/main/res/drawable/gift_wall_gift_info_lighten.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="8dp"/>
|
||||
<gradient
|
||||
android:startColor="#4DC8D7FF"
|
||||
android:endColor="#4DC8D7FF"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="8dp"/>
|
||||
<gradient
|
||||
android:startColor="#202053"
|
||||
android:endColor="#202053"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="8dp"/>
|
||||
<gradient
|
||||
android:startColor="#D4F6FF"
|
||||
android:endColor="#D4F6FF"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
23
common/src/main/res/drawable/gift_wall_gift_info_progres.xml
Normal file
23
common/src/main/res/drawable/gift_wall_gift_info_progres.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="26dp" />
|
||||
<solid android:color="#70BCD3FF" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:startColor="#AAEAF3"
|
||||
android:endColor="#AAEAF3" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user