From 771cbd94aac89f0696c5cb8d64bcc2764d05039f Mon Sep 17 00:00:00 2001 From: "Jonatan E. Salas" Date: Sun, 22 Jan 2017 21:16:32 -0300 Subject: [PATCH 1/3] Update README.md, moving to v1.5.1 --- README.md | 71 ++++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 3d5fd7d..0f2f5f7 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ repositories { ```java dependencies { - compile 'com.github.BlackBoxVision:material-calendar-view:v1.4.0' + compile 'com.github.BlackBoxVision:material-calendar-view:v1.5.1' } ``` **Maven** @@ -51,7 +51,7 @@ dependencies { com.github.BlackBoxVision material-calendar-view - v1.4.0 + v1.5.1 ``` **SBT** @@ -65,7 +65,7 @@ resolvers += "jitpack" at "https://jitpack.io" - Add the dependency in the form: ```java -libraryDependencies += "com.github.BlackBoxVision" % "material-calendar-view" % "v1.4.0" +libraryDependencies += "com.github.BlackBoxVision" % "material-calendar-view" % "v1.5.1" ``` ##Usage example @@ -85,27 +85,24 @@ This example shows all the possible customization around Material Calendar View: ```xml + 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="@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"> ``` Then, in your Activity.java or Fragment.java initialize the calendar: @@ -113,24 +110,18 @@ Then, in your Activity.java or Fragment.java initialize the calendar: ```java calendarView = (CalendarView) findViewById(R.id.calendar_view); -calendarView.shouldAnimateOnEnter(true); -calendarView.setFirstDayOfWeek(Calendar.MONDAY); -calendarView.setIsOverflowDateVisible(true); -calendarView.setCurrentDay(new Date(System.currentTimeMillis())); -calendarView.setBackButtonColor(R.color.colorAccent); -calendarView.setNextButtonColor(R.color.colorAccent); -calendarView.update(Calendar.getInstance(Locale.getDefault())); -calendarView.setOnDateLongClickListener(selectedDate -> textView.setText(formatter.format(selectedDate))); -calendarView.setOnMonthChangeListener(monthDate -> { - final SimpleDateFormat df = new SimpleDateFormat("MMMM yyyy", Locale.getDefault()); +calendarView.shouldAnimateOnEnter(true) + .setFirstDayOfWeek(Calendar.MONDAY) + .setOnDateClickListener(this::onDateClick) + .setOnMonthChangeListener(this::onMonthChange) + .setOnDateLongClickListener(this::onDateLongClick) + .setOnMonthTitleClickListener(this::onMonthTitleClick); - if (null != actionBar) { - String dateStr = df.format(monthDate); - dateStr = dateStr.substring(0, 1).toUpperCase() + dateStr.substring(1, dateStr.length()); +if (calendarView.isMultiSelectDayEnabled()) { + calendarView.setOnMultipleDaySelectedListener(this::onMultipleDaySelected); +} - actionBar.setTitle(dateStr); - } -}); +calendarView.update(Calendar.getInstance(Locale.getDefault())); ``` ##Issues From b6432bae17b445f206211816b6a1ff1521754ac4 Mon Sep 17 00:00:00 2001 From: "Jonatan E. Salas" Date: Sun, 22 Jan 2017 21:28:32 -0300 Subject: [PATCH 2/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f2f5f7..c934b74 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ ##Screenshots
- - + +
From c16f0a903ac33c52290a629478ba62f9ca8c3546 Mon Sep 17 00:00:00 2001 From: "Jonatan E. Salas" Date: Sun, 22 Jan 2017 21:29:26 -0300 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c934b74..e3d112d 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ ##Screenshots
- - + +