From 1bc150007e176d61a5caf7c1336b3bd328e69dc3 Mon Sep 17 00:00:00 2001 From: Administrator <123> Date: Wed, 27 Oct 2021 00:58:00 +0000 Subject: [PATCH] 开通会员UI --- app/src/main/res/values/styles.xml | 9 + app/src/main/res/layout/item_vip_right.xml | 36 +++++++ app/src/main/res/layout/fragment_dashboard.xml | 7 app/src/main/res/layout/activity_main.xml | 3 app/src/main/res/layout/activity_vip.xml | 51 ++++++++++ app/src/main/res/values/colors.xml | 2 app/src/main/res/layout/fragment_employer_vip.xml | 192 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 293 insertions(+), 7 deletions(-) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index a57477b..035ff13 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -4,8 +4,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/container" android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingTop="?attr/actionBarSize" > + android:layout_height="match_parent" > <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/nav_view" diff --git a/app/src/main/res/layout/activity_vip.xml b/app/src/main/res/layout/activity_vip.xml new file mode 100644 index 0000000..ca58f37 --- /dev/null +++ b/app/src/main/res/layout/activity_vip.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + + <ImageView + android:id="@+id/imageView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:srcCompat="@android:drawable/ic_delete" + android:layout_marginLeft="@dimen/frame_margin_lr" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintBottom_toBottomOf="@id/txt_employer"/> + + <TextView + android:id="@+id/txt_employer" + android:layout_width="wrap_content" + android:layout_height="50dp" + android:gravity="center" + android:text="发单会员" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toLeftOf="@id/txt_employee"/> + + <TextView + android:id="@+id/txt_employee" + android:layout_width="wrap_content" + android:layout_height="50dp" + android:gravity="center" + android:text="接单会员" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintLeft_toRightOf="@id/txt_employer" + app:layout_constraintRight_toRightOf="parent"/> + + + <include layout="@layout/fragment_employer_vip" + android:id="@+id/nav_host_fragment_activity_main" + android:layout_width="match_parent" + android:layout_height="0dp" + app:defaultNavHost="true" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@id/txt_employer" + /> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml index 377b41f..c55e1b8 100644 --- a/app/src/main/res/layout/fragment_dashboard.xml +++ b/app/src/main/res/layout/fragment_dashboard.xml @@ -43,7 +43,7 @@ app:layout_constraintHorizontal_weight="4" app:layout_constraintTop_toBottomOf="@id/tablayout" app:layout_constraintLeft_toLeftOf="parent" - app:layout_constraintRight_toLeftOf="@id/check_classify" + app:layout_constraintRight_toLeftOf="@id/txt_classify" android:orientation="horizontal"> <com.google.android.material.radiobutton.MaterialRadioButton android:layout_width="match_parent" @@ -80,11 +80,10 @@ </RadioGroup> - <com.google.android.material.checkbox.MaterialCheckBox - android:id="@+id/check_classify" + <TextView + android:id="@+id/txt_classify" android:layout_width="0dp" android:layout_height="40dp" - android:button="@null" android:text="分类▼" android:gravity="center" android:textColor="@color/radio_text" diff --git a/app/src/main/res/layout/fragment_employer_vip.xml b/app/src/main/res/layout/fragment_employer_vip.xml new file mode 100644 index 0000000..93abde3 --- /dev/null +++ b/app/src/main/res/layout/fragment_employer_vip.xml @@ -0,0 +1,192 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.core.widget.NestedScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + <TextView + android:id="@+id/txt_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="会员套餐" + android:layout_margin="@dimen/frame_margin_lr" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/layout_month"/> + + <LinearLayout + android:id="@+id/layout_month" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/frame_margin_lr" + android:orientation="vertical" + android:background="@drawable/bg_border_red_corner" + android:padding="@dimen/frame_margin_lr" + android:layout_marginTop="10dp" + app:layout_constraintHorizontal_chainStyle="spread_inside" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toLeftOf="@+id/layout_quarter" + app:layout_constraintTop_toBottomOf="@id/txt_title"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="VIP初体验" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="月卡会员" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="¥40" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="开通立即生效" /> + </LinearLayout> + + <LinearLayout + android:id="@+id/layout_quarter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="@drawable/bg_border_red_corner" + android:padding="@dimen/frame_margin_lr" + app:layout_constraintTop_toTopOf="@id/layout_month" + app:layout_constraintLeft_toRightOf="@id/layout_month" + app:layout_constraintRight_toLeftOf="@id/layout_year"> + + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="VIP初体验" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="月卡会员" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="¥40" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="开通立即生效" /> + </LinearLayout> + + <LinearLayout + android:id="@+id/layout_year" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_marginRight="@dimen/frame_margin_lr" + android:background="@drawable/bg_border_red_corner" + android:padding="@dimen/frame_margin_lr" + app:layout_constraintTop_toTopOf="@id/layout_quarter" + app:layout_constraintLeft_toRightOf="@id/layout_quarter" + app:layout_constraintRight_toRightOf="parent"> + + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="VIP初体验" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="月卡会员" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="¥40" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="开通立即生效" /> + </LinearLayout> + + <TextView + android:id="@+id/txt_rights_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="会员专属权益" + android:layout_margin="@dimen/frame_margin_lr" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@id/layout_month"/> + + <include + layout="@layout/item_vip_right" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:layout_constraintTop_toBottomOf="@id/txt_rights_title" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintLeft_toLeftOf="parent" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_rights" + android:layout_width="match_parent" + android:layout_height="wrap_content" + tools:itemCount="8" + tools:listitem="@layout/item_vip_right" + app:layout_constraintTop_toBottomOf="@id/txt_rights_title" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent"/> + + <TextView + android:id="@+id/txt_desc" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="说明" + android:padding="@dimen/frame_margin_lr" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@id/recycler_rights"/> + + <LinearLayout + android:id="@+id/lin_btn" + android:layout_width="match_parent" + android:layout_height="40dp" + android:layout_margin="@dimen/frame_margin_lr" + android:orientation="horizontal" + android:background="@drawable/bg_sky_corner" + android:gravity="center" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@id/txt_desc" + app:layout_constraintBottom_toBottomOf="parent"> + + <TextView + android:id="@+id/textView9" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:textColor="@color/white_2" + android:gravity="center" + android:textSize="16sp" + android:text="开通会员" /> + + <TextView + android:id="@+id/textView10" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginRight="20dp" + android:textColor="@color/red" + android:text="总价:¥40" /> + </LinearLayout> + </androidx.constraintlayout.widget.ConstraintLayout> +</androidx.core.widget.NestedScrollView> \ No newline at end of file diff --git a/app/src/main/res/layout/item_vip_right.xml b/app/src/main/res/layout/item_vip_right.xml new file mode 100644 index 0000000..57b0ae8 --- /dev/null +++ b/app/src/main/res/layout/item_vip_right.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:minHeight="30dp" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <TextView + android:id="@+id/txt_title" + style="@style/vip_right_item" + android:maxWidth="200dp" + android:text="名称" + android:layout_weight="1.5"/> + + <TextView + android:id="@+id/txt_general" + style="@style/vip_right_item" + android:text="非会员"/> + + <TextView + android:id="@+id/txt_month" + style="@style/vip_right_item" + android:text="月会员" /> + + <TextView + android:id="@+id/txt_quarter" + style="@style/vip_right_item" + android:text="季会员" /> + + <TextView + android:id="@+id/txt_year" + style="@style/vip_right_item" + android:text="年会员"/> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 557116e..5707c0a 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -6,7 +6,7 @@ <color name="teal_200">#FF03DAC5</color> <color name="teal_700">#FF018786</color> <color name="black">#FF000000</color> - <color name="black_4">#4E4E4E</color> + <color name="black_4">#373737</color> <color name="white">#FFFFFFFF</color> <color name="white_2">#F3F3F3</color> <color name="red">#FF1414</color> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 418f8ee..4ade4fe 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -18,4 +18,13 @@ <item name="layout_constraintHorizontal_chainStyle">spread</item> <item name="layout_constraintHorizontal_weight">1</item> </style> + + <style name="vip_right_item"> + <item name="android:layout_width">0dp</item> + <item name="android:layout_height">match_parent</item> + <item name="android:gravity">center</item> + <item name="android:padding">8dp</item> + <item name="android:textColor">@color/black_4</item> + <item name="android:layout_weight">1</item> + </style> </resources> \ No newline at end of file -- Gitblit v1.9.1