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

style: Dates Tab Shift Due Dates Success SnackBar Design Changes #264

Merged

Conversation

farhan-arshad-dev
Copy link
Contributor

@farhan-arshad-dev farhan-arshad-dev commented Mar 20, 2024

Description

  • Dates Tab Shift Due Dates Success SnackBar Design Changes

Jira: LEARNER-9868
Github issue: [Android] Shift Dates (PLS) Design Changes

Old New
Screenshot_20240320_155845 Screenshot_20240320_155406

@@ -8,5 +8,7 @@ sealed class UIMessage {
val duration: SnackbarDuration = SnackbarDuration.Long,
) : UIMessage()

class DatesShiftedSnackBar : UIMessage()
Copy link
Contributor

@volodymyr-chekyrta volodymyr-chekyrta Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we relocate class DatesShiftedSnackBar: UIMessage() within the course module?
It appears unnecessary to inform the core module about Dates functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inheritance of sealed classes or interfaces from different module is prohibited, to move Dates Shifted SnackBar into the course module need to make open instead of sealed.

thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relocated.

Comment on lines 390 to 395
@Composable
fun DatesShiftedSnackBar(
showAction: Boolean = false,
onViewDates: () -> Unit? = {},
onClose: () -> Unit? = {},
) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be moved as well to the CourseUI.kt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved.

val snackState = remember { SnackbarHostState() }
if (uiMessage is UIMessage.DatesShiftedSnackBar) {
LaunchedEffect(uiMessage) {
snackState.showSnackbar(message = "Dates Shifted", duration = SnackbarDuration.Long)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this text to resources

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved.

val snackState = remember { SnackbarHostState() }
if (uiMessage is UIMessage.DatesShiftedSnackBar) {
LaunchedEffect(uiMessage) {
snackState.showSnackbar(message = "Dates Shifted", duration = SnackbarDuration.Long)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this text to resources

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved.

modifier = Modifier
.padding(top = 4.dp)
.fillMaxWidth(),
text = stringResource(id = org.openedx.core.R.string.core_dates_shift_dates_successfully_msg),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move org.openedx.core.R to import import org.openedx.core.R as CoreR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved.

@farhan-arshad-dev farhan-arshad-dev merged commit 1930739 into openedx:develop Mar 26, 2024
3 checks passed
@farhan-arshad-dev farhan-arshad-dev deleted the farhan_ar/LEARNER-9868 branch March 26, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Shift Dates (PLS) Design Changes
3 participants