Skip to content

Commit

Permalink
chore: migrate flowrow to compose foundation (WPB-3541) (#2082)
Browse files Browse the repository at this point in the history
Co-authored-by: Oussama <[email protected]>
  • Loading branch information
trOnk12 and ohassine authored Aug 25, 2023
1 parent 98a9f25 commit 27f2ea3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
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

0 comments on commit 27f2ea3

Please sign in to comment.