Merge remote-tracking branch 'origin/dev_6.6.4_战令' into dev_6.6.4_战令
This commit is contained in:
commit
dea3264577
@ -17,11 +17,18 @@ public class ActivateEliteBattleOrderPopupWindow extends CenterPopupView {
|
||||
private boolean elites;//是否精英战令
|
||||
private String spendMoney;//花费钱
|
||||
private Button buttonWarOrder;
|
||||
private LiberalBattlePassPopupWindow.LiberalBattlePassCallback mPassCallback;
|
||||
private String mBattlePassTypeId;
|
||||
|
||||
public ActivateEliteBattleOrderPopupWindow(@NonNull Context context, String mSpendMoney, boolean elites) {
|
||||
public ActivateEliteBattleOrderPopupWindow(@NonNull Context context, String mSpendMoney,
|
||||
boolean elites,
|
||||
LiberalBattlePassPopupWindow.LiberalBattlePassCallback passCallback
|
||||
, String battlePassTypeId) {
|
||||
super(context);
|
||||
this.elites = elites;
|
||||
spendMoney = mSpendMoney;
|
||||
mPassCallback=passCallback;
|
||||
mBattlePassTypeId = battlePassTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -64,9 +71,10 @@ public class ActivateEliteBattleOrderPopupWindow extends CenterPopupView {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new LiberalBattlePassPopupWindow(getContext(), spendMoney, elites))
|
||||
.asCustom(new LiberalBattlePassPopupWindow(getContext(), spendMoney, elites,mPassCallback,mBattlePassTypeId))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
/**
|
||||
* 活动结束
|
||||
*/
|
||||
public class ActivityEndPopupWindow extends CenterPopupView {
|
||||
public ActivityEndPopupWindow(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.activity_end_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.confirm), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -11,17 +11,24 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class LiberalBattlePassPopupWindow extends CenterPopupView {
|
||||
private String spendMoney;//花费钱
|
||||
private boolean mElites;//是否精英战令
|
||||
private TextView liberalBattlePass;
|
||||
private LiberalBattlePassCallback mPassCallback;
|
||||
private String mBattlePassTypeId;
|
||||
|
||||
public LiberalBattlePassPopupWindow(@NonNull Context context, String mSpendMoney, boolean elites) {
|
||||
public LiberalBattlePassPopupWindow(@NonNull Context context, String mSpendMoney, boolean elites, LiberalBattlePassCallback passCallback, String battlePassTypeId) {
|
||||
super(context);
|
||||
spendMoney = mSpendMoney;
|
||||
mElites = elites;
|
||||
mPassCallback = passCallback;
|
||||
mBattlePassTypeId = battlePassTypeId;
|
||||
}
|
||||
|
||||
protected int getImplLayoutId() {
|
||||
@ -53,7 +60,36 @@ public class LiberalBattlePassPopupWindow extends CenterPopupView {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.liberal_battle_sure), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext()).
|
||||
upgradesBattlePass(mBattlePassTypeId, new HttpCallback<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> data) {
|
||||
|
||||
dialog.dismiss();
|
||||
if (mPassCallback != null) {
|
||||
mPassCallback.onCallback(data.getData().getCode(), data.getData().getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
dialog.dismiss();
|
||||
if (mPassCallback != null) {
|
||||
mPassCallback.onCallback(102, error);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public interface LiberalBattlePassCallback {
|
||||
void onCallback(int code, String msg);
|
||||
}
|
||||
}
|
||||
|
@ -16,12 +16,18 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
* 升級精英/尊享戰令
|
||||
*/
|
||||
public class PromotionElitePopupWindow extends CenterPopupView {
|
||||
private String enjoySpendMoney,quintessenceSpendMoney;//花费钱
|
||||
private String enjoySpendMoney, quintessenceSpendMoney;//花费钱
|
||||
private LiberalBattlePassPopupWindow.LiberalBattlePassCallback mPassCallback;
|
||||
private String mBattlePassTypeId;
|
||||
|
||||
public PromotionElitePopupWindow(@NonNull Context context, String mEnjoySpendMoney, String mQuintessenceSpendMoney) {
|
||||
public PromotionElitePopupWindow(@NonNull Context context, String mEnjoySpendMoney,
|
||||
String mQuintessenceSpendMoney, LiberalBattlePassPopupWindow.LiberalBattlePassCallback passCallback,
|
||||
String battlePassTypeId) {
|
||||
super(context);
|
||||
enjoySpendMoney = mEnjoySpendMoney;
|
||||
quintessenceSpendMoney = mQuintessenceSpendMoney;
|
||||
mPassCallback = passCallback;
|
||||
mBattlePassTypeId = battlePassTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -46,7 +52,7 @@ public class PromotionElitePopupWindow extends CenterPopupView {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), quintessenceSpendMoney, true))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), quintessenceSpendMoney, true, mPassCallback, mBattlePassTypeId))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
@ -57,7 +63,7 @@ public class PromotionElitePopupWindow extends CenterPopupView {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), enjoySpendMoney, false))
|
||||
.asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), enjoySpendMoney, false, mPassCallback, mBattlePassTypeId))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
@ -1091,4 +1091,7 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<Object>> buyTicket(
|
||||
@Field("quantity") String quantity
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Livebattlepass.upgradesBattlePass")
|
||||
Observable<ResponseModel<Object>> upgradesBattlePass(@Query("battle_pass_type_id") String battlePassTypeId);
|
||||
}
|
||||
|
@ -2460,6 +2460,29 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void upgradesBattlePass(String battlePassTypeId, HttpCallback<ResponseModel<Object>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.upgradesBattlePass(battlePassTypeId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel);
|
||||
}
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void quickGiftSendGift(String quickGiftNumber, String liveUid, String stream, HttpCallback<QuickGiftSendGiftModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.quickGiftSendGift(quickGiftNumber, liveUid, stream)
|
||||
|
40
common/src/main/res/layout/activity_end_popup.xml
Normal file
40
common/src/main/res/layout/activity_end_popup.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="218dp"
|
||||
android:layout_marginStart="22dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="75dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/this_activity_is_over"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="33dp"
|
||||
android:background="@mipmap/button_buying_experience"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/edit_one_4"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
@ -23,28 +23,43 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="57dp">
|
||||
|
||||
|
||||
<Button
|
||||
<LinearLayout
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginStart="19dp"
|
||||
android:background="@mipmap/button_liberal_battle_cancel"
|
||||
android:gravity="center"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
<LinearLayout
|
||||
android:id="@+id/liberal_battle_sure"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="19dp"
|
||||
android:background="@mipmap/button_liberal_battle_sure"
|
||||
android:gravity="center"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/confirm"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1412,5 +1412,6 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="order_level">我的等級</string>
|
||||
<string name="buying_experience_point">購買經驗值:</string>
|
||||
<string name="buying_experience">購買</string>
|
||||
<string name="this_activity_is_over">本期活動已結束,請儘快領取未領取的獎勵積分可保留下次使用</string>
|
||||
|
||||
</resources>
|
||||
|
@ -39,6 +39,7 @@ import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.NativeCallbackModel;
|
||||
import com.yunbao.common.dialog.CinemaTicketPopupWindow;
|
||||
import com.yunbao.common.dialog.LiberalBattlePassPopupWindow;
|
||||
import com.yunbao.common.dialog.OrderLevelPopupWindow;
|
||||
import com.yunbao.common.dialog.PromotionElitePopupWindow;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
@ -235,7 +236,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
|
||||
.asCustom(new PromotionElitePopupWindow(mContext,"62,888","12,888"))
|
||||
.asCustom(new LiberalBattlePassPopupWindow(mContext,"62,888",false))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user