Skip to content

Commit 13fb012

Browse files
authored
Merge pull request #5179 from element-hq/feature/bma/compose2025.08.00
Update Compose BOM to version 2025.12.00.
2 parents d4a6080 + b5d15ee commit 13fb012

File tree

124 files changed

+277
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+277
-263
lines changed

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/list/PinnedMessagesListNode.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import androidx.compose.runtime.CompositionLocalProvider
1515
import androidx.compose.ui.Modifier
1616
import androidx.compose.ui.platform.LocalContext
1717
import androidx.compose.ui.platform.LocalView
18+
import androidx.compose.ui.res.stringResource
1819
import com.bumble.appyx.core.modality.BuildContext
1920
import com.bumble.appyx.core.node.Node
2021
import com.bumble.appyx.core.plugin.Plugin
@@ -100,6 +101,7 @@ class PinnedMessagesListNode(
100101
LocalTimelineItemPresenterFactories provides timelineItemPresenterFactories,
101102
) {
102103
val context = LocalContext.current
104+
val toastMessage = stringResource(CommonStrings.common_copied_to_clipboard)
103105
val view = LocalView.current
104106
val state = presenter.present()
105107
PinnedMessagesListView(
@@ -113,8 +115,8 @@ class PinnedMessagesListNode(
113115
HapticFeedbackConstants.LONG_PRESS
114116
)
115117
context.copyToClipboard(
116-
it.url,
117-
context.getString(CommonStrings.common_copied_to_clipboard)
118+
text = it.url,
119+
toastMessage = toastMessage,
118120
)
119121
},
120122
modifier = modifier

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineView.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ fun TimelineView(
123123
}
124124

125125
val context = LocalContext.current
126+
val toastMessage = stringResource(CommonStrings.common_copied_to_clipboard)
126127
val view = LocalView.current
127128
// Disable reverse layout when TalkBack is enabled to avoid incorrect ordering issues seen in the current Compose UI version
128129
val useReverseLayout = !isTalkbackActive()
@@ -136,8 +137,8 @@ fun TimelineView(
136137
HapticFeedbackConstants.LONG_PRESS
137138
)
138139
context.copyToClipboard(
139-
link.url,
140-
context.getString(CommonStrings.common_copied_to_clipboard)
140+
text = link.url,
141+
toastMessage = toastMessage,
141142
)
142143
}
143144

features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ private fun DebugInfoSection(
721721
) {
722722
val context = LocalContext.current
723723
PreferenceCategory(showTopDivider = true) {
724+
val toastMessage = stringResource(CommonStrings.common_copied_to_clipboard)
724725
ListItem(
725726
headlineContent = {
726727
Text("Internal room ID")
@@ -736,8 +737,8 @@ private fun DebugInfoSection(
736737
trailingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Copy())),
737738
onClick = {
738739
context.copyToClipboard(
739-
roomId.value,
740-
context.getString(CommonStrings.common_copied_to_clipboard)
740+
text = roomId.value,
741+
toastMessage = toastMessage,
741742
)
742743
},
743744
)

features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/setup/SecureBackupSetupView.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ private fun Content(
116116
) {
117117
val context = LocalContext.current
118118
val formattedRecoveryKey = state.recoveryKeyViewState.formattedRecoveryKey
119+
val toastMessage = stringResource(R.string.screen_recovery_key_copied_to_clipboard)
119120
val clickLambda = if (formattedRecoveryKey != null) {
120121
{
121122
context.copyToClipboard(
122-
formattedRecoveryKey,
123-
context.getString(R.string.screen_recovery_key_copied_to_clipboard)
123+
text = formattedRecoveryKey,
124+
toastMessage = toastMessage,
124125
)
125126
state.eventSink.invoke(SecureBackupSetupEvents.RecoveryKeyHasBeenSaved)
126127
}

features/viewfolder/impl/src/main/kotlin/io/element/android/features/viewfolder/impl/file/FileContent.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@ private fun LineRow(
7373
colorationMode: ColorationMode,
7474
) {
7575
val context = LocalContext.current
76+
val toastMessage = stringResource(CommonStrings.common_line_copied_to_clipboard)
7677
Row(
7778
modifier = Modifier
7879
.fillMaxWidth()
7980
.clickable(onClick = {
8081
context.copyToClipboard(
8182
text = line,
82-
toastMessage = context.getString(CommonStrings.common_line_copied_to_clipboard),
83+
toastMessage = toastMessage,
8384
)
8485
})
8586
) {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ camera = "1.5.2"
2222
work = "2.11.0"
2323

2424
# Compose
25-
compose_bom = "2025.07.00"
25+
compose_bom = "2025.12.00"
2626

2727
# Coroutines
2828
coroutines = "1.10.2"

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/tooltip/ElementTooltipDefaults.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
package io.element.android.libraries.designsystem.components.tooltip
1010

1111
import androidx.compose.material3.ExperimentalMaterial3Api
12+
import androidx.compose.material3.TooltipAnchorPosition
1213
import androidx.compose.material3.TooltipDefaults
1314
import androidx.compose.runtime.Composable
1415
import androidx.compose.runtime.remember
@@ -41,8 +42,9 @@ object ElementTooltipDefaults {
4142
windowPadding: Dp = 12.dp,
4243
): PopupPositionProvider {
4344
val windowPaddingPx = with(LocalDensity.current) { windowPadding.roundToPx() }
44-
val plainTooltipPositionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(
45-
spacingBetweenTooltipAndAnchor = spacingBetweenTooltipAndAnchor,
45+
val plainTooltipPositionProvider = TooltipDefaults.rememberTooltipPositionProvider(
46+
positioning = TooltipAnchorPosition.Above,
47+
spacingBetweenTooltipAndAnchor = spacingBetweenTooltipAndAnchor
4648
)
4749
return remember(windowPaddingPx, plainTooltipPositionProvider) {
4850
object : PopupPositionProvider {

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/preview/SheetState.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import androidx.compose.material3.ExperimentalMaterial3Api
1212
import androidx.compose.material3.SheetState
1313
import androidx.compose.material3.SheetValue
1414
import androidx.compose.runtime.Composable
15-
import androidx.compose.ui.platform.LocalDensity
1615

1716
@OptIn(ExperimentalMaterial3Api::class)
1817
@Composable
1918
fun sheetStateForPreview() = SheetState(
2019
skipPartiallyExpanded = true,
20+
positionalThreshold = { 0.5f },
21+
velocityThreshold = { 400f },
2122
initialValue = SheetValue.Expanded,
22-
density = LocalDensity.current,
2323
)

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/MediumTopAppBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fun MediumTopAppBar(
3333
navigationIcon: @Composable () -> Unit = {},
3434
actions: @Composable RowScope.() -> Unit = {},
3535
windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
36-
colors: TopAppBarColors = TopAppBarDefaults.mediumTopAppBarColors(),
36+
colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors(),
3737
scrollBehavior: TopAppBarScrollBehavior? = null
3838
) {
3939
androidx.compose.material3.MediumTopAppBar(

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/SearchBar.kt

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import androidx.compose.foundation.layout.ColumnScope
1414
import androidx.compose.foundation.layout.Spacer
1515
import androidx.compose.foundation.layout.WindowInsets
1616
import androidx.compose.foundation.layout.fillMaxWidth
17+
import androidx.compose.foundation.layout.heightIn
1718
import androidx.compose.foundation.layout.padding
1819
import androidx.compose.foundation.layout.size
1920
import androidx.compose.material3.ExperimentalMaterial3Api
2021
import androidx.compose.material3.SearchBar
2122
import androidx.compose.material3.SearchBarColors
2223
import androidx.compose.material3.SearchBarDefaults
23-
import androidx.compose.material3.TextFieldColors
2424
import androidx.compose.material3.TextFieldDefaults
2525
import androidx.compose.runtime.Composable
2626
import androidx.compose.runtime.Immutable
@@ -45,6 +45,9 @@ import io.element.android.libraries.designsystem.preview.ElementThemedPreview
4545
import io.element.android.libraries.designsystem.preview.PreviewGroup
4646
import io.element.android.libraries.ui.strings.CommonStrings
4747

48+
/**
49+
* Ref: https://www.figma.com/design/G1xy0HDZKJf5TCRFmKb5d5/Compound-Android-Components?node-id=1992-8350
50+
*/
4851
@OptIn(ExperimentalMaterial3Api::class)
4952
@Composable
5053
fun <T> SearchBar(
@@ -63,14 +66,12 @@ fun <T> SearchBar(
6366
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
6467
inactiveBarColors: SearchBarColors = ElementSearchBarDefaults.inactiveColors(),
6568
activeBarColors: SearchBarColors = ElementSearchBarDefaults.activeColors(),
66-
inactiveTextInputColors: TextFieldColors = ElementSearchBarDefaults.inactiveInputFieldColors(),
67-
activeTextInputColors: TextFieldColors = ElementSearchBarDefaults.activeInputFieldColors(),
6869
contentPrefix: @Composable ColumnScope.() -> Unit = {},
6970
contentSuffix: @Composable ColumnScope.() -> Unit = {},
7071
resultHandler: @Composable ColumnScope.(T) -> Unit = {},
7172
) {
7273
val focusManager = LocalFocusManager.current
73-
74+
val colors = if (active) activeBarColors else inactiveBarColors
7475
val updatedOnQueryChange by rememberUpdatedState(onQueryChange)
7576
LaunchedEffect(active) {
7677
if (!active) {
@@ -107,28 +108,25 @@ fun <T> SearchBar(
107108
}
108109
}
109110
}
110-
111111
!active -> {
112112
{
113113
Icon(
114114
imageVector = CompoundIcons.Search(),
115115
contentDescription = stringResource(CommonStrings.action_search),
116-
tint = ElementTheme.colors.iconTertiary,
117116
)
118117
}
119118
}
120-
121119
else -> null
122120
},
123121
interactionSource = interactionSource,
124-
colors = if (active) activeTextInputColors else inactiveTextInputColors,
122+
colors = colors.inputFieldColors,
125123
)
126124
},
127125
expanded = active,
128126
onExpandedChange = onActiveChange,
129127
modifier = modifier.padding(horizontal = if (!active) 16.dp else 0.dp),
130128
shape = shape,
131-
colors = if (active) activeBarColors else inactiveBarColors,
129+
colors = colors,
132130
tonalElevation = tonalElevation,
133131
windowInsets = windowInsets,
134132
content = {
@@ -163,35 +161,43 @@ object ElementSearchBarDefaults {
163161
@OptIn(ExperimentalMaterial3Api::class)
164162
@Composable
165163
fun inactiveColors() = SearchBarDefaults.colors(
166-
containerColor = ElementTheme.materialColors.surfaceVariant,
167-
dividerColor = ElementTheme.materialColors.outline,
164+
containerColor = Color.Transparent,
165+
dividerColor = ElementTheme.colors.borderInteractivePrimary,
166+
inputFieldColors = inactiveInputFieldColors(),
168167
)
169168

170169
@Composable
171170
fun inactiveInputFieldColors() = TextFieldDefaults.colors(
172171
unfocusedPlaceholderColor = ElementTheme.colors.textDisabled,
173172
focusedPlaceholderColor = ElementTheme.colors.textDisabled,
174-
unfocusedLeadingIconColor = ElementTheme.materialColors.primary,
175-
focusedLeadingIconColor = ElementTheme.materialColors.primary,
176-
unfocusedTrailingIconColor = ElementTheme.materialColors.primary,
177-
focusedTrailingIconColor = ElementTheme.materialColors.primary,
173+
unfocusedTrailingIconColor = ElementTheme.colors.iconDisabled,
174+
focusedTrailingIconColor = ElementTheme.colors.iconDisabled,
175+
focusedContainerColor = ElementTheme.colors.bgSubtleSecondary,
176+
unfocusedContainerColor = ElementTheme.colors.bgSubtleSecondary,
177+
disabledContainerColor = ElementTheme.colors.bgSubtleSecondary,
178+
errorContainerColor = ElementTheme.colors.bgSubtleSecondary,
178179
)
179180

180181
@OptIn(ExperimentalMaterial3Api::class)
181182
@Composable
182183
fun activeColors() = SearchBarDefaults.colors(
183184
containerColor = Color.Transparent,
184-
dividerColor = ElementTheme.materialColors.outline,
185+
dividerColor = ElementTheme.colors.borderInteractivePrimary,
186+
inputFieldColors = activeInputFieldColors(),
185187
)
186188

187189
@Composable
188190
fun activeInputFieldColors() = TextFieldDefaults.colors(
189-
unfocusedPlaceholderColor = ElementTheme.colors.textDisabled,
190-
focusedPlaceholderColor = ElementTheme.colors.textDisabled,
191-
unfocusedLeadingIconColor = ElementTheme.materialColors.primary,
192-
focusedLeadingIconColor = ElementTheme.materialColors.primary,
193-
unfocusedTrailingIconColor = ElementTheme.materialColors.primary,
194-
focusedTrailingIconColor = ElementTheme.materialColors.primary,
191+
unfocusedPlaceholderColor = ElementTheme.colors.textSecondary,
192+
focusedPlaceholderColor = ElementTheme.colors.textSecondary,
193+
unfocusedLeadingIconColor = ElementTheme.colors.iconPrimary,
194+
focusedLeadingIconColor = ElementTheme.colors.iconPrimary,
195+
unfocusedTrailingIconColor = ElementTheme.colors.iconTertiary,
196+
focusedTrailingIconColor = ElementTheme.colors.iconTertiary,
197+
focusedContainerColor = Color.Transparent,
198+
unfocusedContainerColor = Color.Transparent,
199+
disabledContainerColor = Color.Transparent,
200+
errorContainerColor = Color.Transparent,
195201
)
196202
}
197203

@@ -295,6 +301,7 @@ private fun ContentToPreview(
295301
resultHandler: @Composable ColumnScope.(String) -> Unit = {},
296302
) {
297303
SearchBar(
304+
modifier = Modifier.heightIn(max = 200.dp),
298305
query = query,
299306
active = active,
300307
resultState = resultState,

0 commit comments

Comments
 (0)