<?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" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/butn_rule" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/padding5" android:layout_marginEnd="@dimen/padding10" android:background="@drawable/sel_spec_bg" android:paddingHorizontal="@dimen/padding10" android:paddingVertical="@dimen/rule_vertical_padding" android:singleLine="true" android:text="加糖" android:foreground="?selectableItemBackground" android:textColor="@drawable/sel_spec_color" android:textSize="@dimen/ts_detail_rule" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/txt_recommend" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bg_spec_recommend" android:paddingHorizontal="@dimen/padding5" android:paddingVertical="@dimen/padding3" android:text="推荐" android:textColor="@color/white" android:textSize="@dimen/ts_detail_spec_rec" android:visibility="gone" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout>