Merge pull request #5845 from element-hq/feature/bma/unsavedChangeDialog

Update unsaved change dialog
This commit is contained in:
Benoit Marty 2025-12-04 11:03:42 +01:00 committed by GitHub
commit b20ccf8b63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
59 changed files with 537 additions and 468 deletions

View file

@ -17,16 +17,22 @@ import io.element.android.libraries.ui.strings.CommonStrings
@Composable
fun SaveChangesDialog(
onSubmitClick: () -> Unit,
onSaveClick: () -> Unit,
onDiscardClick: () -> Unit,
onDismiss: () -> Unit,
modifier: Modifier = Modifier,
title: String = stringResource(CommonStrings.dialog_unsaved_changes_title),
content: String = stringResource(CommonStrings.dialog_unsaved_changes_description_android),
content: String = stringResource(CommonStrings.dialog_unsaved_changes_description),
submitText: String = stringResource(CommonStrings.action_save),
cancelText: String = stringResource(CommonStrings.action_discard),
) = ConfirmationDialog(
modifier = modifier,
title = title,
content = content,
onSubmitClick = onSubmitClick,
submitText = submitText,
cancelText = cancelText,
onSubmitClick = onSaveClick,
onCancelClick = onDiscardClick,
onDismiss = onDismiss,
)
@ -34,7 +40,8 @@ fun SaveChangesDialog(
@Composable
internal fun SaveChangesDialogPreview() = ElementPreview {
SaveChangesDialog(
onSubmitClick = {},
onSaveClick = {},
onDiscardClick = {},
onDismiss = {}
)
}

View file

@ -38,6 +38,7 @@
<string name="notification_room_invite_body_with_sender">"%1$s invited you to join the room"</string>
<string name="notification_sender_me">"Me"</string>
<string name="notification_sender_mention_reply">"%1$s mentioned or replied"</string>
<string name="notification_space_invite_body">"Invited you to join the space"</string>
<string name="notification_test_push_notification_content">"You are viewing the notification! Click me!"</string>
<string name="notification_thread_in_room">"Thread in %1$s"</string>
<string name="notification_ticker_text_dm">"%1$s: %2$s"</string>

View file

@ -392,6 +392,7 @@ Are you sure you want to continue?"</string>
<string name="dialog_title_error">"Error"</string>
<string name="dialog_title_success">"Success"</string>
<string name="dialog_title_warning">"Warning"</string>
<string name="dialog_unsaved_changes_description">"You have unsaved changes."</string>
<string name="dialog_unsaved_changes_description_android">"Your changes have not been saved. Are you sure you want to go back?"</string>
<string name="dialog_unsaved_changes_title">"Save changes?"</string>
<string name="dialog_video_quality_selector_subtitle_file_size">"The max file size allowed is: %1$s"</string>