diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt index 957365b00..49695e648 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt @@ -108,6 +108,8 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener { fillYearlyViewPager() } else if (config.storedView == EVENTS_LIST_VIEW) { fillEventsList() + } else if (config.storedView == WEEKLY_VIEW) { + } else { val targetDay = DateTime().toString(Formatter.DAYCODE_PATTERN) fillMonthlyViewPager(targetDay) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ChangeViewDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ChangeViewDialog.kt index cb97799ec..627f5b331 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ChangeViewDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ChangeViewDialog.kt @@ -8,6 +8,7 @@ import com.simplemobiletools.calendar.R import com.simplemobiletools.calendar.extensions.config import com.simplemobiletools.calendar.helpers.EVENTS_LIST_VIEW import com.simplemobiletools.calendar.helpers.MONTHLY_VIEW +import com.simplemobiletools.calendar.helpers.WEEKLY_VIEW import com.simplemobiletools.calendar.helpers.YEARLY_VIEW import com.simplemobiletools.commons.extensions.setupDialogStuff import kotlinx.android.synthetic.main.dialog_change_views.view.* @@ -33,12 +34,14 @@ class ChangeViewDialog(val activity: Activity, val callback: (newView: Int) -> U } fun getNewView(id: Int) = when (id) { + R.id.dialog_radio_weekly -> WEEKLY_VIEW R.id.dialog_radio_yearly -> YEARLY_VIEW R.id.dialog_radio_events_list -> EVENTS_LIST_VIEW else -> MONTHLY_VIEW } fun getSavedItem() = when (activity.config.storedView) { + WEEKLY_VIEW -> R.id.dialog_radio_weekly YEARLY_VIEW -> R.id.dialog_radio_yearly EVENTS_LIST_VIEW -> R.id.dialog_radio_events_list else -> R.id.dialog_radio_monthly diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt index 9de7adb15..0e9f529b3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt @@ -12,6 +12,7 @@ val EVENT_ID = "event_id" val MONTHLY_VIEW = 1 val YEARLY_VIEW = 2 val EVENTS_LIST_VIEW = 3 +val WEEKLY_VIEW = 4 val REMINDER_OFF = -1 val REMINDER_AT_START = 0 diff --git a/app/src/main/res/layout/dialog_change_views.xml b/app/src/main/res/layout/dialog_change_views.xml index e0e6d5675..ba73d6809 100644 --- a/app/src/main/res/layout/dialog_change_views.xml +++ b/app/src/main/res/layout/dialog_change_views.xml @@ -6,6 +6,14 @@ android:layout_height="wrap_content" android:padding="@dimen/activity_margin"> + +