Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ class GetConversationsFromSearchUseCase @Inject constructor(
.map { staticPagingItems(it) }
}
}.map { pagingData ->
pagingData.map {
it.toConversationItem(userTypeMapper, uiTextResolver, selfUserTeamId)
}
}.flowOn(dispatchers.io())
pagingData.map {
it.toConversationItem(userTypeMapper, uiTextResolver, selfUserTeamId)
}
}.flowOn(dispatchers.io())
}

private fun staticPagingItems(conversations: List<ConversationDetailsWithEvents>): PagingData<ConversationDetailsWithEvents> {
Expand Down
15 changes: 11 additions & 4 deletions app/stability/app-devDebug.stability
Original file line number Diff line number Diff line change
Expand Up @@ -1362,24 +1362,24 @@ public fun com.wire.android.ui.authentication.login.WireAuthBackgroundLayout(mod
- content: STABLE (composable function type)

@Composable
public fun com.wire.android.ui.authentication.login.email.ForgotPasswordLabel(forgotPasswordUrl: kotlin.String, textColor: androidx.compose.ui.graphics.Color, modifier: androidx.compose.ui.Modifier): kotlin.Unit
public fun com.wire.android.ui.authentication.login.email.ForgotPasswordLabel(forgotPasswordUrl: kotlin.String, modifier: androidx.compose.ui.Modifier, textColor: androidx.compose.ui.graphics.Color): kotlin.Unit
skippable: true
restartable: true
params:
- forgotPasswordUrl: STABLE (String is immutable)
- textColor: STABLE (marked @Stable or @Immutable)
- modifier: STABLE (marked @Stable or @Immutable)
- textColor: STABLE (marked @Stable or @Immutable)

@Composable
public fun com.wire.android.ui.authentication.login.email.LoginButton(loading: kotlin.Boolean, enabled: kotlin.Boolean, text: kotlin.String, loadingText: kotlin.String, modifier: androidx.compose.ui.Modifier, onClick: kotlin.Function0<kotlin.Unit>): kotlin.Unit
public fun com.wire.android.ui.authentication.login.email.LoginButton(loading: kotlin.Boolean, enabled: kotlin.Boolean, modifier: androidx.compose.ui.Modifier, text: kotlin.String, loadingText: kotlin.String, onClick: kotlin.Function0<kotlin.Unit>): kotlin.Unit
skippable: true
restartable: true
params:
- loading: STABLE (primitive type)
- enabled: STABLE (primitive type)
- modifier: STABLE (marked @Stable or @Immutable)
- text: STABLE (String is immutable)
- loadingText: STABLE (String is immutable)
- modifier: STABLE (marked @Stable or @Immutable)
- onClick: STABLE (function type)

@Composable
Expand Down Expand Up @@ -10207,6 +10207,13 @@ public fun com.wire.android.ui.markdown.MarkdownThematicBreak(messageStyle: com.
- messageStyle: STABLE (class with no mutable properties)
- modifier: STABLE (marked @Stable or @Immutable)

@Composable
private fun com.wire.android.ui.markdown.getMentions(onOpenProfile: kotlin.Function1<@[ParameterName(name = \): kotlin.collections.List<androidx.compose.ui.semantics.CustomAccessibilityAction>
skippable: true
restartable: true
params:
- onOpenProfile: STABLE (function type)

@Composable
public fun com.wire.android.ui.miscViewModel(): VM of com.wire.android.ui.miscViewModel
skippable: true
Expand Down
3 changes: 2 additions & 1 deletion core/search/stability/search-debug.stability
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,14 @@ private fun com.wire.android.search.users.ShowButton(isShownAll: kotlin.Boolean,
- modifier: STABLE (marked @Stable or @Immutable)

@Composable
public fun com.wire.android.search.widget.HighlightName(name: kotlin.String, searchQuery: kotlin.String, modifier: androidx.compose.ui.Modifier): kotlin.Unit
public fun com.wire.android.search.widget.HighlightName(name: kotlin.String, searchQuery: kotlin.String, modifier: androidx.compose.ui.Modifier, maxLines: kotlin.Int): kotlin.Unit
skippable: true
restartable: true
params:
- name: STABLE (String is immutable)
- searchQuery: STABLE (String is immutable)
- modifier: STABLE (marked @Stable or @Immutable)
- maxLines: STABLE (primitive type)

@Composable
public fun com.wire.android.search.widget.HighlightSubtitle(subTitle: kotlin.String, modifier: androidx.compose.ui.Modifier, searchQuery: kotlin.String, prefix: kotlin.String): kotlin.Unit
Expand Down
23 changes: 20 additions & 3 deletions core/ui-common/stability/ui-common-debug.stability
Original file line number Diff line number Diff line change
Expand Up @@ -907,11 +907,12 @@ public fun com.wire.android.ui.common.button.WireButton(onClick: kotlin.Function
- description: STABLE (class with no mutable properties)

@Composable
public fun com.wire.android.ui.common.button.WireButtonColors.containerColor(state: com.wire.android.ui.common.button.WireButtonState): androidx.compose.runtime.State<androidx.compose.ui.graphics.Color>
public fun com.wire.android.ui.common.button.WireButtonColors.containerColor(state: com.wire.android.ui.common.button.WireButtonState, isFocused: kotlin.Boolean): androidx.compose.runtime.State<androidx.compose.ui.graphics.Color>
skippable: true
restartable: true
params:
- state: STABLE (class with no mutable properties)
- isFocused: STABLE (primitive type)

@Composable
public fun com.wire.android.ui.common.button.WireButtonColors.contentColor(state: com.wire.android.ui.common.button.WireButtonState): androidx.compose.runtime.State<androidx.compose.ui.graphics.Color>
Expand All @@ -921,11 +922,12 @@ public fun com.wire.android.ui.common.button.WireButtonColors.contentColor(state
- state: STABLE (class with no mutable properties)

@Composable
public fun com.wire.android.ui.common.button.WireButtonColors.outlineColor(state: com.wire.android.ui.common.button.WireButtonState): androidx.compose.runtime.State<androidx.compose.ui.graphics.Color>
public fun com.wire.android.ui.common.button.WireButtonColors.outlineColor(state: com.wire.android.ui.common.button.WireButtonState, isFocused: kotlin.Boolean): androidx.compose.runtime.State<androidx.compose.ui.graphics.Color>
skippable: true
restartable: true
params:
- state: STABLE (class with no mutable properties)
- isFocused: STABLE (primitive type)

@Composable
public fun com.wire.android.ui.common.button.WireButtonColors.rippleColor(state: com.wire.android.ui.common.button.WireButtonState): androidx.compose.runtime.State<androidx.compose.ui.graphics.Color>
Expand Down Expand Up @@ -1106,7 +1108,7 @@ public fun com.wire.android.ui.common.button.secondaryButtonColors(): com.wire.a
params:

@Composable
private fun com.wire.android.ui.common.button.wireButtonColors(enabled: androidx.compose.ui.graphics.Color, onEnabled: androidx.compose.ui.graphics.Color, enabledOutline: androidx.compose.ui.graphics.Color, enabledRipple: androidx.compose.ui.graphics.Color, disabled: androidx.compose.ui.graphics.Color, onDisabled: androidx.compose.ui.graphics.Color, disabledOutline: androidx.compose.ui.graphics.Color, disabledRipple: androidx.compose.ui.graphics.Color, selected: androidx.compose.ui.graphics.Color, onSelected: androidx.compose.ui.graphics.Color, selectedOutline: androidx.compose.ui.graphics.Color, selectedRipple: androidx.compose.ui.graphics.Color, error: androidx.compose.ui.graphics.Color, onError: androidx.compose.ui.graphics.Color, errorOutline: androidx.compose.ui.graphics.Color, errorRipple: androidx.compose.ui.graphics.Color, positive: androidx.compose.ui.graphics.Color, onPositive: androidx.compose.ui.graphics.Color, positiveOutline: androidx.compose.ui.graphics.Color, positiveRipple: androidx.compose.ui.graphics.Color): com.wire.android.ui.common.button.WireButtonColors
private fun com.wire.android.ui.common.button.wireButtonColors(enabled: androidx.compose.ui.graphics.Color, onEnabled: androidx.compose.ui.graphics.Color, enabledOutline: androidx.compose.ui.graphics.Color, enabledRipple: androidx.compose.ui.graphics.Color, disabled: androidx.compose.ui.graphics.Color, onDisabled: androidx.compose.ui.graphics.Color, disabledOutline: androidx.compose.ui.graphics.Color, disabledRipple: androidx.compose.ui.graphics.Color, selected: androidx.compose.ui.graphics.Color, onSelected: androidx.compose.ui.graphics.Color, selectedOutline: androidx.compose.ui.graphics.Color, selectedRipple: androidx.compose.ui.graphics.Color, error: androidx.compose.ui.graphics.Color, onError: androidx.compose.ui.graphics.Color, errorOutline: androidx.compose.ui.graphics.Color, errorRipple: androidx.compose.ui.graphics.Color, positive: androidx.compose.ui.graphics.Color, onPositive: androidx.compose.ui.graphics.Color, positiveOutline: androidx.compose.ui.graphics.Color, positiveRipple: androidx.compose.ui.graphics.Color, focused: androidx.compose.ui.graphics.Color, focusedOutline: androidx.compose.ui.graphics.Color): com.wire.android.ui.common.button.WireButtonColors
skippable: true
restartable: true
params:
Expand All @@ -1130,6 +1132,8 @@ private fun com.wire.android.ui.common.button.wireButtonColors(enabled: androidx
- onPositive: STABLE (marked @Stable or @Immutable)
- positiveOutline: STABLE (marked @Stable or @Immutable)
- positiveRipple: STABLE (marked @Stable or @Immutable)
- focused: STABLE (marked @Stable or @Immutable)
- focusedOutline: STABLE (marked @Stable or @Immutable)

@Composable
public fun com.wire.android.ui.common.button.wireCheckBoxColors(): androidx.compose.material3.CheckboxColors
Expand Down Expand Up @@ -1382,6 +1386,13 @@ public fun com.wire.android.ui.common.fixedColorsScheme(): com.wire.android.ui.t
restartable: true
params:

@Composable
public fun com.wire.android.ui.common.focusedBorder(isFocused: kotlin.Boolean): androidx.compose.ui.Modifier
skippable: true
restartable: true
params:
- isFocused: STABLE (primitive type)

@Composable
private fun com.wire.android.ui.common.getButton(modifier: androidx.compose.ui.Modifier): kotlin.Unit
skippable: true
Expand Down Expand Up @@ -1437,6 +1448,12 @@ public fun com.wire.android.ui.common.lightColorsScheme(): com.wire.android.ui.t
restartable: true
params:

@Composable
public fun com.wire.android.ui.common.maxTitleLines(): kotlin.Int
skippable: true
restartable: true
params:

@Composable
public fun com.wire.android.ui.common.preview.EdgeToEdgePreview(useDarkIcons: kotlin.Boolean, content: @[Composable] androidx.compose.runtime.internal.ComposableFunction0<kotlin.Unit>): kotlin.Unit
skippable: true
Expand Down
3 changes: 3 additions & 0 deletions features/cells/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ dependencies {
implementation(libs.coil.video)
implementation(libs.coil.compose)

implementation(libs.media3.exoplayer)
implementation(libs.media3.ui)

implementation(libs.ktx.dateTime)

implementation(libs.androidx.paging3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ import com.ramcosta.composedestinations.generated.cells.destinations.AddRemoveTa
import com.ramcosta.composedestinations.generated.cells.destinations.CellImageViewerScreenDestination
import com.ramcosta.composedestinations.generated.cells.destinations.PublicLinkScreenDestination
import com.ramcosta.composedestinations.generated.cells.destinations.SearchScreenDestination
import com.ramcosta.composedestinations.generated.cells.destinations.VideoPlayerScreenDestination
import com.wire.android.feature.cells.R
import com.wire.android.feature.cells.ui.common.OfflineBanner
import com.wire.android.feature.cells.ui.imageviewer.CellImageViewerNavArgs
import com.wire.android.feature.cells.ui.search.DriveSearchScreenType
import com.wire.android.feature.cells.ui.videoplayer.VideoViewerNavArgs
import com.wire.android.navigation.NavigationCommand
import com.wire.android.navigation.WireNavigator
import com.wire.android.ui.common.scaffold.WireScaffold
Expand Down Expand Up @@ -135,6 +137,19 @@ fun AllFilesScreen(
)
)
},
showVideoPlayer = { file ->
navigator.navigate(
NavigationCommand(
VideoPlayerScreenDestination(
VideoViewerNavArgs(
localPath = file.localPath,
contentUrl = file.contentUrl,
fileName = file.name,
)
)
)
)
},
fileReadyFlow = viewModel.fileReadyFlow,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ internal fun CellScreenContent(
retryEditNodeError: (String) -> Unit = {},
showVersionHistoryScreen: (String, String) -> Unit = { _, _ -> },
showImageViewer: (CellNodeUi.File) -> Unit = {},
showVideoPlayer: (CellNodeUi.File) -> Unit = {},
fileReadyFlow: Flow<CellNodeUi.File>? = emptyFlow(),
) {

Expand Down Expand Up @@ -257,6 +258,7 @@ internal fun CellScreenContent(
).show()
}
is OpenImageViewer -> showImageViewer(action.file)
is OpenVideoPlayer -> showVideoPlayer(action.file)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@

isConversationFiles() -> "${currentNodeUuid()}/${cellNode.name}"
else -> cellNode.remotePath
} ?: run {

Check warning on line 355 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellViewModel.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless elvis operation ?:, it always succeeds.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-android&issues=AZ68AWbykedoSjrIaZ8s&open=AZ68AWbykedoSjrIaZ8s&pullRequest=4961
sendAction(ShowError(CellError.OTHER_ERROR))
return
}
Expand All @@ -378,9 +378,20 @@
}

private fun openFileContentUrl(file: CellNodeUi.File) {
if (file.shouldOpenInAppImageViewer()) {
sendAction(OpenImageViewer(file))
return
when (file.assetType) {
AttachmentFileType.IMAGE -> {
if (file.shouldOpenInAppImageViewer()) {
sendAction(OpenImageViewer(file))
return
}
}

AttachmentFileType.VIDEO -> {
sendAction(OpenVideoPlayer(file))

Check warning on line 390 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellViewModel.kt

View check run for this annotation

Codecov / codecov/patch

features/cells/src/main/java/com/wire/android/feature/cells/ui/CellViewModel.kt#L390

Added line #L390 was not covered by tests
return
}

else -> Unit
}
file.contentUrl?.let { url ->
fileHelper.openAssetUrlWithExternalApp(
Expand All @@ -394,9 +405,20 @@
}

private fun openLocalFile(file: CellNodeUi.File) {
if (file.shouldOpenInAppImageViewer()) {
sendAction(OpenImageViewer(file))
return
when (file.assetType) {
AttachmentFileType.IMAGE -> {
if (file.shouldOpenInAppImageViewer()) {
sendAction(OpenImageViewer(file))
return
}
}

AttachmentFileType.VIDEO -> {
sendAction(OpenVideoPlayer(file))

Check warning on line 417 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellViewModel.kt

View check run for this annotation

Codecov / codecov/patch

features/cells/src/main/java/com/wire/android/feature/cells/ui/CellViewModel.kt#L417

Added line #L417 was not covered by tests
return
}

else -> Unit
}
file.localPath?.let { path ->
fileHelper.openAssetFileWithExternalApp(
Expand Down Expand Up @@ -648,6 +670,7 @@
internal data class ShowEditErrorDialog(val nodeUuid: String) : CellViewAction
internal data object ShowOfflineFileSaved : CellViewAction
internal data class OpenImageViewer(val file: CellNodeUi.File) : CellViewAction
internal data class OpenVideoPlayer(val file: CellNodeUi.File) : CellViewAction

Check warning on line 673 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellViewModel.kt

View check run for this annotation

Codecov / codecov/patch

features/cells/src/main/java/com/wire/android/feature/cells/ui/CellViewModel.kt#L673

Added line #L673 was not covered by tests

internal enum class CellError(val message: Int) {
NO_APP_FOUND(R.string.no_app_found),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

@file:Suppress("TooManyFunctions")

package com.wire.android.feature.cells.ui

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory.Companion.APPLICATION_KEY
import androidx.lifecycle.createSavedStateHandle
import androidx.lifecycle.viewmodel.CreationExtras
import com.wire.android.feature.cells.ui.create.file.CreateFileViewModel
Expand All @@ -31,6 +35,7 @@
import com.wire.android.feature.cells.ui.search.SearchScreenViewModel
import com.wire.android.feature.cells.ui.tags.AddRemoveTagsViewModel
import com.wire.android.feature.cells.ui.versioning.VersionHistoryViewModel
import com.wire.android.feature.cells.ui.videoplayer.VideoPlayerViewModel
import dev.zacsweers.metro.BindingContainer
import dev.zacsweers.metro.IntoMap
import dev.zacsweers.metro.Provides
Expand Down Expand Up @@ -109,9 +114,22 @@
@Provides
@IntoMap
@ViewModelAssistedFactoryKey(CellImageViewerViewModel::class)
fun cellImageViewerViewModel(factory: CellsViewModelFactory): ViewModelAssistedFactory =
fun imageViewerViewModel(factory: CellsViewModelFactory): ViewModelAssistedFactory =
savedStateViewModel { factory.cellImageViewerViewModel(it.createSavedStateHandle()) }

@Provides
@IntoMap
@ViewModelAssistedFactoryKey(VideoPlayerViewModel::class)
fun videoViewerViewModel(factory: CellsViewModelFactory): ViewModelAssistedFactory =
savedStateViewModel {
factory.cellVideoViewerViewModel(

Check warning on line 125 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsMetroViewModelBindings.kt

View check run for this annotation

Codecov / codecov/patch

features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsMetroViewModelBindings.kt#L124-L125

Added lines #L124 - L125 were not covered by tests
context = checkNotNull(it[APPLICATION_KEY]) {
"No Application was provided via CreationExtras"

Check warning on line 127 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsMetroViewModelBindings.kt

View check run for this annotation

Codecov / codecov/patch

features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsMetroViewModelBindings.kt#L127

Added line #L127 was not covered by tests
},
savedStateHandle = it.createSavedStateHandle(),

Check warning on line 129 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsMetroViewModelBindings.kt

View check run for this annotation

Codecov / codecov/patch

features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsMetroViewModelBindings.kt#L129

Added line #L129 was not covered by tests
)
}

private fun savedStateViewModel(create: (CreationExtras) -> ViewModel): ViewModelAssistedFactory =
object : ViewModelAssistedFactory {
override fun create(extras: CreationExtras): ViewModel = create(extras)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package com.wire.android.feature.cells.ui

import android.content.Context
import androidx.lifecycle.SavedStateHandle
import com.wire.android.feature.cells.ui.create.file.CreateFileViewModel
import com.wire.android.feature.cells.ui.create.folder.CreateFolderViewModel
Expand All @@ -30,6 +31,7 @@
import com.wire.android.feature.cells.ui.search.SearchScreenViewModel
import com.wire.android.feature.cells.ui.tags.AddRemoveTagsViewModel
import com.wire.android.feature.cells.ui.versioning.VersionHistoryViewModel
import com.wire.android.feature.cells.ui.videoplayer.VideoPlayerViewModel
import com.wire.android.feature.cells.util.FileHelper
import com.wire.android.util.FileSizeFormatter
import com.wire.android.util.dispatchers.DispatcherProvider
Expand Down Expand Up @@ -219,4 +221,12 @@
internal fun cellImageViewerViewModel(savedStateHandle: SavedStateHandle) = CellImageViewerViewModel(
savedStateHandle = savedStateHandle,
)

internal fun cellVideoViewerViewModel(
context: Context,
savedStateHandle: SavedStateHandle
) = VideoPlayerViewModel(
context = context,
savedStateHandle = savedStateHandle,

Check warning on line 230 in features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsViewModelFactory.kt

View check run for this annotation

Codecov / codecov/patch

features/cells/src/main/java/com/wire/android/feature/cells/ui/CellsViewModelFactory.kt#L228-L230

Added lines #L228 - L230 were not covered by tests
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

@file:Suppress("TooManyFunctions")

package com.wire.android.feature.cells.ui

import androidx.compose.runtime.Composable
Expand All @@ -33,6 +36,7 @@ import com.wire.android.feature.cells.ui.rename.RenameNodeViewModel
import com.wire.android.feature.cells.ui.search.SearchScreenViewModel
import com.wire.android.feature.cells.ui.tags.AddRemoveTagsViewModel
import com.wire.android.feature.cells.ui.versioning.VersionHistoryViewModel
import com.wire.android.feature.cells.ui.videoplayer.VideoPlayerViewModel

@Composable
inline fun <reified VM> cellsViewModel(
Expand Down Expand Up @@ -87,3 +91,6 @@ fun versionHistoryViewModel(): VersionHistoryViewModel = cellsViewModel()

@Composable
fun cellImageViewerViewModel(): CellImageViewerViewModel = cellsViewModel()

@Composable
fun cellVideoViewerViewModel(): VideoPlayerViewModel = cellsViewModel()
Loading
Loading