神龙送财结束Im结束调用接口,神龙列表倒计时修改
This commit is contained in:
@@ -73,6 +73,7 @@ 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.SendMoneyLongEndEvent;
|
||||
import com.yunbao.common.event.ShowHideEvent;
|
||||
import com.yunbao.common.event.SlideEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -1940,6 +1941,16 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSendMoneyLongEndEvent(SendMoneyLongEndEvent sendMoneyLongModel) {
|
||||
Log.e("DateRemindModel", sendMoneyLongModel.toString());
|
||||
if (manager != null) {
|
||||
manager.onSendMoneyLongEndEvent(sendMoneyLongModel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,6 +55,7 @@ import com.yunbao.common.event.GiftWallIlluminateEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.LoginInvalidEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.event.SendMoneyLongEndEvent;
|
||||
import com.yunbao.common.event.ShowHideEvent;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -1721,6 +1722,16 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSendMoneyLongEndEvent(SendMoneyLongEndEvent sendMoneyLongModel) {
|
||||
Log.e("DateRemindModel", sendMoneyLongModel.toString());
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.onSendMoneyLongEndEvent(sendMoneyLongModel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void GiftWallIlluminateEvent(GiftWallIlluminateEvent event) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.flyjingfish.gradienttextviewlib.GradientTextView;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.adapter.DragonSendMoneyListAdapter;
|
||||
import com.yunbao.common.bean.sendMoneyLongListModel;
|
||||
@@ -19,6 +20,7 @@ import com.yunbao.common.views.DragonSendMoneyListViewHolder;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
@@ -27,6 +29,7 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
DragonSendMoneyListAdapter dragonSendMoneyListAdapter;
|
||||
RecyclerView send_money_list;
|
||||
boolean isAnchor;
|
||||
GradientTextView title;
|
||||
|
||||
public DragonSendMoneyListPopup(@NonNull Context context, String liveUid, boolean isAnchor) {
|
||||
super(context);
|
||||
@@ -49,6 +52,7 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
send_money_list = findViewById(R.id.send_money_list);
|
||||
title = findViewById(R.id.title);
|
||||
|
||||
send_money_list.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
dragonSendMoneyListAdapter = new DragonSendMoneyListAdapter(send_money_list);
|
||||
@@ -91,6 +95,8 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
public void onSuccess(List<sendMoneyLongListModel> data) {
|
||||
dragonSendMoneyListAdapter.setMoneyLongListModels(data);
|
||||
send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size());
|
||||
title.removeCallbacks(refreshRunnable);
|
||||
title.postDelayed(refreshRunnable, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,5 +118,25 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Runnable refreshRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<sendMoneyLongListModel> moneyLongListModels = dragonSendMoneyListAdapter.getMoneyLongListModels();
|
||||
List<sendMoneyLongListModel> models = new ArrayList<>();
|
||||
for (sendMoneyLongListModel listModel : moneyLongListModels) {
|
||||
String countdown = listModel.getCountdown();
|
||||
long countdownNumber = Long.parseLong(countdown);
|
||||
countdownNumber = countdownNumber - 1;
|
||||
if (countdownNumber > 0) {
|
||||
listModel.setCountdown(String.valueOf(countdownNumber));
|
||||
models.add(listModel);
|
||||
}
|
||||
}
|
||||
dragonSendMoneyListAdapter.setMoneyLongListModels(models);
|
||||
title.postDelayed(refreshRunnable, 1000);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ 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.event.SendMoneyLongEndEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMRTCManager;
|
||||
@@ -691,7 +692,7 @@ public class SocketRyClient {
|
||||
.setLiveReceiveGiftBean(JSON.parseObject(map.toString(), LiveReceiveGiftBean.class)));
|
||||
break;
|
||||
case "GuardSpecialEffect":
|
||||
LiveReceiveGiftBean giftBean= JSON.parseObject(map.toString(), LiveReceiveGiftBean.class);
|
||||
LiveReceiveGiftBean giftBean = JSON.parseObject(map.toString(), LiveReceiveGiftBean.class);
|
||||
giftBean.setMedal_name(map.getString("medal_name"));
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GuardSpecialEffect)
|
||||
@@ -804,9 +805,12 @@ public class SocketRyClient {
|
||||
Bus.get().post(maturityDateRemindModel);
|
||||
break;
|
||||
case "SendMoneyLong":
|
||||
SendMoneyLongModel sendMoneyLongModel = GsonUtils.fromJson(map.toString(), SendMoneyLongModel.class);
|
||||
SendMoneyLongModel sendMoneyLongModel = GsonUtils.fromJson(map.toString(), SendMoneyLongModel.class);
|
||||
Bus.get().post(sendMoneyLongModel);
|
||||
break;
|
||||
case "SendMoneyLongEnd":
|
||||
Bus.get().post(new SendMoneyLongEndEvent());
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ import com.yunbao.common.event.AnchorInfoEvent;
|
||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SendMoneyLongEndEvent;
|
||||
import com.yunbao.common.event.SlideEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.API;
|
||||
@@ -633,12 +634,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
liveReceiveGiftBean.setGiftId(liveReceiveGiftBean.getGiftName());
|
||||
mLiveGiftAnimPresenter.showGifGift(liveReceiveGiftBean);
|
||||
|
||||
// if (TextUtils.equals(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()), liveReceiveGiftBean.getUid())
|
||||
// && TextUtils.equals(liveReceiveGiftBean.getGuard_type(), "3")) {
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
// }
|
||||
if (TextUtils.equals(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()), liveReceiveGiftBean.getUid())
|
||||
&& TextUtils.equals(liveReceiveGiftBean.getGuard_type(), "3")) {
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3161,9 +3162,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
|
||||
SendMoneyLongModel mSendMoneyLongModel;
|
||||
|
||||
public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) {
|
||||
|
||||
if (mLiveUid.contains(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()))) {
|
||||
mSendMoneyLongModel = sendMoneyLongModel;
|
||||
sendMoneyTime = Long.parseLong(sendMoneyLongModel.getCountdown());
|
||||
participation_time.removeCallbacks(sendMoneyRunnable);
|
||||
dragonImmediateParticipationTime.setVisibility(View.VISIBLE);
|
||||
@@ -3176,6 +3180,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
}
|
||||
|
||||
public void onSendMoneyLongEndEvent(SendMoneyLongEndEvent moneyLongEndEvent) {
|
||||
if (mLiveUid.contains(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()))) {
|
||||
dragonImmediateParticipationTime.setVisibility(View.GONE);
|
||||
} else {
|
||||
dragonImmediateParticipation.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private long sendMoneyTime;
|
||||
Runnable sendMoneyRunnable = new Runnable() {
|
||||
@Override
|
||||
@@ -3187,6 +3199,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
participation_time.postDelayed(sendMoneyRunnable, 1000);
|
||||
} else {
|
||||
participation_time.removeCallbacks(sendMoneyRunnable);
|
||||
LiveNetManager.get(mContext)
|
||||
.endSendMoneyLong(mLiveUid, mSendMoneyLongModel.getSendMoneyLongKey(),
|
||||
new com.yunbao.common.http.base.HttpCallback<SendMoneyLongModel>() {
|
||||
@Override
|
||||
public void onSuccess(SendMoneyLongModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -58,6 +58,7 @@ import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.event.SendMoneyLongEndEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -763,7 +764,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
}
|
||||
mLiveAudienceViewHolder.upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
|
||||
if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())){
|
||||
if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())) {
|
||||
mLiveRoomViewHolder.onSendMoneyLong();
|
||||
}
|
||||
|
||||
@@ -2214,4 +2215,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.onSendMoneyLongModel(sendMoneyLongModel);
|
||||
}
|
||||
}
|
||||
|
||||
public void onSendMoneyLongEndEvent(SendMoneyLongEndEvent moneyLongEndEvent) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.onSendMoneyLongEndEvent(moneyLongEndEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user