Merge remote-tracking branch 'origin/dev_6.6.3'
# Conflicts: # common/src/main/java/com/yunbao/common/bean/IMLoginModel.java # config.gradle
This commit is contained in:
24
common/src/main/java/com/yunbao/common/bean/CoolConfig.java
Normal file
24
common/src/main/java/com/yunbao/common/bean/CoolConfig.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class CoolConfig extends BaseModel {
|
||||
private int rate;
|
||||
private String ticketCount="0" ;
|
||||
|
||||
public String getTicketCount() {
|
||||
return ticketCount;
|
||||
}
|
||||
|
||||
public CoolConfig setTicketCount(String ticketCount) {
|
||||
this.ticketCount = ticketCount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
public CoolConfig setRate(int rate) {
|
||||
this.rate = rate;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,28 @@ public class EnterRoomNewModel extends BaseModel {
|
||||
private String sudGameRoomName;
|
||||
@SerializedName("sud_gameDate")
|
||||
private SudGameDateModel sudGameDateModel;
|
||||
@SerializedName("quick_gift_remaining_quantity")
|
||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||
@SerializedName("if_viewing_duration_complete")
|
||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||
|
||||
public int getQuickGiftRemainingQuantity() {
|
||||
return quickGiftRemainingQuantity;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setQuickGiftRemainingQuantity(int quickGiftRemainingQuantity) {
|
||||
this.quickGiftRemainingQuantity = quickGiftRemainingQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIfViewingDurationComplete() {
|
||||
return ifViewingDurationComplete;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setIfViewingDurationComplete(int ifViewingDurationComplete) {
|
||||
this.ifViewingDurationComplete = ifViewingDurationComplete;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SudGameDateModel getSudGameDateModel() {
|
||||
return sudGameDateModel;
|
||||
|
||||
@@ -204,7 +204,7 @@ public class IMLoginModel extends BaseModel {
|
||||
@SerializedName("votes")
|
||||
private String votes;
|
||||
@SerializedName("yuanbao")
|
||||
private double yuanbao;
|
||||
private String yuanbao;
|
||||
@SerializedName("list")
|
||||
private List<List<ListModel>> list;
|
||||
@SerializedName("slide")
|
||||
@@ -825,11 +825,11 @@ public class IMLoginModel extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public double getYuanbao() {
|
||||
public String getYuanbao() {
|
||||
return yuanbao;
|
||||
}
|
||||
|
||||
public IMLoginModel setYuanbao(double yuanbao) {
|
||||
public IMLoginModel setYuanbao(String yuanbao) {
|
||||
this.yuanbao = yuanbao;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class NativeCallbackModel extends BaseModel{
|
||||
private String uid ;
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public NativeCallbackModel setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class QuickGiftSendGiftModel extends BaseModel {
|
||||
@SerializedName("quick_gift_remaining_quantity")
|
||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||
@SerializedName("if_viewing_duration_complete")
|
||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||
@SerializedName("if_hidden_egg")
|
||||
private int ifHiddenEgg = 1;//1.未解锁 2.已解锁过奖励 3.当前请求解锁了奖励
|
||||
|
||||
public int getIfHiddenEgg() {
|
||||
return ifHiddenEgg;
|
||||
}
|
||||
|
||||
public QuickGiftSendGiftModel setIfHiddenEgg(int ifHiddenEgg) {
|
||||
this.ifHiddenEgg = ifHiddenEgg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getQuickGiftRemainingQuantity() {
|
||||
return quickGiftRemainingQuantity;
|
||||
}
|
||||
|
||||
public QuickGiftSendGiftModel setQuickGiftRemainingQuantity(int quickGiftRemainingQuantity) {
|
||||
this.quickGiftRemainingQuantity = quickGiftRemainingQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIfViewingDurationComplete() {
|
||||
return ifViewingDurationComplete;
|
||||
}
|
||||
|
||||
public QuickGiftSendGiftModel setIfViewingDurationComplete(int ifViewingDurationComplete) {
|
||||
this.ifViewingDurationComplete = ifViewingDurationComplete;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
private CoolConfig mCoolConfig;
|
||||
private TextView cinemaTicket, ticketsPlusMinus, quantityNeed;
|
||||
private int ticket = 1;
|
||||
private CinemaTicketPopupWindowCallBack mCinemaTicketPopupWindowCallBack;
|
||||
|
||||
public CinemaTicketPopupWindow(@NonNull Context context, CoolConfig coolConfig, CinemaTicketPopupWindowCallBack cinemaTicketPopupWindowCallBack) {
|
||||
super(context);
|
||||
mCoolConfig = coolConfig;
|
||||
mCinemaTicketPopupWindowCallBack = cinemaTicketPopupWindowCallBack;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.cinema_ticket_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
cinemaTicket = findViewById(R.id.cinema_ticket);
|
||||
ticketsPlusMinus = findViewById(R.id.tickets_plus_minus);
|
||||
quantityNeed = findViewById(R.id.quantity_need);
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (ticket > 1) {
|
||||
ticket = ticket - 1;
|
||||
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
findViewById(R.id.add).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ticket = ticket + 1;
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_exchange), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
LiveNetManager.get(getContext())
|
||||
.buyTicket(String.valueOf(ticket), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
|
||||
|
||||
if (mCinemaTicketPopupWindowCallBack != null) {
|
||||
mCinemaTicketPopupWindowCallBack.onCallBack(data);
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface CinemaTicketPopupWindowCallBack {
|
||||
void onCallBack(String data);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -23,6 +24,16 @@ public class JavascriptInterfaceEvent extends BaseModel {
|
||||
private String data;
|
||||
private String name;
|
||||
private String image;
|
||||
private CoolConfig coolConfig;
|
||||
|
||||
public CoolConfig getCoolConfig() {
|
||||
return coolConfig;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setCoolConfig(CoolConfig coolConfig) {
|
||||
this.coolConfig = coolConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class QuickGiftingEvent extends BaseModel {
|
||||
private int index;
|
||||
private String svgaName;
|
||||
private boolean show =false;
|
||||
private boolean reminder = false;
|
||||
|
||||
private String giftRemainingQuantity;
|
||||
private String hotNum;
|
||||
|
||||
public String getHotNum() {
|
||||
return hotNum;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setHotNum(String hotNum) {
|
||||
this.hotNum = hotNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftRemainingQuantity() {
|
||||
return giftRemainingQuantity;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setGiftRemainingQuantity(String giftRemainingQuantity) {
|
||||
this.giftRemainingQuantity = giftRemainingQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isReminder() {
|
||||
return reminder;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setReminder(boolean reminder) {
|
||||
this.reminder = reminder;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isShow() {
|
||||
return show;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setShow(boolean show) {
|
||||
this.show = show;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSvgaName() {
|
||||
return svgaName;
|
||||
}
|
||||
|
||||
public QuickGiftingEvent setSvgaName(String svgaName) {
|
||||
this.svgaName = svgaName;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
15
common/src/main/java/com/yunbao/common/event/SlideEvent.java
Normal file
15
common/src/main/java/com/yunbao/common/event/SlideEvent.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SlideEvent extends BaseModel {
|
||||
private boolean isSlide;
|
||||
|
||||
public boolean isSlide() {
|
||||
return isSlide;
|
||||
}
|
||||
public SlideEvent setSlide(boolean slide) {
|
||||
isSlide = slide;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
@@ -46,6 +47,7 @@ import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
||||
import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.RedPacketDetailsBean;
|
||||
@@ -1061,9 +1063,32 @@ public interface PDLiveApi {
|
||||
@GET("/api/public/?service=Sudgameserver.deductMoney")
|
||||
Observable<ResponseModel<Object>> deductMoney(
|
||||
@Query("room_id") String roomId
|
||||
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Sudgameserver.checkCurrency")
|
||||
Observable<ResponseModel<CheckCurrencyModel>> checkCurrency(
|
||||
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Quickgift.sendGift")
|
||||
Observable<ResponseModel<QuickGiftSendGiftModel>> quickGiftSendGift(
|
||||
@Query("quick_gift_number") String quickGiftNumber,
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("stream") String stream
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Quickgift.viewingDurationGetGift")
|
||||
Observable<ResponseModel<QuickGiftSendGiftModel>> viewingDurationGetGift(
|
||||
@Query("liveuid") String liveUid
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=cool.config")
|
||||
Observable<ResponseModel<CoolConfig>> getCoolConfig();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/api/public/?service=cool.buy_ticket")
|
||||
Observable<ResponseModel<Object>> buyTicket(
|
||||
@Field("quantity") String quantity
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
@@ -44,6 +45,7 @@ import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.QuickGiftSendGiftModel;
|
||||
import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.RedPacketDetailsBean;
|
||||
@@ -2317,21 +2319,21 @@ public class LiveNetManager {
|
||||
}
|
||||
|
||||
public void deductMoney(String roomId) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.deductMoney(roomId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
|
||||
}
|
||||
}).isDisposed();
|
||||
// API.get().pdLiveApi(mContext)
|
||||
// .deductMoney(roomId)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
// @Override
|
||||
// public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
//
|
||||
// }
|
||||
// }, new Consumer<Throwable>() {
|
||||
// @Override
|
||||
// public void accept(Throwable throwable) throws Exception {
|
||||
//
|
||||
// }
|
||||
// }).isDisposed();
|
||||
}
|
||||
|
||||
public void checkCurrency(HttpCallback<CheckCurrencyModel> callback) {
|
||||
@@ -2384,6 +2386,102 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void viewingDurationGetGift(String liveUid, HttpCallback<QuickGiftSendGiftModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.viewingDurationGetGift(liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<QuickGiftSendGiftModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<QuickGiftSendGiftModel> quickGiftSendGiftModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(quickGiftSendGiftModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, 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 getCoolConfig(HttpCallback<CoolConfig> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getCoolConfig()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<CoolConfig>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<CoolConfig> coolConfigResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(coolConfigResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, 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 buyTicket(String quantity, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.buyTicket(quantity)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
if (objectResponseModel.getData().getCode() == 200) {
|
||||
callback.onSuccess("1");
|
||||
} else if (objectResponseModel.getData().getCode() == 500) {
|
||||
callback.onSuccess("2");
|
||||
} else {
|
||||
callback.onError(objectResponseModel.getData().getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}, 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)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<QuickGiftSendGiftModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<QuickGiftSendGiftModel> quickGiftSendGiftModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(quickGiftSendGiftModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, 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 getRoomList(String sudGameId, String threshold, String roomHolderType, String liveUid, String currencyType, int page, HttpCallback<List<SudRoomListModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRoomList(sudGameId, threshold, roomHolderType, liveUid, currencyType, page)
|
||||
|
||||
@@ -60,6 +60,13 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
public boolean getRedPoint() {
|
||||
return !TextUtils.isEmpty(getString("RedPoint")) && !TextUtils.equals(getString("RedPoint"), "1");
|
||||
}
|
||||
public void setQuickGiftIfFirst() {
|
||||
put("quick_gift_if_first", "1");
|
||||
}
|
||||
|
||||
public boolean getQuickGiftIfFirst() {
|
||||
return TextUtils.isEmpty(getString("quick_gift_if_first")) || !TextUtils.equals(getString("quick_gift_if_first"), "1");
|
||||
}
|
||||
|
||||
public void setSudGameMin() {
|
||||
put("SudGameMin", "0");
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.momo.mcamera.util.JsonUtil;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
|
||||
public class JavascriptInterfacePlayLetUtils {
|
||||
private Activity mContext;
|
||||
private WebView mWebView;
|
||||
private static JavascriptInterfacePlayLetUtils sInstance;
|
||||
|
||||
public static JavascriptInterfacePlayLetUtils getInstance() {
|
||||
|
||||
synchronized (JavascriptInterfacePlayLetUtils.class) {
|
||||
|
||||
sInstance = new JavascriptInterfacePlayLetUtils();
|
||||
|
||||
return sInstance;
|
||||
}
|
||||
}
|
||||
|
||||
public JavascriptInterfacePlayLetUtils setmContext(Activity mContext, WebView mWebView) {
|
||||
this.mContext = mContext;
|
||||
this.mWebView = mWebView;
|
||||
// webView.evaluateJavascript("javascript:nativeCallback('" + params + "')", new ValueCallback<String>() {
|
||||
// @Override
|
||||
// public void onReceiveValue(String value) {
|
||||
// }
|
||||
// });
|
||||
return this;
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void postEvent(String name, String data) {
|
||||
Log.e("TAG", "postEvent name==" + name);
|
||||
Log.e("TAG", "postEvent data==" + data);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void postWeakBalance(String data) {
|
||||
CoolConfig coolConfig = new JsonUtil().fromJson(data, CoolConfig.class);
|
||||
Log.e("TAG", "postWeakBalance data==" + data);
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setCoolConfig(coolConfig)
|
||||
.setMethod("postWeakBalance"));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package com.yunbao.common.utils;
|
||||
|
||||
import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_REWARD;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.JavascriptInterface;
|
||||
@@ -25,6 +27,7 @@ import com.yunbao.common.bean.VideoBean;
|
||||
import com.yunbao.common.bean.VideoListBean;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.event.QuickGiftingEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
@@ -124,10 +127,10 @@ public class JavascriptInterfaceUtils {
|
||||
url = CommonAppConfig.HOST + url;
|
||||
if (url.contains("?")) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
} else {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
if (LiveZhuangBana) {
|
||||
RouteUtil.forwardLiveZhuangBanActivity(url, false);
|
||||
@@ -147,10 +150,10 @@ public class JavascriptInterfaceUtils {
|
||||
url = CommonAppConfig.HOST + url;
|
||||
if (url.contains("?")) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
} else {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
+ CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
if (LiveZhuangBana) {
|
||||
RouteUtil.forwardLiveZhuangBanActivity(url, title);
|
||||
@@ -259,11 +262,12 @@ public class JavascriptInterfaceUtils {
|
||||
|
||||
/**
|
||||
* 跳转直播并打开礼物栏选中礼物
|
||||
*
|
||||
* @param liveId 直播间id
|
||||
* @param giftId 礼物id
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void androidMethodLookToLiveGift(String liveId,String giftId){
|
||||
public void androidMethodLookToLiveGift(String liveId, String giftId) {
|
||||
LiveHttpUtil.getLiveInfo(liveId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -300,6 +304,7 @@ public class JavascriptInterfaceUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidMethodLookToLive(String liveId) {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
@@ -598,6 +603,18 @@ public class JavascriptInterfaceUtils {
|
||||
.setMethod("clickLogOffAccount"));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidClickToTaskPage() {
|
||||
ARouter.getInstance().build(PATH_REWARD).withString("url",
|
||||
CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid()
|
||||
+ "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidQuickGiftRemainingQuantity(int giftRemainingQuantity) {
|
||||
Bus.get().post(new QuickGiftingEvent().setGiftRemainingQuantity(String.valueOf(giftRemainingQuantity)));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidFansGroupBuy(String id) {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
@@ -644,8 +661,9 @@ public class JavascriptInterfaceUtils {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidCancelAnchorAttention"));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidLnsufficientBalanceClick(String msg){
|
||||
public void androidLnsufficientBalanceClick(String msg) {
|
||||
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
@@ -659,4 +677,5 @@ public class JavascriptInterfaceUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class CircleProgress2 extends View {
|
||||
private Paint mPaint;
|
||||
private RectF mRectF;
|
||||
private int mCurrent = 10, mMax = 100;
|
||||
//圆弧(也可以说是圆环)的宽度
|
||||
private float mArcWidth =7;
|
||||
//控件的宽度
|
||||
private float mWidth;
|
||||
|
||||
public CircleProgress2(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public CircleProgress2(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public CircleProgress2(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mPaint = new Paint();
|
||||
mPaint.setAntiAlias(true);
|
||||
mRectF = new RectF();
|
||||
}
|
||||
|
||||
public void setCurrent(int mCurrent) {
|
||||
this.mCurrent = mCurrent;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void setMax(int mMax) {
|
||||
this.mMax = mMax;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
//getMeasuredWidth获取的是view的原始大小,也就是xml中配置或者代码中设置的大小
|
||||
//getWidth获取的是view最终显示的大小,这个大小不一定等于原始大小
|
||||
mWidth = getMeasuredWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
mPaint.setStyle(Paint.Style.STROKE);
|
||||
//设置圆弧的宽度(圆环的宽度)
|
||||
mPaint.setStrokeWidth(mArcWidth);
|
||||
mPaint.setColor(Color.TRANSPARENT);
|
||||
//大圆的半径
|
||||
float bigCircleRadius = mWidth / 2;
|
||||
//小圆的半径
|
||||
float smallCircleRadius = bigCircleRadius;
|
||||
//绘制小圆
|
||||
canvas.drawCircle(bigCircleRadius, bigCircleRadius, smallCircleRadius, mPaint);
|
||||
mPaint.setColor(Color.parseColor("#FEC51B"));
|
||||
mRectF.set(mArcWidth, mArcWidth, mWidth - mArcWidth, mWidth - mArcWidth);
|
||||
//绘制圆弧
|
||||
canvas.drawArc(mRectF, -90, mCurrent * 360 / mMax, false, mPaint);
|
||||
setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user