Skip to content

Decrease dialog's height if the description field is empty#117

Merged
Oleg-Melnik merged 3 commits into
masterfrom
cut-dialog-height-with-empty-description
Apr 18, 2025
Merged

Decrease dialog's height if the description field is empty#117
Oleg-Melnik merged 3 commits into
masterfrom
cut-dialog-height-with-empty-description

Conversation

@Oleg-Melnik
Copy link
Copy Markdown
Collaborator

@Oleg-Melnik Oleg-Melnik commented Apr 18, 2025

This PR reduces the height of the ConfirmationDialog and InputTextDialog components when the description field is not provided by the user and the dialog height remains at its default value.

@Oleg-Melnik Oleg-Melnik self-assigned this Apr 18, 2025
@Oleg-Melnik Oleg-Melnik requested a review from dpikhulya April 18, 2025 12:14
Copy link
Copy Markdown
Contributor

@dpikhulya dpikhulya left a comment

Choose a reason for hiding this comment

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

@Oleg-Melnik LGTM with some notes below.

*/
public suspend fun showConfirmation(): Boolean {
if (description.isBlank() && height == DefaultDialogHeight) {
height -= ReservedDescriptionHeight
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As discussed, please also create an issue to try to implement some automatic size detection mechanisms for dialogs in general, and place a respective TODO here. This way, it will be clear that this is an intermediate approach.

*/
private suspend fun show(): String? {
if (description.isBlank() && height == DefaultDialogHeight) {
height -= ReservedDescriptionHeight
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same thing — add a TODO for a future more sound solution.

@Oleg-Melnik Oleg-Melnik merged commit 4e61dad into master Apr 18, 2025
5 checks passed
@Oleg-Melnik Oleg-Melnik deleted the cut-dialog-height-with-empty-description branch April 18, 2025 13:45
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.

2 participants