mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-10 16:34:09 +02:00
Simple refactoring to newer versions of the clickable text
This commit is contained in:
@@ -20,9 +20,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.vitorpamplona.amethyst.ui.note.elements
|
package com.vitorpamplona.amethyst.ui.note.elements
|
||||||
|
|
||||||
import androidx.compose.foundation.text.ClickableText
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.material3.LocalTextStyle
|
import androidx.compose.material3.LocalTextStyle
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.text.buildAnnotatedString
|
import androidx.compose.ui.text.buildAnnotatedString
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
@@ -34,7 +35,7 @@ import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DisplayEditStatus(editState: EditState) {
|
fun DisplayEditStatus(editState: EditState) {
|
||||||
ClickableText(
|
Text(
|
||||||
text =
|
text =
|
||||||
buildAnnotatedString {
|
buildAnnotatedString {
|
||||||
if (editState.showingVersion.value == editState.originalVersionId()) {
|
if (editState.showingVersion.value == editState.originalVersionId()) {
|
||||||
@@ -45,15 +46,12 @@ fun DisplayEditStatus(editState: EditState) {
|
|||||||
append(stringRes(id = R.string.edited_number, editState.versionId()))
|
append(stringRes(id = R.string.edited_number, editState.versionId()))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClick = {
|
|
||||||
editState.nextModification()
|
|
||||||
},
|
|
||||||
style =
|
style =
|
||||||
LocalTextStyle.current.copy(
|
LocalTextStyle.current.copy(
|
||||||
color = MaterialTheme.colorScheme.placeholderText,
|
color = MaterialTheme.colorScheme.placeholderText,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
),
|
),
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
modifier = HalfStartPadding,
|
modifier = HalfStartPadding.clickable { editState.nextModification() },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@@ -899,9 +899,7 @@ class AccountViewModel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun markDonatedInThisVersion() {
|
fun markDonatedInThisVersion() = account.markDonatedInThisVersion()
|
||||||
account.markDonatedInThisVersion()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun dontTranslateFrom() = account.settings.syncedSettings.languages.dontTranslateFrom
|
fun dontTranslateFrom() = account.settings.syncedSettings.languages.dontTranslateFrom
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user