lets not switch to monthly view at selecting a month
This commit is contained in:
parent
414cf82901
commit
7dc9cc73f7
|
@ -7,5 +7,5 @@ interface NavigationListener {
|
|||
|
||||
fun goRight()
|
||||
|
||||
fun goToDateTime(dateTime: DateTime, switchedFromYearly: Boolean)
|
||||
fun goToDateTime(dateTime: DateTime)
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class DayActivity : SimpleActivity(), DayFragment.DeleteListener, ViewPager.OnPa
|
|||
view_pager.currentItem = view_pager.currentItem + 1
|
||||
}
|
||||
|
||||
override fun goToDateTime(dateTime: DateTime, switchedFromYearly: Boolean) {
|
||||
override fun goToDateTime(dateTime: DateTime) {
|
||||
checkDeleteEvents()
|
||||
fillViewPager(Formatter.getDayCodeFromDateTime(dateTime))
|
||||
}
|
||||
|
|
|
@ -150,12 +150,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||
view_pager.currentItem = view_pager.currentItem + 1
|
||||
}
|
||||
|
||||
override fun goToDateTime(dateTime: DateTime, switchedFromYearly: Boolean) {
|
||||
override fun goToDateTime(dateTime: DateTime) {
|
||||
fillMonthlyViewPager(Formatter.getDayCodeFromDateTime(dateTime))
|
||||
|
||||
if (switchedFromYearly) {
|
||||
mConfig.view = Constants.MONTHLY_VIEW
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
|
|||
val year = datePicker.year
|
||||
val day = datePicker.dayOfMonth
|
||||
val newDateTime = dateTime.withDayOfMonth(day).withMonthOfYear(month).withYear(year)
|
||||
mListener?.goToDateTime(newDateTime, false)
|
||||
mListener?.goToDateTime(newDateTime)
|
||||
}
|
||||
|
||||
show()
|
||||
|
|
|
@ -127,7 +127,7 @@ class MonthFragment : Fragment(), Calendar {
|
|||
val month = datePicker.month + 1
|
||||
val year = datePicker.year
|
||||
val newDateTime = dateTime.withDayOfMonth(1).withMonthOfYear(month).withYear(year)
|
||||
mListener?.goToDateTime(newDateTime, false)
|
||||
mListener?.goToDateTime(newDateTime)
|
||||
}
|
||||
|
||||
show()
|
||||
|
|
|
@ -49,7 +49,7 @@ class YearFragment : Fragment() {
|
|||
|
||||
monthView.setFirstDay(dayOfWeek)
|
||||
monthView.setOnClickListener {
|
||||
mListener?.goToDateTime(DateTime().withDayOfMonth(1).withMonthOfYear(i).withYear(mYear), true)
|
||||
mListener?.goToDateTime(DateTime().withDayOfMonth(1).withMonthOfYear(i).withYear(mYear))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue