This commit is contained in:
zlzw 2024-08-20 10:02:38 +08:00
parent e8e0fc32f9
commit 6eee7b9ede
14 changed files with 191 additions and 28 deletions

View File

@ -1,6 +1,9 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -16,6 +19,7 @@ import com.yunbao.common.bean.GiftWallInfoBean;
import com.yunbao.common.bean.GiftWallTab2Bean;
import com.yunbao.common.dialog.GiftWallMainTab2ClassicInfoDialog;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -34,6 +38,16 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
int giftId;
private String anchorName;
private String anchorAvatar;
private Context mContext;
private OnItemClickListener<GiftWallTab2Bean.Gift> onItemClickListener;
public GiftWallGiftInfoListItemAdapter(Context mContext) {
this.mContext = mContext;
}
public void setOnItemClickListener(OnItemClickListener<GiftWallTab2Bean.Gift> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
public void setGiftId(int giftId) {
this.giftId = giftId;
@ -82,7 +96,7 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
@Override
public int getItemViewType(int position) {
if (isStar && (getItemCount() > 0) && data.get(0).getId() != -1) {
if (isStar && (getItemCount() > 0) && data.get(0).getId() != -1 && list_type == 2) {
return 1;
}
return 0;
@ -206,7 +220,9 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
e.printStackTrace();
return;
}
new GiftWallMainTab2ClassicInfoDialog(itemView.getContext(), giftData, isAnchor).setFullWindows(!isLiveRoom).showDialog();
if(onItemClickListener!=null){
onItemClickListener.onItemClick(giftData,position);
}
}
});
}

View File

@ -89,6 +89,36 @@ public class GiftWallInfoBean extends BaseModel {
private int gift_status;
@SerializedName("sendtype")
private int sendtype;//0默认钻石购买1金币购买
@SerializedName("live_nicename")
private String live_nicename;
@SerializedName("live_avatar")
private String live_avatar;
@SerializedName("live_sort")
private int live_sort;
public int getLive_sort() {
return live_sort;
}
public void setLive_sort(int live_sort) {
this.live_sort = live_sort;
}
public String getLive_nicename() {
return live_nicename;
}
public void setLive_nicename(String live_nicename) {
this.live_nicename = live_nicename;
}
public String getLive_avatar() {
return live_avatar;
}
public void setLive_avatar(String live_avatar) {
this.live_avatar = live_avatar;
}
public int getSendtype() {
return sendtype;

View File

@ -49,10 +49,10 @@ public class GiftWallMainTab2ClassicInfoBean extends BaseModel{
giftInfo.setGiftName(info.getGiftname());
giftInfo.setGiftIcon(info.getGifticon());
giftInfo.setIlluminateNum(info.getIlluminate_num());
giftInfo.setNamingLiveAvatar(gift.getNamingLiveAvatar());
giftInfo.setNamingLiveAvatar(info.getLive_avatar());
giftInfo.setNamingLiveId(gift.getNamingLiveId());
giftInfo.setNamingLiveNicename(gift.getNamingLiveNicename());
giftInfo.setGiftHallSendNum(gift.getGiftHallSendNum());
giftInfo.setNamingLiveNicename(info.getLive_nicename());
giftInfo.setGiftHallSendNum(Integer.parseInt(info.getGift_hall_send_num()));
}
public void setWallInfoData(List<GiftWallInfoBean.Data> list) {

View File

@ -26,6 +26,7 @@ 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.GiftWallTab2Bean;
import com.yunbao.common.bean.JsWishBean;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.event.ClosePopupDialogEvent;
@ -37,6 +38,7 @@ 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.ViewUtils;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -170,10 +172,25 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
gift_schedule = findViewById(R.id.gift_schedule);
titleLayout = findViewById(R.id.list_title);
titleLayout2 = findViewById(R.id.list_title2);
adapter = new GiftWallGiftInfoListItemAdapter();
adapter = new GiftWallGiftInfoListItemAdapter(mContext);
adapter.setAnchor(isAnchor);
adapter.setLiveRoom(isLiveRoom);
adapter.setStar(isStar);
adapter.setOnItemClickListener(new OnItemClickListener<GiftWallTab2Bean.Gift>() {
@Override
public void onItemClick(GiftWallTab2Bean.Gift bean, int position) {
new GiftWallMainTab2ClassicInfoDialog(mContext, bean, isAnchor)
.setFullWindows(!isLiveRoom)
.setGiftWallGiftInfoDialog(new GiftWallGiftInfoDialog(mContext, giftId, toUserId, isAnchor)
.setFullWindows(isFullWindows)
.setAnchorId(anchorId)
.setTab2Enter(isTab2Enter)
.setLiveRoom(isLiveRoom)
.setStar(isStar))
.showDialog();
dismiss();
}
});
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x00000000, 0, 10));
@ -194,11 +211,13 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
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));
titleLayout2.setVisibility(View.GONE);
titleLayout.setVisibility(View.VISIBLE);
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename());
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"));
@ -207,7 +226,19 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
tab1.setTextColor(Color.parseColor("#FFFFFF"));
list_type = 2;
adapter.setList_type(list_type);
if (isStar && list_type == 2) {
btn_one.setVisibility(View.GONE);
btn_one_tips.setVisibility(View.GONE);
titleLayout.setVisibility(View.GONE);
titleLayout2.setVisibility(View.VISIBLE);
} else {
btn_one.setVisibility(View.VISIBLE);
btn_one_tips.setVisibility(View.VISIBLE);
titleLayout.setVisibility(View.VISIBLE);
}
initTabText();
initData();
});
XPopup.Builder builder = new XPopup.Builder(getContext())
@ -254,7 +285,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
mIvBack.setLayoutParams(params);
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
resetWindows();
if(isStar){
if (isStar && list_type == 2) {
findViewById(R.id.anchorTips).setVisibility(View.VISIBLE);
}
}
@ -382,12 +413,32 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
}
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()));
if (isStar && list_type == 2) {
user_name.setText(giftBean.getGift_info().getLive_nicename());
send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getGift_hall_send_num()));
ImgLoader.display(mContext, giftBean.getGift_info().getLive_avatar(), avatar);
findViewById(R.id.anchorTips).setVisibility(View.VISIBLE);
ViewUtils.findViewById(this, R.id.textView7, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_tips3));
if (giftBean.getGift_info().getLive_sort() == 0) {
ViewUtils.findViewById(this, R.id.bottom_rank_value, TextView.class).setText(WordUtil.isNewZh() ? "未上榜" : "Not listed");
} else {
ViewUtils.findViewById(this, R.id.bottom_rank_value, TextView.class).setText(String.valueOf(giftBean.getGift_info().getLive_sort()));
}
findViewById(R.id.bottom_rank_layout).setVisibility(View.VISIBLE);
} else {
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()));
findViewById(R.id.anchorTips).setVisibility(View.GONE);
ViewUtils.findViewById(this, R.id.textView7, TextView.class).setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_send));
findViewById(R.id.bottom_rank_layout).setVisibility(View.GONE);
}
String tmp = "";
if (giftBean.getGift_info().getIlluminate_status() != 1) {//未點亮
btn_one.setVisibility(View.VISIBLE);
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);
@ -403,8 +454,13 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
}
private void setTips(String tmp) {
if(btn_one.getVisibility()==VISIBLE){
btn_one_tips.setVisibility(View.VISIBLE);
if (isStar && list_type == 2) {
btn_one.setVisibility(View.GONE);
btn_one_tips.setVisibility(View.GONE);
return;
}
if (btn_one.getVisibility() == VISIBLE) {
btn_one_tips.setVisibility(View.VISIBLE);
}
btn_one_tips.setText(String.format(Locale.getDefault(), "%s%s%s"
, WordUtil.isNewZh() ? "" : "Need ",
@ -423,6 +479,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
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.setVisibility(View.VISIBLE);
btn_one.setText(WordUtil.getNewString(R.string.dialog_gift_wall_gfit_info_list_bottom_btn_one_champion));
setTips(String.valueOf(tmp));
}

View File

@ -68,6 +68,7 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
GiftWallTab2Bean.Gift gift;
String userName;
boolean isAnchor;
GiftWallGiftInfoDialog giftWallGiftInfoDialog;
public GiftWallMainTab2ClassicInfoDialog(@NonNull Context context, GiftWallTab2Bean.Gift gift, boolean isAnchor) {
super(context);
@ -81,6 +82,19 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
return this;
}
public GiftWallMainTab2ClassicInfoDialog setGiftWallGiftInfoDialog(GiftWallGiftInfoDialog giftWallGiftInfoDialog) {
this.giftWallGiftInfoDialog = giftWallGiftInfoDialog;
return this;
}
@Override
protected void onDismiss() {
super.onDismiss();
if (giftWallGiftInfoDialog != null) {
giftWallGiftInfoDialog.showDialog();
}
}
@Override
public void buildDialog(XPopup.Builder builder) {

View File

@ -153,8 +153,9 @@ public class RandomSudGameManager {
ss = new SpannableString(text);
ss.setSpan(image, text.indexOf("$"), text.indexOf("$") + 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
builder.setHtmlCode(ss);
}else {
builder.setConfirmString(WordUtil.isNewZh() ? "獲取" : "Obtain");
}
builder.setConfirmString(WordUtil.isNewZh() ? "獲取" : "Obtain");
builder.setSimpleCallbackView(new DialogUitl.SimpleCallbackView() {
@Override
@ -165,7 +166,9 @@ public class RandomSudGameManager {
@Override
public void onConfirmClick(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
dialog.dismiss();
openTicketWeb(mContext);
if(!isAudience){
openTicketWeb(mContext);
}
if (simpleCallback != null) {
simpleCallback.onConfirmClick(dialog, "");
}
@ -174,6 +177,9 @@ public class RandomSudGameManager {
@Override
public void onCancel(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
dialog.dismiss();
if(isAudience){
openTicketWeb(mContext);
}
if (simpleCallback != null) {
simpleCallback.onCancelClick();
}
@ -254,7 +260,7 @@ public class RandomSudGameManager {
}
public void openTicketWeb(Context mContext) {
String url = String.format(Locale.getDefault(), "%sh5/monthlyActivities/20240822/index.html?type=1&uid=%s&token=%s&isZh=%s",
String url = String.format(Locale.getDefault(), "%s/h5/monthlyActivities/20240822/index.html?type=1&uid=%s&token=%s&isZh=%s",
CommonAppConfig.HOST,
IMLoginManager.get(mContext).getUserInfo().getId(),
IMLoginManager.get(mContext).getUserInfo().getToken(),

View File

@ -136,12 +136,12 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
RandomSudGameManager.getManager().showNotActivityTicketDialog(itemView.getContext(), true, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
toGame(model, isHome, true);
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
toGame(model, isHome, true);
}
});
return;

View File

@ -334,7 +334,8 @@
android:src="@mipmap/icon_avatar_placeholder"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="@+id/anchorTips"
android:layout_marginTop="6dp"
app:riv_oval="true" />
<TextView
@ -378,6 +379,7 @@
android:textAllCaps="false"
android:textSize="8sp"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintEnd_toEndOf="@+id/bottom_avatar"
app:layout_constraintStart_toStartOf="@+id/bottom_avatar"
app:layout_constraintTop_toTopOf="parent" />
@ -402,7 +404,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/dialog_gift_wall_gfit_info_list_bottom_btn_one_champion"
tools:visibility="visible" />
tools:visibility="gone" />
<Button
android:id="@+id/btn_one_tips"
@ -420,6 +422,33 @@
app:layout_constraintBottom_toTopOf="@+id/btn_one"
app:layout_constraintEnd_toEndOf="@+id/btn_one"
tools:visibility="visible" />
<LinearLayout
android:id="@+id/bottom_rank_layout"
android:layout_marginEnd="17dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:orientation="vertical"
android:layout_width="wrap_content"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:textColor="#FFFFFF"
android:textSize="12sp"
android:text="@string/dialog_gift_wall_gfit_info_list_bottom_tips2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/bottom_rank_value"
android:textColor="#AAEAF3"
android:textSize="14sp"
android:text="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -10,7 +10,7 @@
android:id="@+id/tv_rank"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:layout_weight="0.6"
android:gravity="start|center"
android:text="@string/dialog_gift_wall_list_info_list_header_rank"
android:textColor="#FFFFFF"
@ -27,11 +27,17 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="bottom"
android:gravity="center|bottom"
android:gravity="start|bottom"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/tv_rank"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_rank">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
@ -59,6 +65,7 @@
android:textSize="12sp"
android:visibility="gone"
tools:visibility="visible" />
</LinearLayout>
</LinearLayout>
<LinearLayout

View File

@ -10,7 +10,7 @@
android:id="@+id/tv_rank"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:layout_weight="0.6"
android:gravity="start|center"
android:text="@string/dialog_gift_wall_list_info_list_header_rank"
android:textColor="#FFFFFF"
@ -25,7 +25,7 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_weight="0.5"
android:layout_gravity="bottom"
android:gravity="center|bottom"
android:orientation="vertical"

View File

@ -56,12 +56,12 @@
<TextView
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="#FFD3A4"
android:textSize="13sp"
android:maxLength="5"
android:gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/dialog_gift_wall_list_info_list_header_rename"

View File

@ -1525,6 +1525,8 @@
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get">已冠名</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get_un">未冠名</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips">當前主播</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips2">當前排名</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips3">已收到:</string>
<string name="dialog_gift_wall_list_info_list_header_rank">排名</string>
<string name="dialog_gift_wall_list_info_list_header_rename">冠名歸屬</string>
<string name="dialog_gift_wall_list_info_list_header_rename1">周星歸屬</string>

View File

@ -1529,6 +1529,8 @@
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get">Titled</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_btn_one_champion_get_un">Untitled</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips">Anchor</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips2">Current ranking</string>
<string name="dialog_gift_wall_gfit_info_list_bottom_tips3">Received:</string>
<string name="dialog_gift_wall_list_info_list_header_rank">Rank</string>
<string name="dialog_gift_wall_list_info_list_header_rename">Title attribution</string>
<string name="dialog_gift_wall_list_info_list_header_rename1">Weekly star attribution</string>

View File

@ -5,7 +5,7 @@ ext {
minSdkVersion : 23,
targetSdkVersion : 34,
versionCode : 693,
versionName : "6.8.0"
versionName : "6.8.1"
]
manifestPlaceholders = [
//