-
Notifications
You must be signed in to change notification settings - Fork 1
Feature
: Display course wide notifications management
#646
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
base: develop
Are you sure you want to change the base?
Conversation
Feature
: Display course notifications management
Feature
: Display course notifications managementFeature
: Display course wide notifications management
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.
Thank you for enabling the new notifications for Android :)
I have a few code comments and one other remark: In the app settings (accessible from the dashboard), the user can still access the old (disabled) notification settings. We can remove these as part of this PR as we now have the replacement :D
TopAppBar( | ||
title = { Text(stringResource(R.string.notification_settings)) }, | ||
navigationIcon = { | ||
IconButton(onClick = onNavigateBack) { |
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 have a own composable for this: NavigationBackButton
:)
BasicDataStateUi( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(padding), |
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.
Add .consumeWindowInsets()
here
) { | ||
Card( | ||
shape = MaterialTheme.shapes.medium, | ||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceContainer), |
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 line could be removed (let me know if not)
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.background(MaterialTheme.colorScheme.surfaceContainer) |
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.
Same for this one background color
Card( | ||
shape = MaterialTheme.shapes.medium, | ||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceContainer), | ||
elevation = CardDefaults.cardElevation(defaultElevation = 0.dp) |
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.
Also the default elevation should be 0.dp if I'm not mistaken
import de.tum.informatics.www1.artemis.native_app.feature.coursenotifications.course_notification_model.NotificationSettings | ||
import de.tum.informatics.www1.artemis.native_app.feature.coursenotifications.course_notification_model.NotificationSettingsInfo | ||
|
||
interface CourseNotificationSettingsService { |
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.
add : LoggedInBasedService
here
) { serverUrl, authToken, _ -> serverUrl to authToken } | ||
.flatMapLatest { (serverUrl, authToken) -> | ||
retryOnInternet(networkStatusProvider.currentNetworkStatus) { | ||
courseNotificationSettingsService.getNotificationSettingsInfo( |
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.
And then make use the of the performAutoReloadingNetworkCall
method here and for the other network calls in this viewmodel
) | ||
} | ||
} | ||
.stateIn(viewModelScope + coroutineContext, SharingStarted.Eagerly, DataState.Loading()) |
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.
There is also a stateIn
method for DataStates that does not need the last parameter. (.stateIn(viewModelScope + coroutineContext, SharingStarted.Eagerly)
)
<string name="settings_preset_description_all_activity">Receive all notifications to stay on track at all times.</string> | ||
<string name="settings_preset_description_ignore_all">Receive no notifications for the course.</string> | ||
|
||
<string name="setting_disclaimer">These settings manage push notifications. To manage Email notifications, please use a browser.; |
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.
The ;
at the end is by mistake?
Problem Description
The course-wide notification management is not possible like ios and web.
Changes
Add icon to top bar, on click to bell icon display course wide notification management.
Steps for testing
Screenshots
Screen.Recording.2025-06-15.at.10.51.57.mov