[UI] Fix displaying lists for correct profile in event manual dialog.

This commit is contained in:
Kuba Szczodrzyński 2020-03-19 20:09:35 +01:00
parent 0296c704cb
commit 3957453ed6
5 changed files with 11 additions and 11 deletions

View File

@ -174,7 +174,7 @@ class EventManualDialog(
enqueuedWeekStart = weekStart
EdziennikTask.syncProfile(
profileId = App.profileId,
profileId = profileId,
viewIds = listOf(
MainActivity.DRAWER_ITEM_TIMETABLE to 0
),
@ -210,7 +210,7 @@ class EventManualDialog(
@Subscribe(threadMode = ThreadMode.MAIN)
fun onApiTaskFinishedEvent(event: ApiTaskFinishedEvent) {
if (event.profileId == App.profileId) {
if (event.profileId == profileId) {
enqueuedWeekDialog?.dismiss()
enqueuedWeekDialog = null
progressDialog?.dismiss()
@ -241,7 +241,7 @@ class EventManualDialog(
with (b.dateDropdown) {
db = app.db
profileId = App.profileId
profileId = profileId
showWeekDays = false
showDays = true
showOtherDate = true
@ -269,7 +269,7 @@ class EventManualDialog(
with (b.timeDropdown) {
db = app.db
profileId = App.profileId
profileId = profileId
showAllDay = true
showCustomTime = true
lessonsDate = b.dateDropdown.getSelected() as? Date ?: Date.getToday()
@ -289,7 +289,7 @@ class EventManualDialog(
with (b.teamDropdown) {
db = app.db
profileId = App.profileId
profileId = profileId
showNoTeam = true
loadItems()
selectTeamClass()
@ -299,7 +299,7 @@ class EventManualDialog(
with (b.subjectDropdown) {
db = app.db
profileId = App.profileId
profileId = profileId
showNoSubject = true
showCustomSubject = false
loadItems()
@ -309,7 +309,7 @@ class EventManualDialog(
with (b.teacherDropdown) {
db = app.db
profileId = App.profileId
profileId = profileId
showNoTeacher = true
loadItems()
selectDefault(editingEvent?.teacherId)

View File

@ -73,7 +73,7 @@ class HomeDebugCard(
}
b.syncReceivers.onClick {
EdziennikTask.recipientListGet(App.profileId).enqueue(activity)
EdziennikTask.recipientListGet(profile.id).enqueue(activity)
}

View File

@ -77,7 +77,7 @@ class HomeEventsCard(
}
)
app.db.eventDao().getAllNearest(App.profileId, Date.getToday(), 4).observe(activity, Observer { events ->
app.db.eventDao().getAllNearest(profile.id, Date.getToday(), 4).observe(activity, Observer { events ->
adapter.items = events
if (b.eventsView.adapter == null) {
b.eventsView.adapter = adapter

View File

@ -60,7 +60,7 @@ class HomeLuckyNumberCard(
R.string.home_lucky_number_details
b.subText.setText(subTextRes, profile.name ?: "", profile.studentNumber)
app.db.luckyNumberDao().getNearestFuture(App.profileId, todayValue).observe(fragment, Observer { luckyNumber ->
app.db.luckyNumberDao().getNearestFuture(profile.id, todayValue).observe(fragment, Observer { luckyNumber ->
val isYours = luckyNumber?.number == profile.studentNumber
val res: Pair<Int, Array<out Any>> = when {
luckyNumber == null -> R.string.home_lucky_number_no_info to emptyArray()

View File

@ -192,7 +192,7 @@ class HomeTimetableCard(
b.noTimetableSync.onClick {
it.isEnabled = false
EdziennikTask.syncProfile(
profileId = App.profileId,
profileId = profile.id,
viewIds = listOf(
MainActivity.DRAWER_ITEM_TIMETABLE to 0
),