Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jaiselrahman committed Dec 24, 2019
1 parent 79220d8 commit 029c81a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
}
});
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -262,7 +262,7 @@ private void setSelectedDate(LocalDate date) {

private class CDayBinder implements DayBinder<DayViewContainer> {
private AgendaView agendaView;
private CalenderListener calenderListener;
private CalendarListener calendarListener;

CDayBinder(AgendaView agendaView) {
this.agendaView = agendaView;
Expand All @@ -271,7 +271,7 @@ private class CDayBinder implements DayBinder<DayViewContainer> {
@Override
@NonNull
public DayViewContainer create(@NonNull View view) {
return new DayViewContainer(view, calenderListener);
return new DayViewContainer(view, calendarListener);
}

@Override
Expand All @@ -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;
}
}

Expand All @@ -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);
Expand All @@ -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());
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 029c81a

Please sign in to comment.