diff --git a/config.gradle b/config.gradle index 58279b97c..9e6022e26 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 -// serverHost : "https://napi.yaoulive.com", + serverHost : "https://napi.yaoulive.com", // 测试 - serverHost : " https://ceshi.yaoulive.com", +// serverHost : " https://ceshi.yaoulive.com", //百度语音识别 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index f4f4e0ff1..b7da267e2 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -249,6 +249,7 @@ public class LiveGiftPopup extends AbsDialogFragment { transaction.commitAllowingStateLoss(); isWrap = true; findViewById(R.id.red_point).setVisibility(View.GONE); + hideLianBtn(); } }); //;连送 @@ -756,6 +757,13 @@ public class LiveGiftPopup extends AbsDialogFragment { } else { LiveHttpUtil.sendGift("0", mLiveUid, mStream, liveGiftModel.getId(), mCount, isContactGift, callback); } + if (!liveGiftModel.getSwf().contains("svga")) { + showLianBtn(); + } + if (liveGiftModel.getType() == 7) { + showLianBtn(); + + } } } @@ -781,68 +789,42 @@ public class LiveGiftPopup extends AbsDialogFragment { //连送逻辑 private int mLianCountDownCount;//连送倒计时的数字 - private Handler lianSongHandler = new Handler(); - private Runnable lianSongRunnable = new Runnable() { - @Override - public void run() { - if (removeRunnable) { - lianSongHandler.removeCallbacks(lianSongRunnable); - if (mLianText != null) { - mLianText.setText("5s"); - } - mLianCountDownCount = 5; - lianSongHandler.postDelayed(lianSongRunnable, 1000); - removeRunnable = false; - } else { - mLianCountDownCount--; - if (mLianCountDownCount == 0) { - hideLianBtn(); - } else { - if (mLianText != null) { - mLianText.setText(mLianCountDownCount + "s"); - lianSongHandler.postDelayed(lianSongRunnable, 1000); - } - } - } - - } - }; - - /** - * 显示连送按钮 - */ - private boolean mShowLianBtn = false; - private boolean removeRunnable = false; private void showLianBtn() { - - - if (mShowLianBtn) { - removeRunnable = true; - } else { - if (mLianText != null) { - mLianText.setText("5s"); - } - mLianCountDownCount = 5; - lianSongHandler.postDelayed(lianSongRunnable, 1000); - mBtnSendGroup.setVisibility(View.VISIBLE); - giftSendLayout.setVisibility(View.INVISIBLE); - mShowLianBtn = true; - } - - + mBtnSendGroup.removeCallbacks(newLianSongRunnable); + mBtnSendGroup.setVisibility(View.VISIBLE); + giftSendLayout.setVisibility(View.INVISIBLE); + mLianCountDownCount = 5; + mBtnSendGroup.post(newLianSongRunnable); } + /** + * 新连送回调 + */ + private Runnable newLianSongRunnable = new Runnable() { + + @Override + public void run() { + if (mLianCountDownCount == 0) { + hideLianBtn(); + } else { + mLianCountDownCount--; + if (mLianText != null) { + mLianText.setText(mLianCountDownCount + "s"); + mBtnSendGroup.postDelayed(newLianSongRunnable, 1000); + } + } + } + }; + /** * 隐藏连送按钮 包裹 */ private void hideLianBtn() { mBtnSendGroup.setVisibility(View.INVISIBLE); giftSendLayout.setVisibility(View.VISIBLE); - lianSongHandler.removeCallbacks(lianSongRunnable); - mShowLianBtn = false; + mBtnSendGroup.removeCallbacks(newLianSongRunnable); getCoin(); - LiveNetManager.get(mContext) .getGiftNamingInfo(liveGiftModel.getId() + "", new com.yunbao.common.http.base.HttpCallback() { @Override @@ -999,7 +981,7 @@ public class LiveGiftPopup extends AbsDialogFragment { } else { operateImage.setVisibility(View.GONE); } - + hideLianBtn(); } @Subscribe(threadMode = ThreadMode.MAIN) @@ -1385,13 +1367,7 @@ public class LiveGiftPopup extends AbsDialogFragment { goldText.setText(goldCoin); } - if (!mGiftBean.getSwf().contains("svga")) { - showLianBtn(); - } - if (mGiftBean.getType() == 7) { - showLianBtn(); - } // //刷新包裹列表wrap_gift_num -1:表示数量没有变化 // mObjGiftSendback = obj;