具体辅助实现代码:
RecyclerData.java
1 package com.example.lileme.ThreeFragment.AppointmentButton;
2
3 public class RecyclerData {
4 public String content;
5 public boolean isSelect=false;
6 }
btn_day_hour_select.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 3 <!-- 连框颜色值 --> 4 <item> 5 <shape android:shape="rectangle"> 6 <solid android:color="#90F7F7" /> 7 </shape> 8 </item> 9 <!-- 主体背景颜色值 --> 10 <item 11 android:bottom="1dp" 12 android:left="1dp" 13 android:right="1dp" 14 android:top="1dp"> 15 <shape> 16 <solid android:color="#90F7F7" /> 17 <padding 18 android:bottom="10dp" 19 android:left="10dp" 20 android:right="10dp" 21 android:top="10dp" /> 22 </shape> 23 24 </item> 25 </layer-list>
btn_day_hour_unselect.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 3 <!-- 连框颜色值 --> 4 <item> 5 <shape android:shape="rectangle"> 6 <solid android:color="#E1E1E1" /> 7 </shape> 8 </item> 9 <!-- 主体背景颜色值 --> 10 <item 11 android:bottom="1dp" 12 android:left="1dp" 13 android:right="1dp" 14 android:top="1dp"> 15 <shape> 16 <solid android:color="#FFFFFF" /> 17 <padding 18 android:bottom="10dp" 19 android:left="10dp" 20 android:right="10dp" 21 android:top="10dp" /> 22 </shape> 23 24 </item> 25 </layer-list>