修改测试问题

This commit is contained in:
18401019693 2024-03-20 13:40:30 +08:00
parent 4693954a72
commit 4fabf3aba3
18 changed files with 238 additions and 82 deletions

View File

@ -20,12 +20,18 @@ public class DragonSendMoneyListAdapter extends RecyclerView.Adapter {
RecyclerView send_money_list; RecyclerView send_money_list;
boolean isAnchor; boolean isAnchor;
SparseArray<CountDownTimer> countDownMap; SparseArray<CountDownTimer> countDownMap;
boolean isAttention;
public DragonSendMoneyListAdapter setAnchor(boolean anchor) { public DragonSendMoneyListAdapter setAnchor(boolean anchor) {
isAnchor = anchor; isAnchor = anchor;
return this; return this;
} }
public DragonSendMoneyListAdapter setAttention(boolean attention) {
isAttention = attention;
return this;
}
public List<sendMoneyLongListModel> getMoneyLongListModels() { public List<sendMoneyLongListModel> getMoneyLongListModels() {
return moneyLongListModels; return moneyLongListModels;
} }
@ -70,7 +76,7 @@ public class DragonSendMoneyListAdapter extends RecyclerView.Adapter {
// if (time > 0) { // if (time > 0) {
// //
// } // }
sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor); sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor,isAttention);
} }

View File

@ -5,21 +5,25 @@ import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.WordUtil;
public class GuardBuyTipsDialog { public class GuardBuyTipsDialog {
/** /**
*
* @param context * @param context
* @param coin 钻石 * @param coin 钻石
* @param content 购买类型名称 * @param content 购买类型名称
* @param simpleCallback * @param simpleCallback
*/ */
public static void showBuyOrRenewDialog(Context context, String coin, String content, boolean isOpen,DialogUitl.SimpleCallback simpleCallback) { public static void showBuyOrRenewDialog(Context context, String coin, String content,
boolean isOpen, GuardGetGuardUserInfoModel mGuardUserInfoModel, int guardType,
DialogUitl.SimpleCallback simpleCallback) {
if (context instanceof Activity) { if (context instanceof Activity) {
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) { if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
return; return;
@ -30,25 +34,49 @@ public class GuardBuyTipsDialog {
dialog.setContentView(R.layout.dialog_guard_buy_tips); dialog.setContentView(R.layout.dialog_guard_buy_tips);
dialog.setCancelable(true); dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true); dialog.setCanceledOnTouchOutside(true);
if (!isOpen){ Button btn_confirm = dialog.findViewById(R.id.btn_confirm);
TextView content1 = dialog.findViewById(R.id.content1);
TextView content2 = dialog.findViewById(R.id.content2);
TextView contentTextView = dialog.findViewById(R.id.content);
TextView buyTypeTextView = dialog.findViewById(R.id.buyType);
content1.setVisibility(View.VISIBLE);
contentTextView.setVisibility(View.VISIBLE);
buyTypeTextView.setVisibility(View.VISIBLE);
content2.setVisibility(View.GONE);
if (!isOpen) {
if (!TextUtils.isEmpty(coin)) { if (!TextUtils.isEmpty(coin)) {
TextView contentTextView = dialog.findViewById(R.id.content);
contentTextView.setText(context.getString(R.string.guard_buy_tips_1, coin)); contentTextView.setText(context.getString(R.string.guard_buy_tips_1, coin));
} }
if (!TextUtils.isEmpty(content)) { if (!TextUtils.isEmpty(content)) {
TextView buyTypeTextView = dialog.findViewById(R.id.buyType); buyTypeTextView.setText("" + content + "");
buyTypeTextView.setText(""+content+"");
} }
}else { } else {
if (!TextUtils.isEmpty(coin)) { if (!TextUtils.isEmpty(coin)) {
TextView contentTextView = dialog.findViewById(R.id.content);
contentTextView.setText(context.getString(R.string.guard_buy_tips_2, coin)); contentTextView.setText(context.getString(R.string.guard_buy_tips_2, coin));
} }
if (!TextUtils.isEmpty(content)) { if (!TextUtils.isEmpty(content)) {
TextView buyTypeTextView = dialog.findViewById(R.id.buyType); buyTypeTextView.setText("" + content + "");
buyTypeTextView.setText(""+content+"");
} }
} }
if (mGuardUserInfoModel != null) {
if (mGuardUserInfoModel.getGuardType() != 0) {
if (guardType < mGuardUserInfoModel.getGuardType()) {
content1.setVisibility(View.GONE);
contentTextView.setVisibility(View.GONE);
buyTypeTextView.setVisibility(View.GONE);
content2.setVisibility(View.VISIBLE);
} else if (guardType==mGuardUserInfoModel.getGuardType()){
content1.setVisibility(View.GONE);
}else {
content1.setVisibility(View.VISIBLE);
}
} else {
content1.setVisibility(View.GONE);
}
} else {
content1.setVisibility(View.GONE);
}
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() { dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -56,11 +84,17 @@ public class GuardBuyTipsDialog {
dialog.dismiss(); dialog.dismiss();
} }
}); });
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() { btn_confirm.setText(WordUtil.isNewZh() ? "確認" : "Confirm");
btn_confirm.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
simpleCallback.onConfirmClick(dialog, ""); if (content2.getVisibility()==View.VISIBLE){
dialog.dismiss(); dialog.dismiss();
}else {
simpleCallback.onConfirmClick(dialog, "");
dialog.dismiss();
}
} }
}); });
dialog.show(); dialog.show();

View File

@ -2993,7 +2993,12 @@ public class LiveNetManager {
@Override @Override
public void accept(ResponseModel<Object> stringResponseModel) throws Exception { public void accept(ResponseModel<Object> stringResponseModel) throws Exception {
if (callback != null) { if (callback != null) {
callback.onSuccess(stringResponseModel.getData().getMsg()); if (stringResponseModel.getData().getCode() == 0) {
callback.onSuccess(stringResponseModel.getData().getMsg());
} else {
callback.onError(stringResponseModel.getData().getMsg());
}
} }
} }
}, new Consumer<Throwable>() { }, new Consumer<Throwable>() {
@ -3129,9 +3134,9 @@ public class LiveNetManager {
} }
public void guardGetRewards( String liveUid,HttpCallback<CheckUpgradesModel> callback) { public void guardGetRewards(String liveUid, HttpCallback<CheckUpgradesModel> callback) {
API.get().pdLiveApi(mContext) API.get().pdLiveApi(mContext)
.guardGetRewards("2",liveUid) .guardGetRewards("2", liveUid)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<CheckUpgradesModel>>() { .subscribe(new Consumer<ResponseModel<CheckUpgradesModel>>() {

View File

@ -39,7 +39,7 @@ public class DragonSendMoneyListViewHolder extends RecyclerView.ViewHolder {
send_benefits = itemView.findViewById(R.id.send_benefits); send_benefits = itemView.findViewById(R.id.send_benefits);
} }
public void setData(sendMoneyLongListModel model, DragonSendMoneyListClicksCallBack callBack,boolean isAnchor) { public void setData(sendMoneyLongListModel model, DragonSendMoneyListClicksCallBack callBack,boolean isAnchor, boolean isAttention) {
ImgLoader.display(itemView.getContext(), model.getUserAvatar(), live_avatar); ImgLoader.display(itemView.getContext(), model.getUserAvatar(), live_avatar);
user_nicename.setText(String.valueOf(model.getUserNicename())); user_nicename.setText(String.valueOf(model.getUserNicename()));
gold_num.setText(String.valueOf(model.getGoldNum())); gold_num.setText(String.valueOf(model.getGoldNum()));

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="300dp" android:layout_width="310dp"
android:layout_height="220dp" android:layout_height="250dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="200dp" android:layout_height="250dp"
android:background="@drawable/guard_buy_tips_bg"> android:background="@drawable/guard_buy_tips_bg">
<ImageView <ImageView
@ -35,18 +35,19 @@
<TextView <TextView
android:id="@+id/content" android:id="@+id/content"
android:gravity="center"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/title" android:layout_below="@+id/title"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="30dp" android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:letterSpacing="0.1" android:letterSpacing="0.1"
android:text="@string/guard_buy_tips_1" android:text="@string/guard_buy_tips_1"
android:textColor="#FFE0BF" android:textColor="#FFE0BF"
android:textSize="14dp" /> android:textSize="14dp"
android:visibility="invisible" />
<TextView <TextView
android:id="@+id/buyType" android:id="@+id/buyType"
@ -55,13 +56,43 @@
android:layout_below="@+id/content" android:layout_below="@+id/content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="50dp"
android:letterSpacing="0.1" android:letterSpacing="0.1"
android:text="@string/guard_buy_type_1" android:text="@string/guard_buy_type_1"
android:textColor="#FFB974" android:textColor="#FFB974"
android:textSize="15dp" android:textSize="15dp"
android:textStyle="italic|bold" /> android:textStyle="italic|bold"
android:visibility="invisible" />
<TextView
android:id="@+id/content1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/buyType"
android:layout_centerHorizontal="true"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:letterSpacing="0.1"
android:text="@string/according_to_the_rules"
android:textColor="#FFE0BF"
android:textSize="12dp"
android:visibility="invisible" />
<TextView
android:id="@+id/content2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:letterSpacing="0.1"
android:text="@string/current_guard_expires"
android:textColor="#FFE0BF"
android:textSize="17dp" />
</RelativeLayout> </RelativeLayout>
<Button <Button

View File

@ -6,7 +6,7 @@
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:layout_width="320dp" android:layout_width="300dp"
android:layout_height="320dp"> android:layout_height="320dp">
<ImageView <ImageView

View File

@ -1494,4 +1494,6 @@ Limited ride And limited avatar frame</string>
<string name="guard_buy_tips_2">You will spend %s diamonds to renew the anchor</string> <string name="guard_buy_tips_2">You will spend %s diamonds to renew the anchor</string>
<string name="participate">Participate</string> <string name="participate">Participate</string>
<string name="send_benefits">Send benefits</string> <string name="send_benefits">Send benefits</string>
<string name="according_to_the_rules">(The original protection level will be retained, and the remaining validity period will be added to the new protection validity period according to the rules)</string>
<string name="current_guard_expires">We are currently unable to activate this guard. Please try again after the current guard expires</string>
</resources> </resources>

View File

@ -1493,4 +1493,6 @@
<string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string> <string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string>
<string name="participate">點擊參加</string> <string name="participate">點擊參加</string>
<string name="send_benefits">發放福利</string> <string name="send_benefits">發放福利</string>
<string name="according_to_the_rules">(原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中)</string>
<string name="current_guard_expires">暫時無法開通該守護,請當前守護到期後嘗試</string>
</resources> </resources>

View File

@ -1492,5 +1492,7 @@
<string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string> <string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string>
<string name="participate">點擊參加</string> <string name="participate">點擊參加</string>
<string name="send_benefits">發放福利</string> <string name="send_benefits">發放福利</string>
<string name="according_to_the_rules">(原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中)</string>
<string name="current_guard_expires">暫時無法開通該守護,請當前守護到期後嘗試</string>
</resources> </resources>

View File

@ -1489,5 +1489,7 @@
<string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string> <string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string>
<string name="participate">點擊參加</string> <string name="participate">點擊參加</string>
<string name="send_benefits">發放福利</string> <string name="send_benefits">發放福利</string>
<string name="according_to_the_rules">(原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中)</string>
<string name="current_guard_expires">暫時無法開通該守護,請當前守護到期後嘗試</string>
</resources> </resources>

View File

@ -1498,5 +1498,7 @@ Limited ride And limited avatar frame</string>
<string name="guard_buy_tips_2">You will spend %s diamonds to renew the anchor</string> <string name="guard_buy_tips_2">You will spend %s diamonds to renew the anchor</string>
<string name="participate">Participate</string> <string name="participate">Participate</string>
<string name="send_benefits">Send benefits</string> <string name="send_benefits">Send benefits</string>
<string name="according_to_the_rules">(The original protection level will be retained, and the remaining validity period will be added to the new protection validity period according to the rules)</string>
<string name="current_guard_expires">We are currently unable to activate this guard. Please try again after the current guard expires</string>
</resources> </resources>

View File

@ -8,8 +8,11 @@ import androidx.fragment.app.FragmentActivity;
import com.lxj.xpopup.core.CenterPopupView; import com.lxj.xpopup.core.CenterPopupView;
import com.makeramen.roundedimageview.RoundedImageView; import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
import com.yunbao.common.bean.GuardMaturityDateRemindModel; import com.yunbao.common.bean.GuardMaturityDateRemindModel;
import com.yunbao.common.glide.ImgLoader; 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.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R; import com.yunbao.live.R;
@ -28,6 +31,7 @@ public class DragonExpirePopup extends CenterPopupView {
TextView dueIn; TextView dueIn;
TextView dueInGuard2; TextView dueInGuard2;
GuardMaturityDateRemindModel maturityDateRemindModel; GuardMaturityDateRemindModel maturityDateRemindModel;
GuardGetGuardUserInfoModel getGuardUserInfoModel = null;
public DragonExpirePopup(@NonNull Context context, String liveUid, GuardMaturityDateRemindModel maturityDateRemindModel, String stream) { public DragonExpirePopup(@NonNull Context context, String liveUid, GuardMaturityDateRemindModel maturityDateRemindModel, String stream) {
super(context); super(context);
@ -60,6 +64,18 @@ public class DragonExpirePopup extends CenterPopupView {
ImgLoader.display(getContext(), maturityDateRemindModel.getUserAvatar(), userAvatar); ImgLoader.display(getContext(), maturityDateRemindModel.getUserAvatar(), userAvatar);
ImgLoader.display(getContext(), maturityDateRemindModel.getLiveAvatar(), liveAvatar); ImgLoader.display(getContext(), maturityDateRemindModel.getLiveAvatar(), liveAvatar);
LiveNetManager.get(getContext()).getGuardUserInfo(mLiveUid, new HttpCallback<GuardGetGuardUserInfoModel>() {
@Override
public void onSuccess(GuardGetGuardUserInfoModel data) {
getGuardUserInfoModel = data;
}
@Override
public void onError(String error) {
}
});
String guardName = WordUtil.isNewZh() ? "星之守護" : "Star Guardian"; String guardName = WordUtil.isNewZh() ? "星之守護" : "Star Guardian";
switch (maturityDateRemindModel.getGuardType()) { switch (maturityDateRemindModel.getGuardType()) {
@ -107,7 +123,7 @@ public class DragonExpirePopup extends CenterPopupView {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
dismiss(); dismiss();
new LiveBuyGuardDialog(activity, mLiveUid,mStream).showDialog(); new LiveBuyGuardDialog(activity, mLiveUid, mStream, getGuardUserInfoModel).showDialog();
} }
}); });
} }

View File

@ -1,6 +1,7 @@
package com.yunbao.live.dialog; package com.yunbao.live.dialog;
import android.content.Context; import android.content.Context;
import android.text.TextUtils;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
@ -16,6 +17,7 @@ import com.yunbao.common.dialog.DragonRulePopup;
import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.DragonSendMoneyListViewHolder; import com.yunbao.common.views.DragonSendMoneyListViewHolder;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R; import com.yunbao.live.R;
@ -30,12 +32,14 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
RecyclerView send_money_list; RecyclerView send_money_list;
boolean isAnchor; boolean isAnchor;
GradientTextView title; GradientTextView title;
boolean isAttention;
public DragonSendMoneyListPopup(@NonNull Context context, String liveUid, boolean isAnchor) { public DragonSendMoneyListPopup(@NonNull Context context, String liveUid, boolean isAnchor, boolean isAttention) {
super(context); super(context);
activity = (FragmentActivity) context; activity = (FragmentActivity) context;
mLiveUid = liveUid; mLiveUid = liveUid;
this.isAnchor = isAnchor; this.isAnchor = isAnchor;
this.isAttention = isAttention;
} }
@Override @Override
@ -59,34 +63,42 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
send_money_list.setAdapter(dragonSendMoneyListAdapter); send_money_list.setAdapter(dragonSendMoneyListAdapter);
dragonSendMoneyListAdapter.setAnchor(isAnchor); dragonSendMoneyListAdapter.setAnchor(isAnchor);
dragonSendMoneyListAdapter.setAttention(isAttention);
dragonSendMoneyListAdapter.setCallBack(new DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack() { dragonSendMoneyListAdapter.setCallBack(new DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack() {
@Override @Override
public void onParticipate(sendMoneyLongListModel moneyLongListModel) { public void onParticipate(sendMoneyLongListModel moneyLongListModel) {
LiveNetManager.get(mContext) if (isAttention) {
.participateMoneyLong(mLiveUid, moneyLongListModel.getSendMoneyLongKey(), new HttpCallback<String>() { LiveNetManager.get(mContext)
@Override .participateMoneyLong(mLiveUid, moneyLongListModel.getSendMoneyLongKey(), new HttpCallback<String>() {
public void onSuccess(String data) { @Override
ToastUtil.show(data); public void onSuccess(String data) {
LiveNetManager.get(mContext) ToastUtil.show(data);
.sendMoneyLongList(mLiveUid, new HttpCallback<List<sendMoneyLongListModel>>() { LiveNetManager.get(mContext)
@Override .sendMoneyLongList(mLiveUid, new HttpCallback<List<sendMoneyLongListModel>>() {
public void onSuccess(List<sendMoneyLongListModel> data) { @Override
dragonSendMoneyListAdapter.setMoneyLongListModels(data); public void onSuccess(List<sendMoneyLongListModel> data) {
send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size()); dragonSendMoneyListAdapter.setMoneyLongListModels(data);
} send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size());
title.removeCallbacks(refreshRunnable);
title.postDelayed(refreshRunnable, 1000);
}
@Override @Override
public void onError(String error) { public void onError(String error) {
ToastUtil.show(error); ToastUtil.show(error);
} }
}); });
} }
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} else {
ToastUtil.show(WordUtil.isNewZh() ? "關注主播後可參與活動" : "Follow the anchor can participate in the activity");
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} }
}); });
LiveNetManager.get(mContext) LiveNetManager.get(mContext)
@ -127,13 +139,18 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
List<sendMoneyLongListModel> moneyLongListModels = dragonSendMoneyListAdapter.getMoneyLongListModels(); List<sendMoneyLongListModel> moneyLongListModels = dragonSendMoneyListAdapter.getMoneyLongListModels();
List<sendMoneyLongListModel> models = new ArrayList<>(); List<sendMoneyLongListModel> models = new ArrayList<>();
for (sendMoneyLongListModel listModel : moneyLongListModels) { for (sendMoneyLongListModel listModel : moneyLongListModels) {
String countdown = listModel.getCountdown(); if (TextUtils.equals("0", listModel.getParticipate())) {
long countdownNumber = Long.parseLong(countdown);
countdownNumber = countdownNumber - 1;
if (countdownNumber > 0) {
listModel.setCountdown(String.valueOf(countdownNumber));
models.add(listModel); models.add(listModel);
} else {
String countdown = listModel.getCountdown();
long countdownNumber = Long.parseLong(countdown);
countdownNumber = countdownNumber - 1;
if (countdownNumber > 0) {
listModel.setCountdown(String.valueOf(countdownNumber));
models.add(listModel);
}
} }
} }
dragonSendMoneyListAdapter.setMoneyLongListModels(models); dragonSendMoneyListAdapter.setMoneyLongListModels(models);
title.postDelayed(refreshRunnable, 1000); title.postDelayed(refreshRunnable, 1000);

View File

@ -67,19 +67,24 @@ public class DragonSendsMoneyPopup extends CenterPopupView {
if (!TextUtils.isEmpty(dragonMoney)) { if (!TextUtils.isEmpty(dragonMoney)) {
long money = Long.parseLong(dragonMoney); long money = Long.parseLong(dragonMoney);
if (goldMoney > money) { if (goldMoney > money) {
LiveNetManager.get(getContext()) if (money >= 1000) {
.sendMoneyLong(mLiveUid, String.valueOf(money), new com.yunbao.common.http.base.HttpCallback<String>() { LiveNetManager.get(getContext())
@Override .sendMoneyLong(mLiveUid, String.valueOf(money), new com.yunbao.common.http.base.HttpCallback<String>() {
public void onSuccess(String data) { @Override
dismiss(); public void onSuccess(String data) {
dismiss();
} }
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} else {
ToastUtil.show(WordUtil.isNewZh() ? "金豆數量不低於1000" : "The number of golden beans is not less than 1000");
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} else { } else {
ToastUtil.show(WordUtil.isNewZh() ? "輸入數量不能大於自己的金豆總數量" : "The input quantity cannot be greater than the total number of gold beans"); ToastUtil.show(WordUtil.isNewZh() ? "輸入數量不能大於自己的金豆總數量" : "The input quantity cannot be greater than the total number of gold beans");
} }

View File

@ -31,6 +31,7 @@ import com.yunbao.common.adapter.LiveBuyGuardPrivilegeAdapter;
import com.yunbao.common.bean.CheckUpgradesModel; import com.yunbao.common.bean.CheckUpgradesModel;
import com.yunbao.common.bean.GuardDataTipModel; import com.yunbao.common.bean.GuardDataTipModel;
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel; import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
import com.yunbao.common.bean.GuardPriceModel; import com.yunbao.common.bean.GuardPriceModel;
import com.yunbao.common.dialog.AbsDialogPopupWindow; import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.dialog.GuardBuyTipsDialog; import com.yunbao.common.dialog.GuardBuyTipsDialog;
@ -74,12 +75,14 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
LiveBuyGuardPrivilegeAdapter buyGuardPrivilegeAdapter; LiveBuyGuardPrivilegeAdapter buyGuardPrivilegeAdapter;
List<String> guardPrivilegeStrings = new ArrayList<>(); List<String> guardPrivilegeStrings = new ArrayList<>();
GuardDataTipModel dataTipModel; GuardDataTipModel dataTipModel;
GuardGetGuardUserInfoModel mGuardUserInfoModel;
public LiveBuyGuardDialog(@NonNull Context context, String liveUid, String stream) { public LiveBuyGuardDialog(@NonNull Context context, String liveUid, String stream, GuardGetGuardUserInfoModel guardUserInfoModel) {
super(context); super(context);
activity = (FragmentActivity) context; activity = (FragmentActivity) context;
mLiveUid = liveUid; mLiveUid = liveUid;
mStream = stream; mStream = stream;
mGuardUserInfoModel = guardUserInfoModel;
} }
@Override @Override
@ -145,6 +148,18 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
buyGuardBanner.setBannerData(R.layout.banner_item_buy_guard, buyGuardBannerModels); buyGuardBanner.setBannerData(R.layout.banner_item_buy_guard, buyGuardBannerModels);
buyGuardBanner.setIsClipChildrenMode(true); buyGuardBanner.setIsClipChildrenMode(true);
guardPrivilegeStrings = data.getGuardData().get(0).getGuardPrivilege(); guardPrivilegeStrings = data.getGuardData().get(0).getGuardPrivilege();
buyGuardBanner.postDelayed(new Runnable() {
@Override
public void run() {
if (mGuardUserInfoModel != null) {
if (mGuardUserInfoModel.getGuardType()!=0){
buyGuardBanner.setBannerCurrentItem(mGuardUserInfoModel.getGuardType() - 1);
}
}
}
}, 500);
} }
@ -246,6 +261,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
} }
}); });
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.guard_month_linear), new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.guard_month_linear), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
@ -316,7 +332,8 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
GuardBuyTipsDialog GuardBuyTipsDialog
.showBuyOrRenewDialog(mContext, .showBuyOrRenewDialog(mContext,
discountPrice.getText().toString(), discountPrice.getText().toString(),
dataTipModel.getGuardName(), dataTipModel.isOpen(),new DialogUitl.SimpleCallback2() { dataTipModel.getGuardName(), dataTipModel.isOpen(),
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
@Override @Override
public void onCancelClick() { public void onCancelClick() {
dismiss(); dismiss();
@ -333,7 +350,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
public void onSuccess(String data) { public void onSuccess(String data) {
ToastUtil.show(data); ToastUtil.show(data);
dismiss(); dismiss();
if (dataTipModel.getGuardType()==3){ if (dataTipModel.getGuardType() == 3) {
new XPopup.Builder(mContext) new XPopup.Builder(mContext)
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
.show(); .show();

View File

@ -3,6 +3,7 @@ package com.yunbao.live.dialog;
import android.content.Context; import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
@ -27,6 +28,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.TimeUtils; import com.yunbao.common.utils.TimeUtils;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
@ -60,6 +62,8 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
TextView btnGuardOpen; TextView btnGuardOpen;
TextView guard_hint; TextView guard_hint;
TextView guard_time; TextView guard_time;
View guardian_task_view;
GuardGetGuardUserInfoModel getGuardUserInfoModel = null;
public LiveGuardDialog(@NonNull Context context, boolean isEmpty, String liveUid, String stream) { public LiveGuardDialog(@NonNull Context context, boolean isEmpty, String liveUid, String stream) {
super(context); super(context);
@ -88,6 +92,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
guardingTheAnchor = findViewById(R.id.guarding_the_anchor); guardingTheAnchor = findViewById(R.id.guarding_the_anchor);
guard_time = findViewById(R.id.guard_time); guard_time = findViewById(R.id.guard_time);
guard_hint = findViewById(R.id.guard_hint); guard_hint = findViewById(R.id.guard_hint);
guardian_task_view = findViewById(R.id.guardian_task_view);
mRefreshView = findViewById(R.id.refreshView); mRefreshView = findViewById(R.id.refreshView);
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
@ -102,6 +107,16 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
guardIcon = findViewById(R.id.guard_imageView); guardIcon = findViewById(R.id.guard_imageView);
giftSvga = findViewById(R.id.gift_svga); giftSvga = findViewById(R.id.gift_svga);
btnGuardOpen = findViewById(R.id.btn_guard_open); btnGuardOpen = findViewById(R.id.btn_guard_open);
if (WordUtil.isNewZh()) {
ViewGroup.LayoutParams layoutParams = guardian_task_view.getLayoutParams();
layoutParams.width = DpUtil.dp2px(50);
guardian_task_view.setLayoutParams(layoutParams);
} else {
ViewGroup.LayoutParams layoutParams = guardian_task_view.getLayoutParams();
layoutParams.width = DpUtil.dp2px(78);
guardian_task_view.setLayoutParams(layoutParams);
}
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<GuardUserModel>() { mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<GuardUserModel>() {
@Override @Override
public RefreshAdapter<GuardUserModel> getAdapter() { public RefreshAdapter<GuardUserModel> getAdapter() {
@ -162,7 +177,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
public void onViewClicks() { public void onViewClicks() {
MobclickAgent.onEvent(mContext, "guardian_renew_btn", "守护席开通守护/续费守护按钮点击次数及人数"); MobclickAgent.onEvent(mContext, "guardian_renew_btn", "守护席开通守护/续费守护按钮点击次数及人数");
dismiss(); dismiss();
new LiveBuyGuardDialog(mContext, mLiveUid, mStream).showDialog(); new LiveBuyGuardDialog(mContext, mLiveUid, mStream, getGuardUserInfoModel).showDialog();
} }
}); });
//神龙送财 //神龙送财
@ -176,6 +191,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
LiveNetManager.get(mContext).getGuardUserInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<GuardGetGuardUserInfoModel>() { LiveNetManager.get(mContext).getGuardUserInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<GuardGetGuardUserInfoModel>() {
@Override @Override
public void onSuccess(GuardGetGuardUserInfoModel data) { public void onSuccess(GuardGetGuardUserInfoModel data) {
getGuardUserInfoModel = data;
if (data.getGuardType() == 0) { if (data.getGuardType() == 0) {
guardianTask.setVisibility(GONE); guardianTask.setVisibility(GONE);
myGraudGrade.setVisibility(GONE); myGraudGrade.setVisibility(GONE);
@ -213,7 +229,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
guard_time.setVisibility(GONE); guard_time.setVisibility(GONE);
} else { } else {
guard_time.setText(String.format(WordUtil.getNewString(R.string.guardiandate), TimeUtils.getDateToString(data.getEndtime()*1000, "yyyy-MM-dd"))); guard_time.setText(String.format(WordUtil.getNewString(R.string.guardiandate), TimeUtils.getDateToString(data.getEndtime() * 1000, "yyyy-MM-dd")));
} }
} }

View File

@ -165,7 +165,6 @@ import com.yunbao.live.bean.WishlistItemModel;
import com.yunbao.live.custom.LiveLightView; import com.yunbao.live.custom.LiveLightView;
import com.yunbao.live.custom.RightGradual; import com.yunbao.live.custom.RightGradual;
import com.yunbao.live.dialog.DragonSendMoneyListPopup; import com.yunbao.live.dialog.DragonSendMoneyListPopup;
import com.yunbao.live.dialog.DragonSendsMoneyPopup;
import com.yunbao.live.dialog.GiftWallDialog; import com.yunbao.live.dialog.GiftWallDialog;
import com.yunbao.live.dialog.LiveContactDetailsSendGiftDialog; import com.yunbao.live.dialog.LiveContactDetailsSendGiftDialog;
import com.yunbao.live.dialog.LiveFaceUnityDialogFragment; import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
@ -636,7 +635,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mLiveGiftAnimPresenter.showGifGift(liveReceiveGiftBean); mLiveGiftAnimPresenter.showGifGift(liveReceiveGiftBean);
} }
List<XydCompleteModel> xydCompleteModels = new ArrayList<>(); List<XydCompleteModel> xydCompleteModels = new ArrayList<>();
@ -1596,7 +1594,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
ViewClicksAntiShake.clicksAntiShake(dragonImmediateParticipation, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(dragonImmediateParticipation, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
new DragonSendMoneyListPopup(mContext, mLiveUid, false).showDialog(); new DragonSendMoneyListPopup(mContext, mLiveUid, false, isAttention != 0).showDialog();
// new XPopup.Builder(mContext) // new XPopup.Builder(mContext)
// .asCustom(new GuardUpgradePopup(mContext, mLiveUid)) // .asCustom(new GuardUpgradePopup(mContext, mLiveUid))
// .show(); // .show();
@ -1612,7 +1610,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
ViewClicksAntiShake.clicksAntiShake(dragonImmediateParticipationTime, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(dragonImmediateParticipationTime, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
new DragonSendMoneyListPopup(mContext, mLiveUid, true).showDialog(); new DragonSendMoneyListPopup(mContext, mLiveUid, true, isAttention != 0).showDialog();
// new XPopup.Builder(mContext) // new XPopup.Builder(mContext)
// .asCustom(new GuardUpgradePopup(mContext, mLiveUid)) // .asCustom(new GuardUpgradePopup(mContext, mLiveUid))
// .show(); // .show();

View File

@ -92,7 +92,8 @@
android:textSize="12sp" /> android:textSize="12sp" />
<View <View
android:layout_width="53dp" android:id="@+id/guardian_task_view"
android:layout_width="50dp"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_gravity="bottom|center_horizontal" android:layout_gravity="bottom|center_horizontal"
android:background="#E8C7F9" /> android:background="#E8C7F9" />