在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):BlackBoxVision/material-calendar-view开源软件地址(OpenSource Url):https://github.com/BlackBoxVision/material-calendar-view开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):> Prettier and simpler Material Design CalendarViewMaterialCalendarView is a prettier and simpler, material design calendar that allows full customization and it's backwards compatible with API 11+. ScreenshotsInstallationGradle
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.github.BlackBoxVision:material-calendar-view:v1.5.8'
} Maven
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.BlackBoxVision</groupId>
<artifactId>material-calendar-view</artifactId>
<version>v1.5.8</version>
</dependency> SBT
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.BlackBoxVision" % "material-calendar-view" % "v1.5.8" Usage exampleIn your layout.xml file: <io.blackbox_vision.materialcalendarview.view.CalendarView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary">
</io.blackbox_vision.materialcalendarview.view.CalendarView> This example shows all the possible customization around Material Calendar View: <io.blackbox_vision.materialcalendarview.view.CalendarView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:calendarIsMultiSelectDayEnabled="false"
app:calendarIsOverflowDatesVisible="true"
app:calendarBackgroundColor="@color/colorPrimary"
app:calendarTitleTextColor="@color/colorAccent"
app:calendarCurrentDayTextColor="@color/white"
app:calendarDayOfWeekTextColor="@color/grey"
app:calendarDayOfMonthTextColor="@android:color/white"
app:calendarDisabledDayBackgroundColor="@color/colorPrimary"
app:calendarDisabledDayTextColor="@android:color/darker_gray"
app:calendarSelectedDayBackgroundColor="@color/colorAccent"
app:calendarTitleBackgroundColor="@color/colorPrimary"
app:calendarWeekBackgroundColor="@color/colorPrimary"
app:calendarCurrentDayBackgroundColor="@color/teal500"
app:calendarWeekendTextColor="@color/colorAccent"
app:calendarButtonBackgroundColor="@color/colorAccent"
app:calendarWeekendDays="saturday|sunday">
</io.blackbox_vision.materialcalendarview.view.CalendarView> Then, in your Activity.java or Fragment.java initialize the calendar: calendarView = (CalendarView) findViewById(R.id.calendar_view);
calendarView.shouldAnimateOnEnter(true)
.setFirstDayOfWeek(Calendar.MONDAY)
.setOnDateClickListener(this::onDateClick)
.setOnMonthChangeListener(this::onMonthChange)
.setOnDateLongClickListener(this::onDateLongClick)
.setOnMonthTitleClickListener(this::onMonthTitleClick);
if (calendarView.isMultiSelectDayEnabled()) {
calendarView.setOnMultipleDaySelectedListener(this::onMultipleDaySelected);
}
calendarView.update(Calendar.getInstance(Locale.getDefault())); IssuesIf you found a bug, or you have an answer, or whatever. Please, open an issue. I will do the best to fix it, or help you. ContributingOf course, if you see something that you want to upgrade from this library, or a bug that needs to be solved, PRs are welcome! BackersSupport us with a monthly donation and help us continue our activities. [Become a backer] SponsorsBecome a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor] LicenseDistributed under the MIT license. See LICENSE for more information. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论