update 粉丝团

This commit is contained in:
zlzw 2023-08-02 15:48:51 +08:00
parent 9a8bc0505d
commit fae0d01dc2
14 changed files with 237 additions and 8 deletions

View File

@ -547,4 +547,19 @@ public class JavascriptInterfaceUtils {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("clickLogOffAccount"));
}
@JavascriptInterface
public void androidFansGroupBuy(String id){
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidFansGroupBuy").setUserId(id));
}
@JavascriptInterface
public void androidFansGroupPack(){
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidFansGroupPack"));
}
@JavascriptInterface
public void androidFansGroupInfo(){
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidFansGroupInfo"));
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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();
}
}

View File

@ -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 -> {
});
}
}

View File

@ -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());
}
}

View File

@ -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);
}
}

View File

@ -31,7 +31,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="主播昵稱" />
tools:text="主播昵稱" />
<TextView
android:id="@+id/giftName"
@ -44,7 +44,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/anchorName"
tools:text="臻愛禮包" />
android:text="@string/live_fans_group_buy_title" />
<TextView
android:id="@+id/giftInfo"
@ -56,7 +56,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/giftName"
tools:text="購買可獲得5200鑽特定禮物同時可獲得限定資源" />
android:text="@string/live_fans_group_buy_info" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/giftList"
@ -89,6 +89,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/giftList"
tools:text="5200鑽購買" />
android:text="@string/live_fans_group_buy_buy" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -73,4 +73,14 @@
android:text="@string/live_fans_group_info2_text2" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<ImageView
android:id="@+id/colse"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:src="@mipmap/ic_live_fans_group_info_colse"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -29,7 +29,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="當前可送出" />
android:text="@string/live_fans_group_send_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/giftList"

View File

@ -56,7 +56,23 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/textView12"
android:id="@+id/day"
android:layout_width="27dp"
android:layout_height="12dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="4dp"
android:background="@mipmap/icon_fans_group_buy_dialog_day"
android:gravity="center"
android:textColor="#7059BB"
android:textSize="8sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="1天"
tools:visibility="visible" />
<TextView
android:id="@+id/send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
@ -65,12 +81,12 @@
android:paddingTop="4dp"
android:paddingEnd="13dp"
android:paddingBottom="4dp"
tools:text="贈送"
android:textColor="#E6FFFFFF"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout4" />
app:layout_constraintTop_toBottomOf="@+id/constraintLayout4"
android:text="@string/live_fans_group_send_sub" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -108,4 +108,9 @@
<string name="live_fans_group_info_title">Introduction</string>
<string name="live_fans_group_info2_title">Rules</string>
<string name="live_fans_follow_toast">Join the fan group and unlock exclusive gifts</string>
<string name="live_fans_group_send_sub">Gift</string>
<string name="live_fans_group_send_title">Currently Available To Send</string>
<string name="live_fans_group_buy_title">The Perfect GiftPack</string>
<string name="live_fans_group_buy_info">Purchase a %s Diamond Specific Gift And Receive ALimited Resource</string>
<string name="live_fans_group_buy_buy">Diamond Purchase</string>
</resources>

View File

@ -106,4 +106,9 @@
<string name="live_fans_group_info_title">禮包介紹</string>
<string name="live_fans_group_info2_title">購買規則</string>
<string name="live_fans_follow_toast">加入粉絲團,解鎖專屬禮物</string>
<string name="live_fans_group_send_sub">赠送</string>
<string name="live_fans_group_send_title">當前可送出</string>
<string name="live_fans_group_buy_title">的臻愛禮包</string>
<string name="live_fans_group_buy_info">購買可獲得%s鑽特定禮物同時可獲得限定資源</string>
<string name="live_fans_group_buy_buy">%s鑽購買</string>
</resources>