實現主介面的聊天頭像
1 <?xml version="1.0" encoding="utf-8"?> 2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="match_parent" 4 android:layout_height="wrap_content" 5 xmlns:app="http://schemas.android.com/apk/res-auto" 6 android:padding="@dimen/_8sdp"> 7 8 <com.makeramen.roundedimageview.RoundedImageView 9 android:id="@+id/imageProfile" 10 android:layout_width="@dimen/_35sdp" 11 android:layout_height="@dimen/_35sdp" 12 android:background="@drawable/background_image" 13 android:scaleType="centerCrop" 14 app:layout_constraintStart_toStartOf="parent" 15 app:layout_constraintTop_toTopOf="parent" 16 app:riv_oval="true"/> 17 18 <View 19 android:id="@+id/viewSupporter" 20 android:layout_width="1dp" 21 android:layout_height="1dp" 22 app:layout_constraintBottom_toBottomOf="@id/imageProfile" 23 app:layout_constraintStart_toEndOf="@id/imageProfile" 24 app:layout_constraintTop_toTopOf="@id/imageProfile"/> 25 26 <TextView 27 android:id="@+id/textName" 28 android:layout_width="0dp" 29 android:layout_height="wrap_content" 30 android:layout_marginStart="@dimen/_8sdp" 31 android:layout_marginEnd="@dimen/_8sdp" 32 android:ellipsize="end" 33 android:maxLines="1" 34 android:textColor="@color/primary_text" 35 android:textSize="@dimen/_13ssp" 36 app:layout_constraintBottom_toTopOf="@id/viewSupporter" 37 app:layout_constraintEnd_toEndOf="parent" 38 app:layout_constraintStart_toEndOf="@id/imageProfile"/> 39 40 <TextView 41 android:id="@+id/textRecentMessage" 42 android:layout_width="0dp" 43 android:layout_height="wrap_content" 44 android:layout_marginStart="@dimen/_8sdp" 45 android:layout_marginEnd="@dimen/_8sdp" 46 android:ellipsize="end" 47 android:maxLines="1" 48 android:textColor="@color/secondary_text" 49 android:textSize="@dimen/_12ssp" 50 app:layout_constraintEnd_toEndOf="parent" 51 app:layout_constraintStart_toEndOf="@id/imageProfile" 52 app:layout_constraintTop_toBottomOf="@id/viewSupporter"/> 53 54 55 56 </androidx.constraintlayout.widget.ConstraintLayout>