mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-02-22 06:24:44 +01:00
[UI] Fix displaying lists for correct profile in event manual dialog.
This commit is contained in:
parent
0296c704cb
commit
3957453ed6
@ -174,7 +174,7 @@ class EventManualDialog(
|
|||||||
enqueuedWeekStart = weekStart
|
enqueuedWeekStart = weekStart
|
||||||
|
|
||||||
EdziennikTask.syncProfile(
|
EdziennikTask.syncProfile(
|
||||||
profileId = App.profileId,
|
profileId = profileId,
|
||||||
viewIds = listOf(
|
viewIds = listOf(
|
||||||
MainActivity.DRAWER_ITEM_TIMETABLE to 0
|
MainActivity.DRAWER_ITEM_TIMETABLE to 0
|
||||||
),
|
),
|
||||||
@ -210,7 +210,7 @@ class EventManualDialog(
|
|||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
fun onApiTaskFinishedEvent(event: ApiTaskFinishedEvent) {
|
fun onApiTaskFinishedEvent(event: ApiTaskFinishedEvent) {
|
||||||
if (event.profileId == App.profileId) {
|
if (event.profileId == profileId) {
|
||||||
enqueuedWeekDialog?.dismiss()
|
enqueuedWeekDialog?.dismiss()
|
||||||
enqueuedWeekDialog = null
|
enqueuedWeekDialog = null
|
||||||
progressDialog?.dismiss()
|
progressDialog?.dismiss()
|
||||||
@ -241,7 +241,7 @@ class EventManualDialog(
|
|||||||
|
|
||||||
with (b.dateDropdown) {
|
with (b.dateDropdown) {
|
||||||
db = app.db
|
db = app.db
|
||||||
profileId = App.profileId
|
profileId = profileId
|
||||||
showWeekDays = false
|
showWeekDays = false
|
||||||
showDays = true
|
showDays = true
|
||||||
showOtherDate = true
|
showOtherDate = true
|
||||||
@ -269,7 +269,7 @@ class EventManualDialog(
|
|||||||
|
|
||||||
with (b.timeDropdown) {
|
with (b.timeDropdown) {
|
||||||
db = app.db
|
db = app.db
|
||||||
profileId = App.profileId
|
profileId = profileId
|
||||||
showAllDay = true
|
showAllDay = true
|
||||||
showCustomTime = true
|
showCustomTime = true
|
||||||
lessonsDate = b.dateDropdown.getSelected() as? Date ?: Date.getToday()
|
lessonsDate = b.dateDropdown.getSelected() as? Date ?: Date.getToday()
|
||||||
@ -289,7 +289,7 @@ class EventManualDialog(
|
|||||||
|
|
||||||
with (b.teamDropdown) {
|
with (b.teamDropdown) {
|
||||||
db = app.db
|
db = app.db
|
||||||
profileId = App.profileId
|
profileId = profileId
|
||||||
showNoTeam = true
|
showNoTeam = true
|
||||||
loadItems()
|
loadItems()
|
||||||
selectTeamClass()
|
selectTeamClass()
|
||||||
@ -299,7 +299,7 @@ class EventManualDialog(
|
|||||||
|
|
||||||
with (b.subjectDropdown) {
|
with (b.subjectDropdown) {
|
||||||
db = app.db
|
db = app.db
|
||||||
profileId = App.profileId
|
profileId = profileId
|
||||||
showNoSubject = true
|
showNoSubject = true
|
||||||
showCustomSubject = false
|
showCustomSubject = false
|
||||||
loadItems()
|
loadItems()
|
||||||
@ -309,7 +309,7 @@ class EventManualDialog(
|
|||||||
|
|
||||||
with (b.teacherDropdown) {
|
with (b.teacherDropdown) {
|
||||||
db = app.db
|
db = app.db
|
||||||
profileId = App.profileId
|
profileId = profileId
|
||||||
showNoTeacher = true
|
showNoTeacher = true
|
||||||
loadItems()
|
loadItems()
|
||||||
selectDefault(editingEvent?.teacherId)
|
selectDefault(editingEvent?.teacherId)
|
||||||
|
@ -73,7 +73,7 @@ class HomeDebugCard(
|
|||||||
}
|
}
|
||||||
|
|
||||||
b.syncReceivers.onClick {
|
b.syncReceivers.onClick {
|
||||||
EdziennikTask.recipientListGet(App.profileId).enqueue(activity)
|
EdziennikTask.recipientListGet(profile.id).enqueue(activity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
adapter.items = events
|
||||||
if (b.eventsView.adapter == null) {
|
if (b.eventsView.adapter == null) {
|
||||||
b.eventsView.adapter = adapter
|
b.eventsView.adapter = adapter
|
||||||
|
@ -60,7 +60,7 @@ class HomeLuckyNumberCard(
|
|||||||
R.string.home_lucky_number_details
|
R.string.home_lucky_number_details
|
||||||
b.subText.setText(subTextRes, profile.name ?: "", profile.studentNumber)
|
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 isYours = luckyNumber?.number == profile.studentNumber
|
||||||
val res: Pair<Int, Array<out Any>> = when {
|
val res: Pair<Int, Array<out Any>> = when {
|
||||||
luckyNumber == null -> R.string.home_lucky_number_no_info to emptyArray()
|
luckyNumber == null -> R.string.home_lucky_number_no_info to emptyArray()
|
||||||
|
@ -192,7 +192,7 @@ class HomeTimetableCard(
|
|||||||
b.noTimetableSync.onClick {
|
b.noTimetableSync.onClick {
|
||||||
it.isEnabled = false
|
it.isEnabled = false
|
||||||
EdziennikTask.syncProfile(
|
EdziennikTask.syncProfile(
|
||||||
profileId = App.profileId,
|
profileId = profile.id,
|
||||||
viewIds = listOf(
|
viewIds = listOf(
|
||||||
MainActivity.DRAWER_ITEM_TIMETABLE to 0
|
MainActivity.DRAWER_ITEM_TIMETABLE to 0
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user