1.1
tj
2025-04-09 2b446a5fd5d8f9b8c0f1e3acef1eef7ad9adb6f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto">
 
    <data>
        <variable
            name="viewModel"
            type="com.example.firstapp.ui.vip.MemberInfoCardViewModel"/>
    </data>
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".ui.vip.MemberInfoCardFragment">
 
        <!-- CardView 内部的内容 -->
        <androidx.cardview.widget.CardView
            android:id="@+id/memberCardCardView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"
            android:layout_marginTop="10dp"
            android:layout_marginRight="15dp"
            android:elevation="0dp"
            android:clipChildren="false"
            android:clipToOutline="true"
            app:cardCornerRadius="10dp">  <!-- 设置CardView的elevation -->
 
 
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/memberCard"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                tools:ignore="MissingConstraints"
                android:background="@android:color/transparent"
                >
 
<!--                <ImageView-->
<!--                    android:id="@+id/memberAvatarView"-->
<!--                    android:layout_width="25dp"-->
<!--                    android:layout_height="27dp"-->
<!--                    android:layout_marginLeft="10dp"-->
<!--                    android:scaleType="centerCrop"-->
<!--                    app:layout_constraintStart_toStartOf="parent"-->
<!--                    app:layout_constraintTop_toTopOf="parent"-->
 
<!--                    />-->
                <com.google.android.material.imageview.ShapeableImageView
                    android:id="@+id/memberAvatarView"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="10dp"
                    android:scaleType="centerCrop"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:shapeAppearanceOverlay="@style/CircleImageView" />
 
 
                <TextView
                    android:id="@+id/phoneNumberText"
                    android:layout_width="120dp"
                    android:layout_height="40dp"
                    android:gravity="center"
                    android:text="@{viewModel.phoneNumber}"
                    android:textColor="#F2F2F2"
                    app:layout_constraintStart_toEndOf="@id/memberAvatarView"
                    app:layout_constraintTop_toTopOf="parent" />
 
<!--                <TextView-->
<!--                    android:id="@+id/memberStatus"-->
<!--                    android:layout_width="match_parent"-->
<!--                    android:layout_height="wrap_content"-->
<!--                    android:gravity="start"-->
<!--                    android:text="@{viewModel.memberStatus}"-->
<!--                    app:layout_constraintStart_toEndOf="@id/memberCard"-->
<!--                    app:layout_constraintTop_toTopOf="parent" />-->
 
                <TextView
                    android:id="@+id/memberStatus"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="start"
                    android:text="@{viewModel.memberStatus}"
                    android:layout_marginLeft="8dp"
                    android:padding="2dp"
                    android:textColor="#AAAAAA"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/memberAvatarView" />
 
            </androidx.constraintlayout.widget.ConstraintLayout>
 
 
        </androidx.cardview.widget.CardView>
 
        <!-- 悬浮的 ImageView, 位于右侧 -->
        <ImageView
            android:id="@+id/memberImageView"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_marginTop="-10dp"
            android:layout_marginRight="40dp"
            android:scaleType="centerCrop"
            android:layout_gravity="end|top"
            android:elevation="4dp" />  <!-- 设置memberImageView的elevation,确保它在上层 -->
 
    </FrameLayout>
 
</layout>