Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel notifications if feedback was given. #228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ val uiModule = module {
feedbackDialogFactory = get(),
syncService = get(),
notificationSchedulingService = get(),
notificationService = get(),
feedbackService = get(),
settingsGateway = get(),
)
Expand Down Expand Up @@ -78,6 +79,7 @@ val uiModule = module {
settingsGateway = get(),
feedbackDialogFactory = get(),
feedbackService = get(),
notificationService = get(),
)
}
single { SpeakerListItemViewModel.Factory() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package co.touchlab.droidcon.viewmodel
import co.touchlab.droidcon.application.gateway.SettingsGateway
import co.touchlab.droidcon.application.service.Notification
import co.touchlab.droidcon.application.service.NotificationSchedulingService
import co.touchlab.droidcon.application.service.NotificationService
import co.touchlab.droidcon.domain.service.FeedbackService
import co.touchlab.droidcon.domain.service.SyncService
import co.touchlab.droidcon.service.DeepLinkNotificationHandler
Expand All @@ -21,6 +22,7 @@ class ApplicationViewModel(
private val feedbackDialogFactory: FeedbackDialogViewModel.Factory,
private val syncService: SyncService,
private val notificationSchedulingService: NotificationSchedulingService,
private val notificationService: NotificationService,
private val feedbackService: FeedbackService,
private val settingsGateway: SettingsGateway,
) : BaseViewModel(), DeepLinkNotificationHandler {
Expand Down Expand Up @@ -88,6 +90,7 @@ class ApplicationViewModel(
session,
submit = { feedback ->
feedbackService.submit(session, feedback)
notificationService.cancel(listOf(session.id))
presentNextFeedback()
},
closeAndDisable = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package co.touchlab.droidcon.viewmodel.session

import co.touchlab.droidcon.application.gateway.SettingsGateway
import co.touchlab.droidcon.application.service.NotificationService
import co.touchlab.droidcon.domain.composite.ScheduleItem
import co.touchlab.droidcon.domain.gateway.SessionGateway
import co.touchlab.droidcon.domain.service.DateTimeService
Expand Down Expand Up @@ -31,6 +32,7 @@ class SessionDetailViewModel(
private val dateTimeService: DateTimeService,
private val parseUrlViewService: ParseUrlViewService,
private val feedbackService: FeedbackService,
private val notificationService: NotificationService,
initialItem: ScheduleItem,
) : BaseViewModel() {

Expand Down Expand Up @@ -126,6 +128,7 @@ class SessionDetailViewModel(
item.session,
submit = { feedback ->
feedbackService.submit(item.session, feedback)
notificationService.cancel(listOf(item.session.id))
presentedFeedback = null
},
closeAndDisable = null,
Expand Down Expand Up @@ -156,6 +159,7 @@ class SessionDetailViewModel(
private val dateTimeService: DateTimeService,
private val parseUrlViewService: ParseUrlViewService,
private val feedbackService: FeedbackService,
private val notificationService: NotificationService,
) {

fun create(
Expand All @@ -170,6 +174,7 @@ class SessionDetailViewModel(
dateTimeService,
parseUrlViewService,
feedbackService,
notificationService,
item,
)
}
Expand Down
Loading