remove some private variables

This commit is contained in:
tibbi 2017-09-10 16:44:23 +02:00
parent 1d7ba8ee0a
commit fcb2725309
2 changed files with 5 additions and 12 deletions

View File

@ -67,7 +67,7 @@ class YearFragment : Fragment(), YearlyCalendar {
if (!mSundayFirst) if (!mSundayFirst)
dayOfWeek-- dayOfWeek--
monthView.setFirstDay(dayOfWeek) monthView.firstDay = dayOfWeek
monthView.setOnClickListener { monthView.setOnClickListener {
mListener?.goToDateTime(DateTime().withDate(mYear, i, 1)) mListener?.goToDateTime(DateTime().withDate(mYear, i, 1))
} }
@ -81,7 +81,7 @@ class YearFragment : Fragment(), YearlyCalendar {
monthLabel.setTextColor(context.config.primaryColor) monthLabel.setTextColor(context.config.primaryColor)
val monthView = mView.findViewById(res.getIdentifier("month_${now.monthOfYear}", "id", activity.packageName)) as SmallMonthView val monthView = mView.findViewById(res.getIdentifier("month_${now.monthOfYear}", "id", activity.packageName)) as SmallMonthView
monthView.setTodaysId(now.dayOfMonth) monthView.todaysId = now.dayOfMonth
} }
} }

View File

@ -19,11 +19,12 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
private var textColor = 0 private var textColor = 0
private var coloredTextColor = 0 private var coloredTextColor = 0
private var days = 31 private var days = 31
private var firstDay = 0
private var todaysId = 0
private var isLandscape = false private var isLandscape = false
private var mEvents: ArrayList<Int>? = null private var mEvents: ArrayList<Int>? = null
var firstDay = 0
var todaysId = 0
constructor(context: Context, attrs: AttributeSet) : this(context, attrs, 0) constructor(context: Context, attrs: AttributeSet) : this(context, attrs, 0)
fun setDays(days: Int) { fun setDays(days: Int) {
@ -31,19 +32,11 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
invalidate() invalidate()
} }
fun setFirstDay(firstDay: Int) {
this.firstDay = firstDay
}
fun setEvents(events: ArrayList<Int>?) { fun setEvents(events: ArrayList<Int>?) {
mEvents = events mEvents = events
post { invalidate() } post { invalidate() }
} }
fun setTodaysId(id: Int) {
todaysId = id
}
init { init {
val attributes = context.theme.obtainStyledAttributes( val attributes = context.theme.obtainStyledAttributes(
attrs, attrs,