1、好友邀请守护内容修改
This commit is contained in:
parent
9dd3619049
commit
963fe2c110
@ -22,6 +22,24 @@ 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;
|
||||
|
||||
public String getCouponDiscount() {
|
||||
return couponDiscount;
|
||||
}
|
||||
|
||||
public String getCouponDiscountEn() {
|
||||
return couponDiscountEn;
|
||||
}
|
||||
|
||||
public String getCouponDiscountPrice() {
|
||||
return couponDiscountPrice;
|
||||
}
|
||||
|
||||
public String getOpeningTime() {
|
||||
return openingTime;
|
||||
|
@ -0,0 +1,78 @@
|
||||
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.SimpleCallback 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) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
btn_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
simpleCallback.onConfirmClick(dialog, "");
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
@ -1194,7 +1194,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);
|
||||
|
||||
@GET("/api/public/?service=Guard.sendMoneyLong")
|
||||
Observable<ResponseModel<Object>> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum);
|
||||
|
@ -3014,9 +3014,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, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.openGuard(liveUid, guardType, priceKey, stream)
|
||||
.openGuard(liveUid, guardType, priceKey, stream,coupon_type)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
|
88
common/src/main/res/layout/dialog_guard_buy_coupon_tips.xml
Normal file
88
common/src/main/res/layout/dialog_guard_buy_coupon_tips.xml
Normal file
@ -0,0 +1,88 @@
|
||||
<?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="310dp"
|
||||
android:layout_height="260dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="243dp"
|
||||
android:background="@drawable/guard_buy_tips_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@mipmap/icon_guard_buy_tips_close" />
|
||||
|
||||
<com.flyjingfish.gradienttextviewlib.GradientTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/dialog_tip"
|
||||
android:textSize="22dp"
|
||||
app:gradient_angle="45"
|
||||
app:gradient_endColor="#F9E1AE"
|
||||
app:gradient_startColor="#C28413" />
|
||||
|
||||
<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="14dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_cancel1"
|
||||
android:layout_width="100dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="38dp"
|
||||
android:textColor="#F7F7F7"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@mipmap/guard_buy_tips_cancel_bg"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/live_guard_buy_coupon_tips_cancel" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginLeft="40dp"
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="100dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="38dp"
|
||||
android:textColor="#893D0D"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/guard_buy_tips_sure_bg"
|
||||
android:letterSpacing="0.1"
|
||||
android:text="@string/live_guard_buy_coupon_tips_use" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
BIN
common/src/main/res/mipmap-xxhdpi/guard_buy_tips_cancel_bg.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/guard_buy_tips_cancel_bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -1501,4 +1501,6 @@
|
||||
<string name="main_type_theater">短劇</string>
|
||||
<string name="prank_complete">完成*1</string>
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="live_guard_buy_coupon_tips_use">使用</string>
|
||||
<string name="live_guard_buy_coupon_tips_cancel">取消</string>
|
||||
</resources>
|
||||
|
@ -1500,4 +1500,6 @@
|
||||
<string name="main_type_theater">短劇</string>
|
||||
<string name="prank_complete">完成*1</string>
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="live_guard_buy_coupon_tips_use">使用</string>
|
||||
<string name="live_guard_buy_coupon_tips_cancel">取消</string>
|
||||
</resources>
|
||||
|
@ -1497,5 +1497,7 @@
|
||||
<string name="main_type_theater">短劇</string>
|
||||
<string name="prank_complete">完成*1</string>
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="live_guard_buy_coupon_tips_use">使用</string>
|
||||
<string name="live_guard_buy_coupon_tips_cancel">取消</string>
|
||||
|
||||
</resources>
|
||||
|
@ -1506,4 +1506,6 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="main_type_theater" >Theater</string>
|
||||
<string name="pking_over">The anchor is in PK, please try again later</string>
|
||||
<string name="prank_complete">once</string>
|
||||
<string name="live_guard_buy_coupon_tips_use">Use</string>
|
||||
<string name="live_guard_buy_coupon_tips_cancel">Cancel</string>
|
||||
</resources>
|
||||
|
@ -41,6 +41,7 @@ import com.yunbao.common.bean.GuardUserInfoModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.custom.LiveGuardScalePageTransformer;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.dialog.GuardBuyCouponTipsDialog;
|
||||
import com.yunbao.common.dialog.GuardBuyTipsDialog;
|
||||
import com.yunbao.common.dialog.GuardUpgradePopup;
|
||||
import com.yunbao.common.dialog.LiveBuyGuardSelectPopup;
|
||||
@ -246,6 +247,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
openTheGuard.setText(dataTipModel.isOpen() ? WordUtil.isNewZh() ? "續費神之守護" : "Renew God Guardian"
|
||||
: WordUtil.getNewString(R.string.open_the_god_guard));
|
||||
}
|
||||
discountPrice.setTag("1");
|
||||
guardPriceModel = price.get(0);
|
||||
if (TextUtils.isEmpty(guardPriceModel.getDiscountPrice())) {
|
||||
discountPrice.setText(String.valueOf(guardPriceModel.getOriginalPrice()));
|
||||
@ -308,6 +310,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
public void onLiveBuyGuardSelectListener(GuardPriceModel model) {
|
||||
guardPriceModel = model;
|
||||
discountPrice.setTag(String.valueOf(guardPriceModel.getPriceKey()));
|
||||
if (TextUtils.isEmpty(guardPriceModel.getDiscountPrice())) {
|
||||
discountPrice.setText(String.valueOf(guardPriceModel.getOriginalPrice()));
|
||||
originalPrice.setVisibility(GONE);
|
||||
@ -340,204 +343,22 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
ViewClicksAntiShake.clicksAntiShake(openTheGuard, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (TextUtils.equals(userInfo.getIsOpen(), "1")) {
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
discountPrice.getText().toString(),
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),
|
||||
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream, new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
new DialogUitl.Builder(mContext)
|
||||
.setView(R.layout.dialog_live_unfollow)
|
||||
.setConfirmString(mContext.getString(R.string.charge))
|
||||
.setContent(mContext.getString(R.string.insufficient_balance))
|
||||
.setClickCallback(new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveBuyGuardDialog.this.dismiss();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType());
|
||||
ToastUtil.show(data);
|
||||
dismiss();
|
||||
if (dataTipModel.getGuardType() == 3) {
|
||||
new XPopup.Builder(mContext)
|
||||
.dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (userInfo.getGuardType() > dataTipModel.getGuardType()) {
|
||||
String name = "星之守護";
|
||||
switch (userInfo.getGuardType()) {
|
||||
case 1:
|
||||
name = WordUtil.isNewZh() ? "星之守護" : "star guardian";
|
||||
break;
|
||||
case 2:
|
||||
name = WordUtil.isNewZh() ? "王之守護" : "king guardian";
|
||||
break;
|
||||
case 3:
|
||||
name = WordUtil.isNewZh() ? "神之守護" : "god guardian";
|
||||
break;
|
||||
//判断是否选择的是一个月
|
||||
if(discountPrice.getTag().equals("1")){
|
||||
GuardBuyCouponTipsDialog.showBuyOrRenewDialog(mContext, WordUtil.isNewZh() ? guardPriceModel.getCouponDiscount() : guardPriceModel.getCouponDiscountEn(), guardPriceModel.getCouponDiscountPrice(), dataTipModel.getGuardName(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
|
||||
}
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
if (WordUtil.isNewZh()) {
|
||||
buffer.append("您的【")
|
||||
.append(name).append("】已過期\n").append("開通相同或更高等級守護將會保留您的守護等級").append("開通低等級守護將重新計算您的守護等級");
|
||||
} else {
|
||||
buffer.append("Your [")
|
||||
.append(name).append("] has expired").append("active the same or higher level of guardian will retain your guardian level").append("active lower level guardian will recalculate your guardian level");
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
bugGurd(true);
|
||||
dialog.dismiss();
|
||||
}
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
null,
|
||||
buffer.toString(), false,
|
||||
null, -200, new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
discountPrice.getText().toString(),
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),
|
||||
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream, new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
new DialogUitl.Builder(mContext)
|
||||
.setView(R.layout.dialog_live_unfollow)
|
||||
.setConfirmString(mContext.getString(R.string.charge))
|
||||
.setContent(mContext.getString(R.string.insufficient_balance))
|
||||
.setClickCallback(new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveBuyGuardDialog.this.dismiss();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType());
|
||||
ToastUtil.show(data);
|
||||
dismiss();
|
||||
if (dataTipModel.getGuardType() == 3) {
|
||||
new XPopup.Builder(mContext)
|
||||
.dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else {
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
discountPrice.getText().toString(),
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),
|
||||
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream, new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
new DialogUitl.Builder(mContext)
|
||||
.setView(R.layout.dialog_live_unfollow)
|
||||
.setConfirmString(mContext.getString(R.string.charge))
|
||||
.setContent(mContext.getString(R.string.insufficient_balance))
|
||||
.setClickCallback(new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveBuyGuardDialog.this.dismiss();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType());
|
||||
ToastUtil.show(data);
|
||||
dismiss();
|
||||
if (dataTipModel.getGuardType() == 3) {
|
||||
new XPopup.Builder(mContext)
|
||||
.dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}else{
|
||||
bugGurd(false);
|
||||
}
|
||||
switch (dataTipModel.getGuardType()) {
|
||||
case 1:
|
||||
@ -605,6 +426,208 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
|
||||
}
|
||||
|
||||
private void bugGurd(boolean isCoupon) {
|
||||
if (TextUtils.equals(userInfo.getIsOpen(), "1")) {
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
isCoupon?guardPriceModel.getCouponDiscountPrice():discountPrice.getText().toString(),
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),
|
||||
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0", new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
new DialogUitl.Builder(mContext)
|
||||
.setView(R.layout.dialog_live_unfollow)
|
||||
.setConfirmString(mContext.getString(R.string.charge))
|
||||
.setContent(mContext.getString(R.string.insufficient_balance))
|
||||
.setClickCallback(new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveBuyGuardDialog.this.dismiss();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType());
|
||||
ToastUtil.show(data);
|
||||
dismiss();
|
||||
if (dataTipModel.getGuardType() == 3) {
|
||||
new XPopup.Builder(mContext)
|
||||
.dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (userInfo.getGuardType() > dataTipModel.getGuardType()) {
|
||||
String name = "星之守護";
|
||||
switch (userInfo.getGuardType()) {
|
||||
case 1:
|
||||
name = WordUtil.isNewZh() ? "星之守護" : "star guardian";
|
||||
break;
|
||||
case 2:
|
||||
name = WordUtil.isNewZh() ? "王之守護" : "king guardian";
|
||||
break;
|
||||
case 3:
|
||||
name = WordUtil.isNewZh() ? "神之守護" : "god guardian";
|
||||
break;
|
||||
|
||||
}
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
if (WordUtil.isNewZh()) {
|
||||
buffer.append("您的【")
|
||||
.append(name).append("】已過期\n").append("開通相同或更高等級守護將會保留您的守護等級").append("開通低等級守護將重新計算您的守護等級");
|
||||
} else {
|
||||
buffer.append("Your [")
|
||||
.append(name).append("] has expired").append("active the same or higher level of guardian will retain your guardian level").append("active lower level guardian will recalculate your guardian level");
|
||||
}
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
null,
|
||||
buffer.toString(), false,
|
||||
null, -200, new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
isCoupon?guardPriceModel.getCouponDiscountPrice():discountPrice.getText().toString(),
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),
|
||||
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0", new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
new DialogUitl.Builder(mContext)
|
||||
.setView(R.layout.dialog_live_unfollow)
|
||||
.setConfirmString(mContext.getString(R.string.charge))
|
||||
.setContent(mContext.getString(R.string.insufficient_balance))
|
||||
.setClickCallback(new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveBuyGuardDialog.this.dismiss();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType());
|
||||
ToastUtil.show(data);
|
||||
dismiss();
|
||||
if (dataTipModel.getGuardType() == 3) {
|
||||
new XPopup.Builder(mContext)
|
||||
.dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else {
|
||||
GuardBuyTipsDialog
|
||||
.showBuyOrRenewDialog(mContext,
|
||||
isCoupon?guardPriceModel.getCouponDiscountPrice():discountPrice.getText().toString(),
|
||||
dataTipModel.getGuardName(), dataTipModel.isOpen(),
|
||||
mGuardUserInfoModel, dataTipModel.getGuardType(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0", new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
new DialogUitl.Builder(mContext)
|
||||
.setView(R.layout.dialog_live_unfollow)
|
||||
.setConfirmString(mContext.getString(R.string.charge))
|
||||
.setContent(mContext.getString(R.string.insufficient_balance))
|
||||
.setClickCallback(new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveBuyGuardDialog.this.dismiss();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||
}
|
||||
}).build().show();
|
||||
} else {
|
||||
IMLoginManager.get(mContext).setGuardType(dataTipModel.getGuardType());
|
||||
ToastUtil.show(data);
|
||||
dismiss();
|
||||
if (dataTipModel.getGuardType() == 3) {
|
||||
new XPopup.Builder(mContext)
|
||||
.dismissOnTouchOutside(false) // 点击外部是否关闭弹窗,默认为true
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void closeAnimSudGameListEvent(View view) {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(view, "rotation", -90f, 0f);
|
||||
animator.setDuration(animDuration);
|
||||
|
@ -15,12 +15,9 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.dialog.SkitCheckInWasSuccessfulPopup;
|
||||
import com.yunbao.common.event.FloatWarOrderEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.live.dialog.LiveBuyGuardDialog;
|
||||
import com.yunbao.live.dialog.LiveGuardDialog;
|
||||
import com.yunbao.live.dialog.LivePrankDialogFragment;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user