<?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:layout_width="match_parent"
|
android:layout_height="100dp"
|
android:layout_marginTop="20dp"
|
android:layout_marginLeft="15dp"
|
android:layout_marginRight="15dp"
|
app:cardCornerRadius="30dp"
|
android:elevation="2dp"> <!-- 设置CardView的elevation -->
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
android:id="@+id/memberCard"
|
android:layout_width="match_parent"
|
android:layout_height="80dp"
|
android:layout_marginTop="10dp"
|
tools:ignore="MissingConstraints">
|
|
<ImageView
|
android:id="@+id/memberAvatarView"
|
android:layout_width="60dp"
|
android:layout_height="60dp"
|
android:layout_marginLeft="10dp"
|
android:layout_marginRight="10dp"
|
android:scaleType="centerCrop"
|
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintStart_toStartOf="parent" />
|
|
<TextView
|
android:id="@+id/phoneNumberText"
|
android:layout_width="120dp"
|
android:layout_height="60dp"
|
android:gravity="center"
|
android:text="@{viewModel.phoneNumber}"
|
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintStart_toEndOf="@id/memberAvatarView" />
|
|
<TextView
|
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
android:layout_marginLeft="15dp"
|
android:layout_marginTop="60dp"
|
android:gravity="start"
|
android:text="@{viewModel.memberStatus}" />
|
|
</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="0dp"
|
android:layout_marginRight="40dp"
|
android:scaleType="centerCrop"
|
android:layout_gravity="end|top"
|
android:elevation="4dp" /> <!-- 设置memberImageView的elevation,确保它在上层 -->
|
|
</FrameLayout>
|
|
</layout>
|