diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 00000000..9ffcbb8a
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+Szkolny.eu
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 15ef006b..24f8c447 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,6 +11,7 @@
+
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt
index 89af0ed3..c27fa7d0 100644
--- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt
@@ -92,7 +92,7 @@ class DayDialog(
onEventEditClick = {
EventManualDialog(
activity,
- profileId,
+ it.profileId,
editingEvent = it,
onShowListener = onShowListener,
onDismissListener = onDismissListener
@@ -105,6 +105,7 @@ class DayDialog(
if (b.eventsView.adapter == null) {
b.eventsView.adapter = adapter
b.eventsView.apply {
+ isNestedScrollingEnabled = false
setHasFixedSize(true)
layoutManager = LinearLayoutManager(context)
addItemDecoration(SimpleDividerItemDecoration(context))
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt
index fe529f5c..223bf1f8 100644
--- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt
@@ -461,7 +461,7 @@ class EventManualDialog(
b.teacherDropdown.deselect()
}
else {
- defaultTime?.let {
+ val setTime: (Time) -> Unit = {
event.startTime = it
if (b.timeDropdown.select(it) == null)
b.timeDropdown.select(TextInputDropDown.Item(
@@ -470,23 +470,10 @@ class EventManualDialog(
tag = it
))
}
-
- editingEvent?.startTime?.let {
- if (b.timeDropdown.select(it) == null)
- b.timeDropdown.select(TextInputDropDown.Item(
- it.value.toLong(),
- it.stringHM,
- tag = it
- ))
- }
-
- defaultLesson?.let {
- b.timeDropdown.select(it.displayStartTime?.value?.toLong())
- }
-
- defaultHour?.let {
- b.timeDropdown.select(it.value.toLong())
- }
+ defaultTime?.let(setTime)
+ editingEvent?.startTime?.let(setTime)
+ defaultLesson?.displayStartTime?.let(setTime)
+ defaultHour?.let(setTime)
}
defaultLoaded = true
b.timeDropdown.isEnabled = true
@@ -554,7 +541,7 @@ class EventManualDialog(
private fun saveEvent() {
val date = b.dateDropdown.selected?.tag.instanceOfOrNull()
- val lesson = b.timeDropdown.selected?.tag.instanceOfOrNull()
+ val startTime = b.timeDropdown.selected?.tag.instanceOfOrNull