lets not switch to monthly view at selecting a month

This commit is contained in:
tibbi 2016-10-19 23:02:43 +02:00
parent 414cf82901
commit 7dc9cc73f7
6 changed files with 6 additions and 11 deletions

View File

@ -7,5 +7,5 @@ interface NavigationListener {
fun goRight()
fun goToDateTime(dateTime: DateTime, switchedFromYearly: Boolean)
fun goToDateTime(dateTime: DateTime)
}

View File

@ -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))
}

View File

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

View File

@ -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()

View File

@ -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()

View File

@ -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))
}
}
}