神龙列表接口对接,神龙送财活动参加接口对接,ui更新

This commit is contained in:
18401019693
2024-03-14 16:39:04 +08:00
parent 3b6d586b58
commit 1981fb553a
21 changed files with 730 additions and 4 deletions

View File

@@ -4,16 +4,28 @@ import android.content.Context;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.adapter.DragonSendMoneyListAdapter;
import com.yunbao.common.bean.sendMoneyLongListModel;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.dialog.DragonRulePopup;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.DragonSendMoneyListViewHolder;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import java.util.List;
public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
FragmentActivity activity;
String mLiveUid;
DragonSendMoneyListAdapter dragonSendMoneyListAdapter;
RecyclerView send_money_list;
public DragonSendMoneyListPopup(@NonNull Context context, String liveUid) {
super(context);
@@ -34,6 +46,56 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
@Override
protected void onCreate() {
super.onCreate();
send_money_list = findViewById(R.id.send_money_list);
send_money_list.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
dragonSendMoneyListAdapter = new DragonSendMoneyListAdapter(send_money_list);
send_money_list.setAdapter(dragonSendMoneyListAdapter);
dragonSendMoneyListAdapter.setCallBack(new DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack() {
@Override
public void onParticipate(sendMoneyLongListModel moneyLongListModel) {
LiveNetManager.get(mContext)
.participateMoneyLong(mLiveUid, moneyLongListModel.getSendMoneyLongKey(), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
ToastUtil.show(data);
LiveNetManager.get(mContext)
.sendMoneyLongList(mLiveUid, new HttpCallback<List<sendMoneyLongListModel>>() {
@Override
public void onSuccess(List<sendMoneyLongListModel> data) {
dragonSendMoneyListAdapter.setMoneyLongListModels(data);
send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size());
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
});
LiveNetManager.get(mContext)
.sendMoneyLongList(mLiveUid, new HttpCallback<List<sendMoneyLongListModel>>() {
@Override
public void onSuccess(List<sendMoneyLongListModel> data) {
dragonSendMoneyListAdapter.setMoneyLongListModels(data);
send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size());
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_rule), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {

View File

@@ -1603,7 +1603,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
// .show();
}
});
dragonImmediateParticipation.setVisibility(View.GONE);
// dragonImmediateParticipation.setVisibility(View.GONE);
}
private LinearLayout dragonImmediateParticipation;
@@ -3153,6 +3153,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) {
dragonImmediateParticipation.setVisibility(View.VISIBLE);
}
public void onSendMoneyLong() {
dragonImmediateParticipation.setVisibility(View.VISIBLE);
}
/**
* 设置礼物墙和周星榜
*/

View File

@@ -763,6 +763,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
mLiveAudienceViewHolder.upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())){
mLiveRoomViewHolder.onSendMoneyLong();
}
}

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="450dp"
android:layout_gravity="bottom"
@@ -56,6 +57,16 @@
app:gradient_endColor="#F9D78F"
app:gradient_startColor="#E59F1F" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/send_money_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="4"
android:paddingBottom="12dp"
tools:listitem="@layout/view_dragon_send_money_list" />
</LinearLayout>