Skip to content

Commit

Permalink
feat: scrollable dialogs [WPB-1681] (#2552)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garzas authored Jan 2, 2024
1 parent 1ff4f2e commit cd5d92d
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions app/src/main/kotlin/com/wire/android/ui/common/WireDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -200,21 +201,27 @@ private fun WireDialogContent(
}
}
text?.let {
ClickableText(
text = text,
style = MaterialTheme.wireTypography.body01,
modifier = Modifier.padding(
top = MaterialTheme.wireDimensions.dialogTextsSpacing,
bottom = MaterialTheme.wireDimensions.dialogTextsSpacing,
),
onClick = { offset ->
text.getStringAnnotations(
tag = MarkdownConstants.TAG_URL,
start = offset,
end = offset,
).firstOrNull()?.let { result -> uriHandler.openUri(result.item) }
LazyColumn(modifier = Modifier
.weight(1f, fill = false)
.fillMaxWidth()) {
item {
ClickableText(
text = text,
style = MaterialTheme.wireTypography.body01,
modifier = Modifier.padding(
top = MaterialTheme.wireDimensions.dialogTextsSpacing,
bottom = MaterialTheme.wireDimensions.dialogTextsSpacing,
),
onClick = { offset ->
text.getStringAnnotations(
tag = MarkdownConstants.TAG_URL,
start = offset,
end = offset,
).firstOrNull()?.let { result -> uriHandler.openUri(result.item) }
}
)
}
)
}
}
content?.let {
Box {
Expand Down

0 comments on commit cd5d92d

Please sign in to comment.