https://github.com/square/android-times-square If you look at it, you will get a calendar view that provides the function you want. To briefly explain how to use it
build.gradle to dependency
compile 'com.squareup:android-times-square:1.6.5@aar'
Please add
Go to layout xml
<com.squareup.timessquare.CalendarPickerView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
Insert the code above
And go to the code of the activity you want to print out
Calendar nextYear = Calendar.getInstance();
nextYear.add(Calendar.YEAR, 1);
CalendarPickerView calendar = (CalendarPickerView) findViewById(R.id.calendar_view);
Date today = new Date();
calendar.init(today, nextYear.getTime())
.inMode(RANGE);
You can do it like this.
© 2024 OneMinuteCode. All rights reserved.