From 089b1881f1e1a6787f2b140ecbb6a972b59cac01 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sat, 25 Nov 2023 13:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A4=BC=E7=89=A9=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=AC=ACer=E6=AC=A1=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/bean/EnterRoomNewModel.java | 22 +++ .../common/bean/QuickGiftSendGiftModel.java | 28 ++++ .../common/event/QuickGiftingEvent.java | 10 ++ .../com/yunbao/common/http/PDLiveApi.java | 15 ++ .../common/http/live/LiveNetManager.java | 75 +++++++-- .../common/views/weight/CircleProgress2.java | 6 +- .../live/activity/LiveAudienceActivity.java | 9 +- .../live/views/LiveAudienceViewHolder.java | 145 ++++++++++++++---- .../yunbao/live/views/LiveRoomViewHolder.java | 10 +- .../live/views/PortraitLiveManager.java | 12 +- .../main/res/layout/view_live_audience.xml | 32 +++- 11 files changed, 304 insertions(+), 60 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/QuickGiftSendGiftModel.java diff --git a/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java b/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java index 35d6b7295..049be7908 100644 --- a/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java +++ b/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java @@ -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; diff --git a/common/src/main/java/com/yunbao/common/bean/QuickGiftSendGiftModel.java b/common/src/main/java/com/yunbao/common/bean/QuickGiftSendGiftModel.java new file mode 100644 index 000000000..16bb5fab3 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/QuickGiftSendGiftModel.java @@ -0,0 +1,28 @@ +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礼物的次数 + + 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; + } +} diff --git a/common/src/main/java/com/yunbao/common/event/QuickGiftingEvent.java b/common/src/main/java/com/yunbao/common/event/QuickGiftingEvent.java index 979053457..a01219060 100644 --- a/common/src/main/java/com/yunbao/common/event/QuickGiftingEvent.java +++ b/common/src/main/java/com/yunbao/common/event/QuickGiftingEvent.java @@ -5,6 +5,16 @@ import com.yunbao.common.bean.BaseModel; public class QuickGiftingEvent extends BaseModel { private int index; private String svgaName; + private boolean show =false; + + public boolean isShow() { + return show; + } + + public QuickGiftingEvent setShow(boolean show) { + this.show = show; + return this; + } public int getIndex() { return index; diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index b8298861e..fdcf3ad76 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -46,6 +46,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 +1062,23 @@ public interface PDLiveApi { @GET("/api/public/?service=Sudgameserver.deductMoney") Observable> deductMoney( @Query("room_id") String roomId + ); + @GET("/api/public/?service=Sudgameserver.checkCurrency") Observable> checkCurrency( ); + + @GET("/api/public/?service=Quickgift.sendGift") + Observable> quickGiftSendGift( + @Query("quick_gift_number") String quickGiftNumber, + @Query("liveuid") String liveUid, + @Query("stream") String stream + ); + + @GET("/api/public/?service=Quickgift.viewingDurationGetGift") + Observable> viewingDurationGetGift( + @Query("liveuid") String liveUid + ); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 7627a1f77..b7bf69d11 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -44,6 +44,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 +2318,21 @@ public class LiveNetManager { } public void deductMoney(String roomId) { - API.get().pdLiveApi(mContext) - .deductMoney(roomId) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new Consumer>() { - @Override - public void accept(ResponseModel objectResponseModel) throws Exception { - - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) throws Exception { - - } - }).isDisposed(); +// API.get().pdLiveApi(mContext) +// .deductMoney(roomId) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new Consumer>() { +// @Override +// public void accept(ResponseModel objectResponseModel) throws Exception { +// +// } +// }, new Consumer() { +// @Override +// public void accept(Throwable throwable) throws Exception { +// +// } +// }).isDisposed(); } public void checkCurrency(HttpCallback callback) { @@ -2384,6 +2385,50 @@ public class LiveNetManager { }).isDisposed(); } + public void viewingDurationGetGift(String liveUid, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .viewingDurationGetGift(liveUid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel quickGiftSendGiftModelResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(quickGiftSendGiftModelResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @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 callback) { + API.get().pdLiveApi(mContext) + .quickGiftSendGift(quickGiftNumber, liveUid, stream) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel quickGiftSendGiftModelResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(quickGiftSendGiftModelResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @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> callback) { API.get().pdLiveApi(mContext) .getRoomList(sudGameId, threshold, roomHolderType, liveUid, currencyType, page) diff --git a/common/src/main/java/com/yunbao/common/views/weight/CircleProgress2.java b/common/src/main/java/com/yunbao/common/views/weight/CircleProgress2.java index a41c1e55f..b64ec8433 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/CircleProgress2.java +++ b/common/src/main/java/com/yunbao/common/views/weight/CircleProgress2.java @@ -14,7 +14,7 @@ public class CircleProgress2 extends View { private RectF mRectF; private int mCurrent = 1, mMax = 100; //圆弧(也可以说是圆环)的宽度 - private float mArcWidth =8; + private float mArcWidth =9; //控件的宽度 private float mWidth; @@ -56,14 +56,14 @@ public class CircleProgress2 extends View { mPaint.setStyle(Paint.Style.STROKE); //设置圆弧的宽度(圆环的宽度) mPaint.setStrokeWidth(mArcWidth); - mPaint.setColor(Color.parseColor("#FEC51B")); + mPaint.setColor(Color.parseColor("#46433F")); //大圆的半径 float bigCircleRadius = mWidth / 2; //小圆的半径 float smallCircleRadius = bigCircleRadius - mArcWidth; //绘制小圆 canvas.drawCircle(bigCircleRadius, bigCircleRadius, smallCircleRadius, mPaint); - mPaint.setColor(Color.parseColor("#46433F")); + mPaint.setColor(Color.parseColor("#FEC51B")); mRectF.set(mArcWidth, mArcWidth, mWidth - mArcWidth, mWidth - mArcWidth); //绘制圆弧 canvas.drawArc(mRectF, -90, mCurrent * 360 / mMax, false, mPaint); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 40fdc5761..d1931ad57 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1766,7 +1766,7 @@ public class LiveAudienceActivity extends LiveActivity { } } - @Subscribe(threadMode = ThreadMode .MAIN) + @Subscribe(threadMode = ThreadMode.MAIN) public void onSlideEvent(SlideEvent event) { verticalViewPager.setEnableScroll(event.isSlide()); } @@ -1775,7 +1775,12 @@ public class LiveAudienceActivity extends LiveActivity { public void onQuickGiftingEvent(QuickGiftingEvent event) { if (manager != null) { - manager.onQuickGifting(event.getIndex(), event.getSvgaName()); + + if (event.isShow()) { + manager.onQuickGifting2(true); + } else { + manager.onQuickGifting(event.getIndex(), event.getSvgaName()); + } } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 0d0cb93bb..16d61a803 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -29,6 +29,7 @@ import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; 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; @@ -36,12 +37,14 @@ 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; @@ -80,7 +83,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; @@ -91,6 +94,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { private ImageView mPlay;//玩 private ImageView mCheat;//整蛊 private ImageView pd_pao, combo; + private CircleProgress2 circleProgress; public LiveAudienceViewHolder(Context context, ViewGroup parentView) { super(context, parentView); @@ -116,6 +120,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); @@ -126,6 +132,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { 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); @@ -270,52 +277,121 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { return true; }); mProcessResultUtil = new ProcessResultUtil((FragmentActivity) mContext); - + quick_gift_remaining_quantity.setVisibility(View.GONE); + time_text.setVisibility(View.GONE); pd_pao.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - 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)); + 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)); + } + } }); combo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - 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 { + 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)); } - } }); } + private int mQuickGiftRemainingQuantity = 0, mIfViewingDurationComplete; + + public void upDataQuickGift(int quickGiftRemainingQuantity, int ifViewingDurationComplete) { + mQuickGiftRemainingQuantity = quickGiftRemainingQuantity; + mIfViewingDurationComplete = ifViewingDurationComplete; + 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) { + quickGiftHandler.postDelayed(quickGiftRunnable, 1000); + } + } + + 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() { + @Override + public void onSuccess(QuickGiftSendGiftModel data) { + if (data.getQuickGiftRemainingQuantity() >= 10 && data.getIfViewingDurationComplete() > 0) { + 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); } + private boolean removeRunnable = false; private int mLianCountDownCount;//连送倒计时的数字 private Handler lianSongHandler = new Handler(); @@ -334,6 +410,21 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { 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() { + @Override + public void onSuccess(QuickGiftSendGiftModel data) { + upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete()); + if (mQuickGiftRemainingQuantity >= 10 && mIfViewingDurationComplete > 0) { + quickGiftHandler.postDelayed(quickGiftRunnable, 1000); + } + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); } else { lianSongHandler.postDelayed(lianSongRunnable, 1000); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 07a4b5c9f..1947c5d98 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -708,12 +708,18 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis HashMap svgaImageViewHashMap = new HashMap<>(); + public void onQuickGifting2(boolean show) { + if (show) { + combo_layout.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(); + String tag = svgaName + System.currentTimeMillis(); svgaImageViewHashMap.put(tag, svgaImageView); Bus.get().post(new SlideEvent().setSlide(!(svgaImageViewHashMap.size() > 0))); @@ -739,7 +745,7 @@ String tag = svgaName+System.currentTimeMillis(); Log.e("QuickGiftingEvent", "pa_pao_layout:getChildCount:" + pa_pao_layout.getChildCount()); if (pa_pao_layout.getChildCount() == 0) { pa_pao_layout.setVisibility(View.GONE); - combo_layout.setVisibility(View.GONE); + Bus.get().post(new SlideEvent().setSlide(true)); } } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index da271916a..1888cb042 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -56,7 +56,6 @@ 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; @@ -224,9 +223,15 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } } - public void onQuickGifting(int index,String svgaName) { + public void onQuickGifting(int index, String svgaName) { if (mLiveRoomViewHolder != null) { - mLiveRoomViewHolder.onQuickGifting(index,svgaName); + mLiveRoomViewHolder.onQuickGifting(index, svgaName); + } + } + + public void onQuickGifting2(boolean show) { + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.onQuickGifting2(show); } } @@ -734,6 +739,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()); } diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index 85a8358bf..6d1c75ace 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -392,34 +392,50 @@ + android:layout_width="32dp" + android:layout_height="32dp" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" /> + + + android:src="@mipmap/icon_combo" + android:visibility="gone" />