Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate flowrow to compose foundation (WPB-3541) #2082

Merged
merged 7 commits into from
Aug 25, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ import androidx.compose.animation.core.tween
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -44,7 +46,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.google.accompanist.flowlayout.FlowRow
import androidx.compose.foundation.layout.FlowRow
import com.wire.android.R
import com.wire.android.media.audiomessage.AudioState
import com.wire.android.model.Clickable
Expand Down Expand Up @@ -385,15 +387,17 @@ private fun MessageAuthorRow(messageHeader: MessageHeader) {
}
}

@OptIn(ExperimentalLayoutApi::class)
@Composable
private fun MessageFooter(
messageFooter: MessageFooter,
onReactionClicked: (String, String) -> Unit
) {
if (messageFooter.reactions.entries.isNotEmpty()) { // to eliminate adding unnecessary paddings when the list is empty
// to eliminate adding unnecessary paddings when the list is empty
if (messageFooter.reactions.entries.isNotEmpty()) {
FlowRow(
mainAxisSpacing = dimensions().spacing4x,
crossAxisSpacing = dimensions().spacing6x,
horizontalArrangement = Arrangement.spacedBy(dimensions().spacing4x, Alignment.Start),
verticalArrangement = Arrangement.spacedBy(dimensions().spacing6x, Alignment.Top),
modifier = Modifier.padding(top = dimensions().spacing4x)
) {
messageFooter.reactions.entries
Expand Down