diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt index e20a00022..1fdd892c8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt @@ -67,7 +67,7 @@ class YearFragment : Fragment(), YearlyCalendar { if (!mSundayFirst) dayOfWeek-- - monthView.setFirstDay(dayOfWeek) + monthView.firstDay = dayOfWeek monthView.setOnClickListener { mListener?.goToDateTime(DateTime().withDate(mYear, i, 1)) } @@ -81,7 +81,7 @@ class YearFragment : Fragment(), YearlyCalendar { monthLabel.setTextColor(context.config.primaryColor) val monthView = mView.findViewById(res.getIdentifier("month_${now.monthOfYear}", "id", activity.packageName)) as SmallMonthView - monthView.setTodaysId(now.dayOfMonth) + monthView.todaysId = now.dayOfMonth } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/views/SmallMonthView.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/views/SmallMonthView.kt index 6c2451af9..61cdd607f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/views/SmallMonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/views/SmallMonthView.kt @@ -19,11 +19,12 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie private var textColor = 0 private var coloredTextColor = 0 private var days = 31 - private var firstDay = 0 - private var todaysId = 0 private var isLandscape = false private var mEvents: ArrayList? = null + var firstDay = 0 + var todaysId = 0 + constructor(context: Context, attrs: AttributeSet) : this(context, attrs, 0) fun setDays(days: Int) { @@ -31,19 +32,11 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie invalidate() } - fun setFirstDay(firstDay: Int) { - this.firstDay = firstDay - } - fun setEvents(events: ArrayList?) { mEvents = events post { invalidate() } } - fun setTodaysId(id: Int) { - todaysId = id - } - init { val attributes = context.theme.obtainStyledAttributes( attrs,