-
Notifications
You must be signed in to change notification settings - Fork 101
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
[MBL-18013][Student][Parent] Refactor reminder logic #2628
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -160,4 +165,25 @@ class ApplicationModule { | |||
): OfflineAnalyticsManager { | |||
return OfflineAnalyticsManager(context, analytics, pageViewUtils, apiPrefs, dateTimeProvider, featureFlagProvider) | |||
} | |||
|
|||
@Provides | |||
fun provideDateTimePicker(): DateTimePicker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we providing these in the Application scope?
onReminderSelected(choices[which]) | ||
dialog.dismiss() | ||
private fun showCreateReminderDialog(context: Context) { | ||
viewModel.assignment?.let { assignment -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this logic belongs to the ViewModel. It would be nice to keep the unidirectional data flow also and not request data from the ViewModel.
@@ -451,7 +468,7 @@ class AssignmentDetailsViewModel @Inject constructor( | |||
quizDetails = quizViewViewData, | |||
attemptsViewData = attemptsViewData, | |||
hasDraft = hasDraft, | |||
showReminders = assignment.dueDate?.after(Date()).orDefault(), | |||
showReminders = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this will always be true with the new logic. Maybe we don't need this condition anymore.
import kotlinx.coroutines.flow.callbackFlow | ||
import java.util.Calendar | ||
|
||
class DateTimePicker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have some extensions for Date and Time pickers in the compose/Utils.kt
file. Maybe you can take a look and see if that can be reused.
Test plan:
refs: MBL-18013
affects: Student
release note: Reminders can be set for assignments without due date.
Screenshots
Checklist