Skip to content

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

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

eylulnc
Copy link
Contributor

@eylulnc eylulnc commented Jun 12, 2025

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

  1. Open a Course
  2. On the right top see bell icon.
  3. Click on the icon
  4. See the course wide notification management is visible
  5. Change the settings, see if the web is also in sync.
  6. Verify it works as it should be.

Screenshots

Screenshot 2025-06-15 at 10 37 39 Screenshot 2025-06-15 at 10 37 46
Screen.Recording.2025-06-15.at.10.51.57.mov

@eylulnc eylulnc changed the title display course notifications managmenet Feature: Display course notifications management Jun 15, 2025
@eylulnc eylulnc marked this pull request as ready for review June 15, 2025 08:54
@eylulnc eylulnc self-assigned this Jun 15, 2025
@eylulnc eylulnc changed the title Feature: Display course notifications management Feature: Display course wide notifications management Jun 15, 2025
@eylulnc eylulnc added the ready for review This PR can be reviewed label Jun 15, 2025
Copy link
Collaborator

@FelberMartin FelberMartin left a 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) {
Copy link
Collaborator

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),
Copy link
Collaborator

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),
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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 {
Copy link
Collaborator

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(
Copy link
Collaborator

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())
Copy link
Collaborator

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.;
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR can be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants