update 粉丝团
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.live.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveFansGroupBuyAdapter extends RecyclerView.Adapter<LiveFansGroupBuyAdapter.ViewHolder> {
|
||||
Context mContext;
|
||||
List<?> list=new ArrayList<>();
|
||||
|
||||
public LiveFansGroupBuyAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<?> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_fans_group_buy_list, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftIcon;
|
||||
private TextView day;
|
||||
private TextView title;
|
||||
private TextView introduce;
|
||||
private ImageView diamondIcon;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
giftIcon=itemView.findViewById(R.id.giftIcon);
|
||||
day=itemView.findViewById(R.id.day);
|
||||
title=itemView.findViewById(R.id.title);
|
||||
introduce=itemView.findViewById(R.id.introduce);
|
||||
diamondIcon=itemView.findViewById(R.id.diamondIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.live.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveFansGroupSendGiftAdapter extends RecyclerView.Adapter<LiveFansGroupSendGiftAdapter.ViewHolder> {
|
||||
Context mContext;
|
||||
List<?> list=new ArrayList<>();
|
||||
|
||||
public LiveFansGroupSendGiftAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<?> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public LiveFansGroupSendGiftAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new LiveFansGroupSendGiftAdapter.ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_fans_group_package_list, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull LiveFansGroupSendGiftAdapter.ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftIcon;
|
||||
private TextView day;
|
||||
private TextView title;
|
||||
private TextView send;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
giftIcon=itemView.findViewById(R.id.giftIcon);
|
||||
day=itemView.findViewById(R.id.day);
|
||||
title=itemView.findViewById(R.id.title);
|
||||
send=itemView.findViewById(R.id.send);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,6 +131,13 @@ public class LiveFansFragment extends AbsDialogFragment {
|
||||
//点击 开通粉丝勋章,打开礼物列表送礼物
|
||||
((LiveAudienceActivity) mContext).openGiftWindow(event.getLiveId(), "0");
|
||||
dismiss();
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidFansGroupBuy")) {
|
||||
String id = event.getUserId();
|
||||
new LiveFansGroupBuyDialog(mContext).setGiftId(id).showDialog();
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidFansGroupPack")) {
|
||||
new LiveFansGroupSendGiftDialog(mContext).showDialog();
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidFansGroupInfo")) {
|
||||
new LiveFansGroupInfoDialog(mContext).showDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveFansGroupBuyAdapter;
|
||||
|
||||
public class LiveFansGroupBuyDialog extends AbsDialogPopupWindow {
|
||||
private TextView anchorName;
|
||||
private TextView buy;
|
||||
private RecyclerView recyclerView;
|
||||
private LiveFansGroupBuyAdapter adapter;
|
||||
private String id;
|
||||
|
||||
public LiveFansGroupBuyDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public LiveFansGroupBuyDialog setGiftId(String id) {
|
||||
this.id=id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
@@ -22,4 +36,20 @@ public class LiveFansGroupBuyDialog extends AbsDialogPopupWindow {
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_fans_group_buy;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
anchorName = findViewById(R.id.anchorName);
|
||||
buy = findViewById(R.id.buy);
|
||||
recyclerView = findViewById(R.id.giftList);
|
||||
adapter = new LiveFansGroupBuyAdapter(mContext);
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
buy.setOnClickListener(v -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,4 +22,10 @@ public class LiveFansGroupInfoDialog extends AbsDialogPopupWindow {
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_fans_group_info;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.colse).setOnClickListener(v -> dismiss());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,17 @@ package com.yunbao.live.dialog;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveFansGroupSendGiftAdapter;
|
||||
|
||||
public class LiveFansGroupSendGiftDialog extends AbsDialogPopupWindow {
|
||||
private RecyclerView recyclerView;
|
||||
private LiveFansGroupSendGiftAdapter adapter;
|
||||
|
||||
public LiveFansGroupSendGiftDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
@@ -22,4 +27,12 @@ public class LiveFansGroupSendGiftDialog extends AbsDialogPopupWindow {
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_fans_group_send;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
recyclerView = findViewById(R.id.giftList);
|
||||
adapter = new LiveFansGroupSendGiftAdapter(mContext);
|
||||
recyclerView.setAdapter(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user