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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ dependencies {
implementation(libs.accompanist.systemUI)
implementation(libs.accompanist.placeholder)
implementation(libs.accompanist.navAnimation)
implementation(libs.accompanist.flowLayout)

implementation(libs.androidx.paging3)
implementation(libs.androidx.paging3Compose)
Expand Down
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 @@ -367,7 +369,10 @@ private fun MessageAuthorRow(messageHeader: MessageHeader) {
modifier = Modifier.weight(weight = 1f, fill = true),
verticalAlignment = Alignment.CenterVertically
) {
Username(username.asString(), modifier = Modifier.weight(weight = 1f, fill = false))
Username(
username.asString(),
modifier = Modifier.weight(weight = 1f, fill = false)
)
UserBadge(
membership = membership,
connectionState = connectionState,
Expand All @@ -386,15 +391,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
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ compose-destinations-ksp ={module = "io.github.raamcosta.compose-destinations:ks
accompanist-systemUI = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
accompanist-placeholder = { module = "com.google.accompanist:accompanist-placeholder", version.ref = "accompanist" }
accompanist-navAnimation = { module = "com.google.accompanist:accompanist-navigation-animation", version.ref = "accompanist" }
accompanist-flowLayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist" }

# Image Loading
coil-core = { module = "io.coil-kt:coil", version.ref = "coil" }
Expand Down
2 changes: 1 addition & 1 deletion kalium
Submodule kalium updated 31 files
+1 −1 cryptography/src/androidMain/kotlin/com/wire/kalium/cryptography/ProteusClientCryptoBoxImpl.kt
+1 −1 cryptography/src/appleMain/kotlin/com/wire/kalium/cryptography/ProteusClientCoreCryptoImpl.kt
+2 −2 cryptography/src/appleMain/kotlin/com/wire/kalium/cryptography/ProteusClientImpl.kt
+1 −1 cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/ProteusClientCoreCryptoImpl.kt
+2 −2 cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/ProteusClientImpl.kt
+1 −1 cryptography/src/commonMain/kotlin/com/wire/kalium/cryptography/ProteusClient.kt
+1 −1 cryptography/src/commonTest/kotlin/com/wire/kalium/cryptography/ProteusClientTest.kt
+1 −1 cryptography/src/jsMain/kotlin/com/wire/kalium/cryptography/ProteusClientImpl.kt
+1 −1 cryptography/src/jvmMain/kotlin/com/wire/kalium/cryptography/ProteusClientCryptoBoxImpl.kt
+46 −12 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt
+2 −2 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt
+1 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt
+89 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/proteus/ProteusPreKeyRefiller.kt
+3 −3 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepositoryTest.kt
+7 −7 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCaseTest.kt
+236 −0 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/proteus/ProteusPreKeyRefillerTest.kt
+82 −0 logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/PreKeyRepositoryArrangement.kt
+9 −7 persistence/src/commonMain/db_user/com/wire/kalium/persistence/Conversations.sq
+5 −2 persistence/src/commonMain/db_user/com/wire/kalium/persistence/Users.sq
+86 −166 persistence/src/commonMain/db_user/migrations/51.sqm
+167 −1 persistence/src/commonMain/db_user/migrations/52.sqm
+1 −156 persistence/src/commonMain/db_user/migrations/53.sqm
+12 −108 persistence/src/commonMain/db_user/migrations/54.sqm
+253 −1 persistence/src/commonMain/db_user/migrations/55.sqm
+1 −0 persistence/src/commonMain/db_user/migrations/56.sqm
+16 −11 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/PrekeyDAO.kt
+16 −1 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/UserDAO.kt
+23 −8 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/member/MemberDAO.kt
+18 −24 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/dao/ConversationDAOTest.kt
+27 −1 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/dao/MemberDAOTest.kt
+9 −9 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/dao/PrekeyDAOTest.kt