修改测试问题
This commit is contained in:
@@ -8,8 +8,11 @@ import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||
import com.yunbao.common.bean.GuardMaturityDateRemindModel;
|
||||
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.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
@@ -28,6 +31,7 @@ public class DragonExpirePopup extends CenterPopupView {
|
||||
TextView dueIn;
|
||||
TextView dueInGuard2;
|
||||
GuardMaturityDateRemindModel maturityDateRemindModel;
|
||||
GuardGetGuardUserInfoModel getGuardUserInfoModel = null;
|
||||
|
||||
public DragonExpirePopup(@NonNull Context context, String liveUid, GuardMaturityDateRemindModel maturityDateRemindModel, String stream) {
|
||||
super(context);
|
||||
@@ -60,6 +64,18 @@ public class DragonExpirePopup extends CenterPopupView {
|
||||
ImgLoader.display(getContext(), maturityDateRemindModel.getUserAvatar(), userAvatar);
|
||||
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";
|
||||
switch (maturityDateRemindModel.getGuardType()) {
|
||||
@@ -107,7 +123,7 @@ public class DragonExpirePopup extends CenterPopupView {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
new LiveBuyGuardDialog(activity, mLiveUid,mStream).showDialog();
|
||||
new LiveBuyGuardDialog(activity, mLiveUid, mStream, getGuardUserInfoModel).showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
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.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.DragonSendMoneyListViewHolder;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
@@ -30,12 +32,14 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
RecyclerView send_money_list;
|
||||
boolean isAnchor;
|
||||
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);
|
||||
activity = (FragmentActivity) context;
|
||||
mLiveUid = liveUid;
|
||||
this.isAnchor = isAnchor;
|
||||
this.isAttention = isAttention;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,34 +63,42 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
|
||||
send_money_list.setAdapter(dragonSendMoneyListAdapter);
|
||||
dragonSendMoneyListAdapter.setAnchor(isAnchor);
|
||||
dragonSendMoneyListAdapter.setAttention(isAttention);
|
||||
dragonSendMoneyListAdapter.setCallBack(new DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack() {
|
||||
@Override
|
||||
public void onParticipate(sendMoneyLongListModel moneyLongListModel) {
|
||||
LiveNetManager.get(mContext)
|
||||
.participateMoneyLong(mLiveUid, moneyLongListModel.getSendMoneyLongKey(), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(data);
|
||||
LiveNetManager.get(mContext)
|
||||
.sendMoneyLongList(mLiveUid, new HttpCallback<List<sendMoneyLongListModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<sendMoneyLongListModel> data) {
|
||||
dragonSendMoneyListAdapter.setMoneyLongListModels(data);
|
||||
send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size());
|
||||
}
|
||||
if (isAttention) {
|
||||
LiveNetManager.get(mContext)
|
||||
.participateMoneyLong(mLiveUid, moneyLongListModel.getSendMoneyLongKey(), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(data);
|
||||
LiveNetManager.get(mContext)
|
||||
.sendMoneyLongList(mLiveUid, new HttpCallback<List<sendMoneyLongListModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<sendMoneyLongListModel> data) {
|
||||
dragonSendMoneyListAdapter.setMoneyLongListModels(data);
|
||||
send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size());
|
||||
title.removeCallbacks(refreshRunnable);
|
||||
title.postDelayed(refreshRunnable, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void onError(String 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)
|
||||
@@ -127,13 +139,18 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
List<sendMoneyLongListModel> moneyLongListModels = dragonSendMoneyListAdapter.getMoneyLongListModels();
|
||||
List<sendMoneyLongListModel> models = new ArrayList<>();
|
||||
for (sendMoneyLongListModel listModel : moneyLongListModels) {
|
||||
String countdown = listModel.getCountdown();
|
||||
long countdownNumber = Long.parseLong(countdown);
|
||||
countdownNumber = countdownNumber - 1;
|
||||
if (countdownNumber > 0) {
|
||||
listModel.setCountdown(String.valueOf(countdownNumber));
|
||||
if (TextUtils.equals("0", listModel.getParticipate())) {
|
||||
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);
|
||||
title.postDelayed(refreshRunnable, 1000);
|
||||
|
||||
@@ -67,19 +67,24 @@ public class DragonSendsMoneyPopup extends CenterPopupView {
|
||||
if (!TextUtils.isEmpty(dragonMoney)) {
|
||||
long money = Long.parseLong(dragonMoney);
|
||||
if (goldMoney > money) {
|
||||
LiveNetManager.get(getContext())
|
||||
.sendMoneyLong(mLiveUid, String.valueOf(money), new com.yunbao.common.http.base.HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
dismiss();
|
||||
if (money >= 1000) {
|
||||
LiveNetManager.get(getContext())
|
||||
.sendMoneyLong(mLiveUid, String.valueOf(money), new com.yunbao.common.http.base.HttpCallback<String>() {
|
||||
@Override
|
||||
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 {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "輸入數量不能大於自己的金豆總數量" : "The input quantity cannot be greater than the total number of gold beans");
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.yunbao.common.adapter.LiveBuyGuardPrivilegeAdapter;
|
||||
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||
import com.yunbao.common.bean.GuardDataTipModel;
|
||||
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
|
||||
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||
import com.yunbao.common.bean.GuardPriceModel;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.dialog.GuardBuyTipsDialog;
|
||||
@@ -74,12 +75,14 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
LiveBuyGuardPrivilegeAdapter buyGuardPrivilegeAdapter;
|
||||
List<String> guardPrivilegeStrings = new ArrayList<>();
|
||||
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);
|
||||
activity = (FragmentActivity) context;
|
||||
mLiveUid = liveUid;
|
||||
mStream = stream;
|
||||
mGuardUserInfoModel = guardUserInfoModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,6 +148,18 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
buyGuardBanner.setBannerData(R.layout.banner_item_buy_guard, buyGuardBannerModels);
|
||||
buyGuardBanner.setIsClipChildrenMode(true);
|
||||
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() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
@@ -316,7 +332,8 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
discountPrice.getText().toString(),
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),new DialogUitl.SimpleCallback2() {
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),
|
||||
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
dismiss();
|
||||
@@ -333,7 +350,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
public void onSuccess(String data) {
|
||||
ToastUtil.show(data);
|
||||
dismiss();
|
||||
if (dataTipModel.getGuardType()==3){
|
||||
if (dataTipModel.getGuardType() == 3) {
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.live.dialog;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
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.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.TimeUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -60,6 +62,8 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
|
||||
TextView btnGuardOpen;
|
||||
TextView guard_hint;
|
||||
TextView guard_time;
|
||||
View guardian_task_view;
|
||||
GuardGetGuardUserInfoModel getGuardUserInfoModel = null;
|
||||
|
||||
public LiveGuardDialog(@NonNull Context context, boolean isEmpty, String liveUid, String stream) {
|
||||
super(context);
|
||||
@@ -88,6 +92,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
|
||||
guardingTheAnchor = findViewById(R.id.guarding_the_anchor);
|
||||
guard_time = findViewById(R.id.guard_time);
|
||||
guard_hint = findViewById(R.id.guard_hint);
|
||||
guardian_task_view = findViewById(R.id.guardian_task_view);
|
||||
|
||||
mRefreshView = findViewById(R.id.refreshView);
|
||||
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
@@ -102,6 +107,16 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
|
||||
guardIcon = findViewById(R.id.guard_imageView);
|
||||
giftSvga = findViewById(R.id.gift_svga);
|
||||
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>() {
|
||||
@Override
|
||||
public RefreshAdapter<GuardUserModel> getAdapter() {
|
||||
@@ -162,7 +177,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
|
||||
public void onViewClicks() {
|
||||
MobclickAgent.onEvent(mContext, "guardian_renew_btn", "守护席开通守护/续费守护按钮点击次数及人数");
|
||||
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>() {
|
||||
@Override
|
||||
public void onSuccess(GuardGetGuardUserInfoModel data) {
|
||||
getGuardUserInfoModel = data;
|
||||
if (data.getGuardType() == 0) {
|
||||
guardianTask.setVisibility(GONE);
|
||||
myGraudGrade.setVisibility(GONE);
|
||||
@@ -213,7 +229,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
|
||||
guard_time.setVisibility(GONE);
|
||||
} 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")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -165,7 +165,6 @@ import com.yunbao.live.bean.WishlistItemModel;
|
||||
import com.yunbao.live.custom.LiveLightView;
|
||||
import com.yunbao.live.custom.RightGradual;
|
||||
import com.yunbao.live.dialog.DragonSendMoneyListPopup;
|
||||
import com.yunbao.live.dialog.DragonSendsMoneyPopup;
|
||||
import com.yunbao.live.dialog.GiftWallDialog;
|
||||
import com.yunbao.live.dialog.LiveContactDetailsSendGiftDialog;
|
||||
import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
|
||||
@@ -636,7 +635,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mLiveGiftAnimPresenter.showGifGift(liveReceiveGiftBean);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
List<XydCompleteModel> xydCompleteModels = new ArrayList<>();
|
||||
@@ -1596,7 +1594,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
ViewClicksAntiShake.clicksAntiShake(dragonImmediateParticipation, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new DragonSendMoneyListPopup(mContext, mLiveUid, false).showDialog();
|
||||
new DragonSendMoneyListPopup(mContext, mLiveUid, false, isAttention != 0).showDialog();
|
||||
// new XPopup.Builder(mContext)
|
||||
// .asCustom(new GuardUpgradePopup(mContext, mLiveUid))
|
||||
// .show();
|
||||
@@ -1612,7 +1610,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
ViewClicksAntiShake.clicksAntiShake(dragonImmediateParticipationTime, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new DragonSendMoneyListPopup(mContext, mLiveUid, true).showDialog();
|
||||
new DragonSendMoneyListPopup(mContext, mLiveUid, true, isAttention != 0).showDialog();
|
||||
// new XPopup.Builder(mContext)
|
||||
// .asCustom(new GuardUpgradePopup(mContext, mLiveUid))
|
||||
// .show();
|
||||
|
||||
@@ -92,7 +92,8 @@
|
||||
android:textSize="12sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="53dp"
|
||||
android:id="@+id/guardian_task_view"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:background="#E8C7F9" />
|
||||
|
||||
Reference in New Issue
Block a user