修复:连送重新选择礼物或者包裹按钮不消失问题
This commit is contained in:
parent
45fd56ba66
commit
dd64568fdf
@ -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",
|
||||
|
||||
//百度语音识别
|
||||
|
||||
|
@ -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<GiftNamingInfoModel>() {
|
||||
@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;
|
||||
|
Loading…
Reference in New Issue
Block a user