From 3bf594d0b5f11a3ee892bf8befa43a622844afd8 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Mon, 26 Jun 2023 14:57:11 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=BA=A2=E5=8C=85=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/item_red_packet.xml | 10 + .../main/res/layout/item_user_red_packet.xml | 82 ++++++++ .../main/res/mipmap-xxhdpi/icon_diamond2.png | Bin 0 -> 10869 bytes main/src/main/AndroidManifest.xml | 9 + .../main/activity/RedPacketActivity.java | 23 --- .../main/activity/RedPacketInfoActivity.java | 29 +++ .../main/activity/RedPacketListActivity.java | 49 +++++ .../main/activity/RedPacketUsersActivity.java | 52 +++++ .../adapter/RedPacketListRecyclerAdapter.java | 69 +++++++ .../adapter/RedPacketUserRecyclerAdapter.java | 69 +++++++ .../yunbao/main/bean/RedPacketListBean.java | 33 ++++ .../yunbao/main/views/MainHomeViewHolder.java | 11 +- .../res/layout/activity_red_packet_info.xml | 184 ++++++++++++++++++ .../res/layout/activity_red_packet_users.xml | 105 ++++++++++ 14 files changed, 701 insertions(+), 24 deletions(-) create mode 100644 common/src/main/res/layout/item_user_red_packet.xml create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_diamond2.png delete mode 100644 main/src/main/java/com/yunbao/main/activity/RedPacketActivity.java create mode 100644 main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java create mode 100644 main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java create mode 100644 main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java create mode 100644 main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java create mode 100644 main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java create mode 100644 main/src/main/java/com/yunbao/main/bean/RedPacketListBean.java create mode 100644 main/src/main/res/layout/activity_red_packet_info.xml create mode 100644 main/src/main/res/layout/activity_red_packet_users.xml diff --git a/common/src/main/res/layout/item_red_packet.xml b/common/src/main/res/layout/item_red_packet.xml index 4a8f18371..130bb6199 100644 --- a/common/src/main/res/layout/item_red_packet.xml +++ b/common/src/main/res/layout/item_red_packet.xml @@ -15,6 +15,7 @@ app:srcCompat="@mipmap/diamond" /> + + \ No newline at end of file diff --git a/common/src/main/res/layout/item_user_red_packet.xml b/common/src/main/res/layout/item_user_red_packet.xml new file mode 100644 index 000000000..882546cd4 --- /dev/null +++ b/common/src/main/res/layout/item_user_red_packet.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/icon_diamond2.png b/common/src/main/res/mipmap-xxhdpi/icon_diamond2.png new file mode 100644 index 0000000000000000000000000000000000000000..e5517f232cb7ed160eb1d30173473a02c7bcdee8 GIT binary patch literal 10869 zcmZ{KWlS87?>9Qwa2alc4TjtB!(q4#hWl_CG7dOghud&xz<@E_2ORD$2gBX{I2=y? z-`|_(-P5FP+T_zTY1$@DW3)Au2wu^=LPJ9%P*GOU`A={Bk8v^oleTS|-~Urs_OcqX zXlV6GcyKH1|7>(m9VI!mnkl+tG&D>!ZS~KJO780I=ZKQK^Mw7!z>Q}}EGlI7IiTe^ zVc;=&^*(U-Dfj5+YY@tB8R_hTioCwD{)P&HK8C{X>+WuXps4sUWRxSa@p<3L4H<8O zoQp+`hM*enVbzZZA<*a9Sd>yIYAOm<_i!OMhl;qms=YsVf*_oCo+M{b(qB>WqsV}1 zMC3TqX%?ZAh;p0!pHp@m8El8FyLr&~iV~kgr5GR+Op%ErD4jHvMg&Sb1(kR9m^_Gz zE=SxVQIAN}JrdOgM>WDxwa=&)II0JZdPbuDBM1U@g+#T(Q8mvfFdQ`kN6o-dV{p_z z1Zo+9+C-rG;ixktssWA~f}`r6QGem6W;m+q8CCX-Izpl2%SY7&8R8AGihQ2FzS zm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a33^&ev;E0_mqinCvgQj0LWDY1aw zTr|pivT!fP{wC$b=zWfRV?svyzh5YS(*G|1hMuvEBlbs|Q+u|EPJ5W`Cn91*%{)9P zj$z)GY|EyFNywIx@s6B+=uq5@!qk3uWWahB*aR9oq*-mc5qga+B+QK zq7!S7ScRpwd~Y@*KgSrs2r<;{_PLq2Ws;~C7 + + + \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketActivity.java deleted file mode 100644 index 4de98d450..000000000 --- a/main/src/main/java/com/yunbao/main/activity/RedPacketActivity.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yunbao.main.activity; - -import android.widget.TextView; - -import androidx.recyclerview.widget.RecyclerView; - -import com.yunbao.common.activity.AbsActivity; -import com.yunbao.main.R; - -public class RedPacketActivity extends AbsActivity { - private RecyclerView recyclerView; - @Override - protected int getLayoutId() { - return R.layout.activity_red_packet; - } - - @Override - public void init() { - super.init(); - ((TextView)findViewById(R.id.titleView)).setText("紅包記錄"); - recyclerView=findViewById(R.id.recyclerView); - } -} diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java new file mode 100644 index 000000000..296212675 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java @@ -0,0 +1,29 @@ +package com.yunbao.main.activity; + +import android.content.Intent; +import android.view.View; +import android.widget.TextView; + +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.main.R; + +public class RedPacketInfoActivity extends AbsActivity implements View.OnClickListener{ + @Override + protected int getLayoutId() { + return R.layout.activity_red_packet_info; + } + + @Override + protected void main() { + super.main(); + findViewById(R.id.red_packet_info).setOnClickListener(this); + } + + @Override + public void onClick(View v) { + int id=v.getId(); + if(id==R.id.red_packet_info){ + startActivity(new Intent(this, RedPacketUsersActivity.class)); + } + } +} diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java new file mode 100644 index 000000000..ad98ce1c3 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java @@ -0,0 +1,49 @@ +package com.yunbao.main.activity; + +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.main.R; +import com.yunbao.main.adapter.RedPacketListRecyclerAdapter; +import com.yunbao.main.bean.RedPacketListBean; + +import java.util.ArrayList; +import java.util.List; + +public class RedPacketListActivity extends AbsActivity { + private RecyclerView recyclerView; + private RedPacketListRecyclerAdapter adapter; + + @Override + protected int getLayoutId() { + return R.layout.activity_red_packet; + } + + @Override + public void main() { + super.main(); + ((TextView) findViewById(R.id.titleView)).setText("紅包記錄"); + recyclerView = findViewById(R.id.recyclerView); + + adapter = new RedPacketListRecyclerAdapter(this); + recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); + recyclerView.setAdapter(adapter); + initData(); + } + + private void initData() { + List list = new ArrayList<>(); + for (int i = 1; i <= 5; i++) { + RedPacketListBean bean = new RedPacketListBean(); + bean.setTitle("攢人氣紅包" + i); + bean.setTimer("X月X日 " + i); + bean.setMoney(i * 1000 + ""); + list.add(bean); + } + adapter.setList(list); + + } +} diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java new file mode 100644 index 000000000..61a340b79 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java @@ -0,0 +1,52 @@ +package com.yunbao.main.activity; + +import android.view.View; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.main.R; +import com.yunbao.main.adapter.RedPacketUserRecyclerAdapter; +import com.yunbao.main.bean.RedPacketListBean; + +import java.util.ArrayList; +import java.util.List; + +public class RedPacketUsersActivity extends AbsActivity implements View.OnClickListener{ + private RecyclerView recyclerView; + private RedPacketUserRecyclerAdapter adapter; + + @Override + protected int getLayoutId() { + return R.layout.activity_red_packet_users; + } + + @Override + protected void main() { + super.main(); + recyclerView = findViewById(R.id.recyclerView); + + adapter = new RedPacketUserRecyclerAdapter(this); + recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); + recyclerView.setAdapter(adapter); + initData(); + } + + @Override + public void onClick(View v) { + int id=v.getId(); + } + private void initData() { + List list = new ArrayList<>(); + for (int i = 1; i <= 5; i++) { + RedPacketListBean bean = new RedPacketListBean(); + bean.setTitle("攢人氣紅包 - 主播昵稱的直播間" + i); + bean.setTimer("X月X日 " + i); + bean.setMoney(i * 1000 + ""); + list.add(bean); + } + adapter.setList(list); + + } +} diff --git a/main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java b/main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java new file mode 100644 index 000000000..a1a64e227 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java @@ -0,0 +1,69 @@ +package com.yunbao.main.adapter; + +import android.content.Context; +import android.content.Intent; +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.main.R; +import com.yunbao.main.activity.RedPacketInfoActivity; +import com.yunbao.main.bean.RedPacketListBean; + +import java.util.List; + +public class RedPacketListRecyclerAdapter extends RecyclerView.Adapter { + private List list; + private Context mContext; + + public RedPacketListRecyclerAdapter(Context mContext) { + this.mContext = mContext; + } + + public void setList(List list) { + this.list = list; + notifyDataSetChanged(); + } + + @NonNull + @Override + public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new ItemViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_red_packet, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) { + holder.setData(list.get(position)); + } + + @Override + public int getItemCount() { + return list.size(); + } + + public class ItemViewHolder extends RecyclerView.ViewHolder { + private TextView title, timer, money; + private ImageView icon; + + public ItemViewHolder(@NonNull View itemView) { + super(itemView); + title = itemView.findViewById(R.id.title); + timer = itemView.findViewById(R.id.time); + money = itemView.findViewById(R.id.money); + icon = itemView.findViewById(R.id.icon); + itemView.setOnClickListener(v -> mContext.startActivity(new Intent(mContext, RedPacketInfoActivity.class))); + } + + private void setData(RedPacketListBean bean) { + title.setText(bean.getTitle()); + timer.setText(bean.getTimer()); + money.setText(bean.getMoney()); + itemView.setTag(bean); + } + } +} diff --git a/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java b/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java new file mode 100644 index 000000000..011a95a7a --- /dev/null +++ b/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java @@ -0,0 +1,69 @@ +package com.yunbao.main.adapter; + +import android.content.Context; +import android.content.Intent; +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.main.R; +import com.yunbao.main.activity.RedPacketInfoActivity; +import com.yunbao.main.bean.RedPacketListBean; + +import java.util.List; + +public class RedPacketUserRecyclerAdapter extends RecyclerView.Adapter { + private List list; + private Context mContext; + + public RedPacketUserRecyclerAdapter(Context mContext) { + this.mContext = mContext; + } + + public void setList(List list) { + this.list = list; + notifyDataSetChanged(); + } + + @NonNull + @Override + public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new ItemViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_user_red_packet, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) { + holder.setData(list.get(position)); + } + + @Override + public int getItemCount() { + return list.size(); + } + + public class ItemViewHolder extends RecyclerView.ViewHolder { + private TextView title, timer, money; + private ImageView icon; + + public ItemViewHolder(@NonNull View itemView) { + super(itemView); + title = itemView.findViewById(R.id.title); + timer = itemView.findViewById(R.id.time); + money = itemView.findViewById(R.id.money); + icon = itemView.findViewById(R.id.icon); + itemView.setOnClickListener(v -> mContext.startActivity(new Intent(mContext, RedPacketInfoActivity.class))); + } + + private void setData(RedPacketListBean bean) { + title.setText(bean.getTitle()); + timer.setText(bean.getTimer()); + money.setText(bean.getMoney()); + itemView.setTag(bean); + } + } +} diff --git a/main/src/main/java/com/yunbao/main/bean/RedPacketListBean.java b/main/src/main/java/com/yunbao/main/bean/RedPacketListBean.java new file mode 100644 index 000000000..16f3e0910 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/bean/RedPacketListBean.java @@ -0,0 +1,33 @@ +package com.yunbao.main.bean; + +import com.yunbao.common.bean.BaseModel; + +public class RedPacketListBean extends BaseModel { + private String title; + private String timer; + private String money; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } +} diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index fcfa2000a..a5614849e 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -1,6 +1,8 @@ package com.yunbao.main.views; import android.content.Context; +import android.content.Intent; +import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; @@ -8,6 +10,7 @@ import android.widget.ImageView; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.WordUtil; import com.yunbao.main.R; +import com.yunbao.main.activity.RedPacketListActivity; /** * Created by cxf on 2018/9/22. @@ -38,7 +41,13 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy); - + img_trophy.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + mContext.startActivity(new Intent(mContext, RedPacketListActivity.class)); + return false; + } + }); } diff --git a/main/src/main/res/layout/activity_red_packet_info.xml b/main/src/main/res/layout/activity_red_packet_info.xml new file mode 100644 index 000000000..c2c0a9a58 --- /dev/null +++ b/main/src/main/res/layout/activity_red_packet_info.xml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/activity_red_packet_users.xml b/main/src/main/res/layout/activity_red_packet_users.xml new file mode 100644 index 000000000..6a9f8bfae --- /dev/null +++ b/main/src/main/res/layout/activity_red_packet_users.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file