Refactors color objects to avoid recreating them on-demand.

This commit is contained in:
Vitor Pamplona
2023-06-10 10:08:06 -04:00
parent 7007796497
commit 9ef02d63a0
49 changed files with 314 additions and 217 deletions
@@ -64,6 +64,7 @@ import com.vitorpamplona.amethyst.ui.note.UserPicture
import com.vitorpamplona.amethyst.ui.note.UsernameDisplay import com.vitorpamplona.amethyst.ui.note.UsernameDisplay
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.SearchBarViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.SearchBarViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
@@ -128,7 +129,7 @@ fun JoinUserOrChannelView(searchBarViewModel: SearchBarViewModel, onClose: () ->
Text( Text(
text = "", text = "",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold
) )
} }
@@ -270,7 +271,7 @@ private fun SearchEditTextForJoin(
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.channel_list_user_or_group_id_demo), text = stringResource(R.string.channel_list_user_or_group_id_demo),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
trailingIcon = { trailingIcon = {
@@ -416,7 +417,7 @@ private fun DisplayUserAboutInfo(baseUser: User) {
Text( Text(
text = about, text = about,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
@@ -27,6 +27,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.Channel import com.vitorpamplona.amethyst.model.Channel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -79,7 +80,7 @@ fun NewChannelView(onClose: () -> Unit, accountViewModel: AccountViewModel, chan
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.my_awesome_group), text = stringResource(R.string.my_awesome_group),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -98,7 +99,7 @@ fun NewChannelView(onClose: () -> Unit, accountViewModel: AccountViewModel, chan
placeholder = { placeholder = {
Text( Text(
text = "http://mygroup.com/logo.jpg", text = "http://mygroup.com/logo.jpg",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -115,7 +116,7 @@ fun NewChannelView(onClose: () -> Unit, accountViewModel: AccountViewModel, chan
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.about_us), text = stringResource(R.string.about_us),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -33,6 +33,7 @@ import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.ui.components.* import com.vitorpamplona.amethyst.ui.components.*
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -221,7 +222,7 @@ fun ImageVideoPost(postViewModel: NewMediaModel, acc: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.content_description_example), text = stringResource(R.string.content_description_example),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -22,6 +22,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@Composable @Composable
fun NewPollClosing(pollViewModel: NewPostViewModel) { fun NewPollClosing(pollViewModel: NewPostViewModel) {
@@ -43,7 +44,7 @@ fun NewPollClosing(pollViewModel: NewPostViewModel) {
) )
val colorValid = TextFieldDefaults.outlinedTextFieldColors( val colorValid = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = MaterialTheme.colors.primary, focusedBorderColor = MaterialTheme.colors.primary,
unfocusedBorderColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) unfocusedBorderColor = MaterialTheme.colors.placeholderText
) )
Row( Row(
@@ -59,13 +60,13 @@ fun NewPollClosing(pollViewModel: NewPostViewModel) {
label = { label = {
Text( Text(
text = stringResource(R.string.poll_closing_time), text = stringResource(R.string.poll_closing_time),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.poll_closing_time_days), text = stringResource(R.string.poll_closing_time_days),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -22,6 +22,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@Composable @Composable
fun NewPollConsensusThreshold(pollViewModel: NewPostViewModel) { fun NewPollConsensusThreshold(pollViewModel: NewPostViewModel) {
@@ -43,7 +44,7 @@ fun NewPollConsensusThreshold(pollViewModel: NewPostViewModel) {
) )
val colorValid = TextFieldDefaults.outlinedTextFieldColors( val colorValid = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = MaterialTheme.colors.primary, focusedBorderColor = MaterialTheme.colors.primary,
unfocusedBorderColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) unfocusedBorderColor = MaterialTheme.colors.placeholderText
) )
Row( Row(
@@ -59,13 +60,13 @@ fun NewPollConsensusThreshold(pollViewModel: NewPostViewModel) {
label = { label = {
Text( Text(
text = stringResource(R.string.poll_consensus_threshold), text = stringResource(R.string.poll_consensus_threshold),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.poll_consensus_threshold_percent), text = stringResource(R.string.poll_consensus_threshold_percent),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -11,6 +11,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardCapitalization import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@Composable @Composable
fun NewPollOption(pollViewModel: NewPostViewModel, optionIndex: Int) { fun NewPollOption(pollViewModel: NewPostViewModel, optionIndex: Int) {
@@ -35,13 +36,13 @@ fun NewPollOption(pollViewModel: NewPostViewModel, optionIndex: Int) {
label = { label = {
Text( Text(
text = stringResource(R.string.poll_option_index).format(optionIndex + 1), text = stringResource(R.string.poll_option_index).format(optionIndex + 1),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.poll_option_description), text = stringResource(R.string.poll_option_description),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -19,6 +19,7 @@ import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel
import com.vitorpamplona.amethyst.ui.actions.UrlUserTagTransformation import com.vitorpamplona.amethyst.ui.actions.UrlUserTagTransformation
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@OptIn(ExperimentalComposeUiApi::class) @OptIn(ExperimentalComposeUiApi::class)
@Composable @Composable
@@ -38,7 +39,7 @@ fun NewPollPrimaryDescription(pollViewModel: NewPostViewModel) {
) )
val colorValid = TextFieldDefaults.outlinedTextFieldColors( val colorValid = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = MaterialTheme.colors.primary, focusedBorderColor = MaterialTheme.colors.primary,
unfocusedBorderColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) unfocusedBorderColor = MaterialTheme.colors.placeholderText
) )
OutlinedTextField( OutlinedTextField(
@@ -49,7 +50,7 @@ fun NewPollPrimaryDescription(pollViewModel: NewPostViewModel) {
label = { label = {
Text( Text(
text = stringResource(R.string.poll_primary_description), text = stringResource(R.string.poll_primary_description),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -67,7 +68,7 @@ fun NewPollPrimaryDescription(pollViewModel: NewPostViewModel) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.poll_primary_description), text = stringResource(R.string.poll_primary_description),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
colors = if (isInputValid) colorValid else colorInValid, colors = if (isInputValid) colorValid else colorInValid,
@@ -10,6 +10,7 @@ import androidx.compose.ui.res.stringResource
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel import com.vitorpamplona.amethyst.ui.actions.NewPostViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@Composable @Composable
fun NewPollRecipientsField(pollViewModel: NewPostViewModel, account: Account) { fun NewPollRecipientsField(pollViewModel: NewPostViewModel, account: Account) {
@@ -29,13 +30,13 @@ fun NewPollRecipientsField(pollViewModel: NewPostViewModel, account: Account) {
label = { label = {
Text( Text(
text = stringResource(R.string.poll_zap_recipients), text = stringResource(R.string.poll_zap_recipients),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.poll_zap_recipients), text = stringResource(R.string.poll_zap_recipients),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
@@ -21,6 +21,7 @@ import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@Composable @Composable
fun NewPollVoteValueRange(pollViewModel: NewPostViewModel) { fun NewPollVoteValueRange(pollViewModel: NewPostViewModel) {
@@ -71,7 +72,7 @@ fun NewPollVoteValueRange(pollViewModel: NewPostViewModel) {
) )
val colorValid = TextFieldDefaults.outlinedTextFieldColors( val colorValid = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = MaterialTheme.colors.primary, focusedBorderColor = MaterialTheme.colors.primary,
unfocusedBorderColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) unfocusedBorderColor = MaterialTheme.colors.placeholderText
) )
Row( Row(
@@ -87,13 +88,13 @@ fun NewPollVoteValueRange(pollViewModel: NewPostViewModel) {
label = { label = {
Text( Text(
text = stringResource(R.string.poll_zap_value_min), text = stringResource(R.string.poll_zap_value_min),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.sats), text = stringResource(R.string.sats),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -106,13 +107,13 @@ fun NewPollVoteValueRange(pollViewModel: NewPostViewModel) {
label = { label = {
Text( Text(
text = stringResource(R.string.poll_zap_value_max), text = stringResource(R.string.poll_zap_value_max),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.sats), text = stringResource(R.string.sats),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -73,6 +73,9 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.UserLine
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.mediumImportanceLink
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -200,7 +203,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, quote: Note? = n
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.what_s_on_your_mind), text = stringResource(R.string.what_s_on_your_mind),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
colors = TextFieldDefaults colors = TextFieldDefaults
@@ -219,9 +222,9 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, quote: Note? = n
Button( Button(
onClick = { postViewModel.pollOptions[postViewModel.pollOptions.size] = "" }, onClick = { postViewModel.pollOptions[postViewModel.pollOptions.size] = "" },
border = BorderStroke(1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.32f)), border = BorderStroke(1.dp, MaterialTheme.colors.placeholderText),
colors = ButtonDefaults.outlinedButtonColors( colors = ButtonDefaults.outlinedButtonColors(
contentColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) contentColor = MaterialTheme.colors.placeholderText
) )
) { ) {
Image( Image(
@@ -293,7 +296,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, quote: Note? = n
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
) )
) )
@@ -395,7 +398,7 @@ fun Notifying(baseMentions: ImmutableList<User>?, onClick: (User) -> Unit) {
Text( Text(
stringResource(R.string.reply_notify), stringResource(R.string.reply_notify),
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
mentions.forEachIndexed { idx, user -> mentions.forEachIndexed { idx, user ->
@@ -410,7 +413,7 @@ fun Notifying(baseMentions: ImmutableList<User>?, onClick: (User) -> Unit) {
Button( Button(
shape = ButtonBorder, shape = ButtonBorder,
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.primary.copy(alpha = 0.32f) backgroundColor = MaterialTheme.colors.mediumImportanceLink
), ),
onClick = { onClick = {
onClick(myUser) onClick(myUser)
@@ -551,7 +554,7 @@ private fun ForwardZapTo(
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.zap_forward_lnAddress), text = stringResource(R.string.zap_forward_lnAddress),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
fontSize = 14.sp fontSize = 14.sp
) )
}, },
@@ -774,7 +777,7 @@ fun ImageVideoDescription(
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
) )
) { ) {
@@ -819,7 +822,7 @@ fun ImageVideoDescription(
modifier = Modifier modifier = Modifier
.padding(end = 5.dp) .padding(end = 5.dp)
.size(30.dp), .size(30.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -909,7 +912,7 @@ fun ImageVideoDescription(
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.content_description_example), text = stringResource(R.string.content_description_example),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -52,6 +52,7 @@ import com.vitorpamplona.amethyst.model.RelaySetupInfo
import com.vitorpamplona.amethyst.service.relays.FeedType import com.vitorpamplona.amethyst.service.relays.FeedType
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import java.lang.Math.round import java.lang.Math.round
@Composable @Composable
@@ -157,7 +158,7 @@ fun ServerConfigHeader() {
maxLines = 1, maxLines = 1,
fontSize = 14.sp, fontSize = 14.sp,
modifier = Modifier.weight(1.2f), modifier = Modifier.weight(1.2f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
Spacer(modifier = Modifier.size(5.dp)) Spacer(modifier = Modifier.size(5.dp))
@@ -167,7 +168,7 @@ fun ServerConfigHeader() {
maxLines = 1, maxLines = 1,
fontSize = 14.sp, fontSize = 14.sp,
modifier = Modifier.weight(1.2f), modifier = Modifier.weight(1.2f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
Spacer(modifier = Modifier.size(5.dp)) Spacer(modifier = Modifier.size(5.dp))
@@ -177,7 +178,7 @@ fun ServerConfigHeader() {
maxLines = 1, maxLines = 1,
fontSize = 14.sp, fontSize = 14.sp,
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
Spacer(modifier = Modifier.size(5.dp)) Spacer(modifier = Modifier.size(5.dp))
@@ -187,7 +188,7 @@ fun ServerConfigHeader() {
maxLines = 1, maxLines = 1,
fontSize = 14.sp, fontSize = 14.sp,
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
Spacer(modifier = Modifier.size(2.dp)) Spacer(modifier = Modifier.size(2.dp))
@@ -375,7 +376,7 @@ fun ServerConfig(
maxLines = 1, maxLines = 1,
fontSize = 12.sp, fontSize = 12.sp,
modifier = Modifier.weight(1.2f), modifier = Modifier.weight(1.2f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
IconButton( IconButton(
@@ -403,7 +404,7 @@ fun ServerConfig(
maxLines = 1, maxLines = 1,
fontSize = 12.sp, fontSize = 12.sp,
modifier = Modifier.weight(1.2f), modifier = Modifier.weight(1.2f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
Icon( Icon(
@@ -420,7 +421,7 @@ fun ServerConfig(
maxLines = 1, maxLines = 1,
fontSize = 12.sp, fontSize = 12.sp,
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
Icon( Icon(
@@ -435,7 +436,7 @@ fun ServerConfig(
maxLines = 1, maxLines = 1,
fontSize = 12.sp, fontSize = 12.sp,
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -464,7 +465,7 @@ fun EditableServerConfig(relayToAdd: String, onNewRelay: (RelaySetupInfo) -> Uni
placeholder = { placeholder = {
Text( Text(
text = "server.com", text = "server.com",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1 maxLines = 1
) )
}, },
@@ -478,7 +479,7 @@ fun EditableServerConfig(relayToAdd: String, onNewRelay: (RelaySetupInfo) -> Uni
modifier = Modifier modifier = Modifier
.size(35.dp) .size(35.dp)
.padding(horizontal = 5.dp), .padding(horizontal = 5.dp),
tint = if (read) Color.Green else MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = if (read) Color.Green else MaterialTheme.colors.placeholderText
) )
} }
@@ -489,7 +490,7 @@ fun EditableServerConfig(relayToAdd: String, onNewRelay: (RelaySetupInfo) -> Uni
modifier = Modifier modifier = Modifier
.size(35.dp) .size(35.dp)
.padding(horizontal = 5.dp), .padding(horizontal = 5.dp),
tint = if (write) Color.Green else MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = if (write) Color.Green else MaterialTheme.colors.placeholderText
) )
} }
@@ -507,7 +508,7 @@ fun EditableServerConfig(relayToAdd: String, onNewRelay: (RelaySetupInfo) -> Uni
shape = ButtonBorder, shape = ButtonBorder,
colors = ButtonDefaults colors = ButtonDefaults
.buttonColors( .buttonColors(
backgroundColor = if (url.isNotBlank()) MaterialTheme.colors.primary else MaterialTheme.colors.onSurface.copy(alpha = 0.32f) backgroundColor = if (url.isNotBlank()) MaterialTheme.colors.primary else MaterialTheme.colors.placeholderText
) )
) { ) {
Text(text = stringResource(id = R.string.add), color = Color.White) Text(text = stringResource(id = R.string.add), color = Color.White)
@@ -28,6 +28,7 @@ import androidx.compose.ui.window.DialogProperties
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
@@ -95,7 +96,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.my_display_name), text = stringResource(R.string.my_display_name),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -114,7 +115,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.my_username), text = stringResource(R.string.my_username),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true singleLine = true
@@ -133,7 +134,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(id = R.string.about_me), text = stringResource(id = R.string.about_me),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -152,13 +153,13 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = "https://mywebsite.com/me.jpg", text = "https://mywebsite.com/me.jpg",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
leadingIcon = { leadingIcon = {
UploadFromGallery( UploadFromGallery(
isUploading = postViewModel.isUploadingImageForPicture, isUploading = postViewModel.isUploadingImageForPicture,
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), tint = MaterialTheme.colors.placeholderText,
modifier = Modifier.padding(start = 5.dp) modifier = Modifier.padding(start = 5.dp)
) { ) {
postViewModel.uploadForPicture(it, context) postViewModel.uploadForPicture(it, context)
@@ -177,13 +178,13 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = "https://mywebsite.com/mybanner.jpg", text = "https://mywebsite.com/mybanner.jpg",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
leadingIcon = { leadingIcon = {
UploadFromGallery( UploadFromGallery(
isUploading = postViewModel.isUploadingImageForBanner, isUploading = postViewModel.isUploadingImageForBanner,
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), tint = MaterialTheme.colors.placeholderText,
modifier = Modifier.padding(start = 5.dp) modifier = Modifier.padding(start = 5.dp)
) { ) {
postViewModel.uploadForBanner(it, context) postViewModel.uploadForBanner(it, context)
@@ -202,7 +203,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = "https://mywebsite.com", text = "https://mywebsite.com",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true singleLine = true
@@ -218,7 +219,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = "_@mywebsite.com", text = "_@mywebsite.com",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true singleLine = true
@@ -233,7 +234,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = "me@mylightiningnode.com", text = "me@mylightiningnode.com",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true singleLine = true
@@ -249,7 +250,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.lnurl), text = stringResource(R.string.lnurl),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -264,7 +265,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.twitter_proof_url_template), text = stringResource(R.string.twitter_proof_url_template),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -279,7 +280,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.mastodon_proof_url_template), text = stringResource(R.string.mastodon_proof_url_template),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -294,7 +295,7 @@ fun NewUserMetadataView(onClose: () -> Unit, account: Account) {
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.github_proof_url_template), text = stringResource(R.string.github_proof_url_template),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -1,6 +1,5 @@
package com.vitorpamplona.amethyst.ui.components package com.vitorpamplona.amethyst.ui.components
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
@@ -23,13 +22,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.secondaryButtonBackground
const val SHORT_TEXT_LENGTH = 350 const val SHORT_TEXT_LENGTH = 350
@@ -101,14 +100,13 @@ fun ExpandableRichTextViewer(
} }
@Composable @Composable
public fun ShowMoreButton(onClick: () -> Unit) { fun ShowMoreButton(onClick: () -> Unit) {
Button( Button(
modifier = Modifier.padding(top = 10.dp), modifier = Modifier.padding(top = 10.dp),
onClick = onClick, onClick = onClick,
shape = ButtonBorder, shape = ButtonBorder,
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.primary.copy(alpha = 0.32f) backgroundColor = MaterialTheme.colors.secondaryButtonBackground
.compositeOver(MaterialTheme.colors.background)
), ),
contentPadding = PaddingValues(vertical = 6.dp, horizontal = 16.dp) contentPadding = PaddingValues(vertical = 6.dp, horizontal = 16.dp)
) { ) {
@@ -25,6 +25,7 @@ import androidx.core.content.ContextCompat.startActivity
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.service.lnurl.LnInvoiceUtil import com.vitorpamplona.amethyst.service.lnurl.LnInvoiceUtil
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import java.text.NumberFormat import java.text.NumberFormat
@@ -67,7 +68,7 @@ fun InvoicePreview(lnInvoice: String, amount: String?) {
.fillMaxWidth() .fillMaxWidth()
.padding(start = 30.dp, end = 30.dp) .padding(start = 30.dp, end = 30.dp)
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border(1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), QuoteBorder) .border(1.dp, MaterialTheme.colors.subtleBorder, QuoteBorder)
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
@@ -37,6 +37,8 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.service.lnurl.LightningAddressResolver import com.vitorpamplona.amethyst.service.lnurl.LightningAddressResolver
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@Composable @Composable
@@ -57,7 +59,7 @@ fun InvoiceRequest(
.fillMaxWidth() .fillMaxWidth()
.padding(start = 30.dp, end = 30.dp) .padding(start = 30.dp, end = 30.dp)
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border(1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), QuoteBorder) .border(1.dp, MaterialTheme.colors.subtleBorder, QuoteBorder)
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
@@ -98,7 +100,7 @@ fun InvoiceRequest(
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.thank_you_so_much), text = stringResource(R.string.thank_you_so_much),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -123,7 +125,7 @@ fun InvoiceRequest(
placeholder = { placeholder = {
Text( Text(
text = "1000", text = "1000",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
@@ -43,6 +43,7 @@ import com.vitorpamplona.amethyst.ui.actions.toImmutableListOfLists
import com.vitorpamplona.amethyst.ui.note.NoteCompose import com.vitorpamplona.amethyst.ui.note.NoteCompose
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
import com.vitorpamplona.amethyst.ui.uriToRoute import com.vitorpamplona.amethyst.ui.uriToRoute
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.ImmutableMap import kotlinx.collections.immutable.ImmutableMap
@@ -415,7 +416,7 @@ private fun RenderContentAsMarkdown(content: String, backgroundColor: MutableSta
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
) )
.background( .background(
@@ -767,7 +768,7 @@ private fun DisplayFullNote(
nav: (String) -> Unit, nav: (String) -> Unit,
loadedLink: LoadedBechLink loadedLink: LoadedBechLink
) { ) {
val borderColor = MaterialTheme.colors.onSurface.copy(alpha = 0.12f) val borderColor = MaterialTheme.colors.subtleBorder
val modifier = remember { val modifier = remember {
Modifier Modifier
@@ -955,7 +956,7 @@ private fun DisplayNoteFromTag(
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
), ),
parentBackgroundColor = backgroundColor, parentBackgroundColor = backgroundColor,
@@ -25,6 +25,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
@@ -68,7 +69,7 @@ fun DotsIndicator(
totalDots: Int, totalDots: Int,
selectedIndex: Int, selectedIndex: Int,
selectedColor: Color = MaterialTheme.colors.primary /* Color.Yellow */, selectedColor: Color = MaterialTheme.colors.primary /* Color.Yellow */,
unSelectedColor: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) /* Color.Gray */, unSelectedColor: Color = MaterialTheme.colors.placeholderText /* Color.Gray */,
dotSize: Dp dotSize: Dp
) { ) {
LazyRow( LazyRow(
@@ -21,6 +21,7 @@ import coil.compose.AsyncImage
import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.service.previews.UrlInfoItem import com.vitorpamplona.amethyst.service.previews.UrlInfoItem
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
@Composable @Composable
fun UrlPreviewCard( fun UrlPreviewCard(
@@ -35,7 +36,7 @@ fun UrlPreviewCard(
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
) )
) { ) {
@@ -131,14 +131,13 @@ fun VideoView(
onDialog: ((Boolean) -> Unit)? = null onDialog: ((Boolean) -> Unit)? = null
) { ) {
val lifecycleOwner = rememberUpdatedState(LocalLifecycleOwner.current) val lifecycleOwner = rememberUpdatedState(LocalLifecycleOwner.current)
val defaultVolume = remember { if (DefaultMutedSetting.value) 0f else 1f }
val media = remember { MediaItem.Builder().setUri(videoUri).build() } val media = remember { MediaItem.Builder().setUri(videoUri).build() }
exoPlayerData.exoPlayer.apply { exoPlayerData.exoPlayer.apply {
repeatMode = Player.REPEAT_MODE_ALL repeatMode = Player.REPEAT_MODE_ALL
videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT
volume = defaultVolume volume = if (DefaultMutedSetting.value) 0f else 1f
if (videoUri.startsWith("file") == true) { if (videoUri.startsWith("file") == true) {
setMediaItem(media) setMediaItem(media)
} else { } else {
@@ -48,7 +48,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
@@ -74,8 +73,9 @@ import com.vitorpamplona.amethyst.ui.actions.CloseButton
import com.vitorpamplona.amethyst.ui.actions.LoadingAnimation import com.vitorpamplona.amethyst.ui.actions.LoadingAnimation
import com.vitorpamplona.amethyst.ui.actions.SaveToGallery import com.vitorpamplona.amethyst.ui.actions.SaveToGallery
import com.vitorpamplona.amethyst.ui.note.BlankNote import com.vitorpamplona.amethyst.ui.note.BlankNote
import com.vitorpamplona.amethyst.ui.theme.Nip05
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.hashVerified
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -180,7 +180,7 @@ fun ZoomableContentView(content: ZoomableContent, images: ImmutableList<Zoomable
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
) )
@@ -572,7 +572,7 @@ private fun HashVerificationSymbol(verifiedHash: Boolean, modifier: Modifier) {
Icon( Icon(
painter = painterResource(R.drawable.ic_verified), painter = painterResource(R.drawable.ic_verified),
"Hash Verified", "Hash Verified",
tint = Nip05.copy(0.52f).compositeOver(MaterialTheme.colors.background), tint = MaterialTheme.colors.hashVerified,
modifier = Modifier.size(30.dp) modifier = Modifier.size(30.dp)
) )
} }
@@ -80,6 +80,7 @@ import com.vitorpamplona.amethyst.ui.screen.RelayPoolViewModel
import com.vitorpamplona.amethyst.ui.screen.equalImmutableLists import com.vitorpamplona.amethyst.ui.screen.equalImmutableLists
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.SpinnerSelectionDialog import com.vitorpamplona.amethyst.ui.screen.loggedIn.SpinnerSelectionDialog
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.collections.immutable.toPersistentList import kotlinx.collections.immutable.toPersistentList
@@ -463,7 +464,7 @@ fun SimpleTextSpinner(
imageVector = Icons.Default.ExpandMore, imageVector = Icons.Default.ExpandMore,
null, null,
modifier = Modifier.size(20.dp), modifier = Modifier.size(20.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
Box( Box(
@@ -35,6 +35,7 @@ import com.vitorpamplona.amethyst.model.Note
import com.vitorpamplona.amethyst.ui.actions.CloseButton import com.vitorpamplona.amethyst.ui.actions.CloseButton
import com.vitorpamplona.amethyst.ui.actions.PostButton import com.vitorpamplona.amethyst.ui.actions.PostButton
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
class AddBountyAmountViewModel : ViewModel() { class AddBountyAmountViewModel : ViewModel() {
private var account: Account? = null private var account: Account? = null
@@ -124,7 +125,7 @@ fun AddBountyAmountDialog(bounty: Note, accountViewModel: AccountViewModel, onCl
placeholder = { placeholder = {
Text( Text(
text = "10000, 50000, 5000000", text = "10000, 50000, 5000000",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true singleLine = true
@@ -38,6 +38,7 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.screen.BadgeCard import com.vitorpamplona.amethyst.ui.screen.BadgeCard
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.newItemBackgroundColor import com.vitorpamplona.amethyst.ui.theme.newItemBackgroundColor
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -132,7 +133,7 @@ fun BadgeCompose(likeSetCard: BadgeCard, isInnerNote: Boolean = false, routeForL
Text( Text(
timeAgo(note.createdAt(), context = context), timeAgo(note.createdAt(), context = context),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1 maxLines = 1
) )
@@ -144,7 +145,7 @@ fun BadgeCompose(likeSetCard: BadgeCard, isInnerNote: Boolean = false, routeForL
imageVector = Icons.Default.MoreVert, imageVector = Icons.Default.MoreVert,
null, null,
modifier = Modifier.size(15.dp), modifier = Modifier.size(15.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
NoteDropDownMenu(note, popupExpanded, { popupExpanded = false }, accountViewModel) NoteDropDownMenu(note, popupExpanded, { popupExpanded = false }, accountViewModel)
@@ -51,6 +51,7 @@ import com.vitorpamplona.amethyst.service.model.PrivateDmEvent
import com.vitorpamplona.amethyst.ui.components.ResizeImage import com.vitorpamplona.amethyst.ui.components.ResizeImage
import com.vitorpamplona.amethyst.ui.components.RobohashAsyncImageProxy import com.vitorpamplona.amethyst.ui.components.RobohashAsyncImageProxy
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -149,7 +150,7 @@ private fun ChannelRoomCompose(
withStyle( withStyle(
SpanStyle( SpanStyle(
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
fontWeight = FontWeight.Normal fontWeight = FontWeight.Normal
) )
) { ) {
@@ -38,6 +38,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.compositeOver import androidx.compose.ui.graphics.compositeOver
@@ -69,6 +70,9 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.ChatBubbleShapeMe import com.vitorpamplona.amethyst.ui.theme.ChatBubbleShapeMe
import com.vitorpamplona.amethyst.ui.theme.ChatBubbleShapeThem import com.vitorpamplona.amethyst.ui.theme.ChatBubbleShapeThem
import com.vitorpamplona.amethyst.ui.theme.RelayIconFilter import com.vitorpamplona.amethyst.ui.theme.RelayIconFilter
import com.vitorpamplona.amethyst.ui.theme.mediumImportanceLink
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
import kotlinx.collections.immutable.toImmutableSet import kotlinx.collections.immutable.toImmutableSet
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -144,8 +148,8 @@ fun ChatroomMessageCompose(
onClick = { showHiddenNote = true } onClick = { showHiddenNote = true }
) )
} else { } else {
val loggedInColors = MaterialTheme.colors.primary.copy(alpha = 0.32f) val loggedInColors = MaterialTheme.colors.mediumImportanceLink
val otherColors = MaterialTheme.colors.onSurface.copy(alpha = 0.12f) val otherColors = MaterialTheme.colors.subtleBorder
val defaultBackground = MaterialTheme.colors.background val defaultBackground = MaterialTheme.colors.background
val backgroundBubbleColor = remember { val backgroundBubbleColor = remember {
@@ -327,7 +331,7 @@ private fun StatusRow(
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
onWantsToReply: (Note) -> Unit onWantsToReply: (Note) -> Unit
) { ) {
val grayTint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) val grayTint = MaterialTheme.colors.placeholderText
val time = remember { baseNote.createdAt() ?: 0 } val time = remember { baseNote.createdAt() ?: 0 }
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
@@ -361,7 +365,7 @@ fun ChatTimeAgo(time: Long) {
Text( Text(
timeStr, timeStr,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
fontSize = 12.sp fontSize = 12.sp
) )
} }
@@ -544,7 +548,7 @@ private fun RelayBadges(baseNote: Note) {
imageVector = Icons.Default.ChevronRight, imageVector = Icons.Default.ChevronRight,
null, null,
modifier = Modifier.size(15.dp), modifier = Modifier.size(15.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -569,10 +573,13 @@ fun RenderRelay(dirtyUrl: String) {
.clickable(onClick = { uri.openUri(website) }) .clickable(onClick = { uri.openUri(website) })
} }
val backgroundColor = MaterialTheme.colors.background
val iconModifier = remember(dirtyUrl) { val iconModifier = remember(dirtyUrl) {
Modifier Modifier
.size(13.dp) .size(13.dp)
.clip(shape = CircleShape) .clip(shape = CircleShape)
.drawBehind { drawRect(backgroundColor) }
} }
Box( Box(
@@ -580,11 +587,11 @@ fun RenderRelay(dirtyUrl: String) {
) { ) {
RobohashFallbackAsyncImage( RobohashFallbackAsyncImage(
robot = iconUrl, robot = iconUrl,
robotSize = 13.dp, robotSize = remember { 13.dp },
model = iconUrl, model = iconUrl,
contentDescription = stringResource(id = R.string.relay_icon), contentDescription = stringResource(id = R.string.relay_icon),
colorFilter = RelayIconFilter, colorFilter = RelayIconFilter,
modifier = iconModifier.background(MaterialTheme.colors.background) modifier = iconModifier
) )
} }
} }
@@ -22,6 +22,8 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@@ -46,30 +48,35 @@ fun MessageSetCompose(messageSetCard: MessageSetCard, routeForLastRead: String,
val scope = rememberCoroutineScope() val scope = rememberCoroutineScope()
var isNew by remember { mutableStateOf(false) } val defaultBackgroundColor = MaterialTheme.colors.background
val backgroundColor = remember { mutableStateOf<Color>(defaultBackgroundColor) }
val newItemColor = MaterialTheme.colors.newItemBackgroundColor
LaunchedEffect(key1 = messageSetCard.createdAt()) { LaunchedEffect(key1 = messageSetCard) {
launch(Dispatchers.IO) { scope.launch(Dispatchers.IO) {
val newIsNew = val isNew = messageSetCard.createdAt() > NotificationCache.load(routeForLastRead)
messageSetCard.createdAt() > NotificationCache.load(routeForLastRead)
NotificationCache.markAsRead(routeForLastRead, messageSetCard.createdAt()) NotificationCache.markAsRead(routeForLastRead, messageSetCard.createdAt())
if (newIsNew != isNew) { val newBackgroundColor = if (isNew) {
isNew = newIsNew newItemColor.compositeOver(defaultBackgroundColor)
} else {
defaultBackgroundColor
}
if (backgroundColor.value != newBackgroundColor) {
backgroundColor.value = newBackgroundColor
} }
} }
} }
val backgroundColor = if (isNew) { val columnModifier = remember(backgroundColor.value) {
MaterialTheme.colors.newItemBackgroundColor.compositeOver(MaterialTheme.colors.background)
} else {
MaterialTheme.colors.background
}
val columnModifier = remember(isNew) {
Modifier Modifier
.background(backgroundColor) .drawBehind {
drawRect(
backgroundColor.value
)
}
.padding( .padding(
start = 12.dp, start = 12.dp,
end = 12.dp, end = 12.dp,
@@ -56,6 +56,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.showAmountAxis import com.vitorpamplona.amethyst.ui.screen.loggedIn.showAmountAxis
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.newItemBackgroundColor import com.vitorpamplona.amethyst.ui.theme.newItemBackgroundColor
import com.vitorpamplona.amethyst.ui.theme.overPictureBackground
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.ImmutableMap import kotlinx.collections.immutable.ImmutableMap
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -341,10 +342,11 @@ private fun AuthorPictureAndComment(
amount?.let { amount?.let {
Box(modifier = Modifier.fillMaxSize().clip(shape = CircleShape), contentAlignment = Alignment.BottomCenter) { Box(modifier = Modifier.fillMaxSize().clip(shape = CircleShape), contentAlignment = Alignment.BottomCenter) {
val backgroundColor = MaterialTheme.colors.overPictureBackground
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.background(MaterialTheme.colors.background.copy(0.62f)), .drawBehind { drawRect(backgroundColor) },
contentAlignment = Alignment.BottomCenter contentAlignment = Alignment.BottomCenter
) { ) {
Text( Text(
@@ -34,6 +34,7 @@ import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.model.UserMetadata import com.vitorpamplona.amethyst.model.UserMetadata
import com.vitorpamplona.amethyst.service.Nip05Verifier import com.vitorpamplona.amethyst.service.Nip05Verifier
import com.vitorpamplona.amethyst.ui.theme.Nip05 import com.vitorpamplona.amethyst.ui.theme.Nip05
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.util.Date import java.util.Date
@@ -150,7 +151,7 @@ private fun DisplayNIP05(
if (user != "_") { if (user != "_") {
Text( Text(
text = AnnotatedString(user), text = AnnotatedString(user),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
@@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@@ -26,8 +25,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.CutCornerShape import androidx.compose.foundation.shape.CutCornerShape
import androidx.compose.foundation.text.ClickableText import androidx.compose.foundation.text.ClickableText
import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Divider import androidx.compose.material.Divider
import androidx.compose.material.DropdownMenu import androidx.compose.material.DropdownMenu
import androidx.compose.material.DropdownMenuItem import androidx.compose.material.DropdownMenuItem
@@ -143,11 +140,13 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.ChannelHeader import com.vitorpamplona.amethyst.ui.screen.loggedIn.ChannelHeader
import com.vitorpamplona.amethyst.ui.screen.loggedIn.ReportNoteDialog import com.vitorpamplona.amethyst.ui.screen.loggedIn.ReportNoteDialog
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.Following import com.vitorpamplona.amethyst.ui.theme.Following
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.mediumImportanceLink
import com.vitorpamplona.amethyst.ui.theme.newItemBackgroundColor import com.vitorpamplona.amethyst.ui.theme.newItemBackgroundColor
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import com.vitorpamplona.amethyst.ui.theme.replyBackground import com.vitorpamplona.amethyst.ui.theme.replyBackground
import com.vitorpamplona.amethyst.ui.theme.subtleBorder
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.ImmutableSet import kotlinx.collections.immutable.ImmutableSet
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
@@ -756,7 +755,7 @@ private fun RenderTextEvent(
if (makeItShort && isAuthorTheLoggedUser) { if (makeItShort && isAuthorTheLoggedUser) {
Text( Text(
text = eventContent, text = eventContent,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 2, maxLines = 2,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
@@ -802,7 +801,7 @@ private fun RenderPoll(
if (makeItShort && accountViewModel.isLoggedUser(note.author)) { if (makeItShort && accountViewModel.isLoggedUser(note.author)) {
Text( Text(
text = eventContent, text = eventContent,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 2, maxLines = 2,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
@@ -962,7 +961,7 @@ fun RenderAppDefinition(
if (!website.isNullOrEmpty()) { if (!website.isNullOrEmpty()) {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
Icon( Icon(
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), tint = MaterialTheme.colors.placeholderText,
imageVector = Icons.Default.Link, imageVector = Icons.Default.Link,
contentDescription = stringResource(R.string.website), contentDescription = stringResource(R.string.website),
modifier = Modifier.size(16.dp) modifier = Modifier.size(16.dp)
@@ -1058,7 +1057,7 @@ private fun RenderPrivateMessage(
if (makeItShort && isAuthorTheLoggedUser) { if (makeItShort && isAuthorTheLoggedUser) {
Text( Text(
text = eventContent, text = eventContent,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 2, maxLines = 2,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
@@ -1310,17 +1309,8 @@ fun DisplayPeopleList(
) )
} }
) { ) {
Button( ShowMoreButton {
modifier = Modifier.padding(top = 10.dp), expanded = !expanded
onClick = { expanded = !expanded },
shape = ButtonBorder,
colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.primary.copy(alpha = 0.32f)
.compositeOver(MaterialTheme.colors.background)
),
contentPadding = PaddingValues(vertical = 6.dp, horizontal = 16.dp)
) {
Text(text = stringResource(R.string.show_more), color = Color.White)
} }
} }
} }
@@ -1527,17 +1517,8 @@ fun PinListHeader(
) )
} }
) { ) {
Button( ShowMoreButton {
modifier = Modifier.padding(top = 10.dp), expanded = !expanded
onClick = { expanded = !expanded },
shape = ButtonBorder,
colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.primary.copy(alpha = 0.32f)
.compositeOver(MaterialTheme.colors.background)
),
contentPadding = PaddingValues(vertical = 6.dp, horizontal = 16.dp)
) {
Text(text = stringResource(R.string.show_more), color = Color.White)
} }
} }
} }
@@ -1614,7 +1595,7 @@ private fun RenderReport(
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
), ),
unPackReply = false, unPackReply = false,
@@ -1699,7 +1680,7 @@ private fun ReplyNoteComposition(
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
), ),
unPackReply = false, unPackReply = false,
@@ -1760,7 +1741,7 @@ private fun FirstUserInfoRow(
Text( Text(
" ${stringResource(id = R.string.boosted)}", " ${stringResource(id = R.string.boosted)}",
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} else { } else {
DisplayFollowingHashtagsInPost(eventNote, accountViewModel, nav) DisplayFollowingHashtagsInPost(eventNote, accountViewModel, nav)
@@ -1787,7 +1768,7 @@ private fun MoreOptionsButton(
imageVector = Icons.Default.MoreVert, imageVector = Icons.Default.MoreVert,
null, null,
modifier = Modifier.size(15.dp), modifier = Modifier.size(15.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
NoteDropDownMenu( NoteDropDownMenu(
@@ -1815,7 +1796,7 @@ fun TimeAgo(time: Long) {
Text( Text(
timeStr, timeStr,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1 maxLines = 1
) )
} }
@@ -1878,11 +1859,19 @@ private fun ChannelNotePicture(baseChannel: Channel) {
val channelState by baseChannel.live.observeAsState() val channelState by baseChannel.live.observeAsState()
val channel = remember(channelState) { channelState?.channel } ?: return val channel = remember(channelState) { channelState?.channel } ?: return
val backgroundColor = MaterialTheme.colors.background
val modifier = remember { val modifier = remember {
Modifier Modifier
.width(30.dp) .width(30.dp)
.height(30.dp) .height(30.dp)
.clip(shape = CircleShape) .clip(shape = CircleShape)
.drawBehind { drawRect(backgroundColor) }
.border(
2.dp,
backgroundColor,
CircleShape
)
} }
val boxModifier = remember { val boxModifier = remember {
@@ -1901,12 +1890,6 @@ private fun ChannelNotePicture(baseChannel: Channel) {
model = model, model = model,
contentDescription = stringResource(R.string.group_picture), contentDescription = stringResource(R.string.group_picture),
modifier = modifier modifier = modifier
.background(MaterialTheme.colors.background)
.border(
2.dp,
MaterialTheme.colors.background,
CircleShape
)
) )
} }
} }
@@ -2184,13 +2167,13 @@ private fun RenderPledgeAmount(
imageVector = Icons.Default.Bolt, imageVector = Icons.Default.Bolt,
contentDescription = stringResource(R.string.zaps), contentDescription = stringResource(R.string.zaps),
modifier = Modifier.size(20.dp), modifier = Modifier.size(20.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
Text( Text(
text = reward, text = reward,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
@@ -2228,7 +2211,7 @@ fun BadgeDisplay(baseNote: Note) {
.clip(shape = CutCornerShape(20, 20, 20, 20)) .clip(shape = CutCornerShape(20, 20, 20, 20))
.border( .border(
5.dp, 5.dp,
MaterialTheme.colors.primary.copy(alpha = 0.32f), MaterialTheme.colors.mediumImportanceLink,
CutCornerShape(20) CutCornerShape(20)
) )
.background(backgroundFromImage.first) .background(backgroundFromImage.first)
@@ -2434,7 +2417,7 @@ fun AudioTrackHeader(noteEvent: AudioTrackEvent, accountViewModel: AccountViewMo
it.first.role?.let { it.first.role?.let {
Text( Text(
text = it.capitalize(Locale.ROOT), text = it.capitalize(Locale.ROOT),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1 maxLines = 1
) )
} }
@@ -2474,7 +2457,7 @@ private fun LongFormHeader(noteEvent: LongTextNoteEvent, note: Note, accountView
.clip(shape = QuoteBorder) .clip(shape = QuoteBorder)
.border( .border(
1.dp, 1.dp,
MaterialTheme.colors.onSurface.copy(alpha = 0.12f), MaterialTheme.colors.subtleBorder,
QuoteBorder QuoteBorder
) )
) { ) {
@@ -2644,7 +2627,7 @@ private fun ShowMoreRelaysButton(onClick: () -> Unit) {
imageVector = Icons.Default.ExpandMore, imageVector = Icons.Default.ExpandMore,
null, null,
modifier = iconModifier, modifier = iconModifier,
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -2679,17 +2662,20 @@ fun NoteAuthorPicture(
} }
if (author == null) { if (author == null) {
val backgroundColor = MaterialTheme.colors.background
val nullModifier = remember { val nullModifier = remember {
modifier modifier
.size(size) .size(size)
.clip(shape = CircleShape) .clip(shape = CircleShape)
.drawBehind { drawRect(backgroundColor) }
} }
RobohashAsyncImage( RobohashAsyncImage(
robot = "authornotfound", robot = "authornotfound",
robotSize = size, robotSize = size,
contentDescription = stringResource(R.string.unknown_author), contentDescription = stringResource(R.string.unknown_author),
modifier = nullModifier.background(MaterialTheme.colors.background) modifier = nullModifier
) )
} else { } else {
UserPicture(author!!, size, accountViewModel, modifier, onClick) UserPicture(author!!, size, accountViewModel, modifier, onClick)
@@ -2764,6 +2750,8 @@ fun UserPicture(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
accountViewModel: AccountViewModel accountViewModel: AccountViewModel
) { ) {
val backgroundColor = MaterialTheme.colors.background
val myBoxModifier = remember { val myBoxModifier = remember {
Modifier.size(size) Modifier.size(size)
} }
@@ -2772,6 +2760,7 @@ fun UserPicture(
modifier modifier
.size(size) .size(size)
.clip(shape = CircleShape) .clip(shape = CircleShape)
.drawBehind { drawRect(backgroundColor) }
} }
val myIconSize = remember(size) { size.div(3.5f) } val myIconSize = remember(size) { size.div(3.5f) }
@@ -2783,7 +2772,7 @@ fun UserPicture(
ResizeImage(userPicture, size) ResizeImage(userPicture, size)
}, },
contentDescription = stringResource(id = R.string.profile_image), contentDescription = stringResource(id = R.string.profile_image),
modifier = myImageModifier.background(MaterialTheme.colors.background) modifier = myImageModifier
) )
ObserveAndDisplayFollowingMark(userHex, myIconSize, accountViewModel) ObserveAndDisplayFollowingMark(userHex, myIconSize, accountViewModel)
@@ -2820,14 +2809,17 @@ private fun FollowingIcon(iconSize: Dp) {
} }
Box(myIconBoxModifier, contentAlignment = Alignment.Center) { Box(myIconBoxModifier, contentAlignment = Alignment.Center) {
val backgroundColor = MaterialTheme.colors.background
val myIconBackgroundModifier = remember { val myIconBackgroundModifier = remember {
Modifier Modifier
.clip(CircleShape) .clip(CircleShape)
.fillMaxSize(0.6f) .fillMaxSize(0.6f)
.drawBehind { drawRect(backgroundColor) }
} }
Box( Box(
myIconBackgroundModifier.background(MaterialTheme.colors.background) myIconBackgroundModifier
) )
val myIconModifier = remember { val myIconModifier = remember {
@@ -45,7 +45,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.platform.LocalClipboardManager
@@ -69,6 +68,7 @@ import com.vitorpamplona.amethyst.ui.components.SelectTextDialog
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.ReportNoteDialog import com.vitorpamplona.amethyst.ui.screen.loggedIn.ReportNoteDialog
import com.vitorpamplona.amethyst.ui.theme.WarningColor import com.vitorpamplona.amethyst.ui.theme.WarningColor
import com.vitorpamplona.amethyst.ui.theme.secondaryButtonBackground
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -137,7 +137,7 @@ fun NoteQuickActionMenu(note: Note, popupExpanded: Boolean, onDismiss: () -> Uni
val backgroundColor = if (MaterialTheme.colors.isLight) { val backgroundColor = if (MaterialTheme.colors.isLight) {
MaterialTheme.colors.primary MaterialTheme.colors.primary
} else { } else {
MaterialTheme.colors.primary.copy(alpha = 0.32f).compositeOver(MaterialTheme.colors.background) MaterialTheme.colors.secondaryButtonBackground
} }
val showToast = { stringResource: Int -> val showToast = { stringResource: Int ->
@@ -33,6 +33,8 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
import com.vitorpamplona.amethyst.ui.theme.mediumImportanceLink
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.util.* import java.util.*
@@ -124,7 +126,7 @@ private fun OptionNote(
val color = if (poolOption.consensusThreadhold) { val color = if (poolOption.consensusThreadhold) {
Color.Green.copy(alpha = 0.32f) Color.Green.copy(alpha = 0.32f)
} else { } else {
MaterialTheme.colors.primary.copy(alpha = 0.32f) MaterialTheme.colors.mediumImportanceLink
} }
ZapVote( ZapVote(
@@ -411,7 +413,7 @@ fun ZapVote(
imageVector = Icons.Outlined.Bolt, imageVector = Icons.Outlined.Bolt,
contentDescription = stringResource(id = R.string.zaps), contentDescription = stringResource(id = R.string.zaps),
modifier = Modifier.size(20.dp), modifier = Modifier.size(20.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} else { } else {
Spacer(Modifier.width(3.dp)) Spacer(Modifier.width(3.dp))
@@ -429,7 +431,7 @@ fun ZapVote(
Text( Text(
showAmount(poolOption.zappedValue), showAmount(poolOption.zappedValue),
fontSize = 14.sp, fontSize = 14.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
modifier = modifier modifier = modifier
) )
} }
@@ -67,6 +67,7 @@ import com.vitorpamplona.amethyst.ui.actions.NewPostView
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.collections.immutable.toImmutableMap import kotlinx.collections.immutable.toImmutableMap
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@@ -78,7 +79,7 @@ import kotlin.math.roundToInt
@Composable @Composable
fun ReactionsRow(baseNote: Note, showReactionDetail: Boolean, accountViewModel: AccountViewModel, nav: (String) -> Unit) { fun ReactionsRow(baseNote: Note, showReactionDetail: Boolean, accountViewModel: AccountViewModel, nav: (String) -> Unit) {
val grayTint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) val grayTint = MaterialTheme.colors.placeholderText
var wantsToSeeReactions = remember { var wantsToSeeReactions = remember {
mutableStateOf<Boolean>(false) mutableStateOf<Boolean>(false)
@@ -25,6 +25,7 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.RelayInfo import com.vitorpamplona.amethyst.model.RelayInfo
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import java.time.Instant import java.time.Instant
import java.time.ZoneId import java.time.ZoneId
import java.time.format.DateTimeFormatter import java.time.format.DateTimeFormatter
@@ -67,7 +68,7 @@ fun RelayCompose(
Text( Text(
"${relay.counter} ${stringResource(R.string.posts_received)}", "${relay.counter} ${stringResource(R.string.posts_received)}",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
@@ -21,6 +21,8 @@ import com.vitorpamplona.amethyst.model.*
import com.vitorpamplona.amethyst.ui.actions.toImmutableListOfLists import com.vitorpamplona.amethyst.ui.actions.toImmutableListOfLists
import com.vitorpamplona.amethyst.ui.components.CreateClickableTextWithEmoji import com.vitorpamplona.amethyst.ui.components.CreateClickableTextWithEmoji
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.lessImportantLink
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -69,7 +71,7 @@ private fun ReplyInformation(
Text( Text(
stringResource(R.string.replying_to), stringResource(R.string.replying_to),
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
repliesToDisplay.forEachIndexed { idx, user -> repliesToDisplay.forEachIndexed { idx, user ->
@@ -80,13 +82,13 @@ private fun ReplyInformation(
Text( Text(
", ", ", ",
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} else if (idx < repliesToDisplay.size - 1) { } else if (idx < repliesToDisplay.size - 1) {
Text( Text(
stringResource(R.string.and), stringResource(R.string.and),
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
} else { } else {
@@ -94,25 +96,25 @@ private fun ReplyInformation(
Text( Text(
", ", ", ",
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} else if (idx < repliesToDisplay.size) { } else if (idx < repliesToDisplay.size) {
Text( Text(
stringResource(R.string.and), stringResource(R.string.and),
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
ClickableText( ClickableText(
AnnotatedString("${sortedMentions.size - 2}"), AnnotatedString("${sortedMentions.size - 2}"),
style = LocalTextStyle.current.copy(color = MaterialTheme.colors.primary.copy(alpha = 0.52f), fontSize = 13.sp), style = LocalTextStyle.current.copy(color = MaterialTheme.colors.lessImportantLink, fontSize = 13.sp),
onClick = { expanded = true } onClick = { expanded = true }
) )
Text( Text(
" ${stringResource(R.string.others)}", " ${stringResource(R.string.others)}",
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -195,12 +197,12 @@ fun ReplyInformationChannel(
Text( Text(
stringResource(R.string.in_channel), stringResource(R.string.in_channel),
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
ClickableText( ClickableText(
text = channelName, text = channelName,
style = LocalTextStyle.current.copy(color = MaterialTheme.colors.primary.copy(alpha = 0.52f), fontSize = 13.sp), style = LocalTextStyle.current.copy(color = MaterialTheme.colors.lessImportantLink, fontSize = 13.sp),
onClick = { onChannelTagClick(channel) } onClick = { onChannelTagClick(channel) }
) )
@@ -209,7 +211,7 @@ fun ReplyInformationChannel(
Text( Text(
stringResource(id = R.string.replying_to), stringResource(id = R.string.replying_to),
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
mentions.forEachIndexed { idx, user -> mentions.forEachIndexed { idx, user ->
@@ -219,13 +221,13 @@ fun ReplyInformationChannel(
Text( Text(
", ", ", ",
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} else if (idx < mentions.size - 1) { } else if (idx < mentions.size - 1) {
Text( Text(
" ${stringResource(id = R.string.add)} ", " ${stringResource(id = R.string.add)} ",
fontSize = 13.sp, fontSize = 13.sp,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -246,7 +248,7 @@ private fun ReplyInfoMention(
clickablePart = remember(innerUserState) { "$prefix${innerUserState?.user?.toBestDisplayName()}" }, clickablePart = remember(innerUserState) { "$prefix${innerUserState?.user?.toBestDisplayName()}" },
tags = remember(innerUserState) { innerUserState?.user?.info?.latestMetadata?.tags?.toImmutableListOfLists() }, tags = remember(innerUserState) { innerUserState?.user?.info?.latestMetadata?.tags?.toImmutableListOfLists() },
style = LocalTextStyle.current.copy( style = LocalTextStyle.current.copy(
color = MaterialTheme.colors.primary.copy(alpha = 0.52f), color = MaterialTheme.colors.lessImportantLink,
fontSize = 13.sp fontSize = 13.sp
), ),
onClick = { onUserTagClick(user) } onClick = { onUserTagClick(user) }
@@ -78,6 +78,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner
import com.vitorpamplona.amethyst.ui.screen.loggedIn.getFragmentActivity import com.vitorpamplona.amethyst.ui.screen.loggedIn.getFragmentActivity
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -324,7 +325,7 @@ fun UpdateZapAmountDialog(onClose: () -> Unit, nip47uri: String? = null, account
placeholder = { placeholder = {
Text( Text(
text = "100, 1000, 5000", text = "100, 1000, 5000",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true, singleLine = true,
@@ -413,7 +414,7 @@ fun UpdateZapAmountDialog(onClose: () -> Unit, nip47uri: String? = null, account
Text( Text(
stringResource(id = R.string.wallet_connect_service_explainer), stringResource(id = R.string.wallet_connect_service_explainer),
Modifier.weight(1f), Modifier.weight(1f),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
fontSize = 14.sp fontSize = 14.sp
) )
} }
@@ -452,7 +453,7 @@ fun UpdateZapAmountDialog(onClose: () -> Unit, nip47uri: String? = null, account
placeholder = { placeholder = {
Text( Text(
text = "npub, hex", text = "npub, hex",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true, singleLine = true,
@@ -474,7 +475,7 @@ fun UpdateZapAmountDialog(onClose: () -> Unit, nip47uri: String? = null, account
placeholder = { placeholder = {
Text( Text(
text = "wss://relay.server.com", text = "wss://relay.server.com",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1 maxLines = 1
) )
}, },
@@ -518,7 +519,7 @@ fun UpdateZapAmountDialog(onClose: () -> Unit, nip47uri: String? = null, account
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.wallet_connect_service_secret_placeholder), text = stringResource(R.string.wallet_connect_service_secret_placeholder),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
trailingIcon = { trailingIcon = {
@@ -48,6 +48,7 @@ import com.vitorpamplona.amethyst.ui.components.BundledInsert
import com.vitorpamplona.amethyst.ui.screen.loggedIn.showAmountAxis import com.vitorpamplona.amethyst.ui.screen.loggedIn.showAmountAxis
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.RoyalBlue import com.vitorpamplona.amethyst.ui.theme.RoyalBlue
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
@@ -80,7 +81,7 @@ fun UserReactionsRow(
imageVector = Icons.Default.ExpandMore, imageVector = Icons.Default.ExpandMore,
null, null,
modifier = Modifier.size(20.dp), modifier = Modifier.size(20.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
@@ -14,6 +14,7 @@ import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists
import com.vitorpamplona.amethyst.ui.actions.toImmutableListOfLists import com.vitorpamplona.amethyst.ui.actions.toImmutableListOfLists
import com.vitorpamplona.amethyst.ui.components.CreateTextWithEmoji import com.vitorpamplona.amethyst.ui.components.CreateTextWithEmoji
import com.vitorpamplona.amethyst.ui.theme.placeholderText
@Composable @Composable
fun NoteUsernameDisplay(baseNote: Note, weight: Modifier = Modifier) { fun NoteUsernameDisplay(baseNote: Note, weight: Modifier = Modifier) {
@@ -53,7 +54,7 @@ private fun UserNameDisplay(
CreateTextWithEmoji( CreateTextWithEmoji(
text = remember { "@$bestUserName" }, text = remember { "@$bestUserName" },
tags = tags, tags = tags,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
modifier = modifier modifier = modifier
@@ -26,6 +26,7 @@ import com.vitorpamplona.amethyst.ui.actions.CloseButton
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -148,7 +149,7 @@ fun ZapCustomDialog(onClose: () -> Unit, accountViewModel: AccountViewModel, bas
placeholder = { placeholder = {
Text( Text(
text = "100, 1000, 5000", text = "100, 1000, 5000",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true, singleLine = true,
@@ -199,7 +200,7 @@ fun ZapCustomDialog(onClose: () -> Unit, accountViewModel: AccountViewModel, bas
placeholder = { placeholder = {
Text( Text(
text = stringResource(id = R.string.custom_zaps_add_a_message_example), text = stringResource(id = R.string.custom_zaps_add_a_message_example),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
singleLine = true, singleLine = true,
@@ -35,6 +35,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.ShowUserButton
import com.vitorpamplona.amethyst.ui.screen.loggedIn.UnfollowButton import com.vitorpamplona.amethyst.ui.screen.loggedIn.UnfollowButton
import com.vitorpamplona.amethyst.ui.screen.loggedIn.showAmountAxis import com.vitorpamplona.amethyst.ui.screen.loggedIn.showAmountAxis
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -225,7 +226,7 @@ fun AboutDisplay(baseAuthor: User) {
Text( Text(
userAboutMe, userAboutMe,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
@@ -81,6 +81,8 @@ import com.vitorpamplona.amethyst.ui.note.NoteUsernameDisplay
import com.vitorpamplona.amethyst.ui.note.ReactionsRow import com.vitorpamplona.amethyst.ui.note.ReactionsRow
import com.vitorpamplona.amethyst.ui.note.timeAgo import com.vitorpamplona.amethyst.ui.note.timeAgo
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.lessImportantLink
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import com.vitorpamplona.amethyst.ui.theme.selectedNote import com.vitorpamplona.amethyst.ui.theme.selectedNote
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.collections.immutable.toImmutableSet import kotlinx.collections.immutable.toImmutableSet
@@ -141,8 +143,8 @@ fun ThreadFeedView(noteId: String, viewModel: FeedViewModel, accountViewModel: A
item, item,
modifier = Modifier.drawReplyLevel( modifier = Modifier.drawReplyLevel(
item.replyLevel(), item.replyLevel(),
MaterialTheme.colors.onSurface.copy(alpha = 0.32f), MaterialTheme.colors.placeholderText,
if (item.idHex == noteId) MaterialTheme.colors.primary.copy(alpha = 0.52f) else MaterialTheme.colors.onSurface.copy(alpha = 0.32f) if (item.idHex == noteId) MaterialTheme.colors.lessImportantLink else MaterialTheme.colors.placeholderText
), ),
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav nav = nav
@@ -159,8 +161,8 @@ fun ThreadFeedView(noteId: String, viewModel: FeedViewModel, accountViewModel: A
item, item,
modifier = Modifier.drawReplyLevel( modifier = Modifier.drawReplyLevel(
item.replyLevel(), item.replyLevel(),
MaterialTheme.colors.onSurface.copy(alpha = 0.32f), MaterialTheme.colors.placeholderText,
if (item.idHex == noteId) MaterialTheme.colors.primary.copy(alpha = 0.52f) else MaterialTheme.colors.onSurface.copy(alpha = 0.32f) if (item.idHex == noteId) MaterialTheme.colors.lessImportantLink else MaterialTheme.colors.placeholderText
), ),
parentBackgroundColor = background, parentBackgroundColor = background,
isBoostedNote = false, isBoostedNote = false,
@@ -284,7 +286,7 @@ fun NoteMaster(
Text( Text(
timeAgo(note.createdAt(), context = context), timeAgo(note.createdAt(), context = context),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 1 maxLines = 1
) )
@@ -296,7 +298,7 @@ fun NoteMaster(
imageVector = Icons.Default.MoreVert, imageVector = Icons.Default.MoreVert,
null, null,
modifier = Modifier.size(15.dp), modifier = Modifier.size(15.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
NoteDropDownMenu(baseNote, moreActionsExpanded, { moreActionsExpanded = false }, accountViewModel) NoteDropDownMenu(baseNote, moreActionsExpanded, { moreActionsExpanded = false }, accountViewModel)
@@ -80,6 +80,7 @@ import com.vitorpamplona.amethyst.ui.note.ChatroomMessageCompose
import com.vitorpamplona.amethyst.ui.screen.NostrChannelFeedViewModel import com.vitorpamplona.amethyst.ui.screen.NostrChannelFeedViewModel
import com.vitorpamplona.amethyst.ui.screen.RefreshingChatroomFeedView import com.vitorpamplona.amethyst.ui.screen.RefreshingChatroomFeedView
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
@@ -281,7 +282,7 @@ fun DisplayReplyingToNote(
modifier = Modifier modifier = Modifier
.padding(end = 5.dp) .padding(end = 5.dp)
.size(30.dp), .size(30.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -318,7 +319,7 @@ fun EditFieldRow(
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.reply_here), text = stringResource(R.string.reply_here),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
textStyle = LocalTextStyle.current.copy(textDirection = TextDirection.Content), textStyle = LocalTextStyle.current.copy(textDirection = TextDirection.Content),
@@ -334,7 +335,7 @@ fun EditFieldRow(
leadingIcon = { leadingIcon = {
UploadFromGallery( UploadFromGallery(
isUploading = channelScreenModel.isUploadingImage, isUploading = channelScreenModel.isUploadingImage,
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), tint = MaterialTheme.colors.placeholderText,
modifier = Modifier.padding(start = 5.dp) modifier = Modifier.padding(start = 5.dp)
) { ) {
val fileServer = if (isPrivate) { val fileServer = if (isPrivate) {
@@ -418,7 +419,7 @@ fun ChannelHeader(baseChannel: Channel, accountViewModel: AccountViewModel, nav:
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
Text( Text(
"${channel.info.about}", "${channel.info.about}",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), color = MaterialTheme.colors.placeholderText,
maxLines = 2, maxLines = 2,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
fontSize = 12.sp fontSize = 12.sp
@@ -489,7 +490,7 @@ private fun NoteCopyButton(
shape = ButtonBorder, shape = ButtonBorder,
colors = ButtonDefaults colors = ButtonDefaults
.buttonColors( .buttonColors(
backgroundColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) backgroundColor = MaterialTheme.colors.placeholderText
) )
) { ) {
Icon( Icon(
@@ -45,6 +45,7 @@ import com.vitorpamplona.amethyst.ui.screen.ChatroomListFeedView
import com.vitorpamplona.amethyst.ui.screen.FeedViewModel import com.vitorpamplona.amethyst.ui.screen.FeedViewModel
import com.vitorpamplona.amethyst.ui.screen.NostrChatroomListKnownFeedViewModel import com.vitorpamplona.amethyst.ui.screen.NostrChatroomListKnownFeedViewModel
import com.vitorpamplona.amethyst.ui.screen.NostrChatroomListNewFeedViewModel import com.vitorpamplona.amethyst.ui.screen.NostrChatroomListNewFeedViewModel
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -123,7 +124,7 @@ fun ChatroomListScreen(
Icon( Icon(
imageVector = Icons.Default.MoreVert, imageVector = Icons.Default.MoreVert,
contentDescription = null, contentDescription = null,
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
ChatroomTabMenu( ChatroomTabMenu(
@@ -36,6 +36,7 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.actions.CloseButton import com.vitorpamplona.amethyst.ui.actions.CloseButton
import com.vitorpamplona.amethyst.ui.components.richTextDefaults import com.vitorpamplona.amethyst.ui.components.richTextDefaults
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@Composable @Composable
@@ -121,7 +122,7 @@ fun ConnectOrbotDialog(onClose: () -> Unit, onPost: () -> Unit, portNumber: Muta
placeholder = { placeholder = {
Text( Text(
text = "9050", text = "9050",
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
) )
@@ -97,6 +97,7 @@ import com.vitorpamplona.amethyst.ui.screen.RelayFeedViewModel
import com.vitorpamplona.amethyst.ui.screen.UserFeedViewModel import com.vitorpamplona.amethyst.ui.screen.UserFeedViewModel
import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -447,7 +448,7 @@ private fun ProfileHeader(
contentPadding = PaddingValues(0.dp) contentPadding = PaddingValues(0.dp)
) { ) {
Icon( Icon(
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), tint = MaterialTheme.colors.placeholderText,
imageVector = Icons.Default.MoreVert, imageVector = Icons.Default.MoreVert,
contentDescription = stringResource(R.string.more_options) contentDescription = stringResource(R.string.more_options)
) )
@@ -610,7 +611,7 @@ private fun DrawAdditionalInfo(
CreateTextWithEmoji( CreateTextWithEmoji(
text = "@$it", text = "@$it",
tags = tags, tags = tags,
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -620,7 +621,7 @@ private fun DrawAdditionalInfo(
Text( Text(
text = user.pubkeyDisplayHex(), text = user.pubkeyDisplayHex(),
modifier = Modifier.padding(top = 1.dp, bottom = 1.dp), modifier = Modifier.padding(top = 1.dp, bottom = 1.dp),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
IconButton( IconButton(
@@ -633,7 +634,7 @@ private fun DrawAdditionalInfo(
imageVector = Icons.Default.ContentCopy, imageVector = Icons.Default.ContentCopy,
null, null,
modifier = Modifier.size(15.dp), modifier = Modifier.size(15.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
@@ -660,7 +661,7 @@ private fun DrawAdditionalInfo(
painter = painterResource(R.drawable.ic_qrcode), painter = painterResource(R.drawable.ic_qrcode),
null, null,
modifier = Modifier.size(15.dp), modifier = Modifier.size(15.dp),
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
} }
} }
@@ -673,7 +674,7 @@ private fun DrawAdditionalInfo(
if (!website.isNullOrEmpty()) { if (!website.isNullOrEmpty()) {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
Icon( Icon(
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f), tint = MaterialTheme.colors.placeholderText,
imageVector = Icons.Default.Link, imageVector = Icons.Default.Link,
contentDescription = stringResource(R.string.website), contentDescription = stringResource(R.string.website),
modifier = Modifier.size(16.dp) modifier = Modifier.size(16.dp)
@@ -1224,7 +1225,7 @@ private fun MessageButton(user: User, nav: (String) -> Unit) {
shape = ButtonBorder, shape = ButtonBorder,
colors = ButtonDefaults colors = ButtonDefaults
.buttonColors( .buttonColors(
backgroundColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) backgroundColor = MaterialTheme.colors.placeholderText
) )
) { ) {
Icon( Icon(
@@ -69,6 +69,7 @@ import com.vitorpamplona.amethyst.ui.note.UsernameDisplay
import com.vitorpamplona.amethyst.ui.screen.NostrGlobalFeedViewModel import com.vitorpamplona.amethyst.ui.screen.NostrGlobalFeedViewModel
import com.vitorpamplona.amethyst.ui.screen.RefresheableFeedView import com.vitorpamplona.amethyst.ui.screen.RefresheableFeedView
import com.vitorpamplona.amethyst.ui.screen.ScrollStateKeys import com.vitorpamplona.amethyst.ui.screen.ScrollStateKeys
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
@@ -316,7 +317,7 @@ private fun SearchTextField(
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.npub_hex_username), text = stringResource(R.string.npub_hex_username),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
trailingIcon = { trailingIcon = {
@@ -87,6 +87,7 @@ import com.vitorpamplona.amethyst.ui.screen.LoadingFeed
import com.vitorpamplona.amethyst.ui.screen.NostrVideoFeedViewModel import com.vitorpamplona.amethyst.ui.screen.NostrVideoFeedViewModel
import com.vitorpamplona.amethyst.ui.screen.ScrollStateKeys import com.vitorpamplona.amethyst.ui.screen.ScrollStateKeys
import com.vitorpamplona.amethyst.ui.screen.rememberForeverPagerState import com.vitorpamplona.amethyst.ui.screen.rememberForeverPagerState
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
@@ -341,7 +342,7 @@ private fun VideoUserOptionAction(
imageVector = Icons.Default.MoreVert, imageVector = Icons.Default.MoreVert,
null, null,
modifier = remember { Modifier.size(20.dp) }, modifier = remember { Modifier.size(20.dp) },
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) tint = MaterialTheme.colors.placeholderText
) )
NoteDropDownMenu( NoteDropDownMenu(
@@ -494,8 +495,8 @@ private fun ShowProgress(postViewModel: NewMediaModel) {
progress = postViewModel.uploadingPercentage.value, progress = postViewModel.uploadingPercentage.value,
modifier = Modifier modifier = Modifier
.size(55.dp) .size(55.dp)
.background(MaterialTheme.colors.background) .clip(CircleShape)
.clip(CircleShape), .background(MaterialTheme.colors.background),
strokeWidth = 5.dp strokeWidth = 5.dp
) )
postViewModel.uploadingDescription.value?.let { postViewModel.uploadingDescription.value?.let {
@@ -40,6 +40,7 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.qrcode.SimpleQrCodeScanner import com.vitorpamplona.amethyst.ui.qrcode.SimpleQrCodeScanner
import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel
import com.vitorpamplona.amethyst.ui.screen.loggedIn.ConnectOrbotDialog import com.vitorpamplona.amethyst.ui.screen.loggedIn.ConnectOrbotDialog
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import java.util.* import java.util.*
@OptIn(ExperimentalComposeUiApi::class) @OptIn(ExperimentalComposeUiApi::class)
@@ -122,7 +123,7 @@ fun LoginPage(
placeholder = { placeholder = {
Text( Text(
text = stringResource(R.string.nsec_npub_hex_private_key), text = stringResource(R.string.nsec_npub_hex_private_key),
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) color = MaterialTheme.colors.placeholderText
) )
}, },
trailingIcon = { trailingIcon = {
@@ -4,7 +4,6 @@ import android.app.Activity
import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.Colors import androidx.compose.material.Colors
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.Shapes
import androidx.compose.material.darkColors import androidx.compose.material.darkColors
import androidx.compose.material.lightColors import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@@ -37,6 +36,30 @@ private val LightReplyItemBackground = LightColorPalette.onSurface.copy(alpha =
private val DarkSelectedNote = DarkNewItemBackground.compositeOver(DarkColorPalette.background) private val DarkSelectedNote = DarkNewItemBackground.compositeOver(DarkColorPalette.background)
private val LightSelectedNote = LightNewItemBackground.compositeOver(LightColorPalette.background) private val LightSelectedNote = LightNewItemBackground.compositeOver(LightColorPalette.background)
private val DarkButtonBackground = DarkColorPalette.primary.copy(alpha = 0.32f).compositeOver(DarkColorPalette.background)
private val LightButtonBackground = LightColorPalette.primary.copy(alpha = 0.32f).compositeOver(LightColorPalette.background)
private val DarkLessImportantLink = DarkColorPalette.primary.copy(alpha = 0.52f)
private val LightLessImportantLink = LightColorPalette.primary.copy(alpha = 0.52f)
private val DarkMediumImportantLink = DarkColorPalette.primary.copy(alpha = 0.32f)
private val LightMediumImportantLink = LightColorPalette.primary.copy(alpha = 0.32f)
private val DarkVeryImportantLink = DarkColorPalette.primary.copy(alpha = 0.12f)
private val LightVeryImportantLink = LightColorPalette.primary.copy(alpha = 0.12f)
private val DarkPlaceholderText = DarkColorPalette.onSurface.copy(alpha = 0.32f)
private val LightPlaceholderText = LightColorPalette.onSurface.copy(alpha = 0.32f)
private val DarkSubtleBorder = DarkColorPalette.onSurface.copy(alpha = 0.12f)
private val LightSubtleBorder = LightColorPalette.onSurface.copy(alpha = 0.12f)
private val DarkImageVerifier = Nip05.copy(0.52f).compositeOver(DarkColorPalette.background)
private val LightImageVerifier = Nip05.copy(0.52f).compositeOver(LightColorPalette.background)
private val DarkOverPictureBackground = DarkColorPalette.background.copy(0.62f)
private val LightOverPictureBackground = LightColorPalette.background.copy(0.62f)
val Colors.newItemBackgroundColor: Color val Colors.newItemBackgroundColor: Color
get() = if (isLight) LightNewItemBackground else DarkNewItemBackground get() = if (isLight) LightNewItemBackground else DarkNewItemBackground
@@ -46,6 +69,29 @@ val Colors.replyBackground: Color
val Colors.selectedNote: Color val Colors.selectedNote: Color
get() = if (isLight) LightSelectedNote else DarkSelectedNote get() = if (isLight) LightSelectedNote else DarkSelectedNote
val Colors.secondaryButtonBackground: Color
get() = if (isLight) LightButtonBackground else DarkButtonBackground
val Colors.lessImportantLink: Color
get() = if (isLight) LightLessImportantLink else DarkLessImportantLink
val Colors.mediumImportanceLink: Color
get() = if (isLight) LightMediumImportantLink else DarkMediumImportantLink
val Colors.veryImportantLink: Color
get() = if (isLight) LightVeryImportantLink else DarkVeryImportantLink
val Colors.placeholderText: Color
get() = if (isLight) LightPlaceholderText else DarkPlaceholderText
val Colors.subtleBorder: Color
get() = if (isLight) LightSubtleBorder else DarkSubtleBorder
val Colors.hashVerified: Color
get() = if (isLight) LightImageVerifier else DarkImageVerifier
val Colors.overPictureBackground: Color
get() = if (isLight) LightOverPictureBackground else DarkOverPictureBackground
@Composable @Composable
fun AmethystTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) { fun AmethystTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
val colors = if (darkTheme) { val colors = if (darkTheme) {
@@ -36,6 +36,7 @@ import com.vitorpamplona.amethyst.service.lang.LanguageTranslatorService
import com.vitorpamplona.amethyst.service.lang.ResultOrError import com.vitorpamplona.amethyst.service.lang.ResultOrError
import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import com.vitorpamplona.amethyst.ui.theme.lessImportantLink
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.util.Locale import java.util.Locale
@@ -117,7 +118,7 @@ private fun TranslationMessage(
.padding(top = 5.dp) .padding(top = 5.dp)
) { ) {
val clickableTextStyle = val clickableTextStyle =
SpanStyle(color = MaterialTheme.colors.primary.copy(alpha = 0.52f)) SpanStyle(color = MaterialTheme.colors.lessImportantLink)
val annotatedTranslationString = buildAnnotatedString { val annotatedTranslationString = buildAnnotatedString {
withStyle(clickableTextStyle) { withStyle(clickableTextStyle) {