diff --git a/agendacalendar/src/main/java/com/jaiselrahman/agendacalendar/view/AgendaCalendar.java b/agendacalendar/src/main/java/com/jaiselrahman/agendacalendar/view/AgendaCalendar.java index 0c0dc44..a4bb43c 100644 --- a/agendacalendar/src/main/java/com/jaiselrahman/agendacalendar/view/AgendaCalendar.java +++ b/agendacalendar/src/main/java/com/jaiselrahman/agendacalendar/view/AgendaCalendar.java @@ -51,7 +51,7 @@ public class AgendaCalendar extends CoordinatorLayout { private CalendarView calendarView; private AgendaView agendaView; - private CalenderListener calenderListener; + private CalendarListener calendarListener; private View hideElevationFor = null; private AppBarLayout calendarViewParent; @@ -127,8 +127,8 @@ private void init(Context context, @Nullable AttributeSet attrs, int defStyleAtt verticalOffset = Math.abs(verticalOffset); //Fully visible - if (verticalOffset == 0 && calenderListener != null) { - calenderListener.onCalendarVisibilityChange(true); + if (verticalOffset == 0 && calendarListener != null) { + calendarListener.onCalendarVisibilityChange(true); } //Partially visible @@ -139,8 +139,8 @@ private void init(Context context, @Nullable AttributeSet attrs, int defStyleAtt //Fully collapsed if (verticalOffset == appBarLayout.getTotalScrollRange()) { - if (calenderListener != null) { - calenderListener.onCalendarVisibilityChange(false); + if (calendarListener != null) { + calendarListener.onCalendarVisibilityChange(false); } } }); @@ -182,8 +182,8 @@ private void init(Context context, @Nullable AttributeSet attrs, int defStyleAtt } currentRowCount = calendarMonth.getWeekDays().size(); - if (calenderListener != null) { - calenderListener.onMonthScroll(calendarMonth.getYearMonth()); + if (calendarListener != null) { + calendarListener.onMonthScroll(calendarMonth.getYearMonth()); } LocalDate date = calendarMonth.getYearMonth().atDay(1); @@ -232,12 +232,12 @@ public void hideElevationFor(@NonNull AppBarLayout toolbar) { this.hideElevationFor = toolbar; } - public void setListener(CalenderListener calenderListener) { - this.calenderListener = calenderListener; - ((CDayBinder) calendarView.getDayBinder()).setCalenderListener(calenderListener); + public void setListener(CalendarListener calendarListener) { + this.calendarListener = calendarListener; + ((CDayBinder) calendarView.getDayBinder()).setCalendarListener(calendarListener); } - public interface CalenderListener { + public interface CalendarListener { void onDayClick(LocalDate date); void onMonthScroll(YearMonth yearMonth); @@ -262,7 +262,7 @@ private void setSelectedDate(LocalDate date) { private class CDayBinder implements DayBinder { private AgendaView agendaView; - private CalenderListener calenderListener; + private CalendarListener calendarListener; CDayBinder(AgendaView agendaView) { this.agendaView = agendaView; @@ -271,7 +271,7 @@ private class CDayBinder implements DayBinder { @Override @NonNull public DayViewContainer create(@NonNull View view) { - return new DayViewContainer(view, calenderListener); + return new DayViewContainer(view, calendarListener); } @Override @@ -286,8 +286,8 @@ public void bind(@NonNull DayViewContainer container, @NotNull CalendarDay day) container.bind(day, eventColors); } - void setCalenderListener(CalenderListener calenderListener) { - this.calenderListener = calenderListener; + void setCalendarListener(CalendarListener calendarListener) { + this.calendarListener = calendarListener; } } @@ -296,7 +296,7 @@ private class DayViewContainer extends ViewContainer { private TextView textView; private EventIndicatorView indicator; - DayViewContainer(View view, CalenderListener calenderListener) { + DayViewContainer(View view, CalendarListener calendarListener) { super(view); textView = view.findViewById(R.id.calendarDayText); indicator = view.findViewById(R.id.eventIndicator); @@ -306,7 +306,7 @@ private class DayViewContainer extends ViewContainer { view.setOnClickListener(v -> { setSelectedDate(currentDay.getDate()); scrollAgendaViewTo(currentDay.getDate()); - calenderListener.onDayClick(currentDay.getDate()); + calendarListener.onDayClick(currentDay.getDate()); }); } diff --git a/app/src/main/java/com/jaiselrahman/agendacalendarsample/activity/MainActivity.java b/app/src/main/java/com/jaiselrahman/agendacalendarsample/activity/MainActivity.java index 3097283..1369cf0 100644 --- a/app/src/main/java/com/jaiselrahman/agendacalendarsample/activity/MainActivity.java +++ b/app/src/main/java/com/jaiselrahman/agendacalendarsample/activity/MainActivity.java @@ -73,7 +73,7 @@ protected void onCreate(Bundle savedInstanceState) { } }); - agendaCalendar.setListener(new AgendaCalendar.CalenderListener() { + agendaCalendar.setListener(new AgendaCalendar.CalendarListener() { @Override public void onDayClick(LocalDate date) {