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 000000000..772f10baa Binary files /dev/null and b/live/src/main/res/mipmap-xhdpi/ic_live_fans_group_info_colse.png differ 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鑽購買