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:
18401019693 2023-12-06 15:20:39 +08:00
commit 5c00e065d2
68 changed files with 1551 additions and 72 deletions

View 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;
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;
}
}

View 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;
}
}

View File

@ -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
);
}

View File

@ -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)

View File

@ -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");

View File

@ -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"));
}
}

View File

@ -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 {
}
});
}
}

View File

@ -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);
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#9946433F" />
<corners android:radius="200dp" />
</shape>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="16dp" android:topLeftRadius="16dp" android:topRightRadius="0dp" />
<gradient android:angle="360" android:endColor="#F6F5FF" android:startColor="#D3E3FF" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="475dp"
android:layout_marginStart="21dp"
android:layout_marginEnd="21dp"
android:background="@mipmap/background_cinema_ticket"
android:orientation="vertical">
<ImageView
android:id="@+id/cinema_ticket_close"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="end"
android:layout_margin="12dp"
android:src="@mipmap/icon_cinema_ticket_close" />
<ImageView
android:layout_width="222dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@mipmap/icon_cinema_ticket_title" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp">
<TextView
android:id="@+id/cinema_ticket"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="#DFEAFF"
android:textSize="15sp" />
<ImageView
android:layout_width="23dp"
android:layout_height="19dp"
android:layout_marginStart="5dp"
android:src="@mipmap/icon_cinema_ticket" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="35dp"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/conversion_quantity"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<LinearLayout
android:layout_width="90dp"
android:layout_height="25dp"
android:background="@mipmap/backgroud_tickets_plus_minus">
<View
android:id="@+id/sub"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
android:id="@+id/tickets_plus_minus"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:singleLine="true"
android:text="0"
android:textColor="#000000"
android:textSize="12dp" />
<View
android:id="@+id/add"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="13dp"
android:gravity="center">
<TextView
android:id="@+id/quantity_need"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/conversion_quantity_need"
android:textColor="#DFEAFF"
android:textSize="12sp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginStart="3dp"
android:src="@mipmap/icon_collectibles2" />
</LinearLayout>
<ImageButton
android:id="@+id/cinema_ticket_exchange"
android:layout_width="140dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@mipmap/backgroundn_cinema_ticket_exchange" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="7dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="7dp"
android:layout_marginBottom="23dp"
android:background="@drawable/background_cinema_ticket_hint">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="3dp"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/conversion_quantity_need_of_use"
android:textColor="#000000"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="11dp"
android:text="@string/conversion_quantity_need_of_use1"
android:textColor="#000000"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/conversion_quantity_need_of_use2"
android:textColor="#000000"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/conversion_quantity_need_of_use3"
android:textColor="#000000"
android:textSize="13sp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -1386,5 +1386,12 @@ Limited ride And limited avatar frame</string>
<string name="room_sill0_100">0-100 coins</string>
<string name="room_sill100_500">100-500 coins</string>
<string name="room_sill500_m">Above 500 coins</string>
<string name="combo">combo X</string>
<string name="conversion_quantity">Exchange quantity:</string>
<string name="conversion_quantity_need">Need %s</string>
<string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string>
<string name="conversion_quantity_need_of_use1">·One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance;</string>
<string name="conversion_quantity_need_of_use2">·One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie;</string>
<string name="conversion_quantity_need_of_use3">·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities.</string>
</resources>

View File

@ -1383,4 +1383,11 @@
<string name="room_sill0_100">0-100星幣</string>
<string name="room_sill100_500">100-500星幣</string>
<string name="room_sill500_m">500以上星幣</string>
<string name="combo">連擊×</string>
<string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">·1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊。</string>
</resources>

View File

@ -1382,4 +1382,11 @@
<string name="room_sill0_100">0-100星幣</string>
<string name="room_sill100_500">100-500星幣</string>
<string name="room_sill500_m">500以上星幣</string>
<string name="combo">連擊×</string>
<string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">·1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊。</string>
</resources>

View File

@ -1382,5 +1382,12 @@
<string name="room_sill0_100">0-100星幣</string>
<string name="room_sill100_500">100-500星幣</string>
<string name="room_sill500_m">500以上星幣</string>
<string name="combo">連擊×</string>
<string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">·1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·1張觀影券可觀看一集短劇兌換成功後即可返回觀影頁面使用觀影券繼續觀看影片</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
</resources>

View File

@ -1389,4 +1389,11 @@ Limited ride And limited avatar frame</string>
<string name="room_sill0_100">0-100 coins</string>
<string name="room_sill100_500">100-500 coins</string>
<string name="room_sill500_m">Above 500 coins</string>
<string name="combo">combo X</string>
<string name="conversion_quantity">Exchange quantity:</string>
<string name="conversion_quantity_need">Need %s</string>
<string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string>
<string name="conversion_quantity_need_of_use1">·One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance;</string>
<string name="conversion_quantity_need_of_use2">·One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie;</string>
<string name="conversion_quantity_need_of_use3">·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities.</string>
</resources>

View File

@ -5,7 +5,7 @@ ext {
minSdkVersion : 21,
targetSdkVersion : 33,
versionCode : 458,
versionName : "6.6.2"
versionName : "6.6.3"
]
manifestPlaceholders = [
//
@ -19,11 +19,13 @@ ext {
baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnRB",
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
// true表示谷歌支付 false
isGooglePlay : false,
// true表示谷歌支付 false 0 1 2
isGooglePlay : 1,
//
isUploadLog : true,
//
isPluginModel : false,
isPluginModel : true,
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -70,7 +70,9 @@ import com.yunbao.common.event.LiveOpenSudRoomEvent;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
import com.yunbao.common.event.QuickGiftingEvent;
import com.yunbao.common.event.ShowHideEvent;
import com.yunbao.common.event.SlideEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
@ -1727,14 +1729,13 @@ public class LiveAudienceActivity extends LiveActivity {
.dismissOnTouchOutside(false)
.dismissOnBackPressed(false)
.asCustom(liveSudGamePopupXPopup).show();
}else {
} else {
if (liveSudGamePopupXPopup != null) {
liveSudGamePopupXPopup.dialog.show();
}
}
break;
case 1:
@ -1763,6 +1764,36 @@ public class LiveAudienceActivity extends LiveActivity {
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSlideEvent(SlideEvent event) {
verticalViewPager.setEnableScroll(event.isSlide());
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onQuickGiftingEvent(QuickGiftingEvent event) {
if (manager != null) {
if (TextUtils.isEmpty(event.getHotNum())) {
if (TextUtils.isEmpty(event.getGiftRemainingQuantity())) {
if (event.isReminder()) {
manager.onQuickGifting3();
} else {
if (event.isShow()) {
manager.onQuickGifting2(true);
} else {
manager.onQuickGifting(event.getIndex(), event.getSvgaName());
}
}
} else {
manager.setGiftRemainingQuantity(event.getGiftRemainingQuantity());
}
} else {
manager.setHotNum(event.getHotNum());
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onNewRoleCustomDrawerPopupEvent(NewRoleCustomDrawerPopupEvent event) {
//是否关闭弹窗

View File

@ -0,0 +1,52 @@
package com.yunbao.live.bean;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.bean.BaseModel;
public class SendQuickGiftModel extends BaseModel {
@SerializedName("_method_")
private String method;
@SerializedName("user_nicename")
private String userNicename;
@SerializedName("quick_gift_number")
private String quickGiftNumber;
@SerializedName("hot_num")
private String hotNum;
public String getHotNum() {
return hotNum;
}
public SendQuickGiftModel setHotNum(String hotNum) {
this.hotNum = hotNum;
return this;
}
public String getMethod() {
return method;
}
public SendQuickGiftModel setMethod(String method) {
this.method = method;
return this;
}
public String getUserNicename() {
return userNicename;
}
public SendQuickGiftModel setUserNicename(String userNicename) {
this.userNicename = userNicename;
return this;
}
public String getQuickGiftNumber() {
return quickGiftNumber;
}
public SendQuickGiftModel setQuickGiftNumber(String quickGiftNumber) {
this.quickGiftNumber = quickGiftNumber;
return this;
}
}

View File

@ -38,6 +38,7 @@ import com.yunbao.common.bean.XydCompleteModel;
import com.yunbao.common.event.AllServerNotifyEvent;
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
import com.yunbao.common.event.GiftWallIlluminateEvent;
import com.yunbao.common.event.QuickGiftingEvent;
import com.yunbao.common.event.SendBlindGiftEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
@ -62,6 +63,7 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.SendQuickGiftModel;
import com.yunbao.live.event.LiveAnchorEvent;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.views.LiveEndViewHolder;
@ -762,6 +764,16 @@ public class SocketRyClient {
.setAvatar(WordUtil.isNewZh() ? map.getString("sud_game_name") : map.getString("sud_game_name_en"))
.setCreateSudRoomModel(GsonUtils.fromJson(map.toString(), SudGameDateModel.class)));
break;
case "sendQuickGift":
SendQuickGiftModel sendQuickGiftModel = GsonUtils.fromJson(map.toString(), SendQuickGiftModel.class);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(sendQuickGiftModel.getUserNicename())
.append(WordUtil.isNewZh() ? " 送出了 " : " sent ")
.append(sendQuickGiftModel.getQuickGiftNumber())
.append(WordUtil.isNewZh() ? " 個小PD " : " small pandas ");
systemChatMessage2(stringBuffer.toString());
Bus.get().post(new QuickGiftingEvent().setHotNum(sendQuickGiftModel.getHotNum()));
break;
}
}

View File

@ -28,19 +28,24 @@ import com.lxj.xpopup.XPopup;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.NewPeopleInfo;
import com.yunbao.common.bean.QuickGiftSendGiftModel;
import com.yunbao.common.dialog.LiveNewRolePopup;
import com.yunbao.common.event.MessageIMEvent;
import com.yunbao.common.event.QuickGiftingEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.API;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ProcessResultUtil;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.CircleProgress2;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
@ -58,7 +63,10 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
@ -76,7 +84,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
private View v_msg_redpoint, stationHornBanner;
private Activity context;
private ViewFlipper viewFlipper;
private TextView goToRomm;
private TextView goToRomm, quick_gift_remaining_quantity, time_text;
private int icon = 0;
private String nobleName, nobleTtext;
private ImageView giftImage, liveNewPeople;
@ -86,10 +94,13 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
private ImageView mRole;//特权
private ImageView mPlay;//
private ImageView mCheat;//整蛊
private ImageView pd_pao, combo;
private CircleProgress2 circleProgress;
public LiveAudienceViewHolder(Context context, ViewGroup parentView) {
super(context, parentView);
this.context = (Activity) context;
initLittlePanda();
}
@ -110,6 +121,8 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
findViewById(R.id.btn_zg).setOnClickListener(this);
voiceButton = (LinearLayout) findViewById(R.id.voice_button);
giftImage = (ImageView) findViewById(R.id.gift_image);
quick_gift_remaining_quantity = (TextView) findViewById(R.id.quick_gift_remaining_quantity);
time_text = (TextView) findViewById(R.id.time_text);
liveNewPeople = (ImageView) findViewById(R.id.live_new_people);
viewFlipper = (ViewFlipper) findViewById(R.id.viewflipper_banner);
@ -118,6 +131,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
mPlay = (ImageView) findViewById(R.id.live_play);
stationHornBanner = findViewById(R.id.station_horn_banner);
mNewPeopleRedDot = findViewById(R.id.live_new_people_red_dot);
pd_pao = (ImageView) findViewById(R.id.pd_pao);
combo = (ImageView) findViewById(R.id.combo);
circleProgress = (CircleProgress2) findViewById(R.id.circleProgress);
combo.setVisibility(View.GONE);
liveNewPeople.setOnClickListener(this);
mRole.setOnClickListener(this);
mCheat.setOnClickListener(this);
@ -261,6 +278,249 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
return true;
});
mProcessResultUtil = new ProcessResultUtil((FragmentActivity) mContext);
quick_gift_remaining_quantity.setVisibility(View.GONE);
time_text.setVisibility(View.GONE);
ViewClicksAntiShake.clicksAntiShake(time_text, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
StringBuffer urlString = new StringBuffer();
urlString.append(CommonAppConfig.HOST)
.append("/h5/exchangeShop/index.html?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken()).append("&isZh=")
.append(WordUtil.isNewZh() ? "1" : 0);
Bundle bundle1 = new Bundle();
bundle1.putString("url", urlString.toString());
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle1);
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
Bus.get().post(new QuickGiftingEvent().setReminder(true));
}
});
pd_pao.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
StringBuffer urlString = new StringBuffer();
urlString.append(CommonAppConfig.HOST)
.append("/h5/exchangeShop/index.html?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken()).append("&isZh=")
.append(WordUtil.isNewZh() ? "1" : 0);
Bundle bundle1 = new Bundle();
bundle1.putString("url", urlString.toString());
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle1);
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
Bus.get().post(new QuickGiftingEvent().setReminder(true));
MobclickAgent.onEvent(mContext, "small_pd_gifts", "长按");
return true;
}
});
pd_pao.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mQuickGiftRemainingQuantity > 0) {
quickGiftingIndex = 1;
combo.setVisibility(View.VISIBLE);
removeRunnable = true;
lianSongHandler.postDelayed(lianSongRunnable, 1000);
Random random = new Random();
int randomNumber = random.nextInt(shortSvgas.size());
String randomName = shortSvgas.get(randomNumber);
Bus.get().post(new QuickGiftingEvent().setIndex(quickGiftingIndex).setSvgaName(randomName));
mQuickGiftRemainingQuantity = mQuickGiftRemainingQuantity - 1;
quick_gift_remaining_quantity.setText(String.valueOf(mQuickGiftRemainingQuantity));
MobclickAgent.onEvent(mContext, "small_pd_gifts", "连点");
}
}
});
combo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mQuickGiftRemainingQuantity > 0) {
quickGiftingIndex = quickGiftingIndex + 1;
removeRunnable = true;
lianSongHandler.postDelayed(lianSongRunnable, 1000);
Random random = new Random();
if (quickGiftingIndex < 11) {
int randomNumber = random.nextInt(shortSvgas.size());
String randomName = shortSvgas.get(randomNumber);
Bus.get().post(new QuickGiftingEvent().setIndex(quickGiftingIndex).setSvgaName(randomName));
} else {
int randomNumber = random.nextInt(highSvgas.size());
String randomName = highSvgas.get(randomNumber);
if (quickGiftingIndex >= 88) {
Bus.get().post(new QuickGiftingEvent().setIndex(quickGiftingIndex).setSvgaName("littlepanda_craft.svga"));
} else {
Bus.get().post(new QuickGiftingEvent().setIndex(quickGiftingIndex).setSvgaName(randomName));
}
}
mQuickGiftRemainingQuantity = mQuickGiftRemainingQuantity - 1;
quick_gift_remaining_quantity.setText(String.valueOf(mQuickGiftRemainingQuantity));
MobclickAgent.onEvent(mContext, "small_pd_gifts", "连点"+quickGiftingIndex);
}
}
});
}
public void setGiftRemainingQuantity(String giftRemainingQuantity) {
mQuickGiftRemainingQuantity = Integer.parseInt(giftRemainingQuantity);
if (mQuickGiftRemainingQuantity > 0) {
quick_gift_remaining_quantity.setVisibility(View.VISIBLE);
quick_gift_remaining_quantity.setText(String.valueOf(mQuickGiftRemainingQuantity));
} else {
quick_gift_remaining_quantity.setVisibility(View.GONE);
}
}
private int mQuickGiftRemainingQuantity = 0, mIfViewingDurationComplete;
public void upDataQuickGift(int quickGiftRemainingQuantity, int ifViewingDurationComplete) {
mQuickGiftRemainingQuantity = quickGiftRemainingQuantity;
mIfViewingDurationComplete = ifViewingDurationComplete;
if (!(quickGiftContDown > 0 && quickGiftContDown < 120)) {
quickGiftContDown = 120;
circleProgress.setMax(120);
circleProgress.setCurrent(quickGiftContDown);
}
if (quickGiftRemainingQuantity > 0) {
quick_gift_remaining_quantity.setVisibility(View.VISIBLE);
quick_gift_remaining_quantity.setText(String.valueOf(quickGiftRemainingQuantity));
} else {
quick_gift_remaining_quantity.setVisibility(View.GONE);
}
if (quickGiftRemainingQuantity < 10 && ifViewingDurationComplete > 0) {
if (!(quickGiftContDown > 0 && quickGiftContDown < 120)) {
quickGiftHandler.postDelayed(quickGiftRunnable, 1000);
}
}else {
circleProgress.setCurrent(2);
}
}
private int quickGiftContDown = 120;
private Handler quickGiftHandler = new Handler();
private Runnable quickGiftRunnable = new Runnable() {
@Override
public void run() {
if (mQuickGiftRemainingQuantity == 0) {
time_text.setVisibility(View.VISIBLE);
quick_gift_remaining_quantity.setVisibility(View.GONE);
} else {
time_text.setVisibility(View.GONE);
}
if (quickGiftContDown > 0) {
quickGiftContDown = quickGiftContDown - 1;
if (time_text.getVisibility() == View.VISIBLE) {
time_text.setText(String.valueOf(quickGiftContDown) + "s");
}
circleProgress.setCurrent(quickGiftContDown);
quickGiftHandler.postDelayed(quickGiftRunnable, 1000);
} else {
quickGiftHandler.removeCallbacks(quickGiftRunnable);
LiveNetManager.get(mContext).viewingDurationGetGift(mLiveUid, new com.yunbao.common.http.base.HttpCallback<QuickGiftSendGiftModel>() {
@Override
public void onSuccess(QuickGiftSendGiftModel data) {
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
}
};
public void resetView() {
pd_pao.setVisibility(View.VISIBLE);
combo.setVisibility(View.GONE);
lianSongHandler.removeCallbacks(lianSongRunnable);
lianSongHandler.removeCallbacks(lianSongRunnable);
quickGiftHandler.removeCallbacks(quickGiftRunnable);
}
private boolean removeRunnable = false;
private int mLianCountDownCount;//连送倒计时的数字
private Handler lianSongHandler = new Handler();
private Runnable lianSongRunnable = new Runnable() {
@Override
public void run() {
if (removeRunnable) {
lianSongHandler.removeCallbacks(lianSongRunnable);
mLianCountDownCount = 5;
lianSongHandler.postDelayed(lianSongRunnable, 1000);
removeRunnable = false;
Log.e("QuickGiftingEvent", removeRunnable + " " + mLianCountDownCount);
} else {
mLianCountDownCount--;
if (mLianCountDownCount == 0) {
pd_pao.setVisibility(View.VISIBLE);
combo.setVisibility(View.GONE);
lianSongHandler.removeCallbacks(lianSongRunnable);
Bus.get().post(new QuickGiftingEvent().setShow(true));
LiveNetManager.get(mContext).quickGiftSendGift(String.valueOf(quickGiftingIndex), mLiveUid, mStream, new com.yunbao.common.http.base.HttpCallback<QuickGiftSendGiftModel>() {
@Override
public void onSuccess(QuickGiftSendGiftModel data) {
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
if (data.getIfHiddenEgg() == 3) {
ToastUtil.show(WordUtil.isNewZh() ? "恭喜您解鎖隱藏彩蛋! 獎勵已發放!" : "Congratulations on unlocking the hidden easter egg! Rewards have been distributed!");
}
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} else {
lianSongHandler.postDelayed(lianSongRunnable, 1000);
}
Log.e("QuickGiftingEvent", removeRunnable + " " + mLianCountDownCount);
}
}
};
private List<String> highSvgas = new ArrayList<>();
private List<String> shortSvgas = new ArrayList<>();
private int quickGiftingIndex = 1;
private void initLittlePanda() {
highSvgas = new ArrayList<>();
shortSvgas = new ArrayList<>();
highSvgas.add("littlepanda1.svga");
highSvgas.add("littlepanda2.svga");
highSvgas.add("littlepanda3.svga");
highSvgas.add("littlepanda4.svga");
highSvgas.add("littlepanda5.svga");
highSvgas.add("littlepanda6.svga");
highSvgas.add("littlepanda7.svga");
highSvgas.add("littlepanda8.svga");
highSvgas.add("littlepanda9.svga");
highSvgas.add("littlepanda10.svga");
shortSvgas.add("littlepanda11.svga");
shortSvgas.add("littlepanda12.svga");
shortSvgas.add("littlepanda13.svga");
shortSvgas.add("littlepanda14.svga");
shortSvgas.add("littlepanda15.svga");
shortSvgas.add("littlepanda16.svga");
shortSvgas.add("littlepanda17.svga");
shortSvgas.add("littlepanda18.svga");
shortSvgas.add("littlepanda19.svga");
}
private float downY = 0;
@ -528,6 +788,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
super.release();
EventBus.getDefault().unregister(this);
removeCallbacks();
resetView();
}
/**

View File

@ -198,7 +198,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
// ImgLoader.displayBlurLive(mContext, coverUrl, mCover, 400, 600);
//
// }
}
}//
@Override
public synchronized void setLiveBeanLandscape(int landscape) {
@ -206,7 +206,10 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
Log.i(TAG, "setLiveBeanLandscape: " + landscape + " isPk: " + isPk);
this.landscape = landscape;
this.videoLandscape = landscape;
mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL);
if (mPlayer != null) {
mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL);
}
if (landscape == 2) {
Log.i(TAG, "还原916");
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
@ -1111,19 +1114,19 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
int maxRate = 900;
switch (IMLoginManager.get(mContext).getSelectClarity()) {
case 0:
rcrtcVideoResolution = RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_480_848;
minRate = 200;
maxRate = 900;
rcrtcVideoResolution = landscape == 1 ? RCRTCParamsType.RCRTCVideoResolution.parseVideoResolution(960, 720) : RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_480_848;
minRate = landscape == 1 ? 900 : 200;
maxRate = landscape == 1 ? 700 : 900;
break;
case 1:
rcrtcVideoResolution = RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_720_1280;
minRate = 250;
maxRate = 2200;
rcrtcVideoResolution = landscape == 1 ? RCRTCParamsType.RCRTCVideoResolution.parseVideoResolution(960, 720) : RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_720_1280;
minRate = landscape == 1 ? 900 : 250;
maxRate = landscape == 1 ? 700 : 2200;
break;
case 2:
rcrtcVideoResolution = RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_1080_1920;
minRate = 400;
maxRate = 4000;
rcrtcVideoResolution = landscape == 1 ? RCRTCParamsType.RCRTCVideoResolution.parseVideoResolution(960, 720) : RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_1080_1920;
minRate = landscape == 1 ? 900 : 400;
maxRate = landscape == 1 ? 700 : 4000;
break;
}
// 示例代码使用480x640分辨率演示
@ -1146,6 +1149,15 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
ArrayList<RCRTCOutputStream> streams = new ArrayList<>();
// streams.add(RCRTCEngine.getInstance().getDefaultVideoStream());
streams.add(RCRTCEngine.getInstance().getDefaultAudioStream());
if (landscape == 1) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
setLiveBeanLandscape(1);
}
});
}
// 开启摄像头
// RCRTCEngine.getInstance().getDefaultVideoStream().startCamera(null);
// 开始切换为主播身份

View File

@ -56,6 +56,7 @@ import com.makeramen.roundedimageview.RoundedImageView;
import com.ms.banner.Banner;
import com.ms.banner.BannerConfig;
import com.ms.banner.listener.OnBannerClickListener;
import com.opensource.svgaplayer.SVGACallback;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
@ -99,9 +100,9 @@ import com.yunbao.common.bean.XydCompleteModel;
import com.yunbao.common.event.AllServerNotifyEvent;
import com.yunbao.common.event.AnchorInfoEvent;
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
import com.yunbao.common.event.HideShowEvent;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
import com.yunbao.common.event.SlideEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.API;
import com.yunbao.common.http.CommonHttpConsts;
@ -131,7 +132,6 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum;
import com.yunbao.common.views.AbsViewHolder;
import com.yunbao.common.views.LiveSudGamePopup;
import com.yunbao.common.views.weight.ClipPathCircleImage;
import com.yunbao.common.views.weight.FullServiceNotificationView;
import com.yunbao.common.views.weight.NobleNoticeView;
@ -384,6 +384,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private String mAnchorName;//主播名字
private boolean isHinde = false;
private boolean isFans = false;
private FrameLayout pa_pao_layout;
private LinearLayout combo_layout;
private TextView combo_number;
private View quick_gift_reminder ;
@Subscribe(threadMode = ThreadMode.MAIN)
public void onUpdata(String str) {
@ -703,6 +707,90 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
HashMap<String, SVGAImageView> svgaImageViewHashMap = new HashMap<>();
public void onQuickGifting2(boolean show) {
if (show) {
combo_layout.setVisibility(View.GONE);
if (IMLoginManager.get(mContext).getQuickGiftIfFirst()) {
quick_gift_reminder.setVisibility(View.VISIBLE);
} else {
quick_gift_reminder.setVisibility(View.GONE);
}
}
}
public void onQuickGifting3() {
IMLoginManager.get(mContext).setQuickGiftIfFirst();
quick_gift_reminder.setVisibility(View.GONE);
}
public void onQuickGifting(int index, String svgaName) {
pa_pao_layout.setVisibility(View.VISIBLE);
combo_layout.setVisibility(View.VISIBLE);
combo_number.setText(String.valueOf(index));
SVGAImageView svgaImageView = new SVGAImageView(mContext);
String tag = svgaName + System.currentTimeMillis();
svgaImageViewHashMap.put(tag, svgaImageView);
Bus.get().post(new SlideEvent().setSlide(!(svgaImageViewHashMap.size() > 0)));
svgaImageView.setLoops(1);
svgaImageView.setTag(tag);
pa_pao_layout.addView(svgaImageView);
Log.e("QuickGiftingEvent", "pa_pao_layout:getChildCount:" + pa_pao_layout.getChildCount());
Log.e("QuickGiftingEvent", "index:" + index + " svgaName:" + svgaName);
svgaImageView.setCallback(new SVGACallback() {
@Override
public void onPause() {
}
@Override
public void onFinished() {
if (svgaImageViewHashMap.size() != 0) {
svgaImageView.clear();
pa_pao_layout.removeView(svgaImageView);
Log.e("QuickGiftingEvent", "svgaImageView.getTag:" + svgaImageView.getTag());
svgaImageViewHashMap.remove(svgaName);
Log.e("QuickGiftingEvent", "svgaImageViewHashMap:" + svgaImageViewHashMap.toString());
Log.e("QuickGiftingEvent", "pa_pao_layout:getChildCount:" + pa_pao_layout.getChildCount());
if (pa_pao_layout.getChildCount() == 0) {
pa_pao_layout.setVisibility(View.GONE);
Bus.get().post(new SlideEvent().setSlide(true));
}
}
}
@Override
public void onRepeat() {
}
@Override
public void onStep(int i, double v) {
}
});
new SVGAParser(mContext).decodeFromAssets(svgaName, new SVGAParser.ParseCompletion() {
@Override
public void onComplete(@NonNull SVGAVideoEntity svgaVideoEntity) {
SVGADrawable drawable = new SVGADrawable(svgaVideoEntity);
svgaImageView.setImageDrawable(drawable);
svgaImageView.startAnimation();
}
@Override
public void onError() {
}
}, null);
}
/**
* 获取下一秒钟的时间
*/
@ -1473,6 +1561,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1);
pa_pao_layout = (FrameLayout) findViewById(R.id.pa_pao_layout);
combo_layout = (LinearLayout) findViewById(R.id.combo_layout);
combo_number = (TextView) findViewById(R.id.combo_number);
quick_gift_reminder = findViewById(R.id.quick_gift_reminder);
pa_pao_layout.setVisibility(View.GONE);
combo_layout.setVisibility(View.GONE);
}
@ -1730,8 +1824,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 重置数据
*/
public void resetView() {
svgaImageViewHashMap.clear();
pa_pao_layout.removeAllViews();
timeHandler.removeCallbacks(timeRunnable);
anchorTimeHandler.removeCallbacks(anchorTimeRunnable);
pa_pao_layout.setVisibility(View.GONE);
combo_layout.setVisibility(View.GONE);
resetViewGone();
visibility = false;
pkUidTmp = "";
@ -2446,11 +2544,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param rank 小时榜
*/
public void setHourRankData(long rank) {
if (mHourRank != null) {
if (mHotText != null) {
if (rank == 0) {
mHourRank.setText(R.string.no_rank_data);
mHotText.setText(R.string.no_rank_data);
} else {
mHourRank.setText(String.format(mContext.getString(R.string.hour_rank), formatBigNum.formatBigNum(rank + "")));
mHotText.setText(String.format(mContext.getString(R.string.hour_rank), formatBigNum.formatBigNum(rank + "")));
}
}
}
@ -2470,12 +2568,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param hot 热度值
*/
public void setHotData(String hot) {
if (mHotText != null && !TextUtils.isEmpty(hot)) {
mHotText.setText(hot);
if (mHourRank != null && !TextUtils.isEmpty(hot)) {
mHourRank.setText(hot);
}
}
public void setHotNum(String hotNum) {
setHotData(formatBigNum.formatBigNum(hotNum));
}
/**
* 更新心愿单进度
*
@ -3987,6 +4087,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
public void clearData() {
svgaImageViewHashMap.clear();
pa_pao_layout.removeAllViews();
timeHandler.removeCallbacks(timeRunnable);
anchorTimeHandler.removeCallbacks(anchorTimeRunnable);
LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST);

View File

@ -56,6 +56,7 @@ import com.yunbao.common.event.LiveFloatEvent;
import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
import com.yunbao.common.event.QuickGiftingEvent;
import com.yunbao.common.event.SendBlindGiftEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
@ -223,6 +224,34 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
public void onQuickGifting(int index, String svgaName) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.onQuickGifting(index, svgaName);
}
}
public void onQuickGifting2(boolean show) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.onQuickGifting2(show);
}
}
public void onQuickGifting3() {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.onQuickGifting3();
}
}
public void setGiftRemainingQuantity(String giftRemainingQuantity) {
if (mLiveAudienceViewHolder!=null){
mLiveAudienceViewHolder.setGiftRemainingQuantity(giftRemainingQuantity);
}
}
public void setHotNum(String hotNum) {
if (mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.setHotNum(hotNum);
}
}
public PortraitLiveManager(Activity context, Intent intent) {
this.mContext = context;
this.mIntent = intent;
@ -386,6 +415,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
});
mLiveRoomViewHolder.resetView();
mLiveAudienceViewHolder.resetView();
enterRoomModel.clear();
enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable);
mLiveRoomViewHolder.setAvatar(data.getAvatar());
@ -726,6 +756,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setSudName(WordUtil.isNewZh() ? data.getSudGameDateModel().getSudGameName() : data.getSudGameDateModel().getSud_game_name_en(), data.getSudGameDateModel());
}
}
mLiveAudienceViewHolder.upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
}
@ -832,8 +863,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLivePlayViewHolder.release();
}
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.removeFromParent();
mLiveRoomViewHolder.clearData();
mLiveRoomViewHolder.removeFromParent();
mLiveRoomViewHolder.countDownTimerTrickery = null;
}
@ -932,7 +963,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
* 申请连麦但是主播还未同意的状态
*/
public void micIngTypeOne(LiveBean bean, int liveType, int liveTypeVal) {
DialogUitl.showSimpleDialog(mContext, null, WordUtil.isNewZh()?"您已申請,退出將取消語音連麥申請!":"You have applied, logout will cancel the voice connection application!", false, new DialogUitl.SimpleCallback3() {
DialogUitl.showSimpleDialog(mContext, null, WordUtil.isNewZh() ? "您已申請,退出將取消語音連麥申請!" : "You have applied, logout will cancel the voice connection application!", false, new DialogUitl.SimpleCallback3() {
@Override
public void onConfirmClick(Dialog dialog) {
MicStatusManager.getInstance().clear();

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<RelativeLayout
@ -345,11 +345,11 @@
<!--整蛊-->
<ImageView
android:id="@+id/live_cheat"
android:visibility="gone"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="8dp"
android:src="@mipmap/icon_prank" />
android:src="@mipmap/icon_prank"
android:visibility="gone" />
<!---->
<ImageView
android:id="@+id/live_play"
@ -384,31 +384,74 @@
android:background="@drawable/background_ff5075"
android:visibility="invisible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="8dp">
<com.yunbao.common.views.weight.CircleProgress2
android:id="@+id/circleProgress"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
<ImageView
android:id="@+id/pd_pao"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_pd_pao" />
<TextView
android:id="@+id/time_text"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/backgroud_panda_time"
android:gravity="center"
android:text="120S"
android:textColor="@color/white"
android:textSize="10sp"
android:visibility="gone" />
<ImageView
android:id="@+id/combo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/icon_combo"
android:visibility="gone" />
</RelativeLayout>
<!--礼物-->
<ImageView
android:id="@+id/gift_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="8dp"
android:background="@drawable/background_gift"
/>
android:background="@drawable/background_gift" />
<!--特权-->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="40dp"
android:layout_height="40dp">
<ImageView
android:id="@+id/live_privilege"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
android:src="@mipmap/icon_privilege"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@mipmap/icon_privilege" />
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/privilege_red_point"
android:layout_width="10dp"
@ -433,10 +476,6 @@
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
@ -455,6 +494,18 @@
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="@+id/quick_gift_remaining_quantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="150dp"
android:layout_marginBottom="-2dp"
android:text="99"
android:textColor="#FFB403"
android:textSize="8sp"
android:textStyle="bold" />
</RelativeLayout>

View File

@ -2484,13 +2484,13 @@
android:layout_height="40dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:background="@drawable/background_live_sud_hint"
android:gravity="center"
android:layout_marginStart="21dp"
android:layout_marginEnd="42dp"
android:background="@drawable/background_live_sud_hint"
android:gravity="center"
android:paddingStart="21dp"
android:visibility="gone"
android:paddingEnd="15dp">
android:paddingEnd="15dp"
android:visibility="gone">
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/sud_text_name"
@ -2501,8 +2501,47 @@
android:singleLine="true"
android:text="主播創建了【游戲名】房間,快來與主播同玩~"
android:textColor="@color/white"
android:textSize="14sp"
/>
android:textSize="14sp" />
</LinearLayout>
<FrameLayout
android:id="@+id/pa_pao_layout"
android:layout_width="match_parent"
android:layout_height="384dp"
android:layout_alignParentBottom="true" />
<LinearLayout
android:id="@+id/combo_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="220dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/combo"
android:textColor="#FFDD25"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/combo_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textColor="#FFDD25"
android:textSize="45sp"
android:textStyle="bold" />
</LinearLayout>
<ImageView
android:id="@+id/quick_gift_reminder"
android:layout_width="63dp"
android:layout_height="72dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="125dp"
android:src="@mipmap/background_quick_gift_reminder"
android:visibility="gone" />
</RelativeLayout>

View File

@ -2,6 +2,8 @@ package com.yunbao.main.views;
import static android.content.Context.CLIPBOARD_SERVICE;
import android.app.Activity;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
@ -28,25 +30,35 @@ import androidx.annotation.RequiresApi;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.lxj.xpopup.XPopup;
import com.momo.mcamera.util.JsonUtil;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig;
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.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.JavascriptInterfacePlayLetUtils;
import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.live.views.LoadingView;
import com.yunbao.main.R;
import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.activity.MyWalletActivity;
import com.yunbao.main.dialog.EncourageDialog;
import com.yunbao.main.utils.BottomBarUtil;
import com.yunbao.share.ui.SharePopDialog;
@ -89,11 +101,12 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
Bus.getOn(this);
String url = HtmlConfig.ENCOURAGE + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()
+ "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
// String url = "https://coolshi.feioou.com/testAndroid.html";
final LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
mWebView = new WebView(mContext);
int aa = BottomBarUtil.getNavigationBarHeightIfRoom(mContext);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
params.topMargin = DpUtil.dp2px(1);
mWebView.setLayoutParams(params);
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
@ -114,7 +127,9 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(nowMainActivity, mWebView), "androidObject");
//短剧
mWebView.addJavascriptInterface(JavascriptInterfacePlayLetUtils.getInstance().setmContext(nowMainActivity, mWebView), "jsBridge");
mWebView.getSettings().setSupportMultipleWindows(true);
rootView.addView(mWebView);
mWebView.setWebViewClient(new WebViewClient() {
@ -211,6 +226,26 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
mWebView.loadUrl(url);
// findViewById(R.id.native_callback).setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// mWebView.post(new Runnable() {
// @Override
// public void run() {
//
// NativeCallbackModel model = new NativeCallbackModel();
// model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
// String nativeJson = new JsonUtil().toJson(model);
// mWebView.evaluateJavascript("javascript:nativeCallback('" +nativeJson + "')", new ValueCallback<String>() {
// @Override
// public void onReceiveValue(String value) {
// }
// });
//
// }
// });
// }
// });
}
public void loadNewUrl() {
@ -357,7 +392,60 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
.setShareLink(CommonAppConfig.HOST + json.getString("link"))
.setAnchorAvatar(json.getString("avatar"))
.showDialog();
} else if (TextUtils.equals(event.getMethod(), "postWeakBalance")) {
LiveNetManager.get(mContext).
getCoolConfig(new com.yunbao.common.http.base.HttpCallback<CoolConfig>() {
@Override
public void onSuccess(CoolConfig data) {
new XPopup.Builder(mContext)
.enableDrag(false)
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
.asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() {
@Override
public void onCallBack(String data) {
if (TextUtils.equals(data, "2")) {
DialogUitl.showSimpleDialog(mContext, mContext.getString(com.yunbao.live.R.string.live_coin_not_enough), false,
new DialogUitl.SimpleCallback2() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 1));
}
@Override
public void onCancelClick() {
}
});
} else if (TextUtils.equals(data, "1")) {
mWebView.post(new Runnable() {
@Override
public void run() {
NativeCallbackModel model = new NativeCallbackModel();
model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
String nativeJson = new JsonUtil().toJson(model);
mWebView.evaluateJavascript("javascript:nativeCallback('" + nativeJson + "')", new ValueCallback<String>() {
@Override
public void onReceiveValue(String value) {
}
});
}
});
}
}
})).show();
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
}
}
}

View File

@ -8,6 +8,7 @@
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="45dp"
android:orientation="vertical" />
<ProgressBar
@ -17,4 +18,11 @@
android:layout_height="3dp"
android:progressDrawable="@drawable/bg_horizontal_progressbar" />
<!-- <Button-->
<!-- android:id="@+id/native_callback"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="nativeCallback" />-->
</RelativeLayout>