From fae0d01dc242f5e121c7244937913bf43d8721be Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 2 Aug 2023 15:48:51 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=B2=89=E4=B8=9D=E5=9B=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/JavascriptInterfaceUtils.java | 15 +++++ .../live/adapter/LiveFansGroupBuyAdapter.java | 62 ++++++++++++++++++ .../adapter/LiveFansGroupSendGiftAdapter.java | 60 +++++++++++++++++ .../yunbao/live/dialog/LiveFansFragment.java | 7 ++ .../live/dialog/LiveFansGroupBuyDialog.java | 30 +++++++++ .../live/dialog/LiveFansGroupInfoDialog.java | 6 ++ .../dialog/LiveFansGroupSendGiftDialog.java | 13 ++++ .../main/res/layout/dialog_fans_group_buy.xml | 8 +-- .../res/layout/dialog_fans_group_info.xml | 10 +++ .../res/layout/dialog_fans_group_send.xml | 2 +- .../layout/item_fans_group_package_list.xml | 22 ++++++- .../ic_live_fans_group_info_colse.png | Bin 0 -> 3219 bytes live/src/main/res/values-en/strings.xml | 5 ++ live/src/main/res/values/strings.xml | 5 ++ 14 files changed, 237 insertions(+), 8 deletions(-) create mode 100644 live/src/main/java/com/yunbao/live/adapter/LiveFansGroupBuyAdapter.java create mode 100644 live/src/main/java/com/yunbao/live/adapter/LiveFansGroupSendGiftAdapter.java create mode 100644 live/src/main/res/mipmap-xhdpi/ic_live_fans_group_info_colse.png diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 99d965be4..698aa8101 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -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")); + } } diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveFansGroupBuyAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveFansGroupBuyAdapter.java new file mode 100644 index 000000000..ca4af865f --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/LiveFansGroupBuyAdapter.java @@ -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 { + 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); + } + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveFansGroupSendGiftAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveFansGroupSendGiftAdapter.java new file mode 100644 index 000000000..e88ddb3cf --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/LiveFansGroupSendGiftAdapter.java @@ -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 { + 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); + } + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java index 0a1d21c8f..87a1abc04 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveFansFragment.java @@ -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(); } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupBuyDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupBuyDialog.java index 64097a08f..930c059f1 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupBuyDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupBuyDialog.java @@ -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 -> { + + }); + } + + } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupInfoDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupInfoDialog.java index ce6a67981..b2a4c22db 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupInfoDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupInfoDialog.java @@ -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()); + } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupSendGiftDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupSendGiftDialog.java index f156cd57c..6350cdd5d 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupSendGiftDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveFansGroupSendGiftDialog.java @@ -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); + } } diff --git a/live/src/main/res/layout/dialog_fans_group_buy.xml b/live/src/main/res/layout/dialog_fans_group_buy.xml index 5ac4251f7..7ff9b8f82 100644 --- a/live/src/main/res/layout/dialog_fans_group_buy.xml +++ b/live/src/main/res/layout/dialog_fans_group_buy.xml @@ -31,7 +31,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - tools:text="主播昵稱的" /> + tools:text="主播昵稱" /> + android:text="@string/live_fans_group_buy_title" /> + android:text="@string/live_fans_group_buy_info" /> + android:text="@string/live_fans_group_buy_buy" /> \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_fans_group_info.xml b/live/src/main/res/layout/dialog_fans_group_info.xml index 572b142f6..33cfbeaf2 100644 --- a/live/src/main/res/layout/dialog_fans_group_info.xml +++ b/live/src/main/res/layout/dialog_fans_group_info.xml @@ -73,4 +73,14 @@ android:text="@string/live_fans_group_info2_text2" /> + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_fans_group_send.xml b/live/src/main/res/layout/dialog_fans_group_send.xml index 96fbbd1f9..091c138fa 100644 --- a/live/src/main/res/layout/dialog_fans_group_send.xml +++ b/live/src/main/res/layout/dialog_fans_group_send.xml @@ -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" /> + + + app:layout_constraintTop_toBottomOf="@+id/constraintLayout4" + android:text="@string/live_fans_group_send_sub" /> \ No newline at end of file diff --git a/live/src/main/res/mipmap-xhdpi/ic_live_fans_group_info_colse.png b/live/src/main/res/mipmap-xhdpi/ic_live_fans_group_info_colse.png new file mode 100644 index 0000000000000000000000000000000000000000..772f10baad3e8b8062bce45b1017ca4134a1e703 GIT binary patch literal 3219 zcmV;E3~cj>P)Px>O-V#SRA@upT77U_RTV$yzWZJ_O&SskLIVh;Z2)DcK>3`Z)B&N0jQxY}+8UF* zx7n1{qBsfz7=)r|#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kDJ4=(@! literal 0 HcmV?d00001 diff --git a/live/src/main/res/values-en/strings.xml b/live/src/main/res/values-en/strings.xml index f4d35b300..acd4cc037 100644 --- a/live/src/main/res/values-en/strings.xml +++ b/live/src/main/res/values-en/strings.xml @@ -108,4 +108,9 @@ Introduction Rules Join the fan group and unlock exclusive gifts + Gift + Currently Available To Send + The Perfect GiftPack + Purchase a %s Diamond Specific Gift And Receive ALimited Resource + Diamond Purchase \ No newline at end of file diff --git a/live/src/main/res/values/strings.xml b/live/src/main/res/values/strings.xml index ddecb9f51..b3fdc3dd2 100644 --- a/live/src/main/res/values/strings.xml +++ b/live/src/main/res/values/strings.xml @@ -106,4 +106,9 @@ 禮包介紹 購買規則 加入粉絲團,解鎖專屬禮物 + 赠送 + 當前可送出 + 的臻愛禮包 + 購買可獲得%s鑽特定禮物,同時可獲得限定資源 + %s鑽購買