Skip to content

Commit

Permalink
feat: Make original & cleaned URL selectable (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenjacobs authored Jan 7, 2024
1 parent 2aa9a63 commit 1c5479b
Showing 1 changed file with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Léon - The URL Cleaner
* Copyright (C) 2023 Sven Jacobs
* Copyright (C) 2024 Sven Jacobs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,6 +31,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Card
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -277,23 +278,27 @@ private fun SuccessBody(
color = MaterialTheme.colorScheme.primary,
)

Text(
modifier = Modifier.padding(16.dp),
text = result.originalText,
style = MaterialTheme.typography.bodyMedium,
)
SelectionContainer {
Text(
modifier = Modifier.padding(16.dp),
text = result.originalText,
style = MaterialTheme.typography.bodyMedium,
)
}

Text(
text = stringResource(R.string.cleaned_url),
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.primary,
)

Text(
modifier = Modifier.padding(16.dp),
text = result.cleanedText,
style = MaterialTheme.typography.bodyMedium,
)
SelectionContainer {
Text(
modifier = Modifier.padding(16.dp),
text = result.cleanedText,
style = MaterialTheme.typography.bodyMedium,
)
}

val buttonModifier = Modifier.widthIn(min = 120.dp)

Expand Down

0 comments on commit 1c5479b

Please sign in to comment.