Android realizes the effect of unlimited sliding around the switching date
When we are developing Android, we often use dates. For example, in course arrangement, work arrangement, log and other places, what we bring today is to make the date slide infinitely around, and support the method of customizing the display effect. Let's study together.
The above is the effect to be achieved this time
instructions:
XML layout
New XML layout
Layout of recyclerview_ The behavior is com.ldf.calendar.behavior.recyclerviewbehavior
Customize the calendar style, create a new customdayview, inherit from dayview, and override the refreshcontent and copy methods
Create a new customdayview instance and build the calendarviewadapter as a parameter
Initializing view at present, compared with dialog selecting calendar, my control is more suitable for activity / fragment in oncreate of activity or oncreateview of fragment. You need to implement these two methods to start calendar and load data
Use this method to recall calendar click events
Use this method to initialize calendar tag data
Use this method to add related listeners to monthpager
Override the onwindowfocuschanged method, and use this method to know the dimensions of calendar and day
The above is all the codes and instructions used in this effect. If you have any questions, you can discuss them in the message below.