修改测试问题
This commit is contained in:
@@ -20,12 +20,18 @@ public class DragonSendMoneyListAdapter extends RecyclerView.Adapter {
|
||||
RecyclerView send_money_list;
|
||||
boolean isAnchor;
|
||||
SparseArray<CountDownTimer> countDownMap;
|
||||
boolean isAttention;
|
||||
|
||||
public DragonSendMoneyListAdapter setAnchor(boolean anchor) {
|
||||
isAnchor = anchor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DragonSendMoneyListAdapter setAttention(boolean attention) {
|
||||
isAttention = attention;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<sendMoneyLongListModel> getMoneyLongListModels() {
|
||||
return moneyLongListModels;
|
||||
}
|
||||
@@ -70,7 +76,7 @@ public class DragonSendMoneyListAdapter extends RecyclerView.Adapter {
|
||||
// if (time > 0) {
|
||||
//
|
||||
// }
|
||||
sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor);
|
||||
sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor,isAttention);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,21 +5,25 @@ import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
public class GuardBuyTipsDialog {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param context
|
||||
* @param coin 钻石
|
||||
* @param content 购买类型名称
|
||||
* @param coin 钻石
|
||||
* @param content 购买类型名称
|
||||
* @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 (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
|
||||
return;
|
||||
@@ -30,25 +34,49 @@ public class GuardBuyTipsDialog {
|
||||
dialog.setContentView(R.layout.dialog_guard_buy_tips);
|
||||
dialog.setCancelable(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)) {
|
||||
TextView contentTextView = dialog.findViewById(R.id.content);
|
||||
contentTextView.setText(context.getString(R.string.guard_buy_tips_1, coin));
|
||||
}
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
TextView buyTypeTextView = dialog.findViewById(R.id.buyType);
|
||||
buyTypeTextView.setText("【"+content+"】");
|
||||
buyTypeTextView.setText("【" + content + "】");
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
if (!TextUtils.isEmpty(coin)) {
|
||||
TextView contentTextView = dialog.findViewById(R.id.content);
|
||||
contentTextView.setText(context.getString(R.string.guard_buy_tips_2, coin));
|
||||
}
|
||||
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() {
|
||||
@Override
|
||||
@@ -56,11 +84,17 @@ public class GuardBuyTipsDialog {
|
||||
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
|
||||
public void onClick(View v) {
|
||||
simpleCallback.onConfirmClick(dialog, "");
|
||||
dialog.dismiss();
|
||||
if (content2.getVisibility()==View.VISIBLE){
|
||||
dialog.dismiss();
|
||||
}else {
|
||||
simpleCallback.onConfirmClick(dialog, "");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
|
||||
@@ -2993,7 +2993,12 @@ public class LiveNetManager {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> stringResponseModel) throws Exception {
|
||||
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>() {
|
||||
@@ -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)
|
||||
.guardGetRewards("2",liveUid)
|
||||
.guardGetRewards("2", liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CheckUpgradesModel>>() {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DragonSendMoneyListViewHolder extends RecyclerView.ViewHolder {
|
||||
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);
|
||||
user_nicename.setText(String.valueOf(model.getUserNicename()));
|
||||
gold_num.setText(String.valueOf(model.getGoldNum()));
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="220dp"
|
||||
android:layout_width="310dp"
|
||||
android:layout_height="250dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_height="250dp"
|
||||
android:background="@drawable/guard_buy_tips_bg">
|
||||
|
||||
<ImageView
|
||||
@@ -35,18 +35,19 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/title"
|
||||
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:text="@string/guard_buy_tips_1"
|
||||
android:textColor="#FFE0BF"
|
||||
android:textSize="14dp" />
|
||||
android:textSize="14dp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/buyType"
|
||||
@@ -55,13 +56,43 @@
|
||||
android:layout_below="@+id/content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/guard_buy_type_1"
|
||||
android:textColor="#FFB974"
|
||||
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>
|
||||
|
||||
<Button
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="320dp"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="320dp">
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -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="participate">Participate</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>
|
||||
|
||||
@@ -1493,4 +1493,6 @@
|
||||
<string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string>
|
||||
<string name="participate">點擊參加</string>
|
||||
<string name="send_benefits">發放福利</string>
|
||||
<string name="according_to_the_rules">(原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中)</string>
|
||||
<string name="current_guard_expires">暫時無法開通該守護,請當前守護到期後嘗試</string>
|
||||
</resources>
|
||||
|
||||
@@ -1492,5 +1492,7 @@
|
||||
<string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string>
|
||||
<string name="participate">點擊參加</string>
|
||||
<string name="send_benefits">發放福利</string>
|
||||
<string name="according_to_the_rules">(原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中)</string>
|
||||
<string name="current_guard_expires">暫時無法開通該守護,請當前守護到期後嘗試</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1489,5 +1489,7 @@
|
||||
<string name="guard_buy_tips_2">您將花費%s鑽石為主播續費</string>
|
||||
<string name="participate">點擊參加</string>
|
||||
<string name="send_benefits">發放福利</string>
|
||||
<string name="according_to_the_rules">(原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中)</string>
|
||||
<string name="current_guard_expires">暫時無法開通該守護,請當前守護到期後嘗試</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -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="participate">Participate</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>
|
||||
|
||||
Reference in New Issue
Block a user