From df437d2abaa35a3d6bd965c438daa43185498943 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 09:38:25 +0200 Subject: [PATCH 01/36] Use color from design (same value) --- .../android/features/analytics/impl/AnalyticsOptInView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt b/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt index 30e93302ea..48f9e60258 100644 --- a/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt +++ b/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt @@ -174,7 +174,7 @@ private fun AnalyticsOptInContentRow( .padding(2.dp), imageVector = Icons.Rounded.Check, contentDescription = null, - tint = ElementTheme.colors.iconSuccessPrimary, + tint = ElementTheme.colors.textActionAccent, ) Text( modifier = Modifier.padding(start = 16.dp), From fef58a476e96d913a639c367edf14dfc740dd416 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 10:25:41 +0200 Subject: [PATCH 02/36] Design iteration on preferences. --- .../components/preferences/Config.kt | 5 +- .../preferences/PreferenceCategory.kt | 16 ++- .../preferences/PreferenceCheckbox.kt | 92 +++++++++++++++ .../preferences/PreferenceScreen.kt | 9 +- .../components/preferences/PreferenceSlide.kt | 52 ++++----- .../preferences/PreferenceSwitch.kt | 55 +++++---- .../components/preferences/PreferenceText.kt | 105 +++++++++--------- .../preferences/components/PreferenceIcon.kt | 11 +- 8 files changed, 223 insertions(+), 122 deletions(-) create mode 100644 libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/Config.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/Config.kt index 3b3bc8460e..be8c86448e 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/Config.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/Config.kt @@ -18,7 +18,6 @@ package io.element.android.libraries.designsystem.components.preferences import androidx.compose.ui.unit.dp -internal val preferenceMinHeightOnlyTitle = 48.dp -internal val preferenceMinHeight = 64.dp +internal val preferenceMinHeightOnlyTitle = 56.dp +internal val preferenceMinHeight = 56.dp internal val preferencePaddingHorizontal = 16.dp -internal val preferencePaddingVertical = 16.dp diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt index 0569900b8b..1bfd209a71 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt @@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Announcement import androidx.compose.material.icons.filled.BugReport -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview @@ -32,6 +31,7 @@ import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup import io.element.android.libraries.designsystem.theme.components.Divider import io.element.android.libraries.designsystem.theme.components.Text +import io.element.android.libraries.theme.ElementTheme @Composable fun PreferenceCategory( @@ -57,9 +57,14 @@ fun PreferenceCategory( @Composable fun PreferenceCategoryTitle(title: String, modifier: Modifier = Modifier) { Text( - modifier = modifier.padding(top = 12.dp, start = 16.dp, end = 16.dp), - style = MaterialTheme.typography.titleMedium, - color = MaterialTheme.colorScheme.primary, + modifier = modifier.padding( + top = 12.dp, + bottom = 8.dp, + start = preferencePaddingHorizontal, + end = preferencePaddingHorizontal, + ), + style = ElementTheme.typography.fontBodyLgMedium, + color = ElementTheme.materialColors.primary, text = title, ) } @@ -85,7 +90,8 @@ private fun ContentToPreview() { PreferenceSlide( title = "Slide", summary = "Summary", - value = 0.75F + value = 0.75F, + showIconAreaIfNoIcon = true, ) } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt new file mode 100644 index 0000000000..276dbf5323 --- /dev/null +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.designsystem.components.preferences + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.defaultMinSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Announcement +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import io.element.android.libraries.designsystem.components.preferences.components.PreferenceIcon +import io.element.android.libraries.designsystem.preview.ElementThemedPreview +import io.element.android.libraries.designsystem.preview.PreviewGroup +import io.element.android.libraries.designsystem.theme.components.Checkbox +import io.element.android.libraries.designsystem.theme.components.Text +import io.element.android.libraries.designsystem.toEnabledColor +import io.element.android.libraries.theme.ElementTheme + +@Composable +fun PreferenceCheckbox( + title: String, + isChecked: Boolean, + modifier: Modifier = Modifier, + enabled: Boolean = true, + icon: ImageVector? = null, + showIconAreaIfNoIcon: Boolean = false, + onCheckedChange: (Boolean) -> Unit = {}, +) { + Row( + modifier = modifier + .fillMaxWidth() + .defaultMinSize(minHeight = preferenceMinHeight) + .padding(vertical = 4.dp, horizontal = preferencePaddingHorizontal) + .clickable { onCheckedChange(!isChecked) }, + verticalAlignment = Alignment.CenterVertically + ) { + PreferenceIcon( + icon = icon, + enabled = enabled, + isVisible = showIconAreaIfNoIcon + ) + Text( + modifier = Modifier + .weight(1f), + style = ElementTheme.typography.fontBodyLgRegular, + text = title, + color = enabled.toEnabledColor(), + ) + Checkbox( + modifier = Modifier + .align(Alignment.CenterVertically), + checked = isChecked, + enabled = enabled, + onCheckedChange = onCheckedChange + ) + } +} + +@Preview(group = PreviewGroup.Preferences) +@Composable +internal fun PreferenceCheckboxPreview() = ElementThemedPreview { ContentToPreview() } + +@Composable +private fun ContentToPreview() { + PreferenceCheckbox( + title = "Checkbox", + icon = Icons.Default.Announcement, + enabled = true, + isChecked = true + ) +} diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt index 3826e6ebde..84c6ff7655 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt @@ -136,10 +136,17 @@ private fun ContentToPreview() { isChecked = true, ) Divider() + PreferenceCheckbox( + title = "Checkbox", + icon = Icons.Default.Announcement, + isChecked = true, + ) + Divider() PreferenceSlide( title = "Slide", summary = "Summary", - value = 0.75F + value = 0.75F, + showIconAreaIfNoIcon = true, ) } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt index 024f026c4c..91a9852ed4 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt @@ -17,7 +17,6 @@ package io.element.android.libraries.designsystem.components.preferences import androidx.annotation.FloatRange -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.defaultMinSize @@ -25,17 +24,18 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Person -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import io.element.android.libraries.designsystem.components.preferences.components.PreferenceIcon import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup import io.element.android.libraries.designsystem.theme.components.Slider import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.toEnabledColor +import io.element.android.libraries.theme.ElementTheme @Composable fun PreferenceSlide( @@ -44,45 +44,41 @@ fun PreferenceSlide( value: Float, modifier: Modifier = Modifier, icon: ImageVector? = null, + showIconAreaIfNoIcon: Boolean = false, enabled: Boolean = true, summary: String? = null, steps: Int = 0, onValueChange: (Float) -> Unit = {}, ) { - Box( + Row( modifier = modifier .fillMaxWidth() .defaultMinSize(minHeight = preferenceMinHeight) - .padding(top = preferencePaddingVertical), + .padding(vertical = 4.dp, horizontal = preferencePaddingHorizontal), ) { - Row(modifier = Modifier.fillMaxWidth()) { - PreferenceIcon(icon = icon) - Column( - modifier = Modifier - .weight(1f) - .padding(end = preferencePaddingHorizontal), - ) { + PreferenceIcon(icon = icon, isVisible = showIconAreaIfNoIcon) + Column( + modifier = Modifier + .weight(1f), + ) { + Text( + style = ElementTheme.typography.fontBodyLgRegular, + text = title, + color = enabled.toEnabledColor(), + ) + summary?.let { Text( - modifier = Modifier.fillMaxWidth(), - style = MaterialTheme.typography.bodyLarge, + style = ElementTheme.typography.fontBodyMdRegular, + text = summary, color = enabled.toEnabledColor(), - text = title - ) - summary?.let { - Text( - modifier = Modifier.fillMaxWidth(), - style = MaterialTheme.typography.bodyMedium, - color = enabled.toEnabledColor(), - text = summary - ) - } - Slider( - value = value, - steps = steps, - onValueChange = onValueChange, - enabled = enabled, ) } + Slider( + value = value, + steps = steps, + onValueChange = onValueChange, + enabled = enabled, + ) } } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt index 96427c1dee..41661c2b90 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt @@ -17,25 +17,25 @@ package io.element.android.libraries.designsystem.components.preferences import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Announcement -import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Switch import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import io.element.android.libraries.designsystem.components.preferences.components.PreferenceIcon import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup -import io.element.android.libraries.designsystem.theme.components.Checkbox import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.toEnabledColor +import io.element.android.libraries.theme.ElementTheme @Composable fun PreferenceSwitch( @@ -44,38 +44,37 @@ fun PreferenceSwitch( modifier: Modifier = Modifier, enabled: Boolean = true, icon: ImageVector? = null, + showIconAreaIfNoIcon: Boolean = false, onCheckedChange: (Boolean) -> Unit = {}, ) { - Box( + Row( modifier = modifier .fillMaxWidth() .defaultMinSize(minHeight = preferenceMinHeight) + .padding(vertical = 4.dp, horizontal = preferencePaddingHorizontal) .clickable { onCheckedChange(!isChecked) }, - contentAlignment = Alignment.CenterStart + verticalAlignment = Alignment.CenterVertically ) { - Row(modifier = Modifier.fillMaxWidth()) { - PreferenceIcon( - modifier = Modifier.padding(vertical = preferencePaddingVertical), - icon = icon, - enabled = enabled - ) - Text( - modifier = Modifier - .weight(1f) - .padding(vertical = preferencePaddingVertical), - style = MaterialTheme.typography.bodyLarge, - color = enabled.toEnabledColor(), - text = title - ) - Checkbox( - modifier = Modifier - .padding(end = preferencePaddingHorizontal) - .align(Alignment.CenterVertically), - checked = isChecked, - enabled = enabled, - onCheckedChange = onCheckedChange - ) - } + PreferenceIcon( + icon = icon, + enabled = enabled, + isVisible = showIconAreaIfNoIcon + ) + Text( + modifier = Modifier + .weight(1f), + style = ElementTheme.typography.fontBodyLgRegular, + text = title, + color = enabled.toEnabledColor(), + ) + // TODO Create a wrapper for Switch + Switch( + modifier = Modifier + .align(Alignment.CenterVertically), + checked = isChecked, + enabled = enabled, + onCheckedChange = onCheckedChange + ) } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt index 2195be296f..fd0d4c0b4f 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt @@ -18,19 +18,15 @@ package io.element.android.libraries.designsystem.components.preferences import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.progressSemantics import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.BugReport -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -43,75 +39,75 @@ import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup import io.element.android.libraries.designsystem.theme.components.CircularProgressIndicator import io.element.android.libraries.designsystem.theme.components.Text +import io.element.android.libraries.theme.ElementTheme +/** + * Tried to use ListItem, but it cannot really match the design. Keep custom Layout for now. + */ @Composable fun PreferenceText( - title: String?, + title: String, modifier: Modifier = Modifier, subtitle: String? = null, currentValue: String? = null, loadingCurrentValue: Boolean = false, icon: ImageVector? = null, + showIconAreaIfNoIcon: Boolean = false, tintColor: Color? = null, onClick: () -> Unit = {}, ) { val minHeight = if (subtitle == null) preferenceMinHeightOnlyTitle else preferenceMinHeight - Box( + + Row( modifier = modifier .fillMaxWidth() .defaultMinSize(minHeight = minHeight) .clickable { onClick() } - .padding(end = preferencePaddingHorizontal), + .padding(horizontal = preferencePaddingHorizontal, vertical = 4.dp), + verticalAlignment = Alignment.CenterVertically ) { - Row( + PreferenceIcon( + icon = icon, + isVisible = showIconAreaIfNoIcon, + tintColor = tintColor ?: ElementTheme.materialColors.secondary + ) + Column( modifier = Modifier - .fillMaxWidth() - .padding(vertical = preferencePaddingVertical) + .weight(1f) + .align(Alignment.CenterVertically) ) { - PreferenceIcon(icon = icon, tintColor = tintColor) - Column( - modifier = Modifier - .weight(1f) - .align(Alignment.CenterVertically) - ) { - if (title != null) { - Text( - style = MaterialTheme.typography.bodyLarge, - text = title, - color = tintColor ?: MaterialTheme.colorScheme.primary, - ) - } - if (title != null && subtitle != null) { - Spacer(modifier = Modifier.height(8.dp)) - } - if (subtitle != null) { - Text( - style = MaterialTheme.typography.bodyMedium, - text = subtitle, - color = tintColor ?: MaterialTheme.colorScheme.tertiary, - ) - } - } - if (currentValue != null) { + Text( + style = ElementTheme.typography.fontBodyLgRegular, + text = title, + color = tintColor ?: ElementTheme.materialColors.primary, + ) + if (subtitle != null) { Text( - modifier = Modifier - .align(Alignment.CenterVertically) - .padding(horizontal = 16.dp), - text = currentValue, - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.secondary, - ) - } else if (loadingCurrentValue) { - CircularProgressIndicator( - modifier = Modifier - .progressSemantics() - .padding(horizontal = 16.dp) - .size(20.dp) - .align(Alignment.CenterVertically), - strokeWidth = 2.dp + style = ElementTheme.typography.fontBodyMdRegular, + text = subtitle, + color = tintColor ?: ElementTheme.materialColors.secondary, ) } } + if (currentValue != null) { + Text( + modifier = Modifier + .align(Alignment.CenterVertically) + .padding(horizontal = 16.dp), + text = currentValue, + style = ElementTheme.typography.fontBodyXsMedium, + color = ElementTheme.materialColors.secondary, + ) + } else if (loadingCurrentValue) { + CircularProgressIndicator( + modifier = Modifier + .progressSemantics() + .padding(horizontal = 16.dp) + .size(20.dp) + .align(Alignment.CenterVertically), + strokeWidth = 2.dp + ) + } } } @@ -155,5 +151,14 @@ private fun ContentToPreview() { icon = Icons.Default.BugReport, loadingCurrentValue = true, ) + PreferenceText( + title = "Title no icon with icon area", + showIconAreaIfNoIcon = true, + loadingCurrentValue = true, + ) + PreferenceText( + title = "Title no icon", + loadingCurrentValue = true, + ) } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/components/PreferenceIcon.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/components/PreferenceIcon.kt index 1f6e07b44c..ec44a7846a 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/components/PreferenceIcon.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/components/PreferenceIcon.kt @@ -17,8 +17,8 @@ package io.element.android.libraries.designsystem.components.preferences.components import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -46,14 +46,11 @@ fun PreferenceIcon( contentDescription = "", tint = tintColor ?: enabled.toSecondaryEnabledColor(), modifier = modifier - .padding(start = 8.dp) - .width(48.dp) - .heightIn(max = 48.dp), + .padding(end = 16.dp) + .size(24.dp), ) } else if (isVisible) { - Spacer(modifier = modifier.width(56.dp)) - } else { - Spacer(modifier = modifier.width(16.dp)) + Spacer(modifier = modifier.width(40.dp)) } } From 54b5097c52c089d04b21f24330bbcbf65b5c89b0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 10:37:36 +0200 Subject: [PATCH 03/36] Update some setting screens. --- .../features/logout/api/LogoutPreferenceScreen.kt | 14 +++++--------- .../impl/developer/DeveloperSettingsView.kt | 5 +---- .../libraries/featureflag/ui/FeatureListView.kt | 5 ++--- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt b/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt index 343bef4498..0ad6eab4eb 100644 --- a/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt +++ b/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt @@ -27,11 +27,9 @@ import androidx.compose.ui.tooling.preview.Preview import io.element.android.libraries.architecture.Async import io.element.android.libraries.designsystem.components.ProgressDialog import io.element.android.libraries.designsystem.components.dialogs.ConfirmationDialog -import io.element.android.libraries.designsystem.components.preferences.PreferenceCategory import io.element.android.libraries.designsystem.components.preferences.PreferenceText import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight -import io.element.android.libraries.ui.strings.CommonStrings @Composable fun LogoutPreferenceView( @@ -81,13 +79,11 @@ fun LogoutPreferenceView( fun LogoutPreferenceContent( onClick: () -> Unit = {}, ) { - PreferenceCategory(title = stringResource(id = CommonStrings.settings_title_general)) { - PreferenceText( - title = stringResource(id = R.string.screen_signout_preference_item), - icon = Icons.Default.Logout, - onClick = onClick - ) - } + PreferenceText( + title = stringResource(id = R.string.screen_signout_preference_item), + icon = Icons.Default.Logout, + onClick = onClick + ) } @Preview diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt index 6403c70bf7..ff5c1b1bfd 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt @@ -16,8 +16,6 @@ package io.element.android.features.preferences.impl.developer -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Delete import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -55,10 +53,9 @@ fun DeveloperSettingsView( ) } val cache = state.cacheSize - PreferenceCategory(title = "Cache") { + PreferenceCategory(title = "Cache", showDivider = false) { PreferenceText( title = "Clear cache", - icon = Icons.Default.Delete, currentValue = cache.dataOrNull(), loadingCurrentValue = state.cacheSize.isLoading() || state.clearCacheAction.isLoading(), onClick = { diff --git a/libraries/featureflag/ui/src/main/kotlin/io/element/android/libraries/featureflag/ui/FeatureListView.kt b/libraries/featureflag/ui/src/main/kotlin/io/element/android/libraries/featureflag/ui/FeatureListView.kt index 2f17482875..87d0125278 100644 --- a/libraries/featureflag/ui/src/main/kotlin/io/element/android/libraries/featureflag/ui/FeatureListView.kt +++ b/libraries/featureflag/ui/src/main/kotlin/io/element/android/libraries/featureflag/ui/FeatureListView.kt @@ -20,7 +20,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview -import io.element.android.libraries.designsystem.components.preferences.PreferenceSwitch +import io.element.android.libraries.designsystem.components.preferences.PreferenceCheckbox import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.featureflag.ui.model.FeatureUiModel @@ -52,8 +52,7 @@ fun FeaturePreferenceView( onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier ) { - - PreferenceSwitch( + PreferenceCheckbox( title = feature.title, isChecked = feature.isEnabled, modifier = modifier, From bd3142b0bb5ba5152a7c8717e880df6a35eee861 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 10:43:30 +0200 Subject: [PATCH 04/36] Create PreferenceDivider --- .../preferences/PreferenceCategory.kt | 3 +- .../preferences/PreferenceDivider.kt | 46 +++++++++++++++++++ .../preferences/PreferenceScreen.kt | 7 ++- 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt index 1bfd209a71..6d557d5994 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt @@ -29,7 +29,6 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup -import io.element.android.libraries.designsystem.theme.components.Divider import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.theme.ElementTheme @@ -49,7 +48,7 @@ fun PreferenceCategory( } content() if (showDivider) { - Divider() + PreferenceDivider() } } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt new file mode 100644 index 0000000000..41a499c9d0 --- /dev/null +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.designsystem.components.preferences + +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import io.element.android.libraries.designsystem.preview.ElementThemedPreview +import io.element.android.libraries.designsystem.preview.PreviewGroup +import io.element.android.libraries.designsystem.theme.components.Divider +import io.element.android.libraries.theme.ElementTheme + +@Composable +fun PreferenceDivider( + modifier: Modifier = Modifier, +) { + Divider( + modifier = modifier.padding(bottom = 8.dp), + color = ElementTheme.colors.borderDisabled, + ) +} + +@Preview(group = PreviewGroup.Preferences) +@Composable +internal fun PreferenceDividerPreview() = ElementThemedPreview { ContentToPreview() } + +@Composable +private fun ContentToPreview() { + PreferenceDivider() +} diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt index 84c6ff7655..79575a2d3c 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt @@ -43,7 +43,6 @@ import androidx.compose.ui.unit.sp import io.element.android.libraries.designsystem.components.button.BackButton import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight -import io.element.android.libraries.designsystem.theme.components.Divider import io.element.android.libraries.designsystem.theme.components.Scaffold import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar @@ -129,19 +128,19 @@ private fun ContentToPreview() { subtitle = "Some other text", icon = Icons.Default.BugReport, ) - Divider() + PreferenceDivider() PreferenceSwitch( title = "Switch", icon = Icons.Default.Announcement, isChecked = true, ) - Divider() + PreferenceDivider() PreferenceCheckbox( title = "Checkbox", icon = Icons.Default.Announcement, isChecked = true, ) - Divider() + PreferenceDivider() PreferenceSlide( title = "Slide", summary = "Summary", From efb6f2dcbd2188ee844fd1fdef3cd6036682d26a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 10:45:48 +0200 Subject: [PATCH 05/36] Fix padding end. --- .../designsystem/components/preferences/PreferenceText.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt index fd0d4c0b4f..3f204ee847 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt @@ -93,7 +93,7 @@ fun PreferenceText( Text( modifier = Modifier .align(Alignment.CenterVertically) - .padding(horizontal = 16.dp), + .padding(start = 16.dp, end = 8.dp), text = currentValue, style = ElementTheme.typography.fontBodyXsMedium, color = ElementTheme.materialColors.secondary, @@ -102,7 +102,7 @@ fun PreferenceText( CircularProgressIndicator( modifier = Modifier .progressSemantics() - .padding(horizontal = 16.dp) + .padding(start = 16.dp, end = 8.dp) .size(20.dp) .align(Alignment.CenterVertically), strokeWidth = 2.dp From b4a5128a059875558cc873d9b921b6ee969a0a1b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 10:59:28 +0200 Subject: [PATCH 06/36] Update preference header (still have to be displayed) --- .../components/avatar/AvatarSize.kt | 2 + .../matrix/ui/components/MatrixUserHeader.kt | 55 ++++++++++--------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/AvatarSize.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/AvatarSize.kt index e2a1329f9e..2438e5f017 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/AvatarSize.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/AvatarSize.kt @@ -27,6 +27,8 @@ enum class AvatarSize(val dp: Dp) { ForwardRoomListItem(36.dp), + UserPreference(56.dp), + UserHeader(96.dp), UserListItem(36.dp), diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt index 06551987ec..c4ec772456 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt @@ -18,21 +18,18 @@ package io.element.android.libraries.matrix.ui.components import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.IntrinsicSize +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme +import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import io.element.android.libraries.designsystem.components.avatar.Avatar import io.element.android.libraries.designsystem.components.avatar.AvatarSize import io.element.android.libraries.designsystem.preview.ElementPreviewDark @@ -41,6 +38,7 @@ import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.ui.model.getAvatarData import io.element.android.libraries.matrix.ui.model.getBestName +import io.element.android.libraries.theme.ElementTheme @Composable fun MatrixUserHeader( @@ -48,37 +46,40 @@ fun MatrixUserHeader( modifier: Modifier = Modifier, onClick: () -> Unit = {}, ) { - Column( + Row( modifier = modifier .clickable(onClick = onClick) .fillMaxWidth() - .padding(all = 16.dp) - .height(IntrinsicSize.Min), - horizontalAlignment = Alignment.CenterHorizontally + .padding(horizontal = 16.dp), + verticalAlignment = Alignment.CenterVertically ) { Avatar( - matrixUser.getAvatarData(size = AvatarSize.UserHeader), + modifier = Modifier + .padding(vertical = 12.dp), + avatarData = matrixUser.getAvatarData(size = AvatarSize.UserPreference), ) - Spacer(modifier = Modifier.height(16.dp)) - // Name - Text( - fontSize = 18.sp, - fontWeight = FontWeight.SemiBold, - text = matrixUser.getBestName(), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary, - ) - // Id - if (matrixUser.displayName.isNullOrEmpty().not()) { - Spacer(modifier = Modifier.height(4.dp)) + Spacer(modifier = Modifier.width(16.dp)) + Column( + modifier = Modifier.weight(1f) + ) { + // Name Text( - text = matrixUser.userId.value, - color = MaterialTheme.colorScheme.secondary, - fontSize = 14.sp, + text = matrixUser.getBestName(), maxLines = 1, - overflow = TextOverflow.Ellipsis + style = ElementTheme.typography.fontHeadingSmMedium, + overflow = TextOverflow.Ellipsis, + color = ElementTheme.materialColors.primary, ) + // Id + if (matrixUser.displayName.isNullOrEmpty().not()) { + Text( + text = matrixUser.userId.value, + style = ElementTheme.typography.fontBodyMdRegular, + color = ElementTheme.materialColors.secondary, + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + } } } } From e1b528e861892340648f08fdd6da2d21dd3e3c06 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 14:26:35 +0200 Subject: [PATCH 07/36] Show current user in the settings and extract code in CurrentUserProvider. --- .../impl/root/PreferencesRootPresenter.kt | 23 +++++- .../impl/root/PreferencesRootState.kt | 3 +- .../impl/root/PreferencesRootStateProvider.kt | 3 +- .../impl/root/PreferencesRootView.kt | 2 +- .../preferences/impl/user/UserPreferences.kt | 23 ++---- .../impl/root/PreferencesRootPresenterTest.kt | 31 +++++-- .../roomlist/impl/RoomListPresenter.kt | 15 ++-- .../roomlist/impl/RoomListPresenterTests.kt | 67 ++++++++++----- .../matrix/api/user/CurrentUserProvider.kt | 34 ++++++++ .../matrix/ui/components/MatrixUserHeader.kt | 10 ++- .../components/MatrixUserHeaderPlaceholder.kt | 82 +++++++++++++++++++ .../android/samples/minimal/RoomListScreen.kt | 2 + 12 files changed, 226 insertions(+), 69 deletions(-) create mode 100644 libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUserProvider.kt create mode 100644 libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeaderPlaceholder.kt diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt index 2f441bcfa2..bb8b656ee6 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt @@ -17,23 +17,38 @@ package io.element.android.features.preferences.impl.root import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesPresenter import io.element.android.features.logout.api.LogoutPreferencePresenter import io.element.android.features.rageshake.api.preferences.RageshakePreferencesPresenter -import io.element.android.libraries.architecture.Async import io.element.android.libraries.architecture.Presenter import io.element.android.libraries.core.meta.BuildType +import io.element.android.libraries.matrix.api.user.CurrentUserProvider +import io.element.android.libraries.matrix.api.user.MatrixUser +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.launch import javax.inject.Inject class PreferencesRootPresenter @Inject constructor( private val logoutPresenter: LogoutPreferencePresenter, private val rageshakePresenter: RageshakePreferencesPresenter, private val analyticsPresenter: AnalyticsPreferencesPresenter, + private val currentUserProvider: CurrentUserProvider, private val buildType: BuildType, ) : Presenter { @Composable override fun present(): PreferencesRootState { + val matrixUser: MutableState = rememberSaveable { + mutableStateOf(null) + } + LaunchedEffect(Unit) { + initialLoad(matrixUser) + } + val logoutState = logoutPresenter.present() val rageshakeState = rageshakePresenter.present() val analyticsState = analyticsPresenter.present() @@ -42,8 +57,12 @@ class PreferencesRootPresenter @Inject constructor( logoutState = logoutState, rageshakeState = rageshakeState, analyticsState = analyticsState, - myUser = Async.Uninitialized, + myUser = matrixUser.value, showDeveloperSettings = showDeveloperSettings ) } + + private fun CoroutineScope.initialLoad(matrixUser: MutableState) = launch { + matrixUser.value = currentUserProvider.provide() + } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt index 78435e7ad5..d427d01ab9 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt @@ -19,13 +19,12 @@ package io.element.android.features.preferences.impl.root import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesState import io.element.android.features.logout.api.LogoutPreferenceState import io.element.android.features.rageshake.api.preferences.RageshakePreferencesState -import io.element.android.libraries.architecture.Async import io.element.android.libraries.matrix.api.user.MatrixUser data class PreferencesRootState( val logoutState: LogoutPreferenceState, val rageshakeState: RageshakePreferencesState, val analyticsState: AnalyticsPreferencesState, - val myUser: Async, + val myUser: MatrixUser?, val showDeveloperSettings: Boolean ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt index 2c78c1f431..db8e7e1f8a 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt @@ -19,12 +19,11 @@ package io.element.android.features.preferences.impl.root import io.element.android.features.analytics.api.preferences.aAnalyticsPreferencesState import io.element.android.features.logout.api.aLogoutPreferenceState import io.element.android.features.rageshake.api.preferences.aRageshakePreferencesState -import io.element.android.libraries.architecture.Async fun aPreferencesRootState() = PreferencesRootState( logoutState = aLogoutPreferenceState(), rageshakeState = aRageshakePreferencesState(), analyticsState = aAnalyticsPreferencesState(), - myUser = Async.Uninitialized, + myUser = null, showDeveloperSettings = true ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index 6d6545d838..8ea02883ac 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -92,5 +92,5 @@ fun PreferencesRootViewDarkPreview(@PreviewParameter(MatrixUserProvider::class) @Composable private fun ContentToPreview(matrixUser: MatrixUser) { - PreferencesRootView(aPreferencesRootState().copy(myUser = Async.Success(matrixUser))) + PreferencesRootView(aPreferencesRootState().copy(myUser = matrixUser)) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/user/UserPreferences.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/user/UserPreferences.kt index ed367007aa..3e00a588e0 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/user/UserPreferences.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/user/UserPreferences.kt @@ -16,14 +16,10 @@ package io.element.android.features.preferences.impl.user -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter -import androidx.compose.ui.unit.dp -import io.element.android.libraries.architecture.Async import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.matrix.api.user.MatrixUser @@ -32,16 +28,13 @@ import io.element.android.libraries.matrix.ui.components.MatrixUserWithNullProvi @Composable fun UserPreferences( - user: Async, + user: MatrixUser?, modifier: Modifier = Modifier, ) { - when (val userData = user.dataOrNull()) { - null -> Spacer(modifier = modifier.height(1.dp)) - else -> MatrixUserHeader( - modifier = modifier, - matrixUser = userData - ) - } + MatrixUserHeader( + modifier = modifier, + matrixUser = user + ) } @Preview @@ -56,9 +49,5 @@ internal fun UserPreferencesDarkPreview(@PreviewParameter(MatrixUserWithNullProv @Composable private fun ContentToPreview(matrixUser: MatrixUser?) { - if (matrixUser == null) { - UserPreferences(Async.Uninitialized) - } else { - UserPreferences(Async.Success(matrixUser)) - } + UserPreferences(matrixUser) } diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt index 2ecd3276ee..6600656803 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt @@ -28,6 +28,10 @@ import io.element.android.features.rageshake.impl.preferences.DefaultRageshakePr import io.element.android.features.rageshake.test.rageshake.FakeRageShake import io.element.android.features.rageshake.test.rageshake.FakeRageshakeDataStore import io.element.android.libraries.architecture.Async +import io.element.android.libraries.matrix.api.user.CurrentUserProvider +import io.element.android.libraries.matrix.api.user.MatrixUser +import io.element.android.libraries.matrix.test.AN_AVATAR_URL +import io.element.android.libraries.matrix.test.A_USER_NAME import io.element.android.libraries.matrix.test.FakeMatrixClient import kotlinx.coroutines.test.runTest import org.junit.Test @@ -35,27 +39,36 @@ import org.junit.Test class PreferencesRootPresenterTest { @Test fun `present - initial state`() = runTest { - val logoutPresenter = DefaultLogoutPreferencePresenter(FakeMatrixClient()) + val matrixClient = FakeMatrixClient() + val logoutPresenter = DefaultLogoutPreferencePresenter(matrixClient) val rageshakePresenter = DefaultRageshakePreferencesPresenter(FakeRageShake(), FakeRageshakeDataStore()) val analyticsPresenter = DefaultAnalyticsPreferencesPresenter(FakeAnalyticsService(), A_BUILD_META) val presenter = PreferencesRootPresenter( logoutPresenter, rageshakePresenter, analyticsPresenter, + CurrentUserProvider(matrixClient), A_BUILD_META.buildType ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() }.test { - skipItems(1) val initialState = awaitItem() - assertThat(initialState.logoutState.logoutAction).isEqualTo(Async.Uninitialized) - assertThat(initialState.analyticsState.isEnabled).isFalse() - assertThat(initialState.rageshakeState.isEnabled).isTrue() - assertThat(initialState.rageshakeState.isSupported).isTrue() - assertThat(initialState.rageshakeState.sensitivity).isEqualTo(1.0f) - assertThat(initialState.myUser).isEqualTo(Async.Uninitialized) - assertThat(initialState.showDeveloperSettings).isEqualTo(true) + assertThat(initialState.myUser).isNull() + val loadedState = awaitItem() + assertThat(loadedState.logoutState.logoutAction).isEqualTo(Async.Uninitialized) + assertThat(loadedState.analyticsState.isEnabled).isFalse() + assertThat(loadedState.rageshakeState.isEnabled).isTrue() + assertThat(loadedState.rageshakeState.isSupported).isTrue() + assertThat(loadedState.rageshakeState.sensitivity).isEqualTo(1.0f) + assertThat(loadedState.myUser).isEqualTo( + MatrixUser( + userId = matrixClient.sessionId, + displayName = A_USER_NAME, + avatarUrl = AN_AVATAR_URL + ) + ) + assertThat(loadedState.showDeveloperSettings).isEqualTo(true) } } } diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt index 8bfe839eed..a929f068ee 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt @@ -26,10 +26,10 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue -import io.element.android.features.networkmonitor.api.NetworkMonitor -import io.element.android.features.networkmonitor.api.NetworkStatus import io.element.android.features.leaveroom.api.LeaveRoomEvent import io.element.android.features.leaveroom.api.LeaveRoomPresenter +import io.element.android.features.networkmonitor.api.NetworkMonitor +import io.element.android.features.networkmonitor.api.NetworkStatus import io.element.android.features.roomlist.impl.model.RoomListRoomSummary import io.element.android.features.roomlist.impl.model.RoomListRoomSummaryPlaceholders import io.element.android.libraries.architecture.Presenter @@ -43,8 +43,8 @@ import io.element.android.libraries.designsystem.utils.collectSnackbarMessageAsS import io.element.android.libraries.eventformatter.api.RoomLastMessageFormatter import io.element.android.libraries.matrix.api.MatrixClient import io.element.android.libraries.matrix.api.core.RoomId -import io.element.android.libraries.matrix.api.core.UserId import io.element.android.libraries.matrix.api.room.RoomSummary +import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.api.verification.SessionVerificationService import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus @@ -60,6 +60,7 @@ private const val extendedRangeSize = 40 class RoomListPresenter @Inject constructor( private val client: MatrixClient, + private val currentUserProvider: CurrentUserProvider, private val lastMessageTimestampFormatter: LastMessageTimestampFormatter, private val roomLastMessageFormatter: RoomLastMessageFormatter, private val sessionVerificationService: SessionVerificationService, @@ -162,13 +163,7 @@ class RoomListPresenter @Inject constructor( } private fun CoroutineScope.initialLoad(matrixUser: MutableState) = launch { - val userAvatarUrl = client.loadUserAvatarURLString().getOrNull() - val userDisplayName = client.loadUserDisplayName().getOrNull() - matrixUser.value = MatrixUser( - userId = UserId(client.sessionId.value), - displayName = userDisplayName, - avatarUrl = userAvatarUrl, - ) + matrixUser.value = currentUserProvider.provide() } private fun updateVisibleRange(range: IntRange) { diff --git a/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt b/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt index c9a2913dde..d512f7a9b1 100644 --- a/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt +++ b/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt @@ -31,6 +31,7 @@ import io.element.android.libraries.designsystem.components.avatar.AvatarData import io.element.android.libraries.designsystem.components.avatar.AvatarSize import io.element.android.libraries.designsystem.utils.SnackbarDispatcher import io.element.android.libraries.eventformatter.test.FakeRoomLastMessageFormatter +import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus import io.element.android.libraries.matrix.test.AN_AVATAR_URL import io.element.android.libraries.matrix.test.AN_EXCEPTION @@ -50,8 +51,10 @@ class RoomListPresenterTests { @Test fun `present - should start with no user and then load user with success`() = runTest { + val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( - FakeMatrixClient(), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -75,11 +78,13 @@ class RoomListPresenterTests { @Test fun `present - should start with no user and then load user with error`() = runTest { + val matrixClient = FakeMatrixClient( + userDisplayName = Result.failure(AN_EXCEPTION), + userAvatarURLString = Result.failure(AN_EXCEPTION), + ) val presenter = RoomListPresenter( - FakeMatrixClient( - userDisplayName = Result.failure(AN_EXCEPTION), - userAvatarURLString = Result.failure(AN_EXCEPTION), - ), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -100,8 +105,10 @@ class RoomListPresenterTests { @Test fun `present - should filter room with success`() = runTest { + val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( - FakeMatrixClient(), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -127,10 +134,12 @@ class RoomListPresenterTests { @Test fun `present - load 1 room with success`() = runTest { val roomSummaryDataSource = FakeRoomSummaryDataSource() + val matrixClient = FakeMatrixClient( + roomSummaryDataSource = roomSummaryDataSource + ) val presenter = RoomListPresenter( - FakeMatrixClient( - roomSummaryDataSource = roomSummaryDataSource - ), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -159,10 +168,12 @@ class RoomListPresenterTests { @Test fun `present - load 1 room with success and filter rooms`() = runTest { val roomSummaryDataSource = FakeRoomSummaryDataSource() + val matrixClient = FakeMatrixClient( + roomSummaryDataSource = roomSummaryDataSource + ) val presenter = RoomListPresenter( - FakeMatrixClient( - roomSummaryDataSource = roomSummaryDataSource - ), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -197,10 +208,12 @@ class RoomListPresenterTests { @Test fun `present - update visible range`() = runTest { val roomSummaryDataSource = FakeRoomSummaryDataSource() + val matrixClient = FakeMatrixClient( + roomSummaryDataSource = roomSummaryDataSource + ) val presenter = RoomListPresenter( - FakeMatrixClient( - roomSummaryDataSource = roomSummaryDataSource - ), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -245,10 +258,12 @@ class RoomListPresenterTests { @Test fun `present - handle DismissRequestVerificationPrompt`() = runTest { val roomSummaryDataSource = FakeRoomSummaryDataSource() + val matrixClient = FakeMatrixClient( + roomSummaryDataSource = roomSummaryDataSource + ) val presenter = RoomListPresenter( - FakeMatrixClient( - roomSummaryDataSource = roomSummaryDataSource - ), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService().apply { @@ -274,8 +289,10 @@ class RoomListPresenterTests { @Test fun `present - sets invite state`() = runTest { val inviteStateFlow = MutableStateFlow(InvitesState.NoInvites) + val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( - FakeMatrixClient(), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -304,8 +321,10 @@ class RoomListPresenterTests { @Test fun `present - show context menu`() = runTest { + val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( - FakeMatrixClient(), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -331,8 +350,10 @@ class RoomListPresenterTests { @Test fun `present - hide context menu`() = runTest { + val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( - FakeMatrixClient(), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -363,8 +384,10 @@ class RoomListPresenterTests { @Test fun `present - leave room calls into leave room presenter`() = runTest { val leaveRoomPresenter = LeaveRoomPresenterFake() + val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( - FakeMatrixClient(), + matrixClient, + CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), diff --git a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUserProvider.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUserProvider.kt new file mode 100644 index 0000000000..2e752578a7 --- /dev/null +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUserProvider.kt @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.matrix.api.user + +import io.element.android.libraries.matrix.api.MatrixClient +import javax.inject.Inject + +class CurrentUserProvider @Inject constructor( + private val matrixClient: MatrixClient, +) { + suspend fun provide(): MatrixUser { + val userAvatarUrl = matrixClient.loadUserAvatarURLString().getOrNull() + val userDisplayName = matrixClient.loadUserDisplayName().getOrNull() + return MatrixUser( + userId = matrixClient.sessionId, + displayName = userDisplayName, + avatarUrl = userAvatarUrl, + ) + } +} diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt index c4ec772456..164d91ebff 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt @@ -16,7 +16,6 @@ package io.element.android.libraries.matrix.ui.components -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -42,13 +41,16 @@ import io.element.android.libraries.theme.ElementTheme @Composable fun MatrixUserHeader( - matrixUser: MatrixUser, + matrixUser: MatrixUser?, modifier: Modifier = Modifier, - onClick: () -> Unit = {}, + // onClick: () -> Unit = {}, ) { + if (matrixUser == null) { + return MatrixUserHeaderPlaceholder(modifier = modifier) + } Row( modifier = modifier - .clickable(onClick = onClick) + // .clickable(onClick = onClick) .fillMaxWidth() .padding(horizontal = 16.dp), verticalAlignment = Alignment.CenterVertically diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeaderPlaceholder.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeaderPlaceholder.kt new file mode 100644 index 0000000000..b43fc36fa6 --- /dev/null +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeaderPlaceholder.kt @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.matrix.ui.components + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import io.element.android.libraries.designsystem.atomic.atoms.PlaceholderAtom +import io.element.android.libraries.designsystem.components.avatar.AvatarSize +import io.element.android.libraries.designsystem.preview.ElementPreviewDark +import io.element.android.libraries.designsystem.preview.ElementPreviewLight +import io.element.android.libraries.designsystem.theme.roomListPlaceholder +import io.element.android.libraries.theme.ElementTheme + +@Composable +fun MatrixUserHeaderPlaceholder( + modifier: Modifier = Modifier, +) { + Row( + modifier = modifier + .fillMaxWidth() + .padding(horizontal = 16.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + Box( + modifier = Modifier + .padding(vertical = 12.dp) + .size(AvatarSize.UserPreference.dp) + .background(color = ElementTheme.colors.roomListPlaceholder, shape = CircleShape) + ) + Spacer(modifier = Modifier.width(16.dp)) + Column( + modifier = Modifier.weight(1f) + ) { + PlaceholderAtom(width = 80.dp, height = 7.dp) + Spacer(modifier = Modifier.height(16.dp)) + PlaceholderAtom(width = 180.dp, height = 6.dp) + } + } +} + +@Preview +@Composable +fun MatrixUserHeaderPlaceholderLightPreview() = + ElementPreviewLight { ContentToPreview() } + +@Preview +@Composable +fun MatrixUserHeaderPlaceholderDarkPreview() = + ElementPreviewDark { ContentToPreview() } + +@Composable +private fun ContentToPreview() { + MatrixUserHeaderPlaceholder() +} diff --git a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt index f9cdf0f3fd..d41a565069 100644 --- a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt +++ b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt @@ -38,6 +38,7 @@ import io.element.android.libraries.eventformatter.impl.StateContentFormatter import io.element.android.libraries.matrix.api.MatrixClient import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.matrix.api.room.RoomMembershipObserver +import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.services.toolbox.impl.strings.AndroidStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -60,6 +61,7 @@ class RoomListScreen( private val stringProvider = AndroidStringProvider(context.resources) private val presenter = RoomListPresenter( client = matrixClient, + currentUserProvider = CurrentUserProvider(matrixClient), lastMessageTimestampFormatter = DefaultLastMessageTimestampFormatter(dateTimeProvider, dateFormatters), roomLastMessageFormatter = DefaultRoomLastMessageFormatter( sp = stringProvider, From 380793e7480b91ea894d9da326b404a7a0449db8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 14:35:18 +0200 Subject: [PATCH 08/36] KotlinJpsPluginSettings upgrade --- .idea/kotlinc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index 217e5c51fb..9a55c2de1f 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file From b6f977c0326243750681979cc5216e1b79aa01bc Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 15:40:49 +0200 Subject: [PATCH 09/36] Change hierarchy of settings. --- .../preferences/AnalyticsPreferencesView.kt | 7 ++- .../logout/api/LogoutPreferenceScreen.kt | 2 +- .../preferences/impl/PreferencesFlowNode.kt | 22 +++++++ .../preferences/impl/about/AboutEvents.kt | 21 +++++++ .../preferences/impl/about/AboutNode.kt | 45 +++++++++++++ .../preferences/impl/about/AboutPresenter.kt | 38 +++++++++++ .../preferences/impl/about/AboutState.kt | 23 +++++++ .../impl/about/AboutStateProvider.kt | 30 +++++++++ .../preferences/impl/about/AboutView.kt | 63 +++++++++++++++++++ .../impl/analytics/AnalyticsSettingsEvents.kt | 21 +++++++ .../impl/analytics/AnalyticsSettingsNode.kt | 45 +++++++++++++ .../analytics/AnalyticsSettingsPresenter.kt | 43 +++++++++++++ .../impl/analytics/AnalyticsSettingsState.kt | 25 ++++++++ .../AnalyticsSettingsStateProvider.kt | 32 ++++++++++ .../impl/analytics/AnalyticsSettingsView.kt | 63 +++++++++++++++++++ .../developer/DeveloperSettingsPresenter.kt | 4 ++ .../impl/developer/DeveloperSettingsState.kt | 2 + .../DeveloperSettingsStateProvider.kt | 2 + .../impl/developer/DeveloperSettingsView.kt | 4 ++ .../impl/root/PreferencesRootNode.kt | 13 +++- .../impl/root/PreferencesRootPresenter.kt | 8 --- .../impl/root/PreferencesRootState.kt | 4 -- .../impl/root/PreferencesRootStateProvider.kt | 4 -- .../impl/root/PreferencesRootView.kt | 62 +++++++++++------- ...AnalyticsAnalyticsSettingsPresenterTest.kt | 43 +++++++++++++ .../DeveloperSettingsPresenterTest.kt | 15 +++++ .../impl/root/PreferencesRootPresenterTest.kt | 8 --- .../preferences/RageshakePreferencesView.kt | 10 --- 28 files changed, 598 insertions(+), 61 deletions(-) create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsNode.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsView.kt create mode 100644 features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt diff --git a/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt b/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt index 8186119132..b04848a999 100644 --- a/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt +++ b/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt @@ -43,13 +43,16 @@ fun AnalyticsPreferencesView( state.eventSink(AnalyticsOptInEvents.EnableAnalytics(isEnabled = isEnabled)) } - PreferenceCategory(title = stringResource(id = CommonStrings.screen_analytics_settings_share_data)) { + PreferenceCategory( + modifier = modifier, + title = stringResource(id = CommonStrings.screen_analytics_settings_share_data) + ) { val firstPart = stringResource(id = CommonStrings.screen_analytics_settings_help_us_improve, state.applicationName) val secondPart = buildAnnotatedStringWithColoredPart( CommonStrings.screen_analytics_settings_read_terms, CommonStrings.screen_analytics_settings_read_terms_content_link ) - val title = "$firstPart\n\n$secondPart" + val title = "$firstPart\n\n$secondPart" PreferenceSwitch( title = title, diff --git a/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt b/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt index 0ad6eab4eb..60844f4477 100644 --- a/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt +++ b/features/logout/api/src/main/kotlin/io/element/android/features/logout/api/LogoutPreferenceScreen.kt @@ -81,7 +81,7 @@ fun LogoutPreferenceContent( ) { PreferenceText( title = stringResource(id = R.string.screen_signout_preference_item), - icon = Icons.Default.Logout, + icon = Icons.Filled.Logout, onClick = onClick ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt index cded5d4bf6..35fe4e77bb 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt @@ -30,6 +30,8 @@ import dagger.assisted.Assisted import dagger.assisted.AssistedInject import io.element.android.anvilannotations.ContributesNode import io.element.android.features.preferences.api.PreferencesEntryPoint +import io.element.android.features.preferences.impl.about.AboutNode +import io.element.android.features.preferences.impl.analytics.AnalyticsSettingsNode import io.element.android.features.preferences.impl.developer.DeveloperSettingsNode import io.element.android.features.preferences.impl.root.PreferencesRootNode import io.element.android.libraries.architecture.BackstackNode @@ -57,6 +59,12 @@ class PreferencesFlowNode @AssistedInject constructor( @Parcelize object DeveloperSettings : NavTarget + + @Parcelize + object AnalyticsSettings : NavTarget + + @Parcelize + object About : NavTarget } override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node { @@ -67,6 +75,14 @@ class PreferencesFlowNode @AssistedInject constructor( plugins().forEach { it.onOpenBugReport() } } + override fun onOpenAnalytics() { + backstack.push(NavTarget.AnalyticsSettings) + } + + override fun onOpenAbout() { + backstack.push(NavTarget.About) + } + override fun onOpenDeveloperSettings() { backstack.push(NavTarget.DeveloperSettings) } @@ -76,6 +92,12 @@ class PreferencesFlowNode @AssistedInject constructor( NavTarget.DeveloperSettings -> { createNode(buildContext) } + NavTarget.About -> { + createNode(buildContext) + } + NavTarget.AnalyticsSettings -> { + createNode(buildContext) + } } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt new file mode 100644 index 0000000000..fd27e3f682 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +sealed interface AboutEvents { + object MyEvent : AboutEvents +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt new file mode 100644 index 0000000000..0cd19d8e14 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.bumble.appyx.core.modality.BuildContext +import com.bumble.appyx.core.node.Node +import com.bumble.appyx.core.plugin.Plugin +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import io.element.android.anvilannotations.ContributesNode +import io.element.android.libraries.di.SessionScope + +@ContributesNode(SessionScope::class) +class AboutNode @AssistedInject constructor( + @Assisted buildContext: BuildContext, + @Assisted plugins: List, + private val presenter: AboutPresenter, +) : Node(buildContext, plugins = plugins) { + + @Composable + override fun View(modifier: Modifier) { + val state = presenter.present() + AboutView( + state = state, + onBackPressed = ::navigateUp, + modifier = modifier + ) + } +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt new file mode 100644 index 0000000000..708e7c9abc --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +import androidx.compose.runtime.Composable +import io.element.android.libraries.architecture.Presenter +import javax.inject.Inject + +class AboutPresenter @Inject constructor() : Presenter { + + @Composable + override fun present(): AboutState { + + fun handleEvents(event: AboutEvents) { + when (event) { + AboutEvents.MyEvent -> Unit + } + } + + return AboutState( + eventSink = ::handleEvents + ) + } +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt new file mode 100644 index 0000000000..0af95e5502 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +// TODO add your ui models. Remove the eventSink if you don't have events. +// Do not use default value, so no member get forgotten in the presenters. +data class AboutState( + val eventSink: (AboutEvents) -> Unit +) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt new file mode 100644 index 0000000000..aeb8dd9aa3 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +import androidx.compose.ui.tooling.preview.PreviewParameterProvider + +open class AboutStateProvider : PreviewParameterProvider { + override val values: Sequence + get() = sequenceOf( + aAboutState(), + ) +} + +fun aAboutState() = AboutState( + eventSink = {} +) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt new file mode 100644 index 0000000000..3736c33bfa --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameter +import io.element.android.libraries.designsystem.components.preferences.PreferenceText +import io.element.android.libraries.designsystem.components.preferences.PreferenceView +import io.element.android.libraries.designsystem.preview.ElementPreviewDark +import io.element.android.libraries.designsystem.preview.ElementPreviewLight +import io.element.android.libraries.ui.strings.CommonStrings + +@Composable +fun AboutView( + state: AboutState, + onBackPressed: () -> Unit, + modifier: Modifier = Modifier, +) { + PreferenceView( + modifier = modifier, + onBackPressed = onBackPressed, + title = stringResource(id = CommonStrings.common_about) + ) { + PreferenceText(title = stringResource(id = CommonStrings.common_copyright)) + PreferenceText(title = stringResource(id = CommonStrings.common_acceptable_use_policy)) + PreferenceText(title = stringResource(id = CommonStrings.common_privacy_policy)) + } +} + +@Preview +@Composable +fun AboutViewLightPreview(@PreviewParameter(AboutStateProvider::class) state: AboutState) = + ElementPreviewLight { ContentToPreview(state) } + +@Preview +@Composable +fun AboutViewDarkPreview(@PreviewParameter(AboutStateProvider::class) state: AboutState) = + ElementPreviewDark { ContentToPreview(state) } + +@Composable +private fun ContentToPreview(state: AboutState) { + AboutView( + state = state, + onBackPressed = {}, + ) +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt new file mode 100644 index 0000000000..86b2db16d9 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.analytics + +sealed interface AnalyticsSettingsEvents { + object MyEvent : AnalyticsSettingsEvents +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsNode.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsNode.kt new file mode 100644 index 0000000000..adc917b7e6 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsNode.kt @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.analytics + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.bumble.appyx.core.modality.BuildContext +import com.bumble.appyx.core.node.Node +import com.bumble.appyx.core.plugin.Plugin +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject +import io.element.android.anvilannotations.ContributesNode +import io.element.android.libraries.di.SessionScope + +@ContributesNode(SessionScope::class) +class AnalyticsSettingsNode @AssistedInject constructor( + @Assisted buildContext: BuildContext, + @Assisted plugins: List, + private val presenter: AnalyticsSettingsPresenter, +) : Node(buildContext, plugins = plugins) { + + @Composable + override fun View(modifier: Modifier) { + val state = presenter.present() + AnalyticsSettingsView( + state = state, + onBackPressed = ::navigateUp, + modifier = modifier + ) + } +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt new file mode 100644 index 0000000000..976193db74 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.analytics + +import androidx.compose.runtime.Composable +import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesPresenter +import io.element.android.libraries.architecture.Presenter +import javax.inject.Inject + +class AnalyticsSettingsPresenter @Inject constructor( + private val analyticsPresenter: AnalyticsPreferencesPresenter, +) : Presenter { + + @Composable + override fun present(): AnalyticsSettingsState { + val analyticsState = analyticsPresenter.present() + + fun handleEvents(event: AnalyticsSettingsEvents) { + when (event) { + AnalyticsSettingsEvents.MyEvent -> Unit + } + } + + return AnalyticsSettingsState( + analyticsState = analyticsState, + eventSink = ::handleEvents + ) + } +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt new file mode 100644 index 0000000000..b5a38fb23c --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.analytics + +import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesState + +// Do not use default value, so no member get forgotten in the presenters. +data class AnalyticsSettingsState( + val analyticsState: AnalyticsPreferencesState, + val eventSink: (AnalyticsSettingsEvents) -> Unit +) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt new file mode 100644 index 0000000000..f1eb2b6c0f --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.analytics + +import androidx.compose.ui.tooling.preview.PreviewParameterProvider +import io.element.android.features.analytics.api.preferences.aAnalyticsPreferencesState + +open class AnalyticsSettingsStateProvider : PreviewParameterProvider { + override val values: Sequence + get() = sequenceOf( + aAnalyticsSettingsState(), + ) +} + +fun aAnalyticsSettingsState() = AnalyticsSettingsState( + analyticsState = aAnalyticsPreferencesState(), + eventSink = {} +) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsView.kt new file mode 100644 index 0000000000..165406c6f5 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsView.kt @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.analytics + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameter +import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesView +import io.element.android.libraries.designsystem.components.preferences.PreferenceView +import io.element.android.libraries.designsystem.preview.ElementPreviewDark +import io.element.android.libraries.designsystem.preview.ElementPreviewLight +import io.element.android.libraries.ui.strings.CommonStrings + +@Composable +fun AnalyticsSettingsView( + state: AnalyticsSettingsState, + onBackPressed: () -> Unit, + modifier: Modifier = Modifier, +) { + PreferenceView( + modifier = modifier, + onBackPressed = onBackPressed, + title = stringResource(id = CommonStrings.common_analytics) + ) { + AnalyticsPreferencesView( + state = state.analyticsState, + ) + } +} + +@Preview +@Composable +fun AnalyticsSettingsViewLightPreview(@PreviewParameter(AnalyticsSettingsStateProvider::class) state: AnalyticsSettingsState) = + ElementPreviewLight { ContentToPreview(state) } + +@Preview +@Composable +fun AnalyticsSettingsViewDarkPreview(@PreviewParameter(AnalyticsSettingsStateProvider::class) state: AnalyticsSettingsState) = + ElementPreviewDark { ContentToPreview(state) } + +@Composable +private fun ContentToPreview(state: AnalyticsSettingsState) { + AnalyticsSettingsView( + state = state, + onBackPressed = {}, + ) +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenter.kt index 2e10622c7a..1a8216ff1b 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenter.kt @@ -27,6 +27,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.snapshots.SnapshotStateMap import io.element.android.features.preferences.impl.tasks.ClearCacheUseCase import io.element.android.features.preferences.impl.tasks.ComputeCacheSizeUseCase +import io.element.android.features.rageshake.api.preferences.RageshakePreferencesPresenter import io.element.android.libraries.architecture.Async import io.element.android.libraries.architecture.Presenter import io.element.android.libraries.architecture.runCatchingUpdatingState @@ -44,10 +45,12 @@ class DeveloperSettingsPresenter @Inject constructor( private val featureFlagService: FeatureFlagService, private val computeCacheSizeUseCase: ComputeCacheSizeUseCase, private val clearCacheUseCase: ClearCacheUseCase, + private val rageshakePresenter: RageshakePreferencesPresenter, ) : Presenter { @Composable override fun present(): DeveloperSettingsState { + val rageshakeState = rageshakePresenter.present() val features = remember { mutableStateMapOf() @@ -90,6 +93,7 @@ class DeveloperSettingsPresenter @Inject constructor( features = featureUiModels.toImmutableList(), cacheSize = cacheSize.value, clearCacheAction = clearCacheAction.value, + rageshakeState = rageshakeState, eventSink = ::handleEvents ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsState.kt index 61205e7f7d..8d79c9241d 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsState.kt @@ -16,6 +16,7 @@ package io.element.android.features.preferences.impl.developer +import io.element.android.features.rageshake.api.preferences.RageshakePreferencesState import io.element.android.libraries.architecture.Async import io.element.android.libraries.featureflag.ui.model.FeatureUiModel import kotlinx.collections.immutable.ImmutableList @@ -23,6 +24,7 @@ import kotlinx.collections.immutable.ImmutableList data class DeveloperSettingsState constructor( val features: ImmutableList, val cacheSize: Async, + val rageshakeState: RageshakePreferencesState, val clearCacheAction: Async, val eventSink: (DeveloperSettingsEvents) -> Unit ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt index de94bd6664..ee5c897987 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsStateProvider.kt @@ -17,6 +17,7 @@ package io.element.android.features.preferences.impl.developer import androidx.compose.ui.tooling.preview.PreviewParameterProvider +import io.element.android.features.rageshake.api.preferences.aRageshakePreferencesState import io.element.android.libraries.architecture.Async import io.element.android.libraries.featureflag.ui.model.aFeatureUiModelList @@ -30,6 +31,7 @@ open class DeveloperSettingsStateProvider : PreviewParameterProvider().forEach { it.onOpenDeveloperSettings() } } + private fun onOpenAnalytics() { + plugins().forEach { it.onOpenAnalytics() } + } + + private fun onOpenAbout() { + plugins().forEach { it.onOpenAbout() } + } + @Composable override fun View(modifier: Modifier) { val state = presenter.present() @@ -55,8 +65,9 @@ class PreferencesRootNode @AssistedInject constructor( modifier = modifier, onBackPressed = this::navigateUp, onOpenRageShake = this::onOpenBugReport, + onOpenAnalytics = this::onOpenAnalytics, + onOpenAbout = this::onOpenAbout, onOpenDeveloperSettings = this::onOpenDeveloperSettings ) } - } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt index bb8b656ee6..2fe22161a8 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt @@ -21,9 +21,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.saveable.rememberSaveable -import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesPresenter import io.element.android.features.logout.api.LogoutPreferencePresenter -import io.element.android.features.rageshake.api.preferences.RageshakePreferencesPresenter import io.element.android.libraries.architecture.Presenter import io.element.android.libraries.core.meta.BuildType import io.element.android.libraries.matrix.api.user.CurrentUserProvider @@ -34,8 +32,6 @@ import javax.inject.Inject class PreferencesRootPresenter @Inject constructor( private val logoutPresenter: LogoutPreferencePresenter, - private val rageshakePresenter: RageshakePreferencesPresenter, - private val analyticsPresenter: AnalyticsPreferencesPresenter, private val currentUserProvider: CurrentUserProvider, private val buildType: BuildType, ) : Presenter { @@ -50,13 +46,9 @@ class PreferencesRootPresenter @Inject constructor( } val logoutState = logoutPresenter.present() - val rageshakeState = rageshakePresenter.present() - val analyticsState = analyticsPresenter.present() val showDeveloperSettings = buildType != BuildType.RELEASE return PreferencesRootState( logoutState = logoutState, - rageshakeState = rageshakeState, - analyticsState = analyticsState, myUser = matrixUser.value, showDeveloperSettings = showDeveloperSettings ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt index d427d01ab9..d1e3a0535c 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt @@ -16,15 +16,11 @@ package io.element.android.features.preferences.impl.root -import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesState import io.element.android.features.logout.api.LogoutPreferenceState -import io.element.android.features.rageshake.api.preferences.RageshakePreferencesState import io.element.android.libraries.matrix.api.user.MatrixUser data class PreferencesRootState( val logoutState: LogoutPreferenceState, - val rageshakeState: RageshakePreferencesState, - val analyticsState: AnalyticsPreferencesState, val myUser: MatrixUser?, val showDeveloperSettings: Boolean ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt index db8e7e1f8a..c438687278 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt @@ -16,14 +16,10 @@ package io.element.android.features.preferences.impl.root -import io.element.android.features.analytics.api.preferences.aAnalyticsPreferencesState import io.element.android.features.logout.api.aLogoutPreferenceState -import io.element.android.features.rageshake.api.preferences.aRageshakePreferencesState fun aPreferencesRootState() = PreferencesRootState( logoutState = aLogoutPreferenceState(), - rageshakeState = aRageshakePreferencesState(), - analyticsState = aAnalyticsPreferencesState(), myUser = null, showDeveloperSettings = true ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index 8ea02883ac..a652b866ad 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -18,21 +18,21 @@ package io.element.android.features.preferences.impl.root import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.DeveloperMode +import androidx.compose.material.icons.filled.Help +import androidx.compose.material.icons.outlined.BugReport +import androidx.compose.material.icons.outlined.InsertChart import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewParameter import io.element.android.features.logout.api.LogoutPreferenceView import io.element.android.features.preferences.impl.user.UserPreferences -import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesView -import io.element.android.features.rageshake.api.preferences.RageshakePreferencesView -import io.element.android.libraries.architecture.Async -import io.element.android.libraries.designsystem.components.preferences.PreferenceCategory import io.element.android.libraries.designsystem.components.preferences.PreferenceText import io.element.android.libraries.designsystem.components.preferences.PreferenceView import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.designsystem.preview.LargeHeightPreview +import io.element.android.libraries.designsystem.theme.components.Divider import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.ui.components.MatrixUserProvider import io.element.android.libraries.ui.strings.CommonStrings @@ -41,11 +41,12 @@ import io.element.android.libraries.ui.strings.CommonStrings fun PreferencesRootView( state: PreferencesRootState, modifier: Modifier = Modifier, - onBackPressed: () -> Unit = {}, - onOpenRageShake: () -> Unit = {}, - onOpenDeveloperSettings: () -> Unit = {}, + onBackPressed: () -> Unit, + onOpenAnalytics: () -> Unit, + onOpenRageShake: () -> Unit, + onOpenAbout: () -> Unit, + onOpenDeveloperSettings: () -> Unit, ) { - // TODO Hierarchy! // Include pref from other modules PreferenceView( modifier = modifier, @@ -53,31 +54,39 @@ fun PreferencesRootView( title = stringResource(id = CommonStrings.common_settings) ) { UserPreferences(state.myUser) - AnalyticsPreferencesView( - state = state.analyticsState, + // TODO Verification and eventually divider + PreferenceText( + title = stringResource(id = CommonStrings.common_analytics), + icon = Icons.Outlined.InsertChart, + onClick = onOpenAnalytics, ) - RageshakePreferencesView( - state = state.rageshakeState, - onOpenRageshake = onOpenRageShake, + PreferenceText( + title = stringResource(id = CommonStrings.action_report_bug), + icon = Icons.Outlined.BugReport, + onClick = onOpenRageShake ) - LogoutPreferenceView( - state = state.logoutState, + PreferenceText( + title = stringResource(id = CommonStrings.common_about), + icon = Icons.Filled.Help, + onClick = onOpenAbout, ) if (state.showDeveloperSettings) { DeveloperPreferencesView(onOpenDeveloperSettings) } + Divider() + LogoutPreferenceView( + state = state.logoutState, + ) } } @Composable fun DeveloperPreferencesView(onOpenDeveloperSettings: () -> Unit) { - PreferenceCategory(title = stringResource(id = CommonStrings.common_developer_options)) { - PreferenceText( - title = stringResource(id = CommonStrings.common_developer_options), - icon = Icons.Default.DeveloperMode, - onClick = onOpenDeveloperSettings - ) - } + PreferenceText( + title = stringResource(id = CommonStrings.common_developer_options), + icon = Icons.Default.DeveloperMode, + onClick = onOpenDeveloperSettings + ) } @LargeHeightPreview @@ -92,5 +101,12 @@ fun PreferencesRootViewDarkPreview(@PreviewParameter(MatrixUserProvider::class) @Composable private fun ContentToPreview(matrixUser: MatrixUser) { - PreferencesRootView(aPreferencesRootState().copy(myUser = matrixUser)) + PreferencesRootView( + state = aPreferencesRootState().copy(myUser = matrixUser), + onBackPressed = {}, + onOpenAnalytics = {}, + onOpenRageShake = {}, + onOpenDeveloperSettings = {}, + onOpenAbout = {}, + ) } diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt new file mode 100644 index 0000000000..a383bcf71b --- /dev/null +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.analytics + +import app.cash.molecule.RecompositionClock +import app.cash.molecule.moleculeFlow +import app.cash.turbine.test +import com.google.common.truth.Truth.assertThat +import io.element.android.features.analytics.impl.preferences.DefaultAnalyticsPreferencesPresenter +import io.element.android.features.analytics.test.A_BUILD_META +import io.element.android.features.analytics.test.FakeAnalyticsService +import kotlinx.coroutines.test.runTest +import org.junit.Test + +class AnalyticsAnalyticsSettingsPresenterTest { + @Test + fun `present - initial state`() = runTest { + val analyticsPresenter = DefaultAnalyticsPreferencesPresenter(FakeAnalyticsService(), A_BUILD_META) + val presenter = AnalyticsSettingsPresenter( + analyticsPresenter, + ) + moleculeFlow(RecompositionClock.Immediate) { + presenter.present() + }.test { + val initialState = awaitItem() + assertThat(initialState.analyticsState.isEnabled).isFalse() + } + } +} diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt index 226140647d..8fee4df488 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt @@ -22,6 +22,9 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.features.preferences.impl.tasks.FakeClearCacheUseCase import io.element.android.features.preferences.impl.tasks.FakeComputeCacheSizeUseCase +import io.element.android.features.rageshake.impl.preferences.DefaultRageshakePreferencesPresenter +import io.element.android.features.rageshake.test.rageshake.FakeRageShake +import io.element.android.features.rageshake.test.rageshake.FakeRageshakeDataStore import io.element.android.libraries.architecture.Async import io.element.android.libraries.featureflag.api.FeatureFlags import io.element.android.libraries.featureflag.test.FakeFeatureFlagService @@ -31,10 +34,12 @@ import org.junit.Test class DeveloperSettingsPresenterTest { @Test fun `present - ensures initial state is correct`() = runTest { + val rageshakePresenter = DefaultRageshakePreferencesPresenter(FakeRageShake(), FakeRageshakeDataStore()) val presenter = DeveloperSettingsPresenter( FakeFeatureFlagService(), FakeComputeCacheSizeUseCase(), FakeClearCacheUseCase(), + rageshakePresenter ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() @@ -43,16 +48,22 @@ class DeveloperSettingsPresenterTest { assertThat(initialState.features).isEmpty() assertThat(initialState.clearCacheAction).isEqualTo(Async.Uninitialized) assertThat(initialState.cacheSize).isEqualTo(Async.Uninitialized) + val loadedState = awaitItem() + assertThat(loadedState.rageshakeState.isEnabled).isTrue() + assertThat(loadedState.rageshakeState.isSupported).isTrue() + assertThat(loadedState.rageshakeState.sensitivity).isEqualTo(1.0f) cancelAndIgnoreRemainingEvents() } } @Test fun `present - ensures feature list is loaded`() = runTest { + val rageshakePresenter = DefaultRageshakePreferencesPresenter(FakeRageShake(), FakeRageshakeDataStore()) val presenter = DeveloperSettingsPresenter( FakeFeatureFlagService(), FakeComputeCacheSizeUseCase(), FakeClearCacheUseCase(), + rageshakePresenter, ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() @@ -66,10 +77,12 @@ class DeveloperSettingsPresenterTest { @Test fun `present - ensures state is updated when enabled feature event is triggered`() = runTest { + val rageshakePresenter = DefaultRageshakePreferencesPresenter(FakeRageShake(), FakeRageshakeDataStore()) val presenter = DeveloperSettingsPresenter( FakeFeatureFlagService(), FakeComputeCacheSizeUseCase(), FakeClearCacheUseCase(), + rageshakePresenter, ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() @@ -88,11 +101,13 @@ class DeveloperSettingsPresenterTest { @Test fun `present - clear cache`() = runTest { + val rageshakePresenter = DefaultRageshakePreferencesPresenter(FakeRageShake(), FakeRageshakeDataStore()) val clearCacheUseCase = FakeClearCacheUseCase() val presenter = DeveloperSettingsPresenter( FakeFeatureFlagService(), FakeComputeCacheSizeUseCase(), clearCacheUseCase, + rageshakePresenter, ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt index 6600656803..4254668583 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt @@ -41,12 +41,8 @@ class PreferencesRootPresenterTest { fun `present - initial state`() = runTest { val matrixClient = FakeMatrixClient() val logoutPresenter = DefaultLogoutPreferencePresenter(matrixClient) - val rageshakePresenter = DefaultRageshakePreferencesPresenter(FakeRageShake(), FakeRageshakeDataStore()) - val analyticsPresenter = DefaultAnalyticsPreferencesPresenter(FakeAnalyticsService(), A_BUILD_META) val presenter = PreferencesRootPresenter( logoutPresenter, - rageshakePresenter, - analyticsPresenter, CurrentUserProvider(matrixClient), A_BUILD_META.buildType ) @@ -57,10 +53,6 @@ class PreferencesRootPresenterTest { assertThat(initialState.myUser).isNull() val loadedState = awaitItem() assertThat(loadedState.logoutState.logoutAction).isEqualTo(Async.Uninitialized) - assertThat(loadedState.analyticsState.isEnabled).isFalse() - assertThat(loadedState.rageshakeState.isEnabled).isTrue() - assertThat(loadedState.rageshakeState.isSupported).isTrue() - assertThat(loadedState.rageshakeState.sensitivity).isEqualTo(1.0f) assertThat(loadedState.myUser).isEqualTo( MatrixUser( userId = matrixClient.sessionId, diff --git a/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt b/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt index d775bce275..73e04fb5d4 100644 --- a/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt +++ b/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt @@ -17,8 +17,6 @@ package io.element.android.features.rageshake.api.preferences import androidx.compose.foundation.layout.Column -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.BugReport import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -36,7 +34,6 @@ import io.element.android.libraries.ui.strings.CommonStrings fun RageshakePreferencesView( state: RageshakePreferencesState, modifier: Modifier = Modifier, - onOpenRageshake: () -> Unit = {}, ) { fun onSensitivityChanged(sensitivity: Float) { state.eventSink(RageshakePreferencesEvents.SetSensitivity(sensitivity = sensitivity)) @@ -47,13 +44,6 @@ fun RageshakePreferencesView( } Column(modifier = modifier) { - PreferenceCategory(title = stringResource(id = CommonStrings.action_report_bug)) { - PreferenceText( - title = stringResource(id = CommonStrings.action_report_bug), - icon = Icons.Default.BugReport, - onClick = onOpenRageshake - ) - } PreferenceCategory(title = stringResource(id = CommonStrings.settings_rageshake)) { if (state.isSupported) { PreferenceSwitch( From ea620fc200cd635e4b126a413ac29ec81e0fa160 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 15:54:07 +0200 Subject: [PATCH 10/36] Use modifier. --- app/src/main/kotlin/io/element/android/x/icon/IconPreview.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/io/element/android/x/icon/IconPreview.kt b/app/src/main/kotlin/io/element/android/x/icon/IconPreview.kt index b8c4272fd4..49c2cc5782 100644 --- a/app/src/main/kotlin/io/element/android/x/icon/IconPreview.kt +++ b/app/src/main/kotlin/io/element/android/x/icon/IconPreview.kt @@ -31,7 +31,7 @@ import io.element.android.x.R fun IconPreview( modifier: Modifier = Modifier, ) { - Box { + Box(modifier = modifier) { Image(painter = painterResource(id = R.mipmap.ic_launcher_background), contentDescription = null) Image(painter = painterResource(id = R.mipmap.ic_launcher_foreground), contentDescription = null) } From d7cf3c091ac181538124abde9e22d6cd53059b34 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 16:13:33 +0200 Subject: [PATCH 11/36] Open legals URL --- features/preferences/impl/build.gradle.kts | 1 + .../preferences/impl/about/AboutNode.kt | 17 ++++++++ .../preferences/impl/about/AboutPresenter.kt | 1 + .../preferences/impl/about/AboutState.kt | 1 + .../impl/about/AboutStateProvider.kt | 1 + .../preferences/impl/about/AboutView.kt | 11 +++-- .../preferences/impl/about/ElementLegal.kt | 41 +++++++++++++++++++ 7 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt diff --git a/features/preferences/impl/build.gradle.kts b/features/preferences/impl/build.gradle.kts index 51a3fcdf6b..0e53ef6716 100644 --- a/features/preferences/impl/build.gradle.kts +++ b/features/preferences/impl/build.gradle.kts @@ -49,6 +49,7 @@ dependencies { implementation(libs.datetime) implementation(libs.accompanist.placeholder) implementation(libs.coil.compose) + implementation(libs.androidx.browser) api(projects.features.preferences.api) ksp(libs.showkase.processor) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt index 0cd19d8e14..000a397cfe 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutNode.kt @@ -16,15 +16,19 @@ package io.element.android.features.preferences.impl.about +import android.app.Activity import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import com.bumble.appyx.core.modality.BuildContext import com.bumble.appyx.core.node.Node import com.bumble.appyx.core.plugin.Plugin import dagger.assisted.Assisted import dagger.assisted.AssistedInject import io.element.android.anvilannotations.ContributesNode +import io.element.android.libraries.androidutils.browser.openUrlInChromeCustomTab import io.element.android.libraries.di.SessionScope +import io.element.android.libraries.theme.ElementTheme @ContributesNode(SessionScope::class) class AboutNode @AssistedInject constructor( @@ -33,12 +37,25 @@ class AboutNode @AssistedInject constructor( private val presenter: AboutPresenter, ) : Node(buildContext, plugins = plugins) { + private fun onElementLegalClicked( + activity: Activity, + darkTheme: Boolean, + elementLegal: ElementLegal, + ) { + activity.openUrlInChromeCustomTab(null, darkTheme, elementLegal.url) + } + @Composable override fun View(modifier: Modifier) { + val activity = LocalContext.current as Activity + val isDark = ElementTheme.isLightTheme.not() val state = presenter.present() AboutView( state = state, onBackPressed = ::navigateUp, + onElementLegalClicked = { elementLegal -> + onElementLegalClicked(activity, isDark, elementLegal) + }, modifier = modifier ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt index 708e7c9abc..ce2439d8a6 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt @@ -32,6 +32,7 @@ class AboutPresenter @Inject constructor() : Presenter { } return AboutState( + elementLegals = getAllLegals(), eventSink = ::handleEvents ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt index 0af95e5502..5a1a123b11 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt @@ -19,5 +19,6 @@ package io.element.android.features.preferences.impl.about // TODO add your ui models. Remove the eventSink if you don't have events. // Do not use default value, so no member get forgotten in the presenters. data class AboutState( + val elementLegals: List, val eventSink: (AboutEvents) -> Unit ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt index aeb8dd9aa3..6f195b71d7 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt @@ -26,5 +26,6 @@ open class AboutStateProvider : PreviewParameterProvider { } fun aAboutState() = AboutState( + elementLegals = getAllLegals(), eventSink = {} ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt index 3736c33bfa..b7c2663b72 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt @@ -30,6 +30,7 @@ import io.element.android.libraries.ui.strings.CommonStrings @Composable fun AboutView( state: AboutState, + onElementLegalClicked: (ElementLegal) -> Unit, onBackPressed: () -> Unit, modifier: Modifier = Modifier, ) { @@ -38,9 +39,12 @@ fun AboutView( onBackPressed = onBackPressed, title = stringResource(id = CommonStrings.common_about) ) { - PreferenceText(title = stringResource(id = CommonStrings.common_copyright)) - PreferenceText(title = stringResource(id = CommonStrings.common_acceptable_use_policy)) - PreferenceText(title = stringResource(id = CommonStrings.common_privacy_policy)) + state.elementLegals.forEach { elementLegal -> + PreferenceText( + title = stringResource(id = elementLegal.titleRes), + onClick = { onElementLegalClicked(elementLegal) } + ) + } } } @@ -58,6 +62,7 @@ fun AboutViewDarkPreview(@PreviewParameter(AboutStateProvider::class) state: Abo private fun ContentToPreview(state: AboutState) { AboutView( state = state, + onElementLegalClicked = {}, onBackPressed = {}, ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt new file mode 100644 index 0000000000..81af611716 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +import androidx.annotation.StringRes +import io.element.android.libraries.ui.strings.CommonStrings + +private const val CopyrightUrl = "https://element.io/copyright" +private const val UsePolicyUrl = "https://element.io/acceptable-use-policy-terms" +private const val PrivacyUrl = "https://element.io/privacy" + +sealed class ElementLegal( + @StringRes val titleRes: Int, + val url: String, +) { + object Copyright : ElementLegal(CommonStrings.common_copyright, CopyrightUrl) + object AcceptableUsePolicy : ElementLegal(CommonStrings.common_acceptable_use_policy, UsePolicyUrl) + object PrivacyPolicy : ElementLegal(CommonStrings.common_privacy_policy, PrivacyUrl) +} + +fun getAllLegals(): List { + return listOf( + ElementLegal.Copyright, + ElementLegal.AcceptableUsePolicy, + ElementLegal.PrivacyPolicy, + ) +} From 6c5c050ba32de320ad1ab22bd35215efdec45c49 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 16:15:44 +0200 Subject: [PATCH 12/36] Add quick test. --- .../impl/about/AboutPresenterTest.kt | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/about/AboutPresenterTest.kt diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/about/AboutPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/about/AboutPresenterTest.kt new file mode 100644 index 0000000000..97fa158d09 --- /dev/null +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/about/AboutPresenterTest.kt @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.about + +import app.cash.molecule.RecompositionClock +import app.cash.molecule.moleculeFlow +import app.cash.turbine.test +import com.google.common.truth.Truth.assertThat +import kotlinx.coroutines.test.runTest +import org.junit.Test + +class AboutPresenterTest { + @Test + fun `present - initial state`() = runTest { + val presenter = AboutPresenter() + moleculeFlow(RecompositionClock.Immediate) { + presenter.present() + }.test { + val initialState = awaitItem() + assertThat(initialState.elementLegals).isEqualTo(getAllLegals()) + } + } +} From d0cf4001469dbba8d149bdbdf3af355bc335118a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 16:35:09 +0200 Subject: [PATCH 13/36] Add "Complete verification" item in the root setting screen. --- .../element/android/appnav/LoggedInFlowNode.kt | 5 ++++- .../preferences/api/PreferencesEntryPoint.kt | 1 + .../preferences/impl/PreferencesFlowNode.kt | 4 ++++ .../preferences/impl/root/PreferencesRootNode.kt | 6 ++++++ .../impl/root/PreferencesRootPresenter.kt | 14 ++++++++++++++ .../impl/root/PreferencesRootState.kt | 1 + .../impl/root/PreferencesRootStateProvider.kt | 1 + .../preferences/impl/root/PreferencesRootView.kt | 16 +++++++++++++--- .../impl/root/PreferencesRootPresenterTest.kt | 7 ++----- 9 files changed, 46 insertions(+), 9 deletions(-) diff --git a/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt b/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt index 8fdfbf3bc0..4d6553f51c 100644 --- a/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt +++ b/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt @@ -69,7 +69,6 @@ import io.element.android.services.analytics.api.AnalyticsService import io.element.android.services.appnavstate.api.AppNavigationStateService import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.combine -import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -292,6 +291,10 @@ class LoggedInFlowNode @AssistedInject constructor( override fun onOpenBugReport() { plugins().forEach { it.onOpenBugReport() } } + + override fun onVerifyClicked() { + backstack.push(NavTarget.VerifySession) + } } preferencesEntryPoint.nodeBuilder(this, buildContext) .callback(callback) diff --git a/features/preferences/api/src/main/kotlin/io/element/android/features/preferences/api/PreferencesEntryPoint.kt b/features/preferences/api/src/main/kotlin/io/element/android/features/preferences/api/PreferencesEntryPoint.kt index 464ab2159f..3d1a516593 100644 --- a/features/preferences/api/src/main/kotlin/io/element/android/features/preferences/api/PreferencesEntryPoint.kt +++ b/features/preferences/api/src/main/kotlin/io/element/android/features/preferences/api/PreferencesEntryPoint.kt @@ -32,5 +32,6 @@ interface PreferencesEntryPoint : FeatureEntryPoint { interface Callback : Plugin { fun onOpenBugReport() + fun onVerifyClicked() } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt index 35fe4e77bb..e5b8254488 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt @@ -75,6 +75,10 @@ class PreferencesFlowNode @AssistedInject constructor( plugins().forEach { it.onOpenBugReport() } } + override fun onVerifyClicked() { + plugins().forEach { it.onVerifyClicked() } + } + override fun onOpenAnalytics() { backstack.push(NavTarget.AnalyticsSettings) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootNode.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootNode.kt index d0920e4fe6..a564927101 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootNode.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootNode.kt @@ -36,6 +36,7 @@ class PreferencesRootNode @AssistedInject constructor( interface Callback : Plugin { fun onOpenBugReport() + fun onVerifyClicked() fun onOpenAnalytics() fun onOpenAbout() fun onOpenDeveloperSettings() @@ -45,6 +46,10 @@ class PreferencesRootNode @AssistedInject constructor( plugins().forEach { it.onOpenBugReport() } } + private fun onVerifyClicked() { + plugins().forEach { it.onVerifyClicked() } + } + private fun onOpenDeveloperSettings() { plugins().forEach { it.onOpenDeveloperSettings() } } @@ -67,6 +72,7 @@ class PreferencesRootNode @AssistedInject constructor( onOpenRageShake = this::onOpenBugReport, onOpenAnalytics = this::onOpenAnalytics, onOpenAbout = this::onOpenAbout, + onVerifyClicked = this::onVerifyClicked, onOpenDeveloperSettings = this::onOpenDeveloperSettings ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt index 2fe22161a8..211b7d4c3e 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt @@ -19,13 +19,19 @@ package io.element.android.features.preferences.impl.root import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.MutableState +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.derivedStateOf +import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable import io.element.android.features.logout.api.LogoutPreferencePresenter import io.element.android.libraries.architecture.Presenter import io.element.android.libraries.core.meta.BuildType import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser +import io.element.android.libraries.matrix.api.verification.SessionVerificationService +import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import javax.inject.Inject @@ -33,6 +39,7 @@ import javax.inject.Inject class PreferencesRootPresenter @Inject constructor( private val logoutPresenter: LogoutPreferencePresenter, private val currentUserProvider: CurrentUserProvider, + private val sessionVerificationService: SessionVerificationService, private val buildType: BuildType, ) : Presenter { @@ -45,11 +52,18 @@ class PreferencesRootPresenter @Inject constructor( initialLoad(matrixUser) } + // Session verification status (unknown, not verified, verified) + val sessionVerifiedStatus by sessionVerificationService.sessionVerifiedStatus.collectAsState() + val sessionIsNotVerified by remember { + derivedStateOf { sessionVerifiedStatus == SessionVerifiedStatus.NotVerified } + } + val logoutState = logoutPresenter.present() val showDeveloperSettings = buildType != BuildType.RELEASE return PreferencesRootState( logoutState = logoutState, myUser = matrixUser.value, + showCompleteVerification = sessionIsNotVerified, showDeveloperSettings = showDeveloperSettings ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt index d1e3a0535c..c412eadde1 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt @@ -22,5 +22,6 @@ import io.element.android.libraries.matrix.api.user.MatrixUser data class PreferencesRootState( val logoutState: LogoutPreferenceState, val myUser: MatrixUser?, + val showCompleteVerification: Boolean, val showDeveloperSettings: Boolean ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt index c438687278..051800e8cd 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt @@ -21,5 +21,6 @@ import io.element.android.features.logout.api.aLogoutPreferenceState fun aPreferencesRootState() = PreferencesRootState( logoutState = aLogoutPreferenceState(), myUser = null, + showCompleteVerification = true, showDeveloperSettings = true ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index a652b866ad..07a4fca15f 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -18,9 +18,10 @@ package io.element.android.features.preferences.impl.root import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.DeveloperMode -import androidx.compose.material.icons.filled.Help import androidx.compose.material.icons.outlined.BugReport +import androidx.compose.material.icons.outlined.Help import androidx.compose.material.icons.outlined.InsertChart +import androidx.compose.material.icons.outlined.VerifiedUser import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -42,6 +43,7 @@ fun PreferencesRootView( state: PreferencesRootState, modifier: Modifier = Modifier, onBackPressed: () -> Unit, + onVerifyClicked: () -> Unit, onOpenAnalytics: () -> Unit, onOpenRageShake: () -> Unit, onOpenAbout: () -> Unit, @@ -54,7 +56,14 @@ fun PreferencesRootView( title = stringResource(id = CommonStrings.common_settings) ) { UserPreferences(state.myUser) - // TODO Verification and eventually divider + if (state.showCompleteVerification) { + PreferenceText( + title = stringResource(id = CommonStrings.action_complete_verification), + icon = Icons.Outlined.VerifiedUser, + onClick = onVerifyClicked, + ) + Divider() + } PreferenceText( title = stringResource(id = CommonStrings.common_analytics), icon = Icons.Outlined.InsertChart, @@ -67,7 +76,7 @@ fun PreferencesRootView( ) PreferenceText( title = stringResource(id = CommonStrings.common_about), - icon = Icons.Filled.Help, + icon = Icons.Outlined.Help, onClick = onOpenAbout, ) if (state.showDeveloperSettings) { @@ -108,5 +117,6 @@ private fun ContentToPreview(matrixUser: MatrixUser) { onOpenRageShake = {}, onOpenDeveloperSettings = {}, onOpenAbout = {}, + onVerifyClicked = {}, ) } diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt index 4254668583..040fda17d1 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt @@ -20,19 +20,15 @@ import app.cash.molecule.RecompositionClock import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.features.analytics.impl.preferences.DefaultAnalyticsPreferencesPresenter import io.element.android.features.analytics.test.A_BUILD_META -import io.element.android.features.analytics.test.FakeAnalyticsService import io.element.android.features.logout.impl.DefaultLogoutPreferencePresenter -import io.element.android.features.rageshake.impl.preferences.DefaultRageshakePreferencesPresenter -import io.element.android.features.rageshake.test.rageshake.FakeRageShake -import io.element.android.features.rageshake.test.rageshake.FakeRageshakeDataStore import io.element.android.libraries.architecture.Async import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.test.AN_AVATAR_URL import io.element.android.libraries.matrix.test.A_USER_NAME import io.element.android.libraries.matrix.test.FakeMatrixClient +import io.element.android.libraries.matrix.test.verification.FakeSessionVerificationService import kotlinx.coroutines.test.runTest import org.junit.Test @@ -44,6 +40,7 @@ class PreferencesRootPresenterTest { val presenter = PreferencesRootPresenter( logoutPresenter, CurrentUserProvider(matrixClient), + FakeSessionVerificationService(), A_BUILD_META.buildType ) moleculeFlow(RecompositionClock.Immediate) { From 24621079f7d125d3329af461628f92b71ad8666a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 16:38:20 +0200 Subject: [PATCH 14/36] Fix font of settings titles. --- .../preferences/PreferenceScreen.kt | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt index 79575a2d3c..7a6eaf327d 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt @@ -19,7 +19,6 @@ package io.element.android.libraries.designsystem.components.preferences import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.ExperimentalLayoutApi -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxSize @@ -34,18 +33,16 @@ import androidx.compose.material.icons.filled.Announcement import androidx.compose.material.icons.filled.BugReport import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.sp import io.element.android.libraries.designsystem.components.button.BackButton import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.designsystem.theme.components.Scaffold import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar +import io.element.android.libraries.theme.ElementTheme @OptIn(ExperimentalLayoutApi::class) @Composable @@ -93,15 +90,12 @@ fun PreferenceTopAppBar( BackButton(onClick = onBackPressed) }, title = { - Row(verticalAlignment = Alignment.CenterVertically) { - Text( - fontSize = 16.sp, - fontWeight = FontWeight.SemiBold, - text = title, - maxLines = 1, - overflow = TextOverflow.Ellipsis - ) - } + Text( + text = title, + style = ElementTheme.typography.fontHeadingSmMedium, + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) } ) From 57152b2000321014fef2ea0dcad99d487fbfc369 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 16:42:04 +0200 Subject: [PATCH 15/36] Fix click effect. --- .../designsystem/components/preferences/PreferenceCheckbox.kt | 4 ++-- .../designsystem/components/preferences/PreferenceSwitch.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt index 276dbf5323..02c0e4eb05 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt @@ -51,8 +51,8 @@ fun PreferenceCheckbox( modifier = modifier .fillMaxWidth() .defaultMinSize(minHeight = preferenceMinHeight) - .padding(vertical = 4.dp, horizontal = preferencePaddingHorizontal) - .clickable { onCheckedChange(!isChecked) }, + .clickable { onCheckedChange(!isChecked) } + .padding(vertical = 4.dp, horizontal = preferencePaddingHorizontal), verticalAlignment = Alignment.CenterVertically ) { PreferenceIcon( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt index 41661c2b90..98dc493606 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt @@ -51,8 +51,8 @@ fun PreferenceSwitch( modifier = modifier .fillMaxWidth() .defaultMinSize(minHeight = preferenceMinHeight) - .padding(vertical = 4.dp, horizontal = preferencePaddingHorizontal) - .clickable { onCheckedChange(!isChecked) }, + .clickable { onCheckedChange(!isChecked) } + .padding(vertical = 4.dp, horizontal = preferencePaddingHorizontal), verticalAlignment = Alignment.CenterVertically ) { PreferenceIcon( From 6a2170f05914ebba6b7bc84a42e83a1ed32d08a9 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 18:09:15 +0200 Subject: [PATCH 16/36] Disable rageshake by default. Can be enabled in the developed settings, but this is not available in the release version. --- .../impl/developer/DeveloperSettingsPresenterTest.kt | 2 +- .../rageshake/impl/rageshake/PreferencesRageshakeDataStore.kt | 4 ++-- .../rageshake/test/rageshake/FakeRageshakeDataStore.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt index 8fee4df488..87a556621c 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt @@ -49,7 +49,7 @@ class DeveloperSettingsPresenterTest { assertThat(initialState.clearCacheAction).isEqualTo(Async.Uninitialized) assertThat(initialState.cacheSize).isEqualTo(Async.Uninitialized) val loadedState = awaitItem() - assertThat(loadedState.rageshakeState.isEnabled).isTrue() + assertThat(loadedState.rageshakeState.isEnabled).isFalse() assertThat(loadedState.rageshakeState.isSupported).isTrue() assertThat(loadedState.rageshakeState.sensitivity).isEqualTo(1.0f) cancelAndIgnoreRemainingEvents() diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/rageshake/PreferencesRageshakeDataStore.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/rageshake/PreferencesRageshakeDataStore.kt index 2dc3f3e517..aa8965fed9 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/rageshake/PreferencesRageshakeDataStore.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/rageshake/PreferencesRageshakeDataStore.kt @@ -25,7 +25,7 @@ import androidx.datastore.preferences.core.floatPreferencesKey import androidx.datastore.preferences.preferencesDataStore import com.squareup.anvil.annotations.ContributesBinding import io.element.android.features.rageshake.api.rageshake.RageshakeDataStore -import io.element.android.libraries.core.bool.orTrue +import io.element.android.libraries.core.bool.orFalse import io.element.android.libraries.di.AppScope import io.element.android.libraries.di.ApplicationContext import kotlinx.coroutines.flow.Flow @@ -45,7 +45,7 @@ class PreferencesRageshakeDataStore @Inject constructor( override fun isEnabled(): Flow { return store.data.map { prefs -> - prefs[enabledKey].orTrue() + prefs[enabledKey].orFalse() } } diff --git a/features/rageshake/test/src/main/kotlin/io/element/android/features/rageshake/test/rageshake/FakeRageshakeDataStore.kt b/features/rageshake/test/src/main/kotlin/io/element/android/features/rageshake/test/rageshake/FakeRageshakeDataStore.kt index a250e50361..698e0a3cd8 100644 --- a/features/rageshake/test/src/main/kotlin/io/element/android/features/rageshake/test/rageshake/FakeRageshakeDataStore.kt +++ b/features/rageshake/test/src/main/kotlin/io/element/android/features/rageshake/test/rageshake/FakeRageshakeDataStore.kt @@ -23,7 +23,7 @@ import kotlinx.coroutines.flow.MutableStateFlow const val A_SENSITIVITY = 1f class FakeRageshakeDataStore( - isEnabled: Boolean = true, + isEnabled: Boolean = false, sensitivity: Float = A_SENSITIVITY, ) : RageshakeDataStore { From c0bda1ec86c41236819f0a599355afc31fc321e0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 17:09:38 +0200 Subject: [PATCH 17/36] Design iteration on bug report screen. --- .../rageshake/impl/bugreport/BugReportNode.kt | 4 +- .../rageshake/impl/bugreport/BugReportView.kt | 117 +++++++----------- .../components/preferences/PreferenceRow.kt | 60 +++++++++ .../theme/components/OutlinedTextField.kt | 2 + 4 files changed, 110 insertions(+), 73 deletions(-) create mode 100644 libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt index b5c20c1ab2..a087300f4e 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt @@ -26,7 +26,6 @@ import dagger.assisted.Assisted import dagger.assisted.AssistedInject import io.element.android.anvilannotations.ContributesNode import io.element.android.features.rageshake.api.bugreport.BugReportEntryPoint -import io.element.android.features.rageshake.impl.bugreport.BugReportPresenter import io.element.android.libraries.di.AppScope @ContributesNode(AppScope::class) @@ -42,7 +41,8 @@ class BugReportNode @AssistedInject constructor( BugReportView( state = state, modifier = modifier, - onDone = this::onDone + onBackPressed = { navigateUp() }, + onDone = this::onDone, ) } diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt index 60c36e0a29..c4e5b78960 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt @@ -17,16 +17,11 @@ package io.element.android.features.rageshake.impl.bugreport import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.imePadding +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.systemBarsPadding -import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.text.KeyboardOptions -import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -35,21 +30,20 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType -import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import coil.compose.AsyncImage import coil.request.ImageRequest import io.element.android.features.rageshake.impl.R import io.element.android.libraries.architecture.Async -import io.element.android.libraries.designsystem.components.LabelledCheckbox import io.element.android.libraries.designsystem.components.dialogs.ErrorDialog import io.element.android.libraries.designsystem.components.form.textFieldState +import io.element.android.libraries.designsystem.components.preferences.PreferenceRow +import io.element.android.libraries.designsystem.components.preferences.PreferenceSwitch +import io.element.android.libraries.designsystem.components.preferences.PreferenceView import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.designsystem.preview.debugPlaceholderBackground @@ -63,8 +57,9 @@ import io.element.android.libraries.ui.strings.CommonStrings @Composable fun BugReportView( state: BugReportState, + onDone: () -> Unit, + onBackPressed: () -> Unit, modifier: Modifier = Modifier, - onDone: () -> Unit = { }, ) { LogCompositions(tag = "Rageshake", msg = "Root") val eventSink = state.eventSink @@ -75,56 +70,27 @@ fun BugReportView( } return } - Box( - modifier = modifier - .fillMaxSize() - .systemBarsPadding() - .imePadding() - ) { - Column( - modifier = Modifier - .verticalScroll(state = rememberScrollState()) - .padding(horizontal = 16.dp), + + Box(modifier = modifier) { + PreferenceView( + title = stringResource(id = CommonStrings.common_report_a_bug), + onBackPressed = onBackPressed ) { - val isError = state.sending is Async.Failure val isFormEnabled = state.sending !is Async.Loading - // Title - Text( - text = stringResource(id = CommonStrings.action_report_bug), - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp, vertical = 16.dp), - textAlign = TextAlign.Center, - fontWeight = FontWeight.Bold, - fontSize = 24.sp, - color = MaterialTheme.colorScheme.primary, - ) - // Form - Text( - text = stringResource(id = R.string.screen_bug_report_editor_description), - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp, vertical = 16.dp), - fontSize = 16.sp, - color = MaterialTheme.colorScheme.primary, - ) var descriptionFieldState by textFieldState( stateValue = state.formState.description ) - Column( - // modifier = Modifier.weight(1f), - ) { + Spacer(modifier = Modifier.height(16.dp)) + PreferenceRow { OutlinedTextField( value = descriptionFieldState, - modifier = Modifier - .fillMaxWidth() - .padding(top = 16.dp), + modifier = Modifier.fillMaxWidth(), enabled = isFormEnabled, label = { Text(text = stringResource(id = R.string.screen_bug_report_editor_placeholder)) }, supportingText = { - Text(text = stringResource(id = R.string.screen_bug_report_editor_supporting)) + Text(text = stringResource(id = R.string.screen_bug_report_editor_description)) }, onValueChange = { descriptionFieldState = it @@ -134,35 +100,37 @@ fun BugReportView( keyboardType = KeyboardType.Text, imeAction = ImeAction.Next ), + minLines = 3, // TODO Error text too short ) } - LabelledCheckbox( - checked = state.formState.sendLogs, + Spacer(modifier = Modifier.height(16.dp)) + PreferenceSwitch( + isChecked = state.formState.sendLogs, onCheckedChange = { eventSink(BugReportEvents.SetSendLog(it)) }, enabled = isFormEnabled, - text = stringResource(id = R.string.screen_bug_report_include_logs) + title = stringResource(id = R.string.screen_bug_report_include_logs), ) if (state.hasCrashLogs) { - LabelledCheckbox( - checked = state.formState.sendCrashLogs, + PreferenceSwitch( + isChecked = state.formState.sendCrashLogs, onCheckedChange = { eventSink(BugReportEvents.SetSendCrashLog(it)) }, enabled = isFormEnabled, - text = stringResource(id = R.string.screen_bug_report_include_crash_logs) + title = stringResource(id = R.string.screen_bug_report_include_crash_logs), ) } - LabelledCheckbox( - checked = state.formState.canContact, + PreferenceSwitch( + isChecked = state.formState.canContact, onCheckedChange = { eventSink(BugReportEvents.SetCanContact(it)) }, enabled = isFormEnabled, - text = stringResource(id = R.string.screen_bug_report_contact_me) + title = stringResource(id = R.string.screen_bug_report_contact_me) ) if (state.screenshotUri != null) { - LabelledCheckbox( - checked = state.formState.sendScreenshot, + PreferenceSwitch( + isChecked = state.formState.sendScreenshot, onCheckedChange = { eventSink(BugReportEvents.SetSendScreenshot(it)) }, enabled = isFormEnabled, - text = stringResource(id = R.string.screen_bug_report_include_screenshot) + title = stringResource(id = R.string.screen_bug_report_include_screenshot) ) if (state.formState.sendScreenshot) { Box( @@ -183,16 +151,19 @@ fun BugReportView( } } // Submit - Button( - onClick = { eventSink(BugReportEvents.SendBugReport) }, - enabled = state.submitEnabled, - modifier = Modifier - .fillMaxWidth() - .padding(vertical = 32.dp) - ) { - Text(text = stringResource(id = CommonStrings.action_send)) + PreferenceRow { + Button( + onClick = { eventSink(BugReportEvents.SendBugReport) }, + enabled = state.submitEnabled, + modifier = Modifier + .fillMaxWidth() + .padding(top = 24.dp, bottom = 16.dp) + ) { + Text(text = stringResource(id = CommonStrings.action_send)) + } } } + when (state.sending) { is Async.Loading -> { // Indeterminate indicator, to avoid the freeze effect if the connection takes time to initialize. @@ -219,5 +190,9 @@ fun BugReportViewDarkPreview(@PreviewParameter(BugReportStateProvider::class) st @Composable private fun ContentToPreview(state: BugReportState) { - BugReportView(state = state) + BugReportView( + state = state, + onDone = {}, + onBackPressed = {}, + ) } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt new file mode 100644 index 0000000000..ef1c6ac09a --- /dev/null +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.designsystem.components.preferences + +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import io.element.android.libraries.designsystem.preview.ElementThemedPreview +import io.element.android.libraries.designsystem.preview.PreviewGroup +import io.element.android.libraries.designsystem.theme.components.Text + +/** + * Simple Row with which follow design for preferences. + */ +@Composable +fun PreferenceRow( + modifier: Modifier = Modifier, + content: @Composable RowScope.() -> Unit, +) { + Row( + modifier = modifier + .padding(horizontal = preferencePaddingHorizontal) + .heightIn(min = preferenceMinHeight) + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + ) { + content() + } +} + +@Preview(group = PreviewGroup.Preferences) +@Composable +internal fun PreferenceRowPreview() = ElementThemedPreview { ContentToPreview() } + +@Composable +private fun ContentToPreview() { + PreferenceRow { + Text(text = "Content") + } +} diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/OutlinedTextField.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/OutlinedTextField.kt index 358ca2abab..2c7318c447 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/OutlinedTextField.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/OutlinedTextField.kt @@ -68,6 +68,7 @@ fun OutlinedTextField( keyboardActions: KeyboardActions = KeyboardActions.Default, singleLine: Boolean = false, maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE, + minLines: Int = 1, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, shape: Shape = OutlinedTextFieldDefaults.shape, colors: TextFieldColors = OutlinedTextFieldDefaults.colors() @@ -90,6 +91,7 @@ fun OutlinedTextField( keyboardActions = keyboardActions, singleLine = singleLine, maxLines = maxLines, + minLines = minLines, interactionSource = interactionSource, shape = shape, colors = colors, From 1909ed9574b719bab1a2ef3edef5194cb02103b8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 17:19:30 +0200 Subject: [PATCH 18/36] Do not distinguish log and crash log anymore. --- .../impl/bugreport/BugReportEvents.kt | 1 - .../impl/bugreport/BugReportPresenter.kt | 5 +---- .../impl/bugreport/BugReportState.kt | 2 -- .../rageshake/impl/bugreport/BugReportView.kt | 8 -------- .../impl/bugreport/BugReportPresenterTest.kt | 20 ------------------- 5 files changed, 1 insertion(+), 35 deletions(-) diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportEvents.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportEvents.kt index 372805bca5..9765f83da0 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportEvents.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportEvents.kt @@ -23,7 +23,6 @@ sealed interface BugReportEvents { data class SetDescription(val description: String) : BugReportEvents data class SetSendLog(val sendLog: Boolean) : BugReportEvents - data class SetSendCrashLog(val sendCrashlog: Boolean) : BugReportEvents data class SetCanContact(val canContact: Boolean) : BugReportEvents data class SetSendScreenshot(val sendScreenshot: Boolean) : BugReportEvents } diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenter.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenter.kt index 1a472d0820..5fd95e79bd 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenter.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenter.kt @@ -100,9 +100,6 @@ class BugReportPresenter @Inject constructor( is BugReportEvents.SetCanContact -> updateFormState(formState) { copy(canContact = event.canContact) } - is BugReportEvents.SetSendCrashLog -> updateFormState(formState) { - copy(sendCrashLogs = event.sendCrashlog) - } is BugReportEvents.SetSendLog -> updateFormState(formState) { copy(sendLogs = event.sendLog) } @@ -138,7 +135,7 @@ class BugReportPresenter @Inject constructor( bugReporter.sendBugReport( reportType = ReportType.BUG_REPORT, withDevicesLogs = formState.sendLogs, - withCrashLogs = hasCrashLogs && formState.sendCrashLogs, + withCrashLogs = hasCrashLogs && formState.sendLogs, withKeyRequestHistory = false, withScreenshot = formState.sendScreenshot, theBugDescription = formState.description, diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportState.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportState.kt index 3300693973..b8bbe62dc6 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportState.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportState.kt @@ -36,7 +36,6 @@ data class BugReportState( data class BugReportFormState( val description: String, val sendLogs: Boolean, - val sendCrashLogs: Boolean, val canContact: Boolean, val sendScreenshot: Boolean ) : Parcelable { @@ -44,7 +43,6 @@ data class BugReportFormState( val Default = BugReportFormState( description = "", sendLogs = true, - sendCrashLogs = true, canContact = false, sendScreenshot = false ) diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt index c4e5b78960..9ae2ea792e 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt @@ -111,14 +111,6 @@ fun BugReportView( enabled = isFormEnabled, title = stringResource(id = R.string.screen_bug_report_include_logs), ) - if (state.hasCrashLogs) { - PreferenceSwitch( - isChecked = state.formState.sendCrashLogs, - onCheckedChange = { eventSink(BugReportEvents.SetSendCrashLog(it)) }, - enabled = isFormEnabled, - title = stringResource(id = R.string.screen_bug_report_include_crash_logs), - ) - } PreferenceSwitch( isChecked = state.formState.canContact, onCheckedChange = { eventSink(BugReportEvents.SetCanContact(it)) }, diff --git a/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenterTest.kt b/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenterTest.kt index 3df6c62287..9b868a637d 100644 --- a/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenterTest.kt +++ b/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportPresenterTest.kt @@ -92,26 +92,6 @@ class BugReportPresenterTest { } } - @Test - fun `present - send crash logs`() = runTest { - val presenter = BugReportPresenter( - FakeBugReporter(), - FakeCrashDataStore(), - FakeScreenshotHolder(), - this, - ) - moleculeFlow(RecompositionClock.Immediate) { - presenter.present() - }.test { - val initialState = awaitItem() - // Since this is true by default, start by disabling - initialState.eventSink.invoke(BugReportEvents.SetSendCrashLog(false)) - assertThat(awaitItem().formState).isEqualTo(BugReportFormState.Default.copy(sendCrashLogs = false)) - initialState.eventSink.invoke(BugReportEvents.SetSendCrashLog(true)) - assertThat(awaitItem().formState).isEqualTo(BugReportFormState.Default.copy(sendCrashLogs = true)) - } - } - @Test fun `present - send logs`() = runTest { val presenter = BugReportPresenter( From f325ffad12db33de228ddcfef471b105255b3cf6 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 17:31:07 +0200 Subject: [PATCH 19/36] More cleanup on BugReportView. --- .../rageshake/impl/bugreport/BugReportView.kt | 4 ++- .../preferences/PreferenceSwitch.kt | 30 +++++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt index 9ae2ea792e..74f3a13d13 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt @@ -110,12 +110,14 @@ fun BugReportView( onCheckedChange = { eventSink(BugReportEvents.SetSendLog(it)) }, enabled = isFormEnabled, title = stringResource(id = R.string.screen_bug_report_include_logs), + subtitle = stringResource(id = R.string.screen_bug_report_logs_description), ) PreferenceSwitch( isChecked = state.formState.canContact, onCheckedChange = { eventSink(BugReportEvents.SetCanContact(it)) }, enabled = isFormEnabled, - title = stringResource(id = R.string.screen_bug_report_contact_me) + title = stringResource(id = R.string.screen_bug_report_contact_me_title), + subtitle = stringResource(id = R.string.screen_bug_report_contact_me), ) if (state.screenshotUri != null) { PreferenceSwitch( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt index 98dc493606..00c0226db9 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt @@ -17,9 +17,12 @@ package io.element.android.libraries.designsystem.components.preferences import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Announcement @@ -35,6 +38,7 @@ import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.toEnabledColor +import io.element.android.libraries.designsystem.toSecondaryEnabledColor import io.element.android.libraries.theme.ElementTheme @Composable @@ -42,6 +46,7 @@ fun PreferenceSwitch( title: String, isChecked: Boolean, modifier: Modifier = Modifier, + subtitle: String? = null, enabled: Boolean = true, icon: ImageVector? = null, showIconAreaIfNoIcon: Boolean = false, @@ -60,13 +65,25 @@ fun PreferenceSwitch( enabled = enabled, isVisible = showIconAreaIfNoIcon ) - Text( + Column( modifier = Modifier - .weight(1f), - style = ElementTheme.typography.fontBodyLgRegular, - text = title, - color = enabled.toEnabledColor(), - ) + .weight(1f) + .align(Alignment.CenterVertically) + ) { + Text( + style = ElementTheme.typography.fontBodyLgRegular, + text = title, + color = enabled.toEnabledColor(), + ) + if (subtitle != null) { + Spacer(modifier = Modifier.height(4.dp)) + Text( + style = ElementTheme.typography.fontBodyMdRegular, + text = subtitle, + color = enabled.toSecondaryEnabledColor(), + ) + } + } // TODO Create a wrapper for Switch Switch( modifier = Modifier @@ -86,6 +103,7 @@ internal fun PreferenceSwitchPreview() = ElementThemedPreview { ContentToPreview private fun ContentToPreview() { PreferenceSwitch( title = "Switch", + subtitle = "Subtitle Switch", icon = Icons.Default.Announcement, enabled = true, isChecked = true From e81d9c1ac99aa886abdb984265e7e395b4b0aafc Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 17:50:13 +0200 Subject: [PATCH 20/36] Add application version to the setting screen. --- .../kotlin/io/element/android/x/di/AppModule.kt | 1 + .../android/features/analytics/test/TestData.kt | 1 + .../impl/root/CreateRoomRootPresenterTests.kt | 1 + .../impl/root/PreferencesRootPresenter.kt | 13 +++++++++++-- .../preferences/impl/root/PreferencesRootState.kt | 1 + .../impl/root/PreferencesRootStateProvider.kt | 1 + .../preferences/impl/root/PreferencesRootView.kt | 15 +++++++++++++++ .../impl/root/PreferencesRootPresenterTest.kt | 3 ++- .../android/libraries/core/meta/BuildMeta.kt | 1 + 9 files changed, 34 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/io/element/android/x/di/AppModule.kt b/app/src/main/kotlin/io/element/android/x/di/AppModule.kt index 729603c4d7..89ab50d32a 100644 --- a/app/src/main/kotlin/io/element/android/x/di/AppModule.kt +++ b/app/src/main/kotlin/io/element/android/x/di/AppModule.kt @@ -77,6 +77,7 @@ object AppModule { applicationId = BuildConfig.APPLICATION_ID, lowPrivacyLoggingEnabled = false, // TODO EAx Config.LOW_PRIVACY_LOG_ENABLE, versionName = BuildConfig.VERSION_NAME, + versionCode = BuildConfig.VERSION_CODE, gitRevision = "TODO", // BuildConfig.GIT_REVISION, gitRevisionDate = "TODO", // BuildConfig.GIT_REVISION_DATE, gitBranchName = "TODO", // BuildConfig.GIT_BRANCH_NAME, diff --git a/features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt b/features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt index b23a4ab3b0..0c3631c476 100644 --- a/features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt +++ b/features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt @@ -26,6 +26,7 @@ val A_BUILD_META = BuildMeta( applicationId = "", lowPrivacyLoggingEnabled = false, versionName = "", + versionCode = 0, gitRevision = "", gitRevisionDate = "", gitBranchName = "", diff --git a/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt b/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt index 359fb5955b..8d0a22e999 100644 --- a/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt +++ b/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt @@ -192,6 +192,7 @@ private fun aBuildMeta() = applicationName = "An Application", lowPrivacyLoggingEnabled = true, versionName = "", + versionCode = 0, gitRevision = "", gitBranchName = "", gitRevisionDate = "", diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt index 211b7d4c3e..871ff98442 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt @@ -25,13 +25,16 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.ui.res.stringResource import io.element.android.features.logout.api.LogoutPreferencePresenter import io.element.android.libraries.architecture.Presenter +import io.element.android.libraries.core.meta.BuildMeta import io.element.android.libraries.core.meta.BuildType import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.api.verification.SessionVerificationService import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus +import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import javax.inject.Inject @@ -40,7 +43,7 @@ class PreferencesRootPresenter @Inject constructor( private val logoutPresenter: LogoutPreferencePresenter, private val currentUserProvider: CurrentUserProvider, private val sessionVerificationService: SessionVerificationService, - private val buildType: BuildType, + private val buildMeta: BuildMeta, ) : Presenter { @Composable @@ -58,11 +61,17 @@ class PreferencesRootPresenter @Inject constructor( derivedStateOf { sessionVerifiedStatus == SessionVerifiedStatus.NotVerified } } + val version = stringResource( + id = CommonStrings.settings_version_number, + buildMeta.versionName, + buildMeta.versionCode.toString() + ) val logoutState = logoutPresenter.present() - val showDeveloperSettings = buildType != BuildType.RELEASE + val showDeveloperSettings = buildMeta.buildType != BuildType.RELEASE return PreferencesRootState( logoutState = logoutState, myUser = matrixUser.value, + version = version, showCompleteVerification = sessionIsNotVerified, showDeveloperSettings = showDeveloperSettings ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt index c412eadde1..8760550fd0 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootState.kt @@ -22,6 +22,7 @@ import io.element.android.libraries.matrix.api.user.MatrixUser data class PreferencesRootState( val logoutState: LogoutPreferenceState, val myUser: MatrixUser?, + val version: String, val showCompleteVerification: Boolean, val showDeveloperSettings: Boolean ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt index 051800e8cd..4f9626bcbd 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootStateProvider.kt @@ -21,6 +21,7 @@ import io.element.android.features.logout.api.aLogoutPreferenceState fun aPreferencesRootState() = PreferencesRootState( logoutState = aLogoutPreferenceState(), myUser = null, + version = "Version 1.1 (1)", showCompleteVerification = true, showDeveloperSettings = true ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index 07a4fca15f..fcd874d49a 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -16,6 +16,8 @@ package io.element.android.features.preferences.impl.root +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.DeveloperMode import androidx.compose.material.icons.outlined.BugReport @@ -25,7 +27,9 @@ import androidx.compose.material.icons.outlined.VerifiedUser import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.PreviewParameter +import androidx.compose.ui.unit.dp import io.element.android.features.logout.api.LogoutPreferenceView import io.element.android.features.preferences.impl.user.UserPreferences import io.element.android.libraries.designsystem.components.preferences.PreferenceText @@ -34,8 +38,10 @@ import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.designsystem.preview.LargeHeightPreview import io.element.android.libraries.designsystem.theme.components.Divider +import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.ui.components.MatrixUserProvider +import io.element.android.libraries.theme.ElementTheme import io.element.android.libraries.ui.strings.CommonStrings @Composable @@ -86,6 +92,15 @@ fun PreferencesRootView( LogoutPreferenceView( state = state.logoutState, ) + Text( + modifier = Modifier + .fillMaxWidth() + .padding(top = 40.dp, bottom = 24.dp), + textAlign = TextAlign.Center, + text = state.version, + style = ElementTheme.typography.fontBodySmRegular, + color = ElementTheme.materialColors.secondary, + ) } } diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt index 040fda17d1..fa3d7163cf 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt @@ -41,13 +41,14 @@ class PreferencesRootPresenterTest { logoutPresenter, CurrentUserProvider(matrixClient), FakeSessionVerificationService(), - A_BUILD_META.buildType + A_BUILD_META ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() }.test { val initialState = awaitItem() assertThat(initialState.myUser).isNull() + assertThat(initialState.version).isEqualTo("Version " + A_BUILD_META.versionName + " (" + A_BUILD_META.versionCode + ")") val loadedState = awaitItem() assertThat(loadedState.logoutState.logoutAction).isEqualTo(Async.Uninitialized) assertThat(loadedState.myUser).isEqualTo( diff --git a/libraries/core/src/main/kotlin/io/element/android/libraries/core/meta/BuildMeta.kt b/libraries/core/src/main/kotlin/io/element/android/libraries/core/meta/BuildMeta.kt index f816f13a39..aaf54cc0f8 100644 --- a/libraries/core/src/main/kotlin/io/element/android/libraries/core/meta/BuildMeta.kt +++ b/libraries/core/src/main/kotlin/io/element/android/libraries/core/meta/BuildMeta.kt @@ -23,6 +23,7 @@ data class BuildMeta( val applicationId: String, val lowPrivacyLoggingEnabled: Boolean, val versionName: String, + val versionCode: Int, val gitRevision: String, val gitRevisionDate: String, val gitBranchName: String, From 34f4078d5f2cf4f8bc1da23c29498d764a668067 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 18:07:16 +0200 Subject: [PATCH 21/36] Move BuildMeta fake to common test module. --- .../impl/AnalyticsOptInPresenterTest.kt | 7 ++- .../AnalyticsPreferencesPresenterTest.kt | 8 ++-- .../features/analytics/test/TestData.kt | 36 -------------- .../impl/root/CreateRoomRootPresenterTests.kt | 17 +------ .../messages/MessagesPresenterTest.kt | 15 +----- .../actionlist/ActionListPresenterTest.kt | 31 +----------- ...AnalyticsAnalyticsSettingsPresenterTest.kt | 4 +- .../impl/root/PreferencesRootPresenterTest.kt | 7 +-- .../libraries/matrix/test/core/BuildMeta.kt | 48 +++++++++++++++++++ 9 files changed, 65 insertions(+), 108 deletions(-) delete mode 100644 features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt create mode 100644 libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/core/BuildMeta.kt diff --git a/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenterTest.kt b/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenterTest.kt index 01e95099d9..a8e42ceb01 100644 --- a/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenterTest.kt +++ b/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInPresenterTest.kt @@ -21,9 +21,8 @@ import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.features.analytics.api.AnalyticsOptInEvents -import io.element.android.features.analytics.impl.preferences.DefaultAnalyticsPreferencesPresenter -import io.element.android.features.analytics.test.A_BUILD_META import io.element.android.features.analytics.test.FakeAnalyticsService +import io.element.android.libraries.matrix.test.core.aBuildMeta import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.runTest import org.junit.Test @@ -33,7 +32,7 @@ class AnalyticsOptInPresenterTest { fun `present - enable`() = runTest { val analyticsService = FakeAnalyticsService(isEnabled = false) val presenter = AnalyticsOptInPresenter( - A_BUILD_META, + aBuildMeta(), analyticsService ) moleculeFlow(RecompositionClock.Immediate) { @@ -51,7 +50,7 @@ class AnalyticsOptInPresenterTest { fun `present - not now`() = runTest { val analyticsService = FakeAnalyticsService(isEnabled = false) val presenter = AnalyticsOptInPresenter( - A_BUILD_META, + aBuildMeta(), analyticsService ) moleculeFlow(RecompositionClock.Immediate) { diff --git a/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/preferences/AnalyticsPreferencesPresenterTest.kt b/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/preferences/AnalyticsPreferencesPresenterTest.kt index c37bf09928..8469abe769 100644 --- a/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/preferences/AnalyticsPreferencesPresenterTest.kt +++ b/features/analytics/impl/src/test/kotlin/io/element/android/features/analytics/impl/preferences/AnalyticsPreferencesPresenterTest.kt @@ -21,8 +21,8 @@ import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.features.analytics.api.AnalyticsOptInEvents -import io.element.android.features.analytics.test.A_BUILD_META import io.element.android.features.analytics.test.FakeAnalyticsService +import io.element.android.libraries.matrix.test.core.aBuildMeta import kotlinx.coroutines.test.runTest import org.junit.Test @@ -31,7 +31,7 @@ class AnalyticsPreferencesPresenterTest { fun `present - initial state available`() = runTest { val presenter = DefaultAnalyticsPreferencesPresenter( FakeAnalyticsService(isEnabled = true, didAskUserConsent = true), - A_BUILD_META + aBuildMeta() ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() @@ -46,7 +46,7 @@ class AnalyticsPreferencesPresenterTest { fun `present - initial state not available`() = runTest { val presenter = DefaultAnalyticsPreferencesPresenter( FakeAnalyticsService(isEnabled = false, didAskUserConsent = false), - A_BUILD_META + aBuildMeta() ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() @@ -60,7 +60,7 @@ class AnalyticsPreferencesPresenterTest { fun `present - enable and disable`() = runTest { val presenter = DefaultAnalyticsPreferencesPresenter( FakeAnalyticsService(isEnabled = true, didAskUserConsent = true), - A_BUILD_META + aBuildMeta() ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() diff --git a/features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt b/features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt deleted file mode 100644 index 0c3631c476..0000000000 --- a/features/analytics/test/src/main/kotlin/io/element/android/features/analytics/test/TestData.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2023 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.element.android.features.analytics.test - -import io.element.android.libraries.core.meta.BuildMeta -import io.element.android.libraries.core.meta.BuildType - -val A_BUILD_META = BuildMeta( - isDebuggable = true, - buildType = BuildType.DEBUG, - applicationName = "Element X test", - applicationId = "", - lowPrivacyLoggingEnabled = false, - versionName = "", - versionCode = 0, - gitRevision = "", - gitRevisionDate = "", - gitBranchName = "", - flavorDescription = "", - flavorShortDescription = "", -) - diff --git a/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt b/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt index 8d0a22e999..408632e04a 100644 --- a/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt +++ b/features/createroom/impl/src/test/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenterTests.kt @@ -34,6 +34,7 @@ import io.element.android.libraries.matrix.api.core.UserId import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.test.A_THROWABLE import io.element.android.libraries.matrix.test.FakeMatrixClient +import io.element.android.libraries.matrix.test.core.aBuildMeta import io.element.android.libraries.matrix.test.room.FakeMatrixRoom import io.element.android.libraries.usersearch.test.FakeUserRepository import kotlinx.collections.immutable.persistentListOf @@ -183,19 +184,3 @@ class CreateRoomRootPresenterTests { } } } - -private fun aBuildMeta() = - BuildMeta( - buildType = BuildType.DEBUG, - isDebuggable = true, - applicationId = "", - applicationName = "An Application", - lowPrivacyLoggingEnabled = true, - versionName = "", - versionCode = 0, - gitRevision = "", - gitBranchName = "", - gitRevisionDate = "", - flavorDescription = "", - flavorShortDescription = "", - ) diff --git a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/MessagesPresenterTest.kt b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/MessagesPresenterTest.kt index 028349d76f..604c9ec4a8 100644 --- a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/MessagesPresenterTest.kt +++ b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/MessagesPresenterTest.kt @@ -59,6 +59,7 @@ import io.element.android.libraries.matrix.test.AN_EVENT_ID import io.element.android.libraries.matrix.test.A_ROOM_ID import io.element.android.libraries.matrix.test.A_SESSION_ID import io.element.android.libraries.matrix.test.A_SESSION_ID_2 +import io.element.android.libraries.matrix.test.core.aBuildMeta import io.element.android.libraries.matrix.test.room.FakeMatrixRoom import io.element.android.libraries.matrix.test.room.aRoomMember import io.element.android.libraries.mediapickers.test.FakePickerProvider @@ -566,19 +567,7 @@ class MessagesPresenterTest { timelineItemsFactory = aTimelineItemsFactory(), room = matrixRoom, ) - val buildMeta = BuildMeta( - buildType = BuildType.DEBUG, - isDebuggable = true, - applicationId = "", - applicationName = "", - lowPrivacyLoggingEnabled = true, - versionName = "", - gitRevision = "", - gitBranchName = "", - gitRevisionDate = "", - flavorDescription = "", - flavorShortDescription = "", - ) + val buildMeta = aBuildMeta() val actionListPresenter = ActionListPresenter(buildMeta = buildMeta) val customReactionPresenter = CustomReactionPresenter() val retrySendMenuPresenter = RetrySendMenuPresenter(room = matrixRoom) diff --git a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/actionlist/ActionListPresenterTest.kt b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/actionlist/ActionListPresenterTest.kt index 88334737d7..c90a03e5bb 100644 --- a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/actionlist/ActionListPresenterTest.kt +++ b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/actionlist/ActionListPresenterTest.kt @@ -25,13 +25,11 @@ import io.element.android.features.messages.impl.actionlist.ActionListEvents import io.element.android.features.messages.impl.actionlist.ActionListPresenter import io.element.android.features.messages.impl.actionlist.ActionListState import io.element.android.features.messages.impl.actionlist.model.TimelineItemAction -import io.element.android.features.messages.impl.timeline.model.event.TimelineItemImageContent import io.element.android.features.messages.impl.timeline.model.event.TimelineItemRedactedContent import io.element.android.features.messages.impl.timeline.model.event.TimelineItemTextContent import io.element.android.features.messages.impl.timeline.model.event.aTimelineItemImageContent -import io.element.android.libraries.core.meta.BuildMeta -import io.element.android.libraries.core.meta.BuildType import io.element.android.libraries.matrix.test.A_MESSAGE +import io.element.android.libraries.matrix.test.core.aBuildMeta import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.test.runTest import org.junit.Test @@ -74,7 +72,6 @@ class ActionListPresenterTest { } } - @Test fun `present - compute for message from others redacted`() = runTest { val presenter = anActionListPresenter(isBuildDebuggable = true) @@ -231,31 +228,5 @@ class ActionListPresenterTest { } } -private fun aBuildMeta( - buildType: BuildType = BuildType.DEBUG, - isDebuggable: Boolean = true, - applicationName: String = "", - applicationId: String = "", - lowPrivacyLoggingEnabled: Boolean = true, - versionName: String = "", - gitRevision: String = "", - gitRevisionDate: String = "", - gitBranchName: String = "", - flavorDescription: String = "", - flavorShortDescription: String = "", -) = BuildMeta( - buildType, - isDebuggable, - applicationName, - applicationId, - lowPrivacyLoggingEnabled, - versionName, - gitRevision, - gitRevisionDate, - gitBranchName, - flavorDescription, - flavorShortDescription -) - private fun anActionListPresenter(isBuildDebuggable: Boolean) = ActionListPresenter(buildMeta = aBuildMeta(isDebuggable = isBuildDebuggable)) diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt index a383bcf71b..5382ad0b37 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsAnalyticsSettingsPresenterTest.kt @@ -21,15 +21,15 @@ import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.features.analytics.impl.preferences.DefaultAnalyticsPreferencesPresenter -import io.element.android.features.analytics.test.A_BUILD_META import io.element.android.features.analytics.test.FakeAnalyticsService +import io.element.android.libraries.matrix.test.core.aBuildMeta import kotlinx.coroutines.test.runTest import org.junit.Test class AnalyticsAnalyticsSettingsPresenterTest { @Test fun `present - initial state`() = runTest { - val analyticsPresenter = DefaultAnalyticsPreferencesPresenter(FakeAnalyticsService(), A_BUILD_META) + val analyticsPresenter = DefaultAnalyticsPreferencesPresenter(FakeAnalyticsService(), aBuildMeta()) val presenter = AnalyticsSettingsPresenter( analyticsPresenter, ) diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt index fa3d7163cf..1dd4c6c67a 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt @@ -20,7 +20,6 @@ import app.cash.molecule.RecompositionClock import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.features.analytics.test.A_BUILD_META import io.element.android.features.logout.impl.DefaultLogoutPreferencePresenter import io.element.android.libraries.architecture.Async import io.element.android.libraries.matrix.api.user.CurrentUserProvider @@ -28,6 +27,7 @@ import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.test.AN_AVATAR_URL import io.element.android.libraries.matrix.test.A_USER_NAME import io.element.android.libraries.matrix.test.FakeMatrixClient +import io.element.android.libraries.matrix.test.core.aBuildMeta import io.element.android.libraries.matrix.test.verification.FakeSessionVerificationService import kotlinx.coroutines.test.runTest import org.junit.Test @@ -35,20 +35,21 @@ import org.junit.Test class PreferencesRootPresenterTest { @Test fun `present - initial state`() = runTest { + val buildMeta = aBuildMeta() val matrixClient = FakeMatrixClient() val logoutPresenter = DefaultLogoutPreferencePresenter(matrixClient) val presenter = PreferencesRootPresenter( logoutPresenter, CurrentUserProvider(matrixClient), FakeSessionVerificationService(), - A_BUILD_META + buildMeta, ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() }.test { val initialState = awaitItem() assertThat(initialState.myUser).isNull() - assertThat(initialState.version).isEqualTo("Version " + A_BUILD_META.versionName + " (" + A_BUILD_META.versionCode + ")") + assertThat(initialState.version).isEqualTo("Version " + buildMeta.versionName + " (" + buildMeta.versionCode + ")") val loadedState = awaitItem() assertThat(loadedState.logoutState.logoutAction).isEqualTo(Async.Uninitialized) assertThat(loadedState.myUser).isEqualTo( diff --git a/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/core/BuildMeta.kt b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/core/BuildMeta.kt new file mode 100644 index 0000000000..d048101f87 --- /dev/null +++ b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/core/BuildMeta.kt @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.matrix.test.core + +import io.element.android.libraries.core.meta.BuildMeta +import io.element.android.libraries.core.meta.BuildType + +fun aBuildMeta( + buildType: BuildType = BuildType.DEBUG, + isDebuggable: Boolean = true, + applicationName: String = "", + applicationId: String = "", + lowPrivacyLoggingEnabled: Boolean = true, + versionName: String = "", + versionCode: Int = 0, + gitRevision: String = "", + gitRevisionDate: String = "", + gitBranchName: String = "", + flavorDescription: String = "", + flavorShortDescription: String = "", +) = BuildMeta( + buildType, + isDebuggable, + applicationName, + applicationId, + lowPrivacyLoggingEnabled, + versionName, + versionCode, + gitRevision, + gitRevisionDate, + gitBranchName, + flavorDescription, + flavorShortDescription +) From 3e1d6e529cfecb6cbdf253d0f50bab32b73d83e3 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 18:25:15 +0200 Subject: [PATCH 22/36] Fix test. --- features/preferences/impl/build.gradle.kts | 1 + .../impl/root/PreferencesRootPresenter.kt | 15 ++---- .../preferences/impl/root/VersionFormatter.kt | 48 +++++++++++++++++++ .../impl/root/PreferencesRootPresenterTest.kt | 8 ++-- 4 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/VersionFormatter.kt diff --git a/features/preferences/impl/build.gradle.kts b/features/preferences/impl/build.gradle.kts index 0e53ef6716..682757d802 100644 --- a/features/preferences/impl/build.gradle.kts +++ b/features/preferences/impl/build.gradle.kts @@ -46,6 +46,7 @@ dependencies { implementation(projects.features.analytics.api) implementation(projects.libraries.matrixui) implementation(projects.features.logout.api) + implementation(projects.services.toolbox.api) implementation(libs.datetime) implementation(libs.accompanist.placeholder) implementation(libs.coil.compose) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt index 871ff98442..18147fd197 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt @@ -25,16 +25,13 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable -import androidx.compose.ui.res.stringResource import io.element.android.features.logout.api.LogoutPreferencePresenter import io.element.android.libraries.architecture.Presenter -import io.element.android.libraries.core.meta.BuildMeta import io.element.android.libraries.core.meta.BuildType import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.api.verification.SessionVerificationService import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus -import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import javax.inject.Inject @@ -43,7 +40,8 @@ class PreferencesRootPresenter @Inject constructor( private val logoutPresenter: LogoutPreferencePresenter, private val currentUserProvider: CurrentUserProvider, private val sessionVerificationService: SessionVerificationService, - private val buildMeta: BuildMeta, + private val buildType: BuildType, + private val versionFormatter: VersionFormatter, ) : Presenter { @Composable @@ -61,17 +59,12 @@ class PreferencesRootPresenter @Inject constructor( derivedStateOf { sessionVerifiedStatus == SessionVerifiedStatus.NotVerified } } - val version = stringResource( - id = CommonStrings.settings_version_number, - buildMeta.versionName, - buildMeta.versionCode.toString() - ) val logoutState = logoutPresenter.present() - val showDeveloperSettings = buildMeta.buildType != BuildType.RELEASE + val showDeveloperSettings = buildType != BuildType.RELEASE return PreferencesRootState( logoutState = logoutState, myUser = matrixUser.value, - version = version, + version = versionFormatter.get(), showCompleteVerification = sessionIsNotVerified, showDeveloperSettings = showDeveloperSettings ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/VersionFormatter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/VersionFormatter.kt new file mode 100644 index 0000000000..7eff670951 --- /dev/null +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/VersionFormatter.kt @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.preferences.impl.root + +import com.squareup.anvil.annotations.ContributesBinding +import io.element.android.libraries.core.meta.BuildMeta +import io.element.android.libraries.di.AppScope +import io.element.android.libraries.ui.strings.CommonStrings +import io.element.android.services.toolbox.api.strings.StringProvider +import javax.inject.Inject + +interface VersionFormatter { + fun get(): String +} + +@ContributesBinding(AppScope::class) +class DefaultVersionFormatter @Inject constructor( + private val stringProvider: StringProvider, + private val buildMeta: BuildMeta, +) : VersionFormatter { + override fun get(): String { + return stringProvider.getString( + CommonStrings.settings_version_number, + buildMeta.versionName, + buildMeta.versionCode.toString() + ) + } +} + +class FakeVersionFormatter : VersionFormatter { + override fun get(): String { + return "A Version" + } +} diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt index 1dd4c6c67a..bd5ec02b10 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt @@ -22,12 +22,12 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.features.logout.impl.DefaultLogoutPreferencePresenter import io.element.android.libraries.architecture.Async +import io.element.android.libraries.core.meta.BuildType import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.test.AN_AVATAR_URL import io.element.android.libraries.matrix.test.A_USER_NAME import io.element.android.libraries.matrix.test.FakeMatrixClient -import io.element.android.libraries.matrix.test.core.aBuildMeta import io.element.android.libraries.matrix.test.verification.FakeSessionVerificationService import kotlinx.coroutines.test.runTest import org.junit.Test @@ -35,21 +35,21 @@ import org.junit.Test class PreferencesRootPresenterTest { @Test fun `present - initial state`() = runTest { - val buildMeta = aBuildMeta() val matrixClient = FakeMatrixClient() val logoutPresenter = DefaultLogoutPreferencePresenter(matrixClient) val presenter = PreferencesRootPresenter( logoutPresenter, CurrentUserProvider(matrixClient), FakeSessionVerificationService(), - buildMeta, + BuildType.DEBUG, + FakeVersionFormatter() ) moleculeFlow(RecompositionClock.Immediate) { presenter.present() }.test { val initialState = awaitItem() assertThat(initialState.myUser).isNull() - assertThat(initialState.version).isEqualTo("Version " + buildMeta.versionName + " (" + buildMeta.versionCode + ")") + assertThat(initialState.version).isEqualTo("A Version") val loadedState = awaitItem() assertThat(loadedState.logoutState.logoutAction).isEqualTo(Async.Uninitialized) assertThat(loadedState.myUser).isEqualTo( From d14b9e3c1fbeab399b6b88aafa7907e2277571fb Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 18:26:42 +0200 Subject: [PATCH 23/36] Fix wrong padding. --- .../designsystem/components/preferences/PreferenceCategory.kt | 2 +- .../designsystem/components/preferences/PreferenceDivider.kt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt index 6d557d5994..4196edb0d5 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCategory.kt @@ -57,7 +57,7 @@ fun PreferenceCategory( fun PreferenceCategoryTitle(title: String, modifier: Modifier = Modifier) { Text( modifier = modifier.padding( - top = 12.dp, + top = 20.dp, bottom = 8.dp, start = preferencePaddingHorizontal, end = preferencePaddingHorizontal, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt index 41a499c9d0..2e4b9e196b 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDivider.kt @@ -16,11 +16,9 @@ package io.element.android.libraries.designsystem.components.preferences -import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup import io.element.android.libraries.designsystem.theme.components.Divider @@ -31,7 +29,7 @@ fun PreferenceDivider( modifier: Modifier = Modifier, ) { Divider( - modifier = modifier.padding(bottom = 8.dp), + modifier = modifier, color = ElementTheme.colors.borderDisabled, ) } From 43af57c1703f08e0517823ad70a2fe33ac3fa11b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 18:34:19 +0200 Subject: [PATCH 24/36] Improve rendering of preference anaytics screen. --- .../preferences/AnalyticsPreferencesView.kt | 32 +++++++++---------- .../preferences/PreferenceSwitch.kt | 5 ++- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt b/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt index b04848a999..f6d77226b9 100644 --- a/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt +++ b/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt @@ -18,6 +18,7 @@ package io.element.android.features.analytics.api.preferences import androidx.annotation.StringRes import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource @@ -27,7 +28,6 @@ import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import io.element.android.features.analytics.api.AnalyticsOptInEvents -import io.element.android.libraries.designsystem.components.preferences.PreferenceCategory import io.element.android.libraries.designsystem.components.preferences.PreferenceSwitch import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight @@ -43,23 +43,21 @@ fun AnalyticsPreferencesView( state.eventSink(AnalyticsOptInEvents.EnableAnalytics(isEnabled = isEnabled)) } - PreferenceCategory( - modifier = modifier, - title = stringResource(id = CommonStrings.screen_analytics_settings_share_data) - ) { - val firstPart = stringResource(id = CommonStrings.screen_analytics_settings_help_us_improve, state.applicationName) - val secondPart = buildAnnotatedStringWithColoredPart( - CommonStrings.screen_analytics_settings_read_terms, - CommonStrings.screen_analytics_settings_read_terms_content_link - ) - val title = "$firstPart\n\n$secondPart" + val firstPart = stringResource(id = CommonStrings.screen_analytics_settings_help_us_improve, state.applicationName) + val secondPart = buildAnnotatedStringWithColoredPart( + CommonStrings.screen_analytics_settings_read_terms, + CommonStrings.screen_analytics_settings_read_terms_content_link + ) + val subtitle = "$firstPart\n\n$secondPart" - PreferenceSwitch( - title = title, - isChecked = state.isEnabled, - onCheckedChange = ::onEnabledChanged - ) - } + PreferenceSwitch( + modifier = modifier, + title = stringResource(id = CommonStrings.screen_analytics_settings_share_data), + subtitle = subtitle, + isChecked = state.isEnabled, + onCheckedChange = ::onEnabledChanged, + switchAlignment = Alignment.Top, + ) } @Composable diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt index 00c0226db9..bbd3583688 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt @@ -24,6 +24,7 @@ import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Announcement import androidx.compose.material3.Switch @@ -51,6 +52,7 @@ fun PreferenceSwitch( icon: ImageVector? = null, showIconAreaIfNoIcon: Boolean = false, onCheckedChange: (Boolean) -> Unit = {}, + switchAlignment: Alignment.Vertical = Alignment.CenterVertically ) { Row( modifier = modifier @@ -84,10 +86,11 @@ fun PreferenceSwitch( ) } } + Spacer(modifier = Modifier.width(16.dp)) // TODO Create a wrapper for Switch Switch( modifier = Modifier - .align(Alignment.CenterVertically), + .align(switchAlignment), checked = isChecked, enabled = enabled, onCheckedChange = onCheckedChange From 028faf2537a1dfc1d51a92e578ce7672925c6b1d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 18:46:40 +0200 Subject: [PATCH 25/36] Show Toast when bug report is submitted with success. --- .../features/rageshake/impl/bugreport/BugReportNode.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt index a087300f4e..db9c2b5aa1 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportNode.kt @@ -16,8 +16,10 @@ package io.element.android.features.rageshake.impl.bugreport +import android.app.Activity import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import com.bumble.appyx.core.modality.BuildContext import com.bumble.appyx.core.node.Node import com.bumble.appyx.core.plugin.Plugin @@ -26,7 +28,9 @@ import dagger.assisted.Assisted import dagger.assisted.AssistedInject import io.element.android.anvilannotations.ContributesNode import io.element.android.features.rageshake.api.bugreport.BugReportEntryPoint +import io.element.android.libraries.androidutils.system.toast import io.element.android.libraries.di.AppScope +import io.element.android.libraries.ui.strings.CommonStrings @ContributesNode(AppScope::class) class BugReportNode @AssistedInject constructor( @@ -38,11 +42,15 @@ class BugReportNode @AssistedInject constructor( @Composable override fun View(modifier: Modifier) { val state = presenter.present() + val activity = LocalContext.current as? Activity BugReportView( state = state, modifier = modifier, onBackPressed = { navigateUp() }, - onDone = this::onDone, + onDone = { + activity?.toast(CommonStrings.common_report_submitted) + onDone() + }, ) } From b69de38c6654f0fbbc9aa6d53c42055a41f37488 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 18:50:29 +0200 Subject: [PATCH 26/36] Bugfix: close screen after bug report has been sent. --- .../rageshake/impl/bugreport/DefaultBugReportEntryPoint.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/DefaultBugReportEntryPoint.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/DefaultBugReportEntryPoint.kt index 19f4e532e9..5abaec94b6 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/DefaultBugReportEntryPoint.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/DefaultBugReportEntryPoint.kt @@ -38,7 +38,7 @@ class DefaultBugReportEntryPoint @Inject constructor() : BugReportEntryPoint { } override fun build(): Node { - return parentNode.createNode(buildContext) + return parentNode.createNode(buildContext, plugins) } } } From 0ea811269b934e0d368e7c9cb938b7d65c0a5b77 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 21:43:44 +0200 Subject: [PATCH 27/36] Fix modifier issue. --- .../preferences/impl/root/PreferencesRootView.kt | 2 +- .../matrix/ui/components/MatrixUserHeader.kt | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index fcd874d49a..d1cf0bf6a6 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -47,13 +47,13 @@ import io.element.android.libraries.ui.strings.CommonStrings @Composable fun PreferencesRootView( state: PreferencesRootState, - modifier: Modifier = Modifier, onBackPressed: () -> Unit, onVerifyClicked: () -> Unit, onOpenAnalytics: () -> Unit, onOpenRageShake: () -> Unit, onOpenAbout: () -> Unit, onOpenDeveloperSettings: () -> Unit, + modifier: Modifier = Modifier, ) { // Include pref from other modules PreferenceView( diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt index 164d91ebff..04ad358aca 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt @@ -46,8 +46,22 @@ fun MatrixUserHeader( // onClick: () -> Unit = {}, ) { if (matrixUser == null) { - return MatrixUserHeaderPlaceholder(modifier = modifier) + MatrixUserHeaderPlaceholder(modifier = modifier) + } else { + MatrixUserHeaderContent( + matrixUser = matrixUser, + modifier = modifier, + // onClick = onClick + ) } +} + +@Composable +private fun MatrixUserHeaderContent( + matrixUser: MatrixUser, + modifier: Modifier = Modifier, + // onClick: () -> Unit = {}, +) { Row( modifier = modifier // .clickable(onClick = onClick) From 3c601c4210c2c8bfda3e3a4b0945068f6ea23550 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 30 Jun 2023 22:01:23 +0200 Subject: [PATCH 28/36] Fix false positive. --- tools/check/forbidden_strings_in_code.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check/forbidden_strings_in_code.txt b/tools/check/forbidden_strings_in_code.txt index 6c91c0baf7..17f352fca4 100755 --- a/tools/check/forbidden_strings_in_code.txt +++ b/tools/check/forbidden_strings_in_code.txt @@ -72,7 +72,7 @@ DO NOT COMMIT ^ /\* ### unnecessary parenthesis around numbers, example: " (0)" - \(\d+\) + \(\d+\)[^"] ### import the package, do not use long class name with package android\.os\.Build\. From 2c8fdf0dadf25214c427035af19f9688098d13c8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 3 Jul 2023 09:56:57 +0200 Subject: [PATCH 29/36] Use correct icon. --- .../features/preferences/impl/root/PreferencesRootView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index d1cf0bf6a6..f1e6e7de61 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -19,8 +19,8 @@ package io.element.android.features.preferences.impl.root import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.DeveloperMode import androidx.compose.material.icons.outlined.BugReport +import androidx.compose.material.icons.outlined.DeveloperMode import androidx.compose.material.icons.outlined.Help import androidx.compose.material.icons.outlined.InsertChart import androidx.compose.material.icons.outlined.VerifiedUser @@ -108,7 +108,7 @@ fun PreferencesRootView( fun DeveloperPreferencesView(onOpenDeveloperSettings: () -> Unit) { PreferenceText( title = stringResource(id = CommonStrings.common_developer_options), - icon = Icons.Default.DeveloperMode, + icon = Icons.Outlined.DeveloperMode, onClick = onOpenDeveloperSettings ) } From 312a5890afd022c6aeb9533fd97c620fcc35fd7c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 3 Jul 2023 09:57:34 +0200 Subject: [PATCH 30/36] PreferenceCategory has more top padding, so reduce the Spacer above in this screen. --- .../android/features/roomdetails/impl/RoomDetailsView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index 041c5cd829..b4df5dd245 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -134,7 +134,7 @@ fun RoomDetailsView( RoomMemberMainActionsSection(onShareUser = ::onShareMember) } } - Spacer(Modifier.height(26.dp)) + Spacer(Modifier.height(18.dp)) if (state.roomTopic !is RoomTopicState.Hidden) { TopicSection( From 73b1ffd7d06b20ee7ad29980067031baf9583270 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 3 Jul 2023 16:48:22 +0200 Subject: [PATCH 31/36] Replace CurrentUserProvider by an extension on MatrixClient. --- .../impl/root/PreferencesRootPresenter.kt | 7 +++--- .../impl/root/PreferencesRootPresenterTest.kt | 3 +-- .../roomlist/impl/RoomListPresenter.kt | 5 ++-- .../roomlist/impl/RoomListPresenterTests.kt | 12 --------- ...{CurrentUserProvider.kt => CurrentUser.kt} | 25 +++++++++---------- .../android/samples/minimal/RoomListScreen.kt | 2 -- 6 files changed, 19 insertions(+), 35 deletions(-) rename libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/{CurrentUserProvider.kt => CurrentUser.kt} (59%) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt index 18147fd197..7afa2a67da 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenter.kt @@ -28,8 +28,9 @@ import androidx.compose.runtime.saveable.rememberSaveable import io.element.android.features.logout.api.LogoutPreferencePresenter import io.element.android.libraries.architecture.Presenter import io.element.android.libraries.core.meta.BuildType -import io.element.android.libraries.matrix.api.user.CurrentUserProvider +import io.element.android.libraries.matrix.api.MatrixClient import io.element.android.libraries.matrix.api.user.MatrixUser +import io.element.android.libraries.matrix.api.user.getCurrentUser import io.element.android.libraries.matrix.api.verification.SessionVerificationService import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus import kotlinx.coroutines.CoroutineScope @@ -38,7 +39,7 @@ import javax.inject.Inject class PreferencesRootPresenter @Inject constructor( private val logoutPresenter: LogoutPreferencePresenter, - private val currentUserProvider: CurrentUserProvider, + private val matrixClient: MatrixClient, private val sessionVerificationService: SessionVerificationService, private val buildType: BuildType, private val versionFormatter: VersionFormatter, @@ -71,6 +72,6 @@ class PreferencesRootPresenter @Inject constructor( } private fun CoroutineScope.initialLoad(matrixUser: MutableState) = launch { - matrixUser.value = currentUserProvider.provide() + matrixUser.value = matrixClient.getCurrentUser() } } diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt index bd5ec02b10..58931e25d7 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootPresenterTest.kt @@ -23,7 +23,6 @@ import com.google.common.truth.Truth.assertThat import io.element.android.features.logout.impl.DefaultLogoutPreferencePresenter import io.element.android.libraries.architecture.Async import io.element.android.libraries.core.meta.BuildType -import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.test.AN_AVATAR_URL import io.element.android.libraries.matrix.test.A_USER_NAME @@ -39,7 +38,7 @@ class PreferencesRootPresenterTest { val logoutPresenter = DefaultLogoutPreferencePresenter(matrixClient) val presenter = PreferencesRootPresenter( logoutPresenter, - CurrentUserProvider(matrixClient), + matrixClient, FakeSessionVerificationService(), BuildType.DEBUG, FakeVersionFormatter() diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt index a929f068ee..7d752ea8b6 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt @@ -44,8 +44,8 @@ import io.element.android.libraries.eventformatter.api.RoomLastMessageFormatter import io.element.android.libraries.matrix.api.MatrixClient import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.matrix.api.room.RoomSummary -import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.user.MatrixUser +import io.element.android.libraries.matrix.api.user.getCurrentUser import io.element.android.libraries.matrix.api.verification.SessionVerificationService import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus import kotlinx.collections.immutable.ImmutableList @@ -60,7 +60,6 @@ private const val extendedRangeSize = 40 class RoomListPresenter @Inject constructor( private val client: MatrixClient, - private val currentUserProvider: CurrentUserProvider, private val lastMessageTimestampFormatter: LastMessageTimestampFormatter, private val roomLastMessageFormatter: RoomLastMessageFormatter, private val sessionVerificationService: SessionVerificationService, @@ -163,7 +162,7 @@ class RoomListPresenter @Inject constructor( } private fun CoroutineScope.initialLoad(matrixUser: MutableState) = launch { - matrixUser.value = currentUserProvider.provide() + matrixUser.value = client.getCurrentUser() } private fun updateVisibleRange(range: IntRange) { diff --git a/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt b/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt index d512f7a9b1..50db5a3be2 100644 --- a/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt +++ b/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTests.kt @@ -31,7 +31,6 @@ import io.element.android.libraries.designsystem.components.avatar.AvatarData import io.element.android.libraries.designsystem.components.avatar.AvatarSize import io.element.android.libraries.designsystem.utils.SnackbarDispatcher import io.element.android.libraries.eventformatter.test.FakeRoomLastMessageFormatter -import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus import io.element.android.libraries.matrix.test.AN_AVATAR_URL import io.element.android.libraries.matrix.test.AN_EXCEPTION @@ -54,7 +53,6 @@ class RoomListPresenterTests { val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -84,7 +82,6 @@ class RoomListPresenterTests { ) val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -108,7 +105,6 @@ class RoomListPresenterTests { val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -139,7 +135,6 @@ class RoomListPresenterTests { ) val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -173,7 +168,6 @@ class RoomListPresenterTests { ) val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -213,7 +207,6 @@ class RoomListPresenterTests { ) val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -263,7 +256,6 @@ class RoomListPresenterTests { ) val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService().apply { @@ -292,7 +284,6 @@ class RoomListPresenterTests { val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -324,7 +315,6 @@ class RoomListPresenterTests { val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -353,7 +343,6 @@ class RoomListPresenterTests { val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), @@ -387,7 +376,6 @@ class RoomListPresenterTests { val matrixClient = FakeMatrixClient() val presenter = RoomListPresenter( matrixClient, - CurrentUserProvider(matrixClient), createDateFormatter(), FakeRoomLastMessageFormatter(), FakeSessionVerificationService(), diff --git a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUserProvider.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUser.kt similarity index 59% rename from libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUserProvider.kt rename to libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUser.kt index 2e752578a7..3968b058d9 100644 --- a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUserProvider.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/user/CurrentUser.kt @@ -17,18 +17,17 @@ package io.element.android.libraries.matrix.api.user import io.element.android.libraries.matrix.api.MatrixClient -import javax.inject.Inject -class CurrentUserProvider @Inject constructor( - private val matrixClient: MatrixClient, -) { - suspend fun provide(): MatrixUser { - val userAvatarUrl = matrixClient.loadUserAvatarURLString().getOrNull() - val userDisplayName = matrixClient.loadUserDisplayName().getOrNull() - return MatrixUser( - userId = matrixClient.sessionId, - displayName = userDisplayName, - avatarUrl = userAvatarUrl, - ) - } +/** + * Get the current user, as [MatrixUser], using [MatrixClient.loadUserAvatarURLString] + * and [MatrixClient.loadUserDisplayName]. + */ +suspend fun MatrixClient.getCurrentUser(): MatrixUser { + val userAvatarUrl = loadUserAvatarURLString().getOrNull() + val userDisplayName = loadUserDisplayName().getOrNull() + return MatrixUser( + userId = sessionId, + displayName = userDisplayName, + avatarUrl = userAvatarUrl, + ) } diff --git a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt index d41a565069..f9cdf0f3fd 100644 --- a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt +++ b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt @@ -38,7 +38,6 @@ import io.element.android.libraries.eventformatter.impl.StateContentFormatter import io.element.android.libraries.matrix.api.MatrixClient import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.matrix.api.room.RoomMembershipObserver -import io.element.android.libraries.matrix.api.user.CurrentUserProvider import io.element.android.services.toolbox.impl.strings.AndroidStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -61,7 +60,6 @@ class RoomListScreen( private val stringProvider = AndroidStringProvider(context.resources) private val presenter = RoomListPresenter( client = matrixClient, - currentUserProvider = CurrentUserProvider(matrixClient), lastMessageTimestampFormatter = DefaultLastMessageTimestampFormatter(dateTimeProvider, dateFormatters), roomLastMessageFormatter = DefaultRoomLastMessageFormatter( sp = stringProvider, From f9c7a9ec0845a03c78c84f9e96a8314d0f506ecb Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 3 Jul 2023 16:51:00 +0200 Subject: [PATCH 32/36] Add todo to explain why code is commented out. --- .../android/libraries/matrix/ui/components/MatrixUserHeader.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt index 04ad358aca..6054aa53af 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt @@ -43,6 +43,7 @@ import io.element.android.libraries.theme.ElementTheme fun MatrixUserHeader( matrixUser: MatrixUser?, modifier: Modifier = Modifier, + // TODO handle click on this item, to let the user be able to update their profile. // onClick: () -> Unit = {}, ) { if (matrixUser == null) { From 4f1d352969f76864e3406f2dc9432ef6c1c5c949 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 3 Jul 2023 16:58:43 +0200 Subject: [PATCH 33/36] Remove dead code. --- .../preferences/impl/about/AboutEvents.kt | 21 ------------------- .../preferences/impl/about/AboutPresenter.kt | 7 ------- .../preferences/impl/about/AboutState.kt | 2 -- .../impl/about/AboutStateProvider.kt | 1 - .../impl/analytics/AnalyticsSettingsEvents.kt | 21 ------------------- .../analytics/AnalyticsSettingsPresenter.kt | 7 ------- .../impl/analytics/AnalyticsSettingsState.kt | 1 - .../AnalyticsSettingsStateProvider.kt | 1 - 8 files changed, 61 deletions(-) delete mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt delete mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt deleted file mode 100644 index fd27e3f682..0000000000 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.element.android.features.preferences.impl.about - -sealed interface AboutEvents { - object MyEvent : AboutEvents -} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt index ce2439d8a6..556c62ec73 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt @@ -25,15 +25,8 @@ class AboutPresenter @Inject constructor() : Presenter { @Composable override fun present(): AboutState { - fun handleEvents(event: AboutEvents) { - when (event) { - AboutEvents.MyEvent -> Unit - } - } - return AboutState( elementLegals = getAllLegals(), - eventSink = ::handleEvents ) } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt index 5a1a123b11..cd361bd4b0 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt @@ -16,9 +16,7 @@ package io.element.android.features.preferences.impl.about -// TODO add your ui models. Remove the eventSink if you don't have events. // Do not use default value, so no member get forgotten in the presenters. data class AboutState( val elementLegals: List, - val eventSink: (AboutEvents) -> Unit ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt index 6f195b71d7..5775cbe48c 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt @@ -27,5 +27,4 @@ open class AboutStateProvider : PreviewParameterProvider { fun aAboutState() = AboutState( elementLegals = getAllLegals(), - eventSink = {} ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt deleted file mode 100644 index 86b2db16d9..0000000000 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.element.android.features.preferences.impl.analytics - -sealed interface AnalyticsSettingsEvents { - object MyEvent : AnalyticsSettingsEvents -} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt index 976193db74..1ef344403d 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt @@ -29,15 +29,8 @@ class AnalyticsSettingsPresenter @Inject constructor( override fun present(): AnalyticsSettingsState { val analyticsState = analyticsPresenter.present() - fun handleEvents(event: AnalyticsSettingsEvents) { - when (event) { - AnalyticsSettingsEvents.MyEvent -> Unit - } - } - return AnalyticsSettingsState( analyticsState = analyticsState, - eventSink = ::handleEvents ) } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt index b5a38fb23c..00fb8443c5 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt @@ -21,5 +21,4 @@ import io.element.android.features.analytics.api.preferences.AnalyticsPreference // Do not use default value, so no member get forgotten in the presenters. data class AnalyticsSettingsState( val analyticsState: AnalyticsPreferencesState, - val eventSink: (AnalyticsSettingsEvents) -> Unit ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt index f1eb2b6c0f..16ad2394ff 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt @@ -28,5 +28,4 @@ open class AnalyticsSettingsStateProvider : PreviewParameterProvider Date: Mon, 3 Jul 2023 17:06:58 +0200 Subject: [PATCH 34/36] Update Maestro test regarding settings. --- .maestro/tests/settings/settings.yaml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.maestro/tests/settings/settings.yaml b/.maestro/tests/settings/settings.yaml index ee3104024c..2fac9b108a 100644 --- a/.maestro/tests/settings/settings.yaml +++ b/.maestro/tests/settings/settings.yaml @@ -2,12 +2,29 @@ appId: ${APP_ID} --- - tapOn: id: "home_screen-settings" -- assertVisible: "Rageshake to report bug" +- assertVisible: "Settings" - takeScreenshot: build/maestro/600-Settings - tapOn: - text: "Report bug" - index: 1 -- assertVisible: "Describe the bug…" + text: "Analytics" +- assertVisible: "Share analytics data" - back + +- tapOn: + text: "Report bug" +- assertVisible: "Report a bug" +- back + +- tapOn: + text: "About" +- assertVisible: "Copyright" +- assertVisible: "Acceptable use policy" +- assertVisible: "Privacy policy" +- back + +- tapOn: + text: "Developer options" +- assertVisible: "Feature flags" +- back + - back - runFlow: ../assertions/assertHomeDisplayed.yaml From 64dde1cee1bc3708c09da9b54e5a1738b39277d7 Mon Sep 17 00:00:00 2001 From: ElementBot Date: Mon, 3 Jul 2023 15:28:29 +0000 Subject: [PATCH 35/36] Update screenshots --- ...icsPreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...csPreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...LogoutPreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...ogoutPreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...ultGroup_AboutViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 3 +++ ...ltGroup_AboutViewLightPreview_0_null_0,NEXUS_5,1.0,en].png | 3 +++ ...lyticsSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 3 +++ ...yticsSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png | 3 +++ ...eloperSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...eloperSettingsViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...loperSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...loperSettingsViewLightPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...erencesRootViewDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...erencesRootViewDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...rencesRootViewLightPreview--0_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...rencesRootViewLightPreview--0_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...up_UserPreferencesDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...up_UserPreferencesDarkPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...up_UserPreferencesDarkPreview_0_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...p_UserPreferencesLightPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...p_UserPreferencesLightPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...p_UserPreferencesLightPreview_0_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...akePreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...akePreferencesViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...kePreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...kePreferencesViewLightPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...roup_BugReportViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...roup_BugReportViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...roup_BugReportViewDarkPreview_0_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...oup_BugReportViewLightPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...oup_BugReportViewLightPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...oup_BugReportViewLightPreview_0_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...mberDetailsViewDarkPreview--3_3_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...mberDetailsViewDarkPreview--3_3_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...mberDetailsViewDarkPreview--3_3_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...mberDetailsViewDarkPreview--3_3_null_3,NEXUS_5,1.0,en].png | 4 ++-- ...mberDetailsViewDarkPreview--3_3_null_4,NEXUS_5,1.0,en].png | 4 ++-- ...berDetailsViewLightPreview--2_2_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...berDetailsViewLightPreview--2_2_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...berDetailsViewLightPreview--2_2_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...berDetailsViewLightPreview--2_2_null_3,NEXUS_5,1.0,en].png | 4 ++-- ...berDetailsViewLightPreview--2_2_null_4,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_3,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_4,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_5,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_6,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_7,NEXUS_5,1.0,en].png | 4 ++-- ...oup_RoomDetailsDarkPreview--1_1_null_8,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_3,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_4,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_5,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_6,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_7,NEXUS_5,1.0,en].png | 4 ++-- ...up_RoomDetailsLightPreview--0_0_null_8,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_12,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_13,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_14,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_15,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_16,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_17,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_18,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_19,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_20,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_21,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_22,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_23,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_24,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_25,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_26,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_27,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_28,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_29,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_30,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_31,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_32,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_33,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_34,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_35,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_36,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_37,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_38,NEXUS_5,1.0,en].png | 4 ++-- ...r_null_Avatars_AvatarPreview_0_null_39,NEXUS_5,1.0,en].png | 3 +++ ...r_null_Avatars_AvatarPreview_0_null_40,NEXUS_5,1.0,en].png | 3 +++ ...r_null_Avatars_AvatarPreview_0_null_41,NEXUS_5,1.0,en].png | 3 +++ ...erences_PreferenceIconPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...erences_PreferenceIconPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...Group_PreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...roup_PreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...ences_PreferenceCategoryPreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...ences_PreferenceCheckboxPreview_0_null,NEXUS_5,1.0,en].png | 3 +++ ...rences_PreferenceDividerPreview_0_null,NEXUS_5,1.0,en].png | 3 +++ ...references_PreferenceRowPreview_0_null,NEXUS_5,1.0,en].png | 3 +++ ...ferences_PreferenceSlidePreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...erences_PreferenceSwitchPreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...eferences_PreferenceTextPreview_0_null,NEXUS_5,1.0,en].png | 4 ++-- ...p_MatrixUserHeaderDarkPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...p_MatrixUserHeaderDarkPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ..._MatrixUserHeaderLightPreview_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ..._MatrixUserHeaderLightPreview_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...serHeaderPlaceholderDarkPreview_0_null,NEXUS_5,1.0,en].png | 3 +++ ...erHeaderPlaceholderLightPreview_0_null,NEXUS_5,1.0,en].png | 3 +++ 107 files changed, 226 insertions(+), 190 deletions(-) create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewLightPreview_0_null_0,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_39,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_40,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_41,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCheckboxPreview_0_null,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceDividerPreview_0_null,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceRowPreview_0_null,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderDarkPreview_0_null,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderLightPreview_0_null,NEXUS_5,1.0,en].png diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png index abab46483b..59c4d1e6ee 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e3ccec7a26ef11d01dfed40d56937c9bf9c1411680b2ff7338cf10f9541a3880 -size 23871 +oid sha256:940c3ac11da74a6eb734085c468050040c2d31056b6d8de516e49ddb0058c9ee +size 23412 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png index 38dd1849ce..726b07850c 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.analytics.api.preferences_null_DefaultGroup_AnalyticsPreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:00a807f1ac722935a0dad2e82d56ba123cad3e92d2f74a465b2c92497c18f4f7 -size 25372 +oid sha256:97b9796def982afb2d5611db431489a2a42f80f11f949ea4aaab41fd01f87cb1 +size 23478 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png index d0f151fc0e..262abbc34a 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e5daf50829c990b33d22b20f2c4f75b526f6800be2d3966c5ca321ebc3a45c2 -size 8830 +oid sha256:e6fe0e5d16dc3e2fcca6f892366b2742d72f32fba4b5973791a139d812d44f95 +size 7010 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png index 9480379ef9..fc2fe8af6b 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.logout.api_null_DefaultGroup_LogoutPreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd59f2b1389ab9d0d9faa993fcd150e09291920563341f452c8f48d4fe27089e -size 8678 +oid sha256:cf330565d0d920c45815781c9619dd063822a53746f28087b6ae8fef729d4dd6 +size 6958 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..e3bbdc845b --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63f37eb39f73c5c4e371dc3c2f6b8c1ec5e58acaee666af235b8b15a79c749fa +size 15970 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewLightPreview_0_null_0,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..e6d462e6f5 --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.about_null_DefaultGroup_AboutViewLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3dd1385bea0ebe1481c52a16cf32f30e1a9a6812cf3618e472dd321078164830 +size 17314 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..923e05f0fc --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba708a48280a4f42196d61b0cfbb7f0bf6e4a818b8e76ba981e5cbacff37c9dd +size 25493 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..9358cd9f18 --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.analytics_null_DefaultGroup_AnalyticsSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b75a4207e4dc3fc0e3a124574e0352eeb7e731558d90b4d19060d3a046b76e7 +size 26656 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png index 92b68f5ae4..4fb8f691f4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:381032750ffe5cbe710ef0535424eaffc95e68ae728cfb048ca51e646627e52d -size 31366 +oid sha256:fb77df9e072715ed947537e4474d504b5b5d533bfe9cd888362a421fea5b53b5 +size 44068 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png index 92b68f5ae4..4fb8f691f4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:381032750ffe5cbe710ef0535424eaffc95e68ae728cfb048ca51e646627e52d -size 31366 +oid sha256:fb77df9e072715ed947537e4474d504b5b5d533bfe9cd888362a421fea5b53b5 +size 44068 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png index 48cb0a645d..ff0fc9708e 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16e2259bc7287d7f69e757165a37f4b00c83198e220a735344a242aa0a6780c0 -size 34785 +oid sha256:004a25de04aac1ca9cbbad77581e0b52a6f8fba30aa2e64c03a791c54b297d5a +size 48875 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_1,NEXUS_5,1.0,en].png index 48cb0a645d..ff0fc9708e 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.developer_null_DefaultGroup_DeveloperSettingsViewLightPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16e2259bc7287d7f69e757165a37f4b00c83198e220a735344a242aa0a6780c0 -size 34785 +oid sha256:004a25de04aac1ca9cbbad77581e0b52a6f8fba30aa2e64c03a791c54b297d5a +size 48875 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png index 125978846c..1b3ca22f31 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b67102fcc5195f76c2e654de9169a9309a4d5f0ca8ccbdf2a0cd3e7d3c9a62c -size 48713 +oid sha256:b8417eee1585f6ec9a29ea1e827415f8b108f88688af9c3b9f5740f499cd1df5 +size 35126 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png index a0699a2f58..1e2c770460 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:365e1631bee71a673120786e428dadefea38842b94b119cbd5b5b3a038a69e7e -size 47870 +oid sha256:3dc2cf5f31b6183171a5b92197f30bc03ef8693be50d1a6e9db4860a670f7440 +size 34516 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_0,NEXUS_5,1.0,en].png index 34d316ddae..6f44c3c747 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d0e4f89015644572b38bc2621f5056c4098621f60fe39c524b4b138ee22314c -size 53147 +oid sha256:050cb885911e011f25e302fee3ec060d74fae70b7b2405927fffdf06ca3b0fee +size 37187 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_1,NEXUS_5,1.0,en].png index e1c49683c7..0221769922 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.root_null_DefaultGroup_PreferencesRootViewLightPreview--0_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6ba3c9b1a3f9d387a9fdc4e8a190a25b614b7b5c02bc21cf43c6cc1795b1e5d0 -size 53193 +oid sha256:dc612a9d9b82f54373fb92e5d4519e331c315391afb52067b2e22c6e0379f3cc +size 37336 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_0,NEXUS_5,1.0,en].png index af9c1b2901..cbd1ab9ec4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0f3a406b87274bffe778e244ead901913218b38fa3647aaab1abc3a95fc63ba5 -size 14979 +oid sha256:79de0ef9c06b6e95d02f6a3dc27d10d741623de162a5597822a50692f2cd28a8 +size 13089 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_1,NEXUS_5,1.0,en].png index 9d7b65a885..1d8ad5d01f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37858c668f8024a21164a8d15af51e71c69cc03eb9f20613ecfc65dcf543818d -size 13297 +oid sha256:d38b0802eab518e2546629197b418d7a1b0369d921b199dc59797bae0636ed94 +size 12435 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_2,NEXUS_5,1.0,en].png index 665c8811ac..23cf3ada3e 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesDarkPreview_0_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb0d3bfcfd75cbd75fd9270ff1dc27090e5dbac79ca8db8a46d91a4c12bc966b -size 4457 +oid sha256:cd987ad48b569d423d1c37743d0e0b862600cf166f357c997435bad6841e3d4d +size 6001 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_0,NEXUS_5,1.0,en].png index 37e5850d7b..e47261e624 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4269d4349997ea6d056c7e65a3307e7ad7de620093d3304be30041a2f8a0795 -size 14235 +oid sha256:8a56c4aa5117ec8ce4d63ee679443b88eaddf84795b21f4b61429ae10ddfd2fe +size 12831 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_1,NEXUS_5,1.0,en].png index 3bcfab0de2..e8c8e656eb 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41d45ef3fd17be71f42982f457f03bfe4d88efb2aabe4df69d3b3a76f0dba7b1 -size 13393 +oid sha256:b3b82fb2d33d5abf66035fd26b7eab778f4b6aa67f29b05e0b252a9cb57ce365 +size 12957 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_2,NEXUS_5,1.0,en].png index 665c8811ac..c1d278b09b 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.preferences.impl.user_null_DefaultGroup_UserPreferencesLightPreview_0_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb0d3bfcfd75cbd75fd9270ff1dc27090e5dbac79ca8db8a46d91a4c12bc966b -size 4457 +oid sha256:61a986107eceb0f6eb11b0807946a84a0c61887fc5c1f5232c70e180c2f124c5 +size 5793 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png index 3eefef8f94..c2b87ec530 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:022f325b03a7a115fc4490766e561dfc65471aaee59e76bd8234dca263a7ce41 -size 22525 +oid sha256:f6399530b992aff076af9a57a1267aa9ef8347b5d2a693e153ddc1607e25ba41 +size 18524 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png index 11828faaf8..420e4f4531 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40832c445fb109f2d9177e3aadf981fab832124497ca6b9689cb838f0e5c4386 -size 21088 +oid sha256:20feb0126811049b238303dd11824cc65aadc5b7256e08cbe2c604452fbd712a +size 15109 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png index 97bdfb87b3..16ab7885b1 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:84c51965accb84017f200813f24112aebd5dbaeba15140bcb12d5a52f68ed294 -size 23379 +oid sha256:e631b7635ec2d9f636c5c0b5174c7f914a76e1fed843eb209805289023b4fe75 +size 19347 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_1,NEXUS_5,1.0,en].png index fc68cb70e3..8dc30bb185 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.api.preferences_null_DefaultGroup_RageshakePreferencesViewLightPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b504a78119e3cdbd410d6c221ebddcddcc2fe8a74cadf8fa2da0c4397b2cd368 -size 21769 +oid sha256:1338c3951801ff9872765b20508f37b15132c61685a3d79f80471f3939d8f249 +size 16072 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png index 6c7d7f0ceb..64a10ed42f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4f9dd248f5fc36877cbb529dad480476830694921f4b736302def1ff8cb3492d -size 52299 +oid sha256:549e9a954cd4b3cb9aef6f2d5f9de45f81be68e5b779ec72552650182f418b08 +size 64611 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png index cdfd940ac2..2a5898b842 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8fb95ef036bee8aaee1187883980cf453c68f947620b7d83d83fef7bba0bb358 -size 173647 +oid sha256:dc3d433d585c87e869c3c426759d62f215f544adda2ed4a6dfa4ce462c3a8a7a +size 200136 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_2,NEXUS_5,1.0,en].png index ce777e01ca..e490d5cfbe 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewDarkPreview_0_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:72ca64d4e4ea896bacb1f31f1506d5a80ee765960a4ff8d0f9d4e5a4decbe3b2 -size 51529 +oid sha256:5818b25d9c382f25f0b8028d51c87cfe8f94deabbd32b739c9ba851b1ed40a87 +size 54996 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_0,NEXUS_5,1.0,en].png index 05b0c127f3..d0b105b609 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e13526f8ff18d425e91fd08bed93167827b70b1ed5fa693003d1ecea3ac56bf6 -size 57750 +oid sha256:efee5c2bdb9fe772bd5e40485cb2f889658e9c523a8b4789f9e271ef4e3f3cc5 +size 67437 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_1,NEXUS_5,1.0,en].png index 24c79673d0..91a39fafab 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b2673cf588ab03359d55ba50208de4a055e311d538bfa0eb1102baac508602b -size 181533 +oid sha256:4bab9b53b1c46abe20a65e0ae77893d7a59046f5b7e45d95a8b15ac5414b68e4 +size 204330 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_2,NEXUS_5,1.0,en].png index d412a59020..0b131a2205 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.rageshake.impl.bugreport_null_DefaultGroup_BugReportViewLightPreview_0_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0636a4e85cc913d30f1c6ef3b655065ac03725a7e31b044b63c12ddf96ef2b92 -size 57877 +oid sha256:945a3683f65a71f2e2f055f760d505387b22e4ca754cb573e11c8c9890c86b88 +size 59066 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_0,NEXUS_5,1.0,en].png index 40df562702..9fd25038e4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e6ceddd8714918c150ec217b4f1e9f4e93494cb066d6c78c1d4edc2fae7ecdc0 -size 19943 +oid sha256:87c08958daaffbb1dd46d444b85381853bf0802371fdea362fac3833f9d013d3 +size 20027 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_1,NEXUS_5,1.0,en].png index fbe850492d..d3e20cc7ff 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:47b2394534adebf92df100fb1855bddaa6046b0c0ea6737c4f3727f81f4e73bc -size 17649 +oid sha256:a73fab76589e239500c3a1f245123689973f0fe620fc6bdb42afd6611a8317d3 +size 17661 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_2,NEXUS_5,1.0,en].png index 9b21bd27ed..423311f54a 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c3ceb80520b00021d87eaed2167c462dda9cf118f600a90633520ec89aa8f26 -size 20368 +oid sha256:12c402a48d5d0de83ac7df53a0e6debf3da509d20b9d6a91279f95061e62a58e +size 20441 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_3,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_3,NEXUS_5,1.0,en].png index 40df562702..9fd25038e4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_3,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_3,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e6ceddd8714918c150ec217b4f1e9f4e93494cb066d6c78c1d4edc2fae7ecdc0 -size 19943 +oid sha256:87c08958daaffbb1dd46d444b85381853bf0802371fdea362fac3833f9d013d3 +size 20027 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_4,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_4,NEXUS_5,1.0,en].png index 40df562702..9fd25038e4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_4,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewDarkPreview--3_3_null_4,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e6ceddd8714918c150ec217b4f1e9f4e93494cb066d6c78c1d4edc2fae7ecdc0 -size 19943 +oid sha256:87c08958daaffbb1dd46d444b85381853bf0802371fdea362fac3833f9d013d3 +size 20027 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_0,NEXUS_5,1.0,en].png index 65abc9be9c..15486460fc 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:53165af4c094a4888aa582f6f88e24ce45470835e43f300b833a28a46583fca9 -size 20431 +oid sha256:33b9cc0d5e6ec9f448d38908b2f0b6a96c9b42643caa1147952941e35fbd127a +size 20483 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_1,NEXUS_5,1.0,en].png index f4db83e432..d36213ff79 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e40fa993da46a9e87a1b4cc4d4fe9ae6496a5b9ced7bc47c1588ac603045fe25 -size 17968 +oid sha256:bef2a2eaa2be605f84aceabb26c1f5671e42362c4738e7a6d293a60541954245 +size 17963 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_2,NEXUS_5,1.0,en].png index ca1b224d82..dd473f1657 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5c6fe4c37241320a75542482353b790007b177e305f0e47b196d7d85696b86e2 -size 20871 +oid sha256:3f9c4cc86f1f1a4b605d598484715bae66357c6876cdf68c182338b8e1aa9021 +size 20924 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_3,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_3,NEXUS_5,1.0,en].png index 65abc9be9c..15486460fc 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_3,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_3,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:53165af4c094a4888aa582f6f88e24ce45470835e43f300b833a28a46583fca9 -size 20431 +oid sha256:33b9cc0d5e6ec9f448d38908b2f0b6a96c9b42643caa1147952941e35fbd127a +size 20483 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_4,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_4,NEXUS_5,1.0,en].png index 65abc9be9c..15486460fc 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_4,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl.members.details_null_DefaultGroup_RoomMemberDetailsViewLightPreview--2_2_null_4,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:53165af4c094a4888aa582f6f88e24ce45470835e43f300b833a28a46583fca9 -size 20431 +oid sha256:33b9cc0d5e6ec9f448d38908b2f0b6a96c9b42643caa1147952941e35fbd127a +size 20483 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png index 2d3c0d2082..6d538df191 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4211f711abb3c3c05ea91702438bbb85bd7af02fee250f1faeb7e536087c99db -size 56766 +oid sha256:3b35df63075bd20375d0f199cb795b239be01691add235842126e89ac9a1d5bd +size 53342 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png index 20b5cd3145..2ba8322f39 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a32caf914aaaabdc7de5cec2e32366c29ee6925246897bb409481f54bcdc1149 -size 45916 +oid sha256:77bfd97da7d87a253cac0f2dc86af32e58a3e57972a9c9f0a24462f28e18e90f +size 45392 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_2,NEXUS_5,1.0,en].png index 5200b411fe..b8c90a5861 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0a31c85179167b1485cfdd501dc66948ba4179af97d4577fb49a9aa1f64df66 -size 46478 +oid sha256:be02f24bf22943bf6a2337ce8681fd496ae71dd5af23c197fe88c930129ce9d9 +size 46369 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_3,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_3,NEXUS_5,1.0,en].png index 8144ddbee1..7bcfb3d4b0 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_3,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_3,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f481d878b51170d6bb28d5c1e800d1029a935d95477872bbbb3f3d27c5cd9ed9 -size 48785 +oid sha256:7d3b7bba8d197feb18438044dc244a759739bdc0433121dd511b4b5dee166348 +size 48790 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_4,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_4,NEXUS_5,1.0,en].png index 81c270d764..6c1427a332 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_4,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_4,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3c74e7d3fce247c294ea2355ae3c697c703615856f42522678612135bcb6827 -size 59892 +oid sha256:d06ddfedb91d989050d8548720d7d820463349b88a1f6f79a89ef80d66f030e8 +size 60019 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_5,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_5,NEXUS_5,1.0,en].png index 75bced4e6d..9e432745f0 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_5,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_5,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b263b9c0c5c785b6e5d65cfefde0d7ff1cbb1c7e74dab41e5ce228a8cd5a22e7 -size 60594 +oid sha256:8194a62380cbcb60e98d063eeb4f33179e9cf33660d3f64f066e282566618460 +size 60328 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_6,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_6,NEXUS_5,1.0,en].png index 75bced4e6d..9e432745f0 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_6,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_6,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b263b9c0c5c785b6e5d65cfefde0d7ff1cbb1c7e74dab41e5ce228a8cd5a22e7 -size 60594 +oid sha256:8194a62380cbcb60e98d063eeb4f33179e9cf33660d3f64f066e282566618460 +size 60328 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_7,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_7,NEXUS_5,1.0,en].png index fa3f14358a..d61eec8f0b 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_7,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_7,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be6b4222a82b72a902b3ceaeedb875e220a678f5f03ee64de9536ef5cb71355a -size 51178 +oid sha256:1bd39efec70aa071e33c4654ecf5b236a880ee7d248316e4f35e47294cdfaddd +size 49317 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_8,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_8,NEXUS_5,1.0,en].png index b19b551c2f..cb616ddaf1 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_8,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsDarkPreview--1_1_null_8,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:503445140ee8928c77445e614c012430ab33d88683fcbaeaf1e98e050af3958c -size 57022 +oid sha256:ce7a0068c54ea32d00570019de4c51d13d55923dcae7186206533e07bbb3348f +size 53595 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_0,NEXUS_5,1.0,en].png index b5144bdae0..8d01f3861f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b9ae252211890303a38378da7c58730397b7eb0c0c65634b28b130347b952cf7 -size 58968 +oid sha256:3ab0c7a7efb7addeee981d7418f58e4e67ca5b29b25f4d86a164818eca86b835 +size 55511 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_1,NEXUS_5,1.0,en].png index 75b19e3373..9c16c94af4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e3f692050c790153d0a3dbdbaefc38cd07d6f8dd1dcb3778858d968a1a3cfec7 -size 47703 +oid sha256:ff3d02131ce61206bf3eb7ee322de885247c4f9b222691bf5769d2d369584f48 +size 47427 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_2,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_2,NEXUS_5,1.0,en].png index 12beb17820..74851a49ae 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_2,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_2,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df10ce8bb961c1a55a49211f5f1e68de7691347e56314895a8cca7e1a8103cbb -size 48648 +oid sha256:739055ea113c8c67751aaf579d5e4e19f35c4e5f73b55af18d5d616c46b257b4 +size 48634 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_3,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_3,NEXUS_5,1.0,en].png index 3c5a88c3ec..fd7f7c2ea2 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_3,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_3,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff5bb6393257d33a60619f029643f7ba049874d4563b32c8806c86fb5d71b5d4 -size 49977 +oid sha256:342d5eb60dd4085f6c2f1a43d7a0e3c6a10f1f3f977ec59f1f2a71883eebb27e +size 50090 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_4,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_4,NEXUS_5,1.0,en].png index f6ee8be261..dabf47ebef 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_4,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_4,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:945a0f3a0e5dbacab5aa386bba6910bd3226c5f2c2401496e589163adfe8f591 -size 62433 +oid sha256:8559752a591496a2b0f3795d166df4989152c9ef0802b6c3368d9dde8821c47e +size 62427 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_5,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_5,NEXUS_5,1.0,en].png index fbbc45850b..c161d2b286 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_5,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_5,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a19baeaa675087bb1992d3ecc95566715bf2abc2042756dfc124ba405bb0c28 -size 62884 +oid sha256:a32d1086c73d01d0ea202f328511016df985e3c32d868b3c6b152dbaf9bd6bb5 +size 62387 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_6,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_6,NEXUS_5,1.0,en].png index fbbc45850b..c161d2b286 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_6,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_6,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a19baeaa675087bb1992d3ecc95566715bf2abc2042756dfc124ba405bb0c28 -size 62884 +oid sha256:a32d1086c73d01d0ea202f328511016df985e3c32d868b3c6b152dbaf9bd6bb5 +size 62387 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_7,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_7,NEXUS_5,1.0,en].png index 2e6aee242f..0ff1870f75 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_7,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_7,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04c3dcf6fd495c9a5ea165b43ad9c5362102d7638e2ceea271a3af6130b68737 -size 52650 +oid sha256:29dc47a2c594f81b2b11eb94575e4b733802a706fb22729ec85c39b9a636fca6 +size 50754 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_8,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_8,NEXUS_5,1.0,en].png index f8cafdf4bb..5b62e9074e 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_8,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.features.roomdetails.impl_null_DefaultGroup_RoomDetailsLightPreview--0_0_null_8,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e70d7c2676c3053310aa00f274ea760559165f2e058db3fba276c276c2be5fad -size 59222 +oid sha256:e30fc6c3279a3d924317712b01278fa49d1bdb653258296ea69872e064f3297e +size 55765 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_12,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_12,NEXUS_5,1.0,en].png index 79fe4747d1..3b8b251633 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_12,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_12,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba65d101418a90fadd97e295e1d8c909e02954f748674e3e8c833ed54227b4cd -size 22996 +oid sha256:31dd10477b9c3a6a522464c01ac115d67d09e788dd3ff90dee23bb29a742dbb5 +size 20139 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_13,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_13,NEXUS_5,1.0,en].png index c71e06b46e..3e2d548a72 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_13,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_13,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:938a9c25649780c7581c6733dd9e6913f56eef96975ac29e9abab5bc7af0c8ab -size 20984 +oid sha256:459fbb9864d1a1d8f3a54a060d60972d0fe4fdf8391381d400970756c762d258 +size 18895 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_14,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_14,NEXUS_5,1.0,en].png index b1d65a8e09..c781dc7be6 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_14,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_14,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0056424b9ab13e9a3eaef918f7b085d806bf8c8e9431d0b9341e3a5cd28e4940 -size 27640 +oid sha256:baddb6d4fd81c775d73e87884945654116d9b6f98cf62fc82597b40ebff731b3 +size 23211 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_15,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_15,NEXUS_5,1.0,en].png index 41dec8e7d2..79fe4747d1 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_15,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_15,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:de3be777cf2256575c2d360587652f61f889b8e3771e4edde40851333bd64685 -size 16716 +oid sha256:ba65d101418a90fadd97e295e1d8c909e02954f748674e3e8c833ed54227b4cd +size 22996 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_16,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_16,NEXUS_5,1.0,en].png index e38dc818a4..c71e06b46e 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_16,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_16,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb08ee71c6566073d63a7741605b61594694829888dbc583f73aeba10122fd2b -size 15915 +oid sha256:938a9c25649780c7581c6733dd9e6913f56eef96975ac29e9abab5bc7af0c8ab +size 20984 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_17,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_17,NEXUS_5,1.0,en].png index f56f058f61..b1d65a8e09 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_17,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_17,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0816e4338e6f5b8dd1c36c32676dcddea3109525afd086107eebbf40f7cc2260 -size 18871 +oid sha256:0056424b9ab13e9a3eaef918f7b085d806bf8c8e9431d0b9341e3a5cd28e4940 +size 27640 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_18,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_18,NEXUS_5,1.0,en].png index 92c4961e37..41dec8e7d2 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_18,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_18,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:196f4bf95edf2183623dd4828509b9fe0e67f9ed4c908c0dd7f187d9ee80e7f8 -size 19437 +oid sha256:de3be777cf2256575c2d360587652f61f889b8e3771e4edde40851333bd64685 +size 16716 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_19,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_19,NEXUS_5,1.0,en].png index 0dadc862bb..e38dc818a4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_19,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_19,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f4b7168caa7359692f9f2fd6dc1f92d855aaf0c27fcb5ef00c5e676ea2c3308f -size 18171 +oid sha256:bb08ee71c6566073d63a7741605b61594694829888dbc583f73aeba10122fd2b +size 15915 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_20,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_20,NEXUS_5,1.0,en].png index c0365c47ff..f56f058f61 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_20,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_20,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae0924117cec1a4dadca4c4891517e0e258897033db90ce2ac27359ade331c17 -size 22514 +oid sha256:0816e4338e6f5b8dd1c36c32676dcddea3109525afd086107eebbf40f7cc2260 +size 18871 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_21,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_21,NEXUS_5,1.0,en].png index 99913e6f44..92c4961e37 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_21,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_21,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a44e1a6553d5d30c4d8767b9d7e397ce2502c0ec3a6ceab7372933f535baea9f -size 20316 +oid sha256:196f4bf95edf2183623dd4828509b9fe0e67f9ed4c908c0dd7f187d9ee80e7f8 +size 19437 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_22,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_22,NEXUS_5,1.0,en].png index 50cf9888ff..0dadc862bb 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_22,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_22,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f13e2fbdcd77586ef4078d105e74d753ea8adc2f14640338059bf2864525e0eb -size 19063 +oid sha256:f4b7168caa7359692f9f2fd6dc1f92d855aaf0c27fcb5ef00c5e676ea2c3308f +size 18171 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_23,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_23,NEXUS_5,1.0,en].png index 1e0ca6d3ee..c0365c47ff 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_23,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_23,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6784742c9249d6bd70e15e795b193bd66ae3c5e8a796ddbc335560a7430f2f9e -size 23349 +oid sha256:ae0924117cec1a4dadca4c4891517e0e258897033db90ce2ac27359ade331c17 +size 22514 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_24,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_24,NEXUS_5,1.0,en].png index 41015fb77c..99913e6f44 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_24,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_24,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:307867952ce3a6baae666e0d8bc904bd1efddde2b60fbaafe9f41e4d35f632aa -size 16297 +oid sha256:a44e1a6553d5d30c4d8767b9d7e397ce2502c0ec3a6ceab7372933f535baea9f +size 20316 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_25,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_25,NEXUS_5,1.0,en].png index c96fd7f4c3..50cf9888ff 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_25,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_25,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:00ed2d7954e7866191750475b9c496477e7144998c2d630e9e8cf47fceaa72f7 -size 15599 +oid sha256:f13e2fbdcd77586ef4078d105e74d753ea8adc2f14640338059bf2864525e0eb +size 19063 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_26,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_26,NEXUS_5,1.0,en].png index 497d76d07f..1e0ca6d3ee 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_26,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_26,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:85b4e6230abdd27fc958a80c35f2d4d62953ffe5f868f561b02504050f6b1d44 -size 18168 +oid sha256:6784742c9249d6bd70e15e795b193bd66ae3c5e8a796ddbc335560a7430f2f9e +size 23349 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_27,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_27,NEXUS_5,1.0,en].png index 7eae7c7bab..41015fb77c 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_27,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_27,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:901a4a4903e9dafa3f4f4741ec0b59a8901326cc4f203bd8207886965c63d3d5 -size 17159 +oid sha256:307867952ce3a6baae666e0d8bc904bd1efddde2b60fbaafe9f41e4d35f632aa +size 16297 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_28,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_28,NEXUS_5,1.0,en].png index 7fbf48fc4e..c96fd7f4c3 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_28,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_28,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1d0f97c11c56b47e0ae5b8e9cdc903a94a062a7fda9ab31d6dccfbb8507dee42 -size 16498 +oid sha256:00ed2d7954e7866191750475b9c496477e7144998c2d630e9e8cf47fceaa72f7 +size 15599 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_29,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_29,NEXUS_5,1.0,en].png index 66e958128f..497d76d07f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_29,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_29,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f70d0db3607bc2ac1385acc67bac28d245f9638581734770b2f43b63662cc37a -size 19000 +oid sha256:85b4e6230abdd27fc958a80c35f2d4d62953ffe5f868f561b02504050f6b1d44 +size 18168 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_30,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_30,NEXUS_5,1.0,en].png index a14694866f..7eae7c7bab 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_30,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_30,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1791957ceafcdad1ca80f03b8ac077b74219e0655240ac0f7e8fefeb41f9ef5b -size 20867 +oid sha256:901a4a4903e9dafa3f4f4741ec0b59a8901326cc4f203bd8207886965c63d3d5 +size 17159 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_31,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_31,NEXUS_5,1.0,en].png index 2b01d7d195..7fbf48fc4e 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_31,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_31,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:09dfb9fceb60f2f6fa1b12c7e010a25e5eacd0d9116e828bcbba1ca01be366d0 -size 20224 +oid sha256:1d0f97c11c56b47e0ae5b8e9cdc903a94a062a7fda9ab31d6dccfbb8507dee42 +size 16498 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_32,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_32,NEXUS_5,1.0,en].png index 07cb21efeb..66e958128f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_32,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_32,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0831ab453c142047b3bac65dcb243b6a6d2079f0fcf8c8a0f3d801c8ccb450e6 -size 22610 +oid sha256:f70d0db3607bc2ac1385acc67bac28d245f9638581734770b2f43b63662cc37a +size 19000 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_33,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_33,NEXUS_5,1.0,en].png index 422a0268a7..a14694866f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_33,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_33,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:52b756870c076794cca7eb0f8fbe591753135effdcc8ce810a2ce0d56a32dde5 -size 18886 +oid sha256:1791957ceafcdad1ca80f03b8ac077b74219e0655240ac0f7e8fefeb41f9ef5b +size 20867 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_34,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_34,NEXUS_5,1.0,en].png index c89c036413..2b01d7d195 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_34,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_34,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a3058026a29a814ccba97a582502cf499a8a6f36c1c3166ef1a845218317d79e -size 17744 +oid sha256:09dfb9fceb60f2f6fa1b12c7e010a25e5eacd0d9116e828bcbba1ca01be366d0 +size 20224 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_35,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_35,NEXUS_5,1.0,en].png index 7f70068f4a..07cb21efeb 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_35,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_35,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:192fc7e3475f8e787c860ae74f60562eecf36ab4322a6c54d0a105f648607188 -size 21850 +oid sha256:0831ab453c142047b3bac65dcb243b6a6d2079f0fcf8c8a0f3d801c8ccb450e6 +size 22610 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_36,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_36,NEXUS_5,1.0,en].png index 7df97fc06d..422a0268a7 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_36,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_36,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6da9570ae74b2b7de831c559560a9c9640d187b5d22ef7b5705fafa1d488273 -size 14613 +oid sha256:52b756870c076794cca7eb0f8fbe591753135effdcc8ce810a2ce0d56a32dde5 +size 18886 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_37,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_37,NEXUS_5,1.0,en].png index 1aafa8431a..c89c036413 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_37,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_37,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7c8445fab89a15fb91a32b2d11d87d745d68245aa76ed631e16eba5ba79105b0 -size 14315 +oid sha256:a3058026a29a814ccba97a582502cf499a8a6f36c1c3166ef1a845218317d79e +size 17744 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_38,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_38,NEXUS_5,1.0,en].png index 5fa4d953d9..7f70068f4a 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_38,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_38,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c5abcdf7a9ae3dd8c6ca33455e7b6d0446b20b0e4e04393ed45bfc4ad615a2ac -size 15454 +oid sha256:192fc7e3475f8e787c860ae74f60562eecf36ab4322a6c54d0a105f648607188 +size 21850 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_39,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_39,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..7df97fc06d --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_39,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6da9570ae74b2b7de831c559560a9c9640d187b5d22ef7b5705fafa1d488273 +size 14613 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_40,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_40,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..1aafa8431a --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_40,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c8445fab89a15fb91a32b2d11d87d745d68245aa76ed631e16eba5ba79105b0 +size 14315 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_41,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_41,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..5fa4d953d9 --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.avatar_null_Avatars_AvatarPreview_0_null_41,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5abcdf7a9ae3dd8c6ca33455e7b6d0446b20b0e4e04393ed45bfc4ad615a2ac +size 15454 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_0,NEXUS_5,1.0,en].png index f4b17cf53b..56b3605183 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:112414d41e3942f0b9588fa21bdba5c6ec737e35b5be364a10b3ad124cb6ad7e -size 5898 +oid sha256:0c37f4429bbe904122e409e614b09396cf493fed5ce274961918d68b00c9faf0 +size 5891 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_1,NEXUS_5,1.0,en].png index f643987010..3c228b96a0 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences.components_null_Preferences_PreferenceIconPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4262e23342ea19a13749be672107d78565e38494f75e59871e469d7f91cd961 -size 4500 +oid sha256:a2d302d58c1faec3c3f0aa3286977b2698cd642c1e6dbcb9632510c6a4a922eb +size 4501 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png index 61f510e6bd..552fc9946b 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewDarkPreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f65836a8dcec927ff600780bd69121b431e599bab4274af606da67aaca34c62f -size 21306 +oid sha256:1911edc801b932f90b0778e01d8c3b75399bb28591fd6cd7aec02b369a0f06da +size 25257 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png index ab891facac..eebbabb4b5 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_DefaultGroup_PreferenceViewLightPreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af13c04eeecf6a2c72ccb1fd586a301eec07fd17b1ba48b87ddd4008d8850343 -size 22389 +oid sha256:6c1109cc7737310e469ee0e68343dd8d56c9b94858b6f4bcece7c58d77b64aa4 +size 27195 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCategoryPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCategoryPreview_0_null,NEXUS_5,1.0,en].png index a0589bf88b..dd0394e3d3 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCategoryPreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCategoryPreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:587d70141f61eaa5cdab083f554c98533cc412fa76e2c8a91bbeb092ea500d1d -size 27049 +oid sha256:c78c08d1f40ec40bd40baea56772f55e000f18a5c451eddf289c16be7efcc8e3 +size 28977 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCheckboxPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCheckboxPreview_0_null,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..06196248f4 --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceCheckboxPreview_0_null,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06813451633c48fccac6f70810ecb9465946b643376fccd61312b6064b0a3a40 +size 11518 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceDividerPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceDividerPreview_0_null,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..9db1d68036 --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceDividerPreview_0_null,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02e28dd43335ab8b7aed7219bda0d4009b2795df7858fc85737ab2915482adea +size 4568 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceRowPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceRowPreview_0_null,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..2cc5845635 --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceRowPreview_0_null,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f89ba9d9312cde0f01e31bb09e2e6f3808d0721cb6bcaa78f3482aa5fe1b5d78 +size 8515 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSlidePreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSlidePreview_0_null,NEXUS_5,1.0,en].png index 556130fdc9..e70238c94c 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSlidePreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSlidePreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a92122b7a7ffb9d52600f94c3e919a198e62d3543f50b0dae490cfce2368f90d -size 14096 +oid sha256:95e3e77ac13c2384236b56f7ed0f05a5e00ab3677531782cb82a2f9c90cacef4 +size 13946 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSwitchPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSwitchPreview_0_null,NEXUS_5,1.0,en].png index 38f7273076..e1fcab2e5f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSwitchPreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceSwitchPreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1f921628e38c15cd35b55fe52fe816ddfbd1676f2302c633261924157b9f1014 -size 10080 +oid sha256:60074c3d771118950867747a1696e29b9113c2efa7a08895b4aabc747148ba57 +size 17642 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceTextPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceTextPreview_0_null,NEXUS_5,1.0,en].png index e609bb0286..4eae75f39b 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceTextPreview_0_null,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.designsystem.components.preferences_null_Preferences_PreferenceTextPreview_0_null,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:936f190b6f145bb13cb0b83e5695805580d74f1f588fdb7cb4a80aa3ebaa787e -size 29427 +oid sha256:f61dc1d9cbb09d39e229535520ec49052d3a12626a7b1a909031189654e060a0 +size 39162 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_0,NEXUS_5,1.0,en].png index af9c1b2901..cbd1ab9ec4 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0f3a406b87274bffe778e244ead901913218b38fa3647aaab1abc3a95fc63ba5 -size 14979 +oid sha256:79de0ef9c06b6e95d02f6a3dc27d10d741623de162a5597822a50692f2cd28a8 +size 13089 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_1,NEXUS_5,1.0,en].png index 9d7b65a885..1d8ad5d01f 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderDarkPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37858c668f8024a21164a8d15af51e71c69cc03eb9f20613ecfc65dcf543818d -size 13297 +oid sha256:d38b0802eab518e2546629197b418d7a1b0369d921b199dc59797bae0636ed94 +size 12435 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_0,NEXUS_5,1.0,en].png index 37e5850d7b..e47261e624 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4269d4349997ea6d056c7e65a3307e7ad7de620093d3304be30041a2f8a0795 -size 14235 +oid sha256:8a56c4aa5117ec8ce4d63ee679443b88eaddf84795b21f4b61429ae10ddfd2fe +size 12831 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_1,NEXUS_5,1.0,en].png index 3bcfab0de2..e8c8e656eb 100644 --- a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderLightPreview_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41d45ef3fd17be71f42982f457f03bfe4d88efb2aabe4df69d3b3a76f0dba7b1 -size 13393 +oid sha256:b3b82fb2d33d5abf66035fd26b7eab778f4b6aa67f29b05e0b252a9cb57ce365 +size 12957 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderDarkPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderDarkPreview_0_null,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..23cf3ada3e --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderDarkPreview_0_null,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd987ad48b569d423d1c37743d0e0b862600cf166f357c997435bad6841e3d4d +size 6001 diff --git a/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderLightPreview_0_null,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderLightPreview_0_null,NEXUS_5,1.0,en].png new file mode 100644 index 0000000000..c1d278b09b --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/io.element.android.tests.uitests_ScreenshotTest_preview_tests[io.element.android.libraries.matrix.ui.components_null_DefaultGroup_MatrixUserHeaderPlaceholderLightPreview_0_null,NEXUS_5,1.0,en].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61a986107eceb0f6eb11b0807946a84a0c61887fc5c1f5232c70e180c2f124c5 +size 5793 From c9ba058deb171eb1a9c896a507d6bed6c5043e19 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 3 Jul 2023 18:01:37 +0200 Subject: [PATCH 36/36] Kover: ignore nearly empty AboutPresenter. --- build.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 99da9c4175..d93046fef6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -225,8 +225,9 @@ koverMerged { includes += "*Presenter" excludes += "*Fake*Presenter" excludes += "io.element.android.appnav.loggedin.LoggedInPresenter$*" - // Too small presenter, cannot reach the threshold. + // Too small presenters, cannot reach the threshold. excludes += "io.element.android.features.onboarding.impl.OnBoardingPresenter" + excludes += "io.element.android.features.preferences.impl.about.AboutPresenter" } bound { minValue = 90