Avoiding the creation of modifiers.
This commit is contained in:
@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Arrangement
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
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.fillMaxWidth
|
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
@@ -55,6 +54,8 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|||||||
import com.vitorpamplona.amethyst.ui.theme.ChatBubbleMaxSizeModifier
|
import com.vitorpamplona.amethyst.ui.theme.ChatBubbleMaxSizeModifier
|
||||||
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.ChatPaddingInnerQuoteModifier
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.ChatPaddingModifier
|
||||||
import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer
|
import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Font12SP
|
import com.vitorpamplona.amethyst.ui.theme.Font12SP
|
||||||
import com.vitorpamplona.amethyst.ui.theme.ReactionRowHeightChat
|
import com.vitorpamplona.amethyst.ui.theme.ReactionRowHeightChat
|
||||||
@@ -218,7 +219,7 @@ fun NormalChatNote(
|
|||||||
nav: (String) -> Unit,
|
nav: (String) -> Unit,
|
||||||
onWantsToReply: (Note) -> Unit
|
onWantsToReply: (Note) -> Unit
|
||||||
) {
|
) {
|
||||||
val drawAuthorInfo by remember {
|
val drawAuthorInfo by remember(note) {
|
||||||
derivedStateOf {
|
derivedStateOf {
|
||||||
val noteEvent = note.event
|
val noteEvent = note.event
|
||||||
if (accountViewModel.isLoggedUser(note.author)) {
|
if (accountViewModel.isLoggedUser(note.author)) {
|
||||||
@@ -267,31 +268,14 @@ fun NormalChatNote(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
val modif = remember {
|
|
||||||
if (innerQuote) {
|
|
||||||
Modifier.padding(top = 10.dp, end = 5.dp)
|
|
||||||
} else {
|
|
||||||
Modifier
|
|
||||||
.fillMaxWidth(1f)
|
|
||||||
.padding(
|
|
||||||
start = 12.dp,
|
|
||||||
end = 12.dp,
|
|
||||||
top = 5.dp,
|
|
||||||
bottom = 5.dp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = modif,
|
modifier = if (innerQuote) ChatPaddingInnerQuoteModifier else ChatPaddingModifier,
|
||||||
horizontalArrangement = alignment
|
horizontalArrangement = alignment
|
||||||
) {
|
) {
|
||||||
val availableBubbleSize = remember { mutableIntStateOf(0) }
|
val availableBubbleSize = remember { mutableIntStateOf(0) }
|
||||||
var popupExpanded by remember { mutableStateOf(false) }
|
var popupExpanded by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
val modif2 = remember {
|
val modif2 = if (innerQuote) Modifier else ChatBubbleMaxSizeModifier
|
||||||
if (innerQuote) Modifier else ChatBubbleMaxSizeModifier
|
|
||||||
}
|
|
||||||
|
|
||||||
val clickableModifier = remember {
|
val clickableModifier = remember {
|
||||||
Modifier
|
Modifier
|
||||||
|
|||||||
@@ -156,6 +156,16 @@ val ZeroPadding = PaddingValues(0.dp)
|
|||||||
val FeedPadding = PaddingValues(top = 10.dp, bottom = 10.dp)
|
val FeedPadding = PaddingValues(top = 10.dp, bottom = 10.dp)
|
||||||
val ButtonPadding = PaddingValues(vertical = 6.dp, horizontal = 16.dp)
|
val ButtonPadding = PaddingValues(vertical = 6.dp, horizontal = 16.dp)
|
||||||
|
|
||||||
|
val ChatPaddingInnerQuoteModifier = Modifier.padding(top = 10.dp, end = 5.dp)
|
||||||
|
val ChatPaddingModifier = Modifier
|
||||||
|
.fillMaxWidth(1f)
|
||||||
|
.padding(
|
||||||
|
start = 12.dp,
|
||||||
|
end = 12.dp,
|
||||||
|
top = 5.dp,
|
||||||
|
bottom = 5.dp
|
||||||
|
)
|
||||||
|
|
||||||
val profileContentHeaderModifier = Modifier.fillMaxWidth().padding(top = 70.dp, start = Size25dp, end = Size25dp)
|
val profileContentHeaderModifier = Modifier.fillMaxWidth().padding(top = 70.dp, start = Size25dp, end = Size25dp)
|
||||||
val bannerModifier = Modifier.fillMaxWidth().height(120.dp)
|
val bannerModifier = Modifier.fillMaxWidth().height(120.dp)
|
||||||
val drawerSpacing = Modifier.padding(top = Size10dp, start = Size25dp, end = Size25dp)
|
val drawerSpacing = Modifier.padding(top = Size10dp, start = Size25dp, end = Size25dp)
|
||||||
|
|||||||
Reference in New Issue
Block a user