diff --git a/README.md b/README.md index 6030feb40..41394bf66 100644 --- a/README.md +++ b/README.md @@ -61,10 +61,10 @@ Or get the latest APK from the [Releases Section](https://github.com/vitorpamplo - [x] Push Notifications (Zaps and Messages) - [x] Generic Tags (NIP-12) - [x] Sensitive Content (NIP-36) +- [x] View Individual Reactions (Like, Boost, Zaps, Reports) per Post - [ ] Marketplace (NIP-15) - [ ] Image/Video Capture in the app -- [ ] Local Database -- [ ] View Individual Reactions (Like, Boost, Zaps, Reports) per Post +- [ ] Local Database - [ ] Bookmarks, Pinned Posts, Muted Events (NIP-51) - [ ] Relay Pages (NIP-11) - [ ] Proof of Work in the Phone (NIP-13, NIP-20) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt index 9a3837e3a..db931b686 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt @@ -71,6 +71,8 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner import com.vitorpamplona.amethyst.ui.screen.loggedIn.UserLine import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder +import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.Dispatchers @@ -288,11 +290,11 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, quote: Note? = n modifier = Modifier .padding(top = 4.dp) .fillMaxWidth() - .clip(shape = RoundedCornerShape(15.dp)) + .clip(shape = QuoteBorder) .border( 1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), - RoundedCornerShape(15.dp) + QuoteBorder ) ) } else if (videoExtensions.any { removedParamsFromUrl.endsWith(it) }) { @@ -401,7 +403,7 @@ fun Notifying(baseMentions: ImmutableList?, onClick: (User) -> Unit) { } Button( - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary.copy(alpha = 0.32f) ), @@ -619,7 +621,7 @@ fun CloseButton(onCancel: () -> Unit) { onClick = { onCancel() }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = Color.Gray @@ -643,7 +645,7 @@ fun PostButton(onPost: () -> Unit = {}, isActive: Boolean, modifier: Modifier = onPost() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = if (isActive) MaterialTheme.colors.primary else Color.Gray @@ -662,7 +664,7 @@ fun SaveButton(onPost: () -> Unit = {}, isActive: Boolean, modifier: Modifier = onPost() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = if (isActive) MaterialTheme.colors.primary else Color.Gray @@ -681,7 +683,7 @@ fun CreateButton(onPost: () -> Unit = {}, isActive: Boolean, modifier: Modifier onPost() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = if (isActive) MaterialTheme.colors.primary else Color.Gray @@ -700,7 +702,7 @@ fun SearchButton(onPost: () -> Unit = {}, isActive: Boolean, modifier: Modifier onPost() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = if (isActive) MaterialTheme.colors.primary else Color.Gray @@ -764,11 +766,11 @@ fun ImageVideoDescription( modifier = Modifier .fillMaxWidth() .padding(start = 30.dp, end = 30.dp) - .clip(shape = RoundedCornerShape(10.dp)) + .clip(shape = QuoteBorder) .border( 1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), - RoundedCornerShape(15.dp) + QuoteBorder ) ) { Column( @@ -919,7 +921,7 @@ fun ImageVideoDescription( onClick = { onAdd(message, selectedServer) }, - shape = RoundedCornerShape(15.dp), + shape = QuoteBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary ) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewRelayListView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewRelayListView.kt index 539b459ed..abca9e1a6 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewRelayListView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewRelayListView.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults import androidx.compose.material.Divider @@ -52,6 +51,7 @@ import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.model.RelaySetupInfo import com.vitorpamplona.amethyst.service.relays.FeedType import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import java.lang.Math.round @Composable @@ -504,7 +504,7 @@ fun EditableServerConfig(relayToAdd: String, onNewRelay: (RelaySetupInfo) -> Uni read = true } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = if (url.isNotBlank()) MaterialTheme.colors.primary else MaterialTheme.colors.onSurface.copy(alpha = 0.32f) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/SaveToGallery.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/SaveToGallery.kt index 0336877ce..3acf74183 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/SaveToGallery.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/SaveToGallery.kt @@ -3,7 +3,6 @@ package com.vitorpamplona.amethyst.ui.actions import android.Manifest import android.os.Build import android.widget.Toast -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults import androidx.compose.material.Text @@ -12,11 +11,11 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource -import androidx.compose.ui.unit.dp import com.google.accompanist.permissions.ExperimentalPermissionsApi import com.google.accompanist.permissions.isGranted import com.google.accompanist.permissions.rememberPermissionState import com.vitorpamplona.amethyst.R +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import kotlinx.coroutines.launch import java.io.File @@ -75,7 +74,7 @@ fun SaveToGallery(url: String) { writeStoragePermissionState.launchPermissionRequest() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = Color.Gray @@ -135,7 +134,7 @@ fun SaveToGallery(localFile: File, mimeType: String?) { writeStoragePermissionState.launchPermissionRequest() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = Color.Gray diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ExpandableRichTextViewer.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ExpandableRichTextViewer.kt index aade217ac..7ab5a140b 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ExpandableRichTextViewer.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ExpandableRichTextViewer.kt @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults import androidx.compose.material.MaterialTheme @@ -28,6 +27,7 @@ import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder const val SHORT_TEXT_LENGTH = 350 @@ -101,7 +101,7 @@ public fun ShowMoreButton(onClick: () -> Unit) { Button( modifier = Modifier.padding(top = 10.dp), onClick = onClick, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary.copy(alpha = 0.32f) .compositeOver(MaterialTheme.colors.background) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoicePreview.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoicePreview.kt index e77f4268a..9478e25e4 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoicePreview.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoicePreview.kt @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment @@ -25,6 +24,7 @@ import androidx.compose.ui.unit.sp import androidx.core.content.ContextCompat.startActivity import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.service.lnurl.LnInvoiceUtil +import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.text.NumberFormat @@ -66,8 +66,8 @@ fun InvoicePreview(lnInvoice: String, amount: String?) { modifier = Modifier .fillMaxWidth() .padding(start = 30.dp, end = 30.dp) - .clip(shape = RoundedCornerShape(10.dp)) - .border(1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), RoundedCornerShape(15.dp)) + .clip(shape = QuoteBorder) + .border(1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), QuoteBorder) ) { Column( modifier = Modifier @@ -118,7 +118,7 @@ fun InvoicePreview(lnInvoice: String, amount: String?) { startActivity(context, intent, null) } }, - shape = RoundedCornerShape(15.dp), + shape = QuoteBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary ) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoiceRequest.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoiceRequest.kt index a5c417728..3d6c51035 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoiceRequest.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/InvoiceRequest.kt @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults @@ -37,6 +36,7 @@ import androidx.compose.ui.unit.sp import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.service.lnurl.LightningAddressResolver +import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import kotlinx.coroutines.launch @Composable @@ -56,8 +56,8 @@ fun InvoiceRequest( modifier = Modifier .fillMaxWidth() .padding(start = 30.dp, end = 30.dp) - .clip(shape = RoundedCornerShape(10.dp)) - .border(1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), RoundedCornerShape(15.dp)) + .clip(shape = QuoteBorder) + .border(1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), QuoteBorder) ) { Column( modifier = Modifier @@ -153,7 +153,7 @@ fun InvoiceRequest( } ) }, - shape = RoundedCornerShape(15.dp), + shape = QuoteBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary ) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt index ad51fd2b2..e8932675a 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt @@ -6,7 +6,6 @@ import android.util.Patterns import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.* -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.ClickableText import androidx.compose.foundation.text.InlineTextContent import androidx.compose.foundation.text.appendInlineContent @@ -43,6 +42,7 @@ import com.vitorpamplona.amethyst.ui.actions.ImmutableListOfLists import com.vitorpamplona.amethyst.ui.actions.toImmutableListOfLists import com.vitorpamplona.amethyst.ui.note.NoteCompose import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel +import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import com.vitorpamplona.amethyst.ui.uriToRoute import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableMap @@ -412,11 +412,11 @@ private fun RenderContentAsMarkdown(content: String, backgroundColor: Color, tag modifier = Modifier .padding(0.dp) .fillMaxWidth() - .clip(shape = RoundedCornerShape(15.dp)) + .clip(shape = QuoteBorder) .border( 1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), - RoundedCornerShape(15.dp) + QuoteBorder ) .background( MaterialTheme.colors.onSurface @@ -767,17 +767,18 @@ private fun DisplayFullNote( nav: (String) -> Unit, loadedLink: LoadedBechLink ) { + println("AAA: Display Full Note") val borderColor = MaterialTheme.colors.onSurface.copy(alpha = 0.12f) val modifier = remember { Modifier .padding(top = 2.dp, bottom = 0.dp, start = 0.dp, end = 0.dp) .fillMaxWidth() - .clip(shape = RoundedCornerShape(15.dp)) + .clip(shape = QuoteBorder) .border( 1.dp, borderColor, - RoundedCornerShape(15.dp) + QuoteBorder ) } @@ -952,11 +953,11 @@ private fun DisplayNoteFromTag( modifier = Modifier .padding(top = 2.dp, bottom = 0.dp, start = 0.dp, end = 0.dp) .fillMaxWidth() - .clip(shape = RoundedCornerShape(15.dp)) + .clip(shape = QuoteBorder) .border( 1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), - RoundedCornerShape(15.dp) + QuoteBorder ), parentBackgroundColor = backgroundColor, isQuotedNote = true, diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/SensitivityWarning.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/SensitivityWarning.kt index f0951a307..467e8b7df 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/SensitivityWarning.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/SensitivityWarning.kt @@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults import androidx.compose.material.Icon @@ -35,6 +34,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder @Composable fun SensitivityWarning( @@ -108,7 +108,7 @@ fun ContentWarningNote(onDismiss: () -> Unit) { Button( modifier = Modifier.padding(top = 10.dp), onClick = onDismiss, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/UrlPreviewCard.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/UrlPreviewCard.kt index 475b2410f..af957121c 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/UrlPreviewCard.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/UrlPreviewCard.kt @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable @@ -21,6 +20,7 @@ import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.service.previews.UrlInfoItem +import com.vitorpamplona.amethyst.ui.theme.QuoteBorder @Composable fun UrlPreviewCard( @@ -32,11 +32,11 @@ fun UrlPreviewCard( Row( modifier = Modifier .clickable { runCatching { uri.openUri(url) } } - .clip(shape = RoundedCornerShape(15.dp)) + .clip(shape = QuoteBorder) .border( 1.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.12f), - RoundedCornerShape(15.dp) + QuoteBorder ) ) { Column { diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt index dfee43bbe..8c34ccc10 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt @@ -26,7 +26,6 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.pager.PagerState import androidx.compose.foundation.shape.CircleShape -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.InlineTextContent import androidx.compose.foundation.text.appendInlineContent import androidx.compose.material.Icon @@ -76,6 +75,7 @@ import com.vitorpamplona.amethyst.ui.actions.LoadingAnimation import com.vitorpamplona.amethyst.ui.actions.SaveToGallery import com.vitorpamplona.amethyst.ui.note.BlankNote import com.vitorpamplona.amethyst.ui.theme.Nip05 +import com.vitorpamplona.amethyst.ui.theme.QuoteBorder import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.Dispatchers @@ -177,11 +177,11 @@ fun ZoomableContentView(content: ZoomableContent, images: ImmutableList(false) } - Spacer(modifier = Modifier.height(5.dp)) + Spacer(modifier = Modifier.height(7.dp)) Row(verticalAlignment = CenterVertically, modifier = Modifier.padding(start = 10.dp)) { if (showReactionDetail) { @@ -120,7 +120,7 @@ fun ReactionsRow(baseNote: Note, showReactionDetail: Boolean, accountViewModel: ReactionDetailGallery(baseNote, nav, accountViewModel) } - Spacer(modifier = Modifier.height(5.dp)) + Spacer(modifier = Modifier.height(7.dp)) } @Composable @@ -835,7 +835,7 @@ private fun BoostTypeChoicePopup(baseNote: Note, accountViewModel: AccountViewMo onDismiss() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -847,7 +847,7 @@ private fun BoostTypeChoicePopup(baseNote: Note, accountViewModel: AccountViewMo Button( modifier = Modifier.padding(horizontal = 3.dp), onClick = onQuote, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -900,7 +900,7 @@ fun ZapAmountChoicePopup( onDismiss() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayCompose.kt index f110d6369..7c9d63d80 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayCompose.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayCompose.kt @@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults import androidx.compose.material.Divider @@ -25,6 +24,7 @@ import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.model.RelayInfo import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import java.time.Instant import java.time.ZoneId import java.time.format.DateTimeFormatter @@ -94,7 +94,7 @@ fun AddRelayButton(onClick: () -> Unit) { Button( modifier = Modifier.padding(horizontal = 3.dp), onClick = onClick, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -110,7 +110,7 @@ fun RemoveRelayButton(onClick: () -> Unit) { Button( modifier = Modifier.padding(horizontal = 3.dp), onClick = onClick, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateZapAmountDialog.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateZapAmountDialog.kt index b72c176db..0978a2408 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateZapAmountDialog.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateZapAmountDialog.kt @@ -25,7 +25,6 @@ import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll import androidx.compose.material.Button @@ -78,6 +77,7 @@ import com.vitorpamplona.amethyst.ui.qrcode.SimpleQrCodeScanner import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner import com.vitorpamplona.amethyst.ui.screen.loggedIn.getFragmentActivity +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch @@ -280,7 +280,7 @@ fun UpdateZapAmountDialog(onClose: () -> Unit, nip47uri: String? = null, account postViewModel.amountSet.forEach { amountInSats -> Button( modifier = Modifier.padding(horizontal = 3.dp), - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary ), @@ -335,7 +335,7 @@ fun UpdateZapAmountDialog(onClose: () -> Unit, nip47uri: String? = null, account Button( onClick = { postViewModel.addAmount() }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary ) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt index 7d63d6092..298691c0d 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt @@ -2,7 +2,6 @@ package com.vitorpamplona.amethyst.ui.note import android.widget.Toast import androidx.compose.foundation.layout.* -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.* import androidx.compose.runtime.* @@ -26,6 +25,7 @@ import com.vitorpamplona.amethyst.service.model.LnZapEvent import com.vitorpamplona.amethyst.ui.actions.CloseButton import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.TextSpinner +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -217,7 +217,7 @@ fun ZapCustomDialog(onClose: () -> Unit, accountViewModel: AccountViewModel, bas fun ZapButton(isActive: Boolean, onPost: () -> Unit) { Button( onClick = { onPost() }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = if (isActive) MaterialTheme.colors.primary else Color.Gray diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountBackupDialog.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountBackupDialog.kt index 5567625e3..561c1cbb4 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountBackupDialog.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountBackupDialog.kt @@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults import androidx.compose.material.Icon @@ -47,6 +46,7 @@ import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.ui.actions.CloseButton import com.vitorpamplona.amethyst.ui.note.authenticate +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import nostr.postr.toNsec @@ -124,7 +124,7 @@ private fun NSecCopyButton( copyNSec(context, scope, account, clipboardManager) } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults.buttonColors( backgroundColor = MaterialTheme.colors.primary ), diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt index 128272fb5..2174bc9f2 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt @@ -79,6 +79,7 @@ import com.vitorpamplona.amethyst.ui.navigation.Route import com.vitorpamplona.amethyst.ui.note.ChatroomMessageCompose import com.vitorpamplona.amethyst.ui.screen.NostrChannelFeedViewModel import com.vitorpamplona.amethyst.ui.screen.RefreshingChatroomFeedView +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -485,7 +486,7 @@ private fun NoteCopyButton( .padding(horizontal = 3.dp) .width(50.dp), onClick = { popupExpanded = true }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) @@ -525,7 +526,7 @@ private fun EditButton(accountViewModel: AccountViewModel, channel: Channel) { .padding(horizontal = 3.dp) .width(50.dp), onClick = { wantsToPost = true }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -546,7 +547,7 @@ private fun JoinButton(accountViewModel: AccountViewModel, channel: Channel, nav onClick = { accountViewModel.account.joinChannel(channel.idHex) }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -565,7 +566,7 @@ private fun LeaveButton(accountViewModel: AccountViewModel, channel: Channel, na accountViewModel.account.leaveChannel(channel.idHex) nav(Route.Message.route) }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ConnectOrbotDialog.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ConnectOrbotDialog.kt index c7b3a1ebb..832d5275d 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ConnectOrbotDialog.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ConnectOrbotDialog.kt @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults @@ -36,6 +35,7 @@ import com.halilibo.richtext.ui.material.MaterialRichText import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.ui.actions.CloseButton import com.vitorpamplona.amethyst.ui.components.richTextDefaults +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import kotlinx.coroutines.launch @Composable @@ -141,7 +141,7 @@ fun UseOrbotButton(onPost: () -> Unit = {}, isActive: Boolean, modifier: Modifie onPost() } }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = if (isActive) MaterialTheme.colors.primary else Color.Gray diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt index f3c92a962..373092a90 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.* import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.rememberPagerState import androidx.compose.foundation.shape.CircleShape -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.ClickableText import androidx.compose.material.* import androidx.compose.material.icons.Icons @@ -97,6 +96,7 @@ import com.vitorpamplona.amethyst.ui.screen.RelayFeedView import com.vitorpamplona.amethyst.ui.screen.RelayFeedViewModel import com.vitorpamplona.amethyst.ui.screen.UserFeedViewModel import com.vitorpamplona.amethyst.ui.theme.BitcoinOrange +import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -439,7 +439,7 @@ private fun ProfileHeader( .size(30.dp) .align(Alignment.Center), onClick = { popupExpanded = true }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.background @@ -1216,7 +1216,7 @@ private fun MessageButton(user: User, nav: (String) -> Unit) { .padding(horizontal = 3.dp) .width(50.dp), onClick = { nav("Room/${user.pubkeyHex}") }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.onSurface.copy(alpha = 0.32f) @@ -1246,7 +1246,7 @@ private fun EditButton(account: Account) { .padding(horizontal = 3.dp) .width(50.dp), onClick = { wantsToEdit = true }, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -1265,7 +1265,7 @@ fun UnfollowButton(onClick: () -> Unit) { Button( modifier = Modifier.padding(horizontal = 3.dp), onClick = onClick, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -1281,7 +1281,7 @@ fun FollowButton(onClick: () -> Unit, text: Int = R.string.follow) { Button( modifier = Modifier.padding(start = 3.dp), onClick = onClick, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary @@ -1297,7 +1297,7 @@ fun ShowUserButton(onClick: () -> Unit) { Button( modifier = Modifier.padding(start = 3.dp), onClick = onClick, - shape = RoundedCornerShape(20.dp), + shape = ButtonBorder, colors = ButtonDefaults .buttonColors( backgroundColor = MaterialTheme.colors.primary diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt index a9542cd24..ff1c80d11 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt @@ -9,3 +9,9 @@ val Shapes = Shapes( medium = RoundedCornerShape(4.dp), large = RoundedCornerShape(0.dp) ) + +val QuoteBorder = RoundedCornerShape(15.dp) +val ButtonBorder = RoundedCornerShape(20.dp) + +val ChatBubbleShapeMe = RoundedCornerShape(15.dp, 15.dp, 3.dp, 15.dp) +val ChatBubbleShapeThem = RoundedCornerShape(3.dp, 15.dp, 15.dp, 15.dp) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt index 2bf60067c..492b6ee25 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt @@ -4,10 +4,12 @@ import android.app.Activity import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material.Colors import androidx.compose.material.MaterialTheme +import androidx.compose.material.Shapes import androidx.compose.material.darkColors import androidx.compose.material.lightColors import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect +import androidx.compose.runtime.remember import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalView @@ -37,7 +39,7 @@ private val LightColorPalette = lightColors( val Colors.newItemBackgroundColor: Color @Composable - get() = if (isLight) primary.copy(0.05f) else primary.copy(0.12f) + get() = remember { if (isLight) primary.copy(0.05f) else primary.copy(0.12f) } @Composable fun AmethystTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {