From f496392b24eb9c9a38498cbbf03159ef5aa037d1 Mon Sep 17 00:00:00 2001 From: tj <1378534974@qq.com> Date: 星期一, 21 四月 2025 15:38:08 +0800 Subject: [PATCH] 1.好友邀请-我的邀请记录:列表样式重写,图片显示 2.已登录的用户点击应用图标之后直接登录 --- app/src/main/res/layout/activity_invitation_main.xml | 564 +++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 350 insertions(+), 214 deletions(-) diff --git a/app/src/main/res/layout/activity_invitation_main.xml b/app/src/main/res/layout/activity_invitation_main.xml index cdc5a91..120d1f0 100644 --- a/app/src/main/res/layout/activity_invitation_main.xml +++ b/app/src/main/res/layout/activity_invitation_main.xml @@ -1,235 +1,371 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - android:background="#F0F0F0"> + android:background="#F0F0F0" + android:fillViewport="true"> - <!-- 标题栏 --> - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="邀请有礼" - android:textSize="20sp" - android:gravity="center" - android:padding="16dp" - android:textColor="#333333"/> - - <!-- 横幅广告区域 --> - <ImageView - android:layout_width="match_parent" - android:layout_height="200dp" - android:src="@drawable/gift_one" - android:scaleType="fitXY" - android:layout_marginBottom="16dp" - android:background="@drawable/rounded_corner_image" - android:padding="1dp" /> - - <!-- 邀请成功提示区域 --> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" - android:background="#FFFFFF" - android:layout_marginBottom="16dp"> - <androidx.recyclerview.widget.RecyclerView - android:id="@+id/invitationsuccessRecyclerView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:maxHeight="100dp" - android:paddingStart="16dp" - android:paddingEnd="16dp" - android:paddingBottom="16dp" - android:clipToPadding="false" - android:overScrollMode="never"/> - </LinearLayout> + android:orientation="vertical"> - <!-- 邀请按钮区域 --> - <Button - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="立即邀请好友" - android:backgroundTint="#FF0000" - android:textColor="#FFFFFF" - android:padding="16dp" - android:textSize="16sp" - android:layout_marginBottom="16dp"/> - - <!-- 邀请任务表格区域 --> - <TableLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="16dp" - android:background="#FFFFFF" - android:layout_marginBottom="16dp"> - - <TableRow> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="邀请人数" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="邀请奖励" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="被邀请人奖励" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - </TableRow> - - <TableRow> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="1人" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="3天会员" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="1天会员" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - </TableRow> - - <TableRow> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="3人" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="免广告特权 (7天)" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="1天会员" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - </TableRow> - - <TableRow> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="5人" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="7天会员" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="1天会员" - android:textSize="16sp" - android:padding="8dp" - android:textColor="#333333"/> - </TableRow> - </TableLayout> - - <!-- 邀请记录区域 --> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:padding="16dp" - android:background="#FFFFFF"> - + <!-- 标题栏 --> <TextView - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="我的邀请记录" - android:textSize="16sp" - android:paddingBottom="8dp" - android:textColor="#333333"/> + android:gravity="center" + android:padding="16dp" + android:text="邀请有礼" + android:textColor="#333333" + android:textSize="13sp" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" - android:paddingBottom="8dp"> + android:background="@drawable/bg_gradient" + android:orientation="vertical"> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Hnnnnne" - android:textSize="16sp" - android:paddingEnd="8dp" - android:textColor="#333333"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginHorizontal="11dp" + android:orientation="vertical"> - <Button - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="待注册" - android:background="#CCCCCC" - android:textColor="#000000" - android:padding="8dp" - android:textSize="14sp"/> - </LinearLayout> + <!-- 提示烂 --> + <TextView + android:id="@+id/tv_notic" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:padding="10dp" + android:textColor="#FFFFFF" + android:textSize="15sp" /> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> + <!-- 横幅广告区域 --> + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="140dp" + android:layout_marginBottom="10dp" + app:cardCornerRadius="13dp" + app:cardPreventCornerOverlap="true"> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Hnnnnne" - android:textSize="16sp" - android:paddingEnd="8dp" - android:textColor="#333333"/> + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="centerCrop" + android:src="@drawable/gift_one" /> + </androidx.cardview.widget.CardView> - <Button - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="已注册" - android:background="#008800" - android:textColor="#FFFFFF" - android:padding="8dp" - android:textSize="14sp"/> + <!-- 邀请成功提示区域 --> + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + app:cardCornerRadius="38dp"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/invitationsuccessRecyclerView" + android:layout_width="match_parent" + android:layout_height="40dp" + android:nestedScrollingEnabled="false" + android:overScrollMode="never" /> + </androidx.cardview.widget.CardView> + + <!-- 邀请按钮区域 --> + <Button + android:id="@+id/btnInvite" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:backgroundTint="#FF0000" + android:insetTop="0dp" + android:insetBottom="0dp" + android:padding="10dp" + android:text="立即邀请好友" + android:textColor="#FFFFFF" + android:textSize="16sp" + app:cornerRadius="10dp" /> + + <!-- 邀请码区域 --> + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginBottom="8dp" + app:cardBackgroundColor="#FFFFFF" + app:cardCornerRadius="8dp" + app:cardElevation="0dp" + app:cardPreventCornerOverlap="true"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="16dp" + android:paddingEnd="16dp"> + + <TextView + android:id="@+id/invitationCodeText" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:textAlignment="center" + android:textColor="#000000" + android:textSize="30sp" /> + + <Button + android:id="@+id/copyButton" + style="?android:attr/borderlessButtonStyle" + android:layout_width="wrap_content" + android:layout_height="40dp" + android:background="@android:color/transparent" + android:paddingStart="12dp" + android:paddingEnd="12dp" + android:stateListAnimator="@null" + android:text="复制邀请码" + android:textColor="#FF0000FF" + android:textSize="13sp" /> + </LinearLayout> + </androidx.cardview.widget.CardView> + + <!-- 邀请任务表格区域 --> + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginBottom="3dp" + app:cardCornerRadius="6dp" + app:cardPreventCornerOverlap="true"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <!-- 添加"邀请任务"标题 --> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="16dp" + android:paddingBottom="8dp" + android:text="邀请任务" + android:textColor="#333333" + android:textSize="16sp" + android:textStyle="bold" /> + + <!-- 表格区域 --> + <TableLayout + android:id="@+id/tableLayout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:paddingBottom="16dp" + android:shrinkColumns="*" + android:stretchColumns="*"> + + <TableRow> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="邀请人数" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="邀请奖励" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="被邀请人奖励" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + </TableRow> + + <TableRow android:background="@drawable/table_cell_border"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="1人" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="3天会员" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="1天会员" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + </TableRow> + + <TableRow android:background="@drawable/table_cell_border"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="3人" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="15天会员" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="1天会员" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + </TableRow> + + <TableRow android:background="@drawable/table_cell_border"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="5人" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="30天会员" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/table_cell_border" + android:text="1天会员" + android:textAlignment="center" + android:textColor="#333333" + android:textSize="12sp" /> + </TableRow> + </TableLayout> + </LinearLayout> + </androidx.cardview.widget.CardView> + + + <LinearLayout + android:id="@+id/invitationrecordLinearLayout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="@drawable/bg_invitation_record" + android:padding="10dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <!-- 添加"我的邀请记录"标题 --> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:paddingLeft="16dp" + android:paddingBottom="5dp" + android:text="我的邀请记录" + android:textColor="#333333" + android:textSize="16sp" + android:textStyle="bold" /> + + </LinearLayout> + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/invited_record_recycler_view_2" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + </LinearLayout> + + <!-- 邀请记录区域 --> + <!-- <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:cardCornerRadius="6dp" + > + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <!– 添加"我的邀请记录"标题 –> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:paddingLeft="16dp" + android:paddingBottom="8dp" + android:text="我的邀请记录" + android:textColor="#333333" + android:textSize="16sp" + android:textStyle="bold" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/invitationrecordRecyclerView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:nestedScrollingEnabled="false" + android:overScrollMode="never" /> + + </LinearLayout> + + + </androidx.cardview.widget.CardView>--> + + + + <!-- 添加一个权重为1的View,用于填充剩余空间 --> + <View + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> + </LinearLayout> </LinearLayout> </LinearLayout> - -</LinearLayout> \ No newline at end of file +</ScrollView> \ No newline at end of file -- Gitblit v1.9.3