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 @@ -162,7 +162,14 @@ fun GroupConversationDetailsScreen(

val onConversationMediaClick: () -> Unit = {
if (groupOptions.isWireCellEnabled && groupOptions.isWireCellFeatureEnabled) {
navigator.navigate(NavigationCommand(ConversationFilesScreenDestination(viewModel.conversationId.toString())))
navigator.navigate(
NavigationCommand(
ConversationFilesScreenDestination(
conversationId = viewModel.conversationId.toString(),
breadcrumbs = arrayOf(groupOptions.groupName)
)
)
)
} else {
navigator.navigate(NavigationCommand(ConversationMediaScreenDestination(viewModel.conversationId)))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ fun ConversationFilesScreenContent(
NavigationCommand(
RecycleBinScreenDestination(
conversationId = currentNodeUuid?.substringBefore("/"),
isRecycleBin = true
isRecycleBin = true,
breadcrumbs = arrayOf(breadcrumbs?.first() ?: ""),
)
)
)
Expand Down Expand Up @@ -196,6 +197,7 @@ fun ConversationFilesScreenContent(
modifier = Modifier
.height(dimensions().spacing40x)
.fillMaxWidth(),
isRecycleBin = isRecycleBin,
pathSegments = it,
onBreadcrumbsFolderClick = onBreadcrumbsFolderClick
)
Expand Down Expand Up @@ -250,9 +252,7 @@ fun ConversationFilesScreenContent(
screenTitle = title,
isRecycleBin = isRecycleBin,
parentFolderUuid = parentFolderUuid,
breadcrumbs = if (!isRecycleBin) {
(breadcrumbs ?: emptyArray()) + title
} else { null }
breadcrumbs = (breadcrumbs ?: emptyArray()) + title
),
BackStackMode.NONE,
launchSingleTop = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ package com.wire.android.feature.cells.ui
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.paging.compose.collectAsLazyPagingItems
import com.wire.android.feature.cells.R
import com.wire.android.feature.cells.ui.destinations.ConversationFilesWithSlideInTransitionScreenDestination
import com.wire.android.feature.cells.ui.destinations.RecycleBinScreenDestination
import com.wire.android.navigation.BackStackMode
Expand Down Expand Up @@ -58,7 +60,7 @@ fun ConversationFilesWithSlideInTransitionScreen(
ConversationFilesScreenContent(
navigator = navigator,
currentNodeUuid = viewModel.currentNodeUuid(),
screenTitle = cellFilesNavArgs.screenTitle,
screenTitle = stringResource(R.string.conversation_files_title),
isRecycleBin = viewModel.isRecycleBin(),
actions = viewModel.actions,
pagingListItems = viewModel.nodesFlow.collectAsLazyPagingItems(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ package com.wire.android.feature.cells.ui.common

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import com.wire.android.feature.cells.R
import com.wire.android.ui.common.colorsScheme
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.common.preview.MultipleThemePreviews
Expand All @@ -35,6 +42,7 @@ import com.wire.android.ui.theme.wireTypography
fun Breadcrumbs(
pathSegments: Array<String>,
modifier: Modifier = Modifier,
isRecycleBin: Boolean = false,
onBreadcrumbsFolderClick: (index: Int) -> Unit
) {
val listState = rememberLazyListState()
Expand All @@ -55,36 +63,83 @@ fun Breadcrumbs(
) {
pathSegments.forEachIndexed { index, item ->
item {
if (index != pathSegments.lastIndex) {
Row(verticalAlignment = Alignment.CenterVertically) {
if (index != 0) {
Icon(
modifier = Modifier.padding(
start = dimensions().spacing8x,
end = dimensions().spacing8x
),
painter = painterResource(id = R.drawable.ic_chevron_right),
contentDescription = null
)
}

Text(
modifier = Modifier
.clickable { onBreadcrumbsFolderClick(index) },
modifier = Modifier.clickable { onBreadcrumbsFolderClick(index) },
text = item,
style = MaterialTheme.wireTypography.button02.copy(
color = colorsScheme().secondaryText
),
style = MaterialTheme.wireTypography.button02.run {
if (index == pathSegments.lastIndex && index != 0) {
copy(color = colorsScheme().primary)
} else {
this
}
}
)
Text(
text = " > ",
style = MaterialTheme.wireTypography.button02.copy(
color = colorsScheme().onBackground
),
)
} else {
Text(
modifier = Modifier
.clickable { onBreadcrumbsFolderClick(index) },
text = item,
style = MaterialTheme.wireTypography.button02.copy(
color = colorsScheme().onBackground

if (isRecycleBin && index == 0) {
val isRecycleBinLast = pathSegments.size == 1
RecycleBinItem(
color = if (isRecycleBinLast) {
colorsScheme().primary
} else {
colorsScheme().onSurfaceVariant
},
onBreadcrumbsFolderClick = { onBreadcrumbsFolderClick(0) }
)
)
}
}
}
}
}
}

@Composable
private fun RecycleBinItem(
color: Color? = null,
onBreadcrumbsFolderClick: () -> Unit = { }
) {
Row(
verticalAlignment = Alignment.CenterVertically,
) {
Icon(
modifier = Modifier.padding(
start = dimensions().spacing8x,
end = dimensions().spacing8x
),
painter = painterResource(id = R.drawable.ic_chevron_right),
contentDescription = null
)
Icon(
modifier = Modifier.padding(end = dimensions().spacing8x),
painter = painterResource(id = R.drawable.ic_trash),
contentDescription = null,
tint = color ?: colorsScheme().onSurfaceVariant
)
Text(
modifier = Modifier.clickable { onBreadcrumbsFolderClick() },
text = "Recycle Bin",
style = MaterialTheme.wireTypography.button02.run {
if (color != null) {
copy(color = color)
} else {
this
}
}
)
}
}

@MultipleThemePreviews
@Composable
fun PreviewBreadcrumbs() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
package com.wire.android.feature.cells.ui.recyclebin

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
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.runtime.Composable
Expand All @@ -30,6 +33,7 @@ import com.wire.android.feature.cells.R
import com.wire.android.feature.cells.ui.CellFilesNavArgs
import com.wire.android.feature.cells.ui.CellScreenContent
import com.wire.android.feature.cells.ui.CellViewModel
import com.wire.android.feature.cells.ui.common.Breadcrumbs
import com.wire.android.feature.cells.ui.destinations.ConversationFilesWithSlideInTransitionScreenDestination
import com.wire.android.feature.cells.ui.destinations.MoveToFolderScreenDestination
import com.wire.android.feature.cells.ui.destinations.PublicLinkScreenDestination
Expand Down Expand Up @@ -57,20 +61,33 @@ fun RecycleBinScreen(
Box(modifier = modifier) {
WireScaffold(
topBar = {
WireCenterAlignedTopAppBar(
elevation = dimensions().spacing0x,
titleContent = {
WireTopAppBarTitle(
title = stringResource(R.string.recycle_bin),
style = MaterialTheme.wireTypography.title01,
maxLines = 2
Column {
WireCenterAlignedTopAppBar(
elevation = dimensions().spacing0x,
titleContent = {
WireTopAppBarTitle(
title = stringResource(R.string.recycle_bin),
style = MaterialTheme.wireTypography.title01,
maxLines = 2
)
},
navigationIconType = NavigationIconType.Back(com.wire.android.ui.common.R.string.content_description_back_button),
onNavigationPressed = {
navigator.navigateBack()
}
)

cellViewModel.breadcrumbs()?.let {
Breadcrumbs(
modifier = Modifier
.height(dimensions().spacing40x)
.fillMaxWidth(),
pathSegments = it,
isRecycleBin = cellViewModel.isRecycleBin(),
onBreadcrumbsFolderClick = {}
)
},
navigationIconType = NavigationIconType.Back(com.wire.android.ui.common.R.string.content_description_back_button),
onNavigationPressed = {
navigator.navigateBack()
}
)
}
}
) { innerPadding ->
Box(modifier = Modifier.padding(innerPadding)) {
Expand All @@ -91,6 +108,7 @@ fun RecycleBinScreen(
conversationId = path,
screenTitle = title,
isRecycleBin = true,
breadcrumbs = (cellViewModel.breadcrumbs() ?: emptyArray()) + title,
parentFolderUuid = parentFolderUuid,
),
BackStackMode.NONE,
Expand Down
27 changes: 27 additions & 0 deletions features/cells/src/main/res/drawable/ic_chevron_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
~ Wire
~ Copyright (C) 2025 Wire Swiss GmbH
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see http://www.gnu.org/licenses/.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M9.402,6.027L3.659,0.284L2.599,1.345L7.281,6.027L2.599,10.709L3.659,11.769L9.402,6.027Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
</vector>
27 changes: 27 additions & 0 deletions features/cells/src/main/res/drawable/ic_trash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
~ Wire
~ Copyright (C) 2025 Wire Swiss GmbH
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see http://www.gnu.org/licenses/.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M4.5,1.5H1.505C1.087,1.5 0.75,1.836 0.75,2.25V3H11.25V2.25C11.25,1.833 10.912,1.5 10.495,1.5H7.5C7.5,0.666 6.828,0 6,0C5.166,0 4.5,0.672 4.5,1.5ZM1.5,4.5H10.5L9.9,10.5C9.817,11.329 9.084,12 8.25,12H3.75C2.921,12 2.183,11.334 2.1,10.5L1.5,4.5Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
</vector>