神龙送财结束Im结束调用接口,神龙列表倒计时修改
This commit is contained in:
@@ -26,6 +26,10 @@ public class DragonSendMoneyListAdapter extends RecyclerView.Adapter {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<sendMoneyLongListModel> getMoneyLongListModels() {
|
||||
return moneyLongListModels;
|
||||
}
|
||||
|
||||
public DragonSendMoneyListAdapter(RecyclerView send_money_list) {
|
||||
this.send_money_list = send_money_list;
|
||||
countDownMap = new SparseArray<>();
|
||||
|
||||
@@ -14,6 +14,7 @@ public class SendMoneyLongModel extends BaseModel {
|
||||
* "add_time": 1710318757,
|
||||
* "gold_num": "5000"
|
||||
* "countdown": 300 // 倒计时
|
||||
* "send_money_long_key": "1710384258446",
|
||||
* }
|
||||
*/
|
||||
|
||||
@@ -35,6 +36,17 @@ public class SendMoneyLongModel extends BaseModel {
|
||||
private String goldNum;
|
||||
@SerializedName("countdown")
|
||||
private String countdown;
|
||||
@SerializedName("send_money_long_key")
|
||||
private String sendMoneyLongKey;
|
||||
|
||||
public String getSendMoneyLongKey() {
|
||||
return sendMoneyLongKey;
|
||||
}
|
||||
|
||||
public SendMoneyLongModel setSendMoneyLongKey(String sendMoneyLongKey) {
|
||||
this.sendMoneyLongKey = sendMoneyLongKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCountdown() {
|
||||
return countdown;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SendMoneyLongEndEvent extends BaseModel {
|
||||
}
|
||||
@@ -62,6 +62,7 @@ import com.yunbao.common.bean.RedPacketInfoModel;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
@@ -1183,4 +1184,6 @@ public interface PDLiveApi {
|
||||
|
||||
@GET("/api/public/?service=Guard.participateMoneyLong")
|
||||
Observable<ResponseModel<String>> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||
@GET("/api/public/?service=Guard.endSendMoneyLong")
|
||||
Observable<ResponseModel<SendMoneyLongModel>> endSendMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.yunbao.common.bean.RedPacketGiftModel;
|
||||
import com.yunbao.common.bean.RedPacketInfoModel;
|
||||
import com.yunbao.common.bean.RedPacketListBean;
|
||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
@@ -3054,6 +3055,30 @@ public class LiveNetManager {
|
||||
|
||||
}
|
||||
|
||||
public void endSendMoneyLong(String liveUid, String sendMoneyLongKey, HttpCallback<SendMoneyLongModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.endSendMoneyLong(liveUid, sendMoneyLongKey)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<SendMoneyLongModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<SendMoneyLongModel> stringResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(stringResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
|
||||
public void sendMoneyLongList(String liveUid, HttpCallback<List<sendMoneyLongListModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.sendMoneyLongList(liveUid)
|
||||
|
||||
@@ -56,39 +56,39 @@ public class DragonSendMoneyListViewHolder extends RecyclerView.ViewHolder {
|
||||
button_participate.setBackgroundResource(R.mipmap.icon_send_benefits);
|
||||
}
|
||||
if (send_benefits_time.getVisibility() == View.VISIBLE) {
|
||||
handler.removeCallbacks(runnable);
|
||||
// handler.removeCallbacks(runnable);
|
||||
mPkTimeCount2 = Long.parseLong(model.getCountdown());
|
||||
String s1 = StringUtil.getDurationText(mPkTimeCount2 * 1000);
|
||||
send_benefits_time.setText(s1);
|
||||
handler.postDelayed(runnable, 1000);
|
||||
// handler.postDelayed(runnable, 1000);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(button_participate, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (!isAnchor && callBack != null && TextUtils.equals("0", model.getParticipate())) {
|
||||
callBack.onParticipate(model);
|
||||
handler.removeCallbacks(runnable);
|
||||
// handler.removeCallbacks(runnable);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Handler handler = new Handler();
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mPkTimeCount2--;
|
||||
if (mPkTimeCount2 > 0) {
|
||||
String s1 = StringUtil.getDurationText(mPkTimeCount2 * 1000);
|
||||
send_benefits_time.setText(s1);
|
||||
handler.postDelayed(runnable, 1000);
|
||||
} else {
|
||||
handler.removeCallbacks(runnable);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
// Handler handler = new Handler();
|
||||
// Runnable runnable = new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// mPkTimeCount2--;
|
||||
// if (mPkTimeCount2 > 0) {
|
||||
// String s1 = StringUtil.getDurationText(mPkTimeCount2 * 1000);
|
||||
// send_benefits_time.setText(s1);
|
||||
// handler.postDelayed(runnable, 1000);
|
||||
// } else {
|
||||
// handler.removeCallbacks(runnable);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// };
|
||||
|
||||
public interface DragonSendMoneyListClicksCallBack {
|
||||
void onParticipate(sendMoneyLongListModel moneyLongListModel);
|
||||
|
||||
Reference in New Issue
Block a user