Skip to content

Commit 798be72

Browse files
authored
feat(Cells): Create cells folder flow (WPB-17272) (#4002)
1 parent dd82370 commit 798be72

File tree

29 files changed

+486
-104
lines changed

29 files changed

+486
-104
lines changed

app/src/main/kotlin/com/wire/android/navigation/WireMainNavGraph.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package com.wire.android.navigation
2020
import com.ramcosta.composedestinations.spec.DestinationSpec
2121
import com.ramcosta.composedestinations.spec.NavGraphSpec
2222
import com.wire.android.feature.cells.ui.destinations.ConversationFilesScreenDestination
23+
import com.wire.android.feature.cells.ui.destinations.CreateFolderScreenDestination
2324
import com.wire.android.feature.cells.ui.destinations.PublicLinkScreenDestination
2425
import com.wire.android.feature.sketch.destinations.DrawingCanvasScreenDestination
2526
import com.wire.android.ui.NavGraphs
@@ -31,6 +32,7 @@ object WireMainNavGraph : NavGraphSpec {
3132
.plus(DrawingCanvasScreenDestination)
3233
.plus(PublicLinkScreenDestination)
3334
.plus(ConversationFilesScreenDestination)
35+
.plus(CreateFolderScreenDestination)
3436
override val destinationsByRoute = destinations.associateBy { it.route }
3537
override val nestedNavGraphs = NavGraphs.root.nestedNavGraphs
3638
}

app/src/main/kotlin/com/wire/android/ui/home/HomeScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ import com.wire.android.navigation.handleNavigation
7373
import com.wire.android.ui.NavGraphs
7474
import com.wire.android.ui.analytics.AnalyticsUsageViewModel
7575
import com.wire.android.ui.common.CollapsingTopBarScaffold
76-
import com.wire.android.ui.common.FloatingActionButton
7776
import com.wire.android.ui.common.bottomsheet.WireModalSheetLayout
7877
import com.wire.android.ui.common.bottomsheet.rememberWireModalSheetState
78+
import com.wire.android.ui.common.button.FloatingActionButton
7979
import com.wire.android.ui.common.dialogs.PermissionPermanentlyDeniedDialog
8080
import com.wire.android.ui.common.dimensions
8181
import com.wire.android.ui.common.snackbar.LocalSnackbarHostState

app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/CreateGuestLinkBottomSheet.kt

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ package com.wire.android.ui.home.conversations.details.editguestaccess
1919

2020
import androidx.compose.runtime.Composable
2121
import androidx.compose.ui.res.stringResource
22-
import androidx.compose.ui.tooling.preview.Preview
2322
import com.wire.android.R
2423
import com.wire.android.ui.common.ArrowRightIcon
2524
import com.wire.android.ui.common.bottomsheet.MenuBottomSheetItem
2625
import com.wire.android.ui.common.bottomsheet.MenuModalSheetHeader
2726
import com.wire.android.ui.common.bottomsheet.WireMenuModalSheetContent
2827
import com.wire.android.ui.common.bottomsheet.WireModalSheetLayout
2928
import com.wire.android.ui.common.bottomsheet.WireModalSheetState
29+
import com.wire.android.ui.common.bottomsheet.WireSheetValue
3030
import com.wire.android.ui.common.bottomsheet.rememberWireModalSheetState
31+
import com.wire.android.ui.common.preview.MultipleThemePreviews
32+
import com.wire.android.ui.theme.WireTheme
3133

3234
@Composable
3335
fun CreateGuestLinkBottomSheet(
@@ -74,22 +76,26 @@ private fun CreateInviteLinkSheetItem(
7476
)
7577
}
7678

77-
@Preview
79+
@MultipleThemePreviews
7880
@Composable
79-
fun PreviewCreateGuestLinkBottomSheet() {
80-
CreateGuestLinkBottomSheet(
81-
sheetState = rememberWireModalSheetState(),
82-
onItemClick = {},
83-
isPasswordInviteLinksAllowed = true,
84-
)
81+
private fun PreviewCreateGuestLinkBottomSheet() {
82+
WireTheme {
83+
CreateGuestLinkBottomSheet(
84+
sheetState = rememberWireModalSheetState(WireSheetValue.Expanded(value = Unit)),
85+
onItemClick = {},
86+
isPasswordInviteLinksAllowed = true,
87+
)
88+
}
8589
}
8690

87-
@Preview
91+
@MultipleThemePreviews
8892
@Composable
89-
fun PreviewCreateGuestLinkBottomSheetDisabled() {
90-
CreateGuestLinkBottomSheet(
91-
sheetState = rememberWireModalSheetState(),
92-
onItemClick = {},
93-
isPasswordInviteLinksAllowed = false,
94-
)
93+
private fun PreviewCreateGuestLinkBottomSheetDisabled() {
94+
WireTheme {
95+
CreateGuestLinkBottomSheet(
96+
sheetState = rememberWireModalSheetState(WireSheetValue.Expanded(value = Unit)),
97+
onItemClick = {},
98+
isPasswordInviteLinksAllowed = false,
99+
)
100+
}
95101
}

app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.wire.android.ui.home.messagecomposer
2020

21+
import android.view.KeyEvent
2122
import androidx.compose.animation.core.animateFloatAsState
2223
import androidx.compose.foundation.background
2324
import androidx.compose.foundation.focusable
@@ -317,7 +318,7 @@ private fun MessageComposerTextInput(
317318
}
318319
}
319320
.onPreInterceptKeyBeforeSoftKeyboard { event ->
320-
if (event.key.nativeKeyCode == android.view.KeyEvent.KEYCODE_BACK) {
321+
if (event.key.nativeKeyCode == KeyEvent.KEYCODE_BACK) {
321322
onClearFocus()
322323
if (isTextExpanded) {
323324
onTextCollapse()
Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,6 @@
1-
/*
2-
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU General Public License as published by
7-
* the Free Software Foundation, either version 3 of the License, or
8-
* (at your option) any later version.
9-
*
10-
* This program is distributed in the hope that it will be useful,
11-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
* GNU General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program. If not, see http://www.gnu.org/licenses/.
17-
*/
18-
191
package com.wire.android.util
202

213
import com.wire.android.ui.markdown.isNotBlank
224
import com.wire.android.ui.markdown.toMarkdownDocument
23-
import java.math.BigInteger
24-
import java.security.MessageDigest
25-
26-
val String.Companion.EMPTY get() = ""
27-
28-
val String.Companion.WHITE_SPACE get() = " "
29-
30-
val String.Companion.MENTION_SYMBOL get() = "@"
31-
32-
val String.Companion.NEW_LINE_SYMBOL get() = "\n"
33-
34-
fun String?.orDefault(default: String) = this ?: default
35-
36-
inline fun String.ifNotEmpty(transform: () -> String): String = if (!isEmpty()) transform() else this
37-
38-
@Suppress("MagicNumber")
39-
fun String.sha256(): String {
40-
val md = MessageDigest.getInstance("SHA-256")
41-
return BigInteger(1, md.digest(toByteArray())).toString(16).padStart(32, '0')
42-
}
43-
44-
fun String.toTitleCase(delimiter: String = " ", separator: String = " "): String =
45-
this.split(delimiter).joinToString(separator = separator) {
46-
it.lowercase().replaceFirstChar(Char::titlecaseChar)
47-
}
48-
49-
fun String.capitalizeFirstLetter(): String = lowercase().replaceFirstChar(Char::titlecaseChar)
50-
51-
fun String.normalizeFileName(): String = this.replace("/", "")
525

536
fun CharSequence.isNotMarkdownBlank(): Boolean = this.isNotBlank() && this.toString().toMarkdownDocument().isNotBlank()

app/src/main/res/values/integers.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020
<resources>
2121
<integer name="welcome_carousel_item_time_ms">3000</integer>
2222
<integer name="splashscreen_animation_ms">1000</integer>
23-
<integer name="code_length">6</integer>
2423
</resources>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Wire
3+
* Copyright (C) 2025 Wire Swiss GmbH
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see http://www.gnu.org/licenses/.
17+
*/
18+
package com.wire.android.navigation
19+
20+
object PreviewNavigator : WireNavigator {
21+
override fun navigate(navigationCommand: NavigationCommand, onlyIfResumed: Boolean) { /* No-op */ }
22+
override fun navigateBack(onlyIfResumed: Boolean) { /* No-op */ }
23+
}

app/src/main/kotlin/com/wire/android/ui/common/FloatingActionButton.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/FloatingActionButton.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* along with this program. If not, see http://www.gnu.org/licenses/.
1717
*/
1818

19-
package com.wire.android.ui.common
19+
package com.wire.android.ui.common.button
2020

2121
import androidx.compose.material.icons.Icons
2222
import androidx.compose.material.icons.filled.Add

app/src/main/kotlin/com/wire/android/ui/common/textfield/CodeTextField.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/CodeTextField.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -38,11 +38,11 @@ import androidx.compose.ui.text.TextStyle
3838
import androidx.compose.ui.text.input.ImeAction
3939
import androidx.compose.ui.text.input.KeyboardType
4040
import androidx.compose.ui.unit.Dp
41-
import com.wire.android.R
41+
import com.wire.android.ui.common.R
4242
import com.wire.android.ui.theme.WireTheme
4343
import com.wire.android.ui.theme.wireDimensions
4444
import com.wire.android.ui.theme.wireTypography
45-
import com.wire.android.util.ui.PreviewMultipleThemes
45+
import com.wire.android.util.PreviewMultipleThemes
4646

4747
@Composable
4848
fun CodeTextField(

app/src/main/kotlin/com/wire/android/ui/common/textfield/CodeTextFieldLayout.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/CodeTextFieldLayout.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

app/src/main/kotlin/com/wire/android/ui/common/textfield/InputTransformations.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/InputTransformations.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -46,7 +46,9 @@ class MaxLengthDigitsFilter(private val maxLength: Int) : InputTransformation {
4646
}
4747

4848
@Stable
49-
fun InputTransformation.maxLengthDigits(maxLength: Int): InputTransformation = this.then(MaxLengthDigitsFilter(maxLength))
49+
fun InputTransformation.maxLengthDigits(maxLength: Int): InputTransformation = this.then(
50+
MaxLengthDigitsFilter(maxLength)
51+
)
5052

5153
class MaxLengthFilterWithCallback(private val maxLength: Int, private val onIncorrectChangesFound: () -> Unit) : InputTransformation {
5254
init {

app/src/main/kotlin/com/wire/android/ui/common/textfield/WireLabel.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/WireLabel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -29,11 +29,11 @@ import androidx.compose.runtime.remember
2929
import androidx.compose.ui.Modifier
3030
import androidx.compose.ui.graphics.vector.ImageVector
3131
import androidx.compose.ui.res.vectorResource
32-
import com.wire.android.R
32+
import com.wire.android.ui.common.R
3333
import com.wire.android.ui.common.dimensions
3434
import com.wire.android.ui.theme.WireTheme
3535
import com.wire.android.ui.theme.wireTypography
36-
import com.wire.android.util.ui.PreviewMultipleThemes
36+
import com.wire.android.util.PreviewMultipleThemes
3737

3838
@Composable
3939
fun WireLabel(

app/src/main/kotlin/com/wire/android/ui/common/textfield/WirePasswordTextField.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/WirePasswordTextField.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -58,13 +58,14 @@ import androidx.compose.ui.text.style.TextAlign
5858
import androidx.compose.ui.text.style.TextDirection
5959
import androidx.compose.ui.unit.Dp
6060
import androidx.compose.ui.unit.dp
61-
import com.wire.android.R
61+
import com.wire.android.ui.common.R
6262
import com.wire.android.ui.common.dimensions
6363
import com.wire.android.ui.theme.WireTheme
6464
import com.wire.android.ui.theme.wireDimensions
6565
import com.wire.android.ui.theme.wireTypography
6666
import com.wire.android.util.EMPTY
67-
import com.wire.android.util.ui.PreviewMultipleThemes
67+
import com.wire.android.util.PreviewMultipleThemes
68+
import java.util.Locale
6869

6970
@Composable
7071
fun WirePasswordTextField(
@@ -95,7 +96,7 @@ fun WirePasswordTextField(
9596
WireTextFieldLayout(
9697
shouldShowPlaceholder = textState.text.isEmpty(),
9798
placeholderText = placeholderText,
98-
labelText = labelText,
99+
labelText = labelText?.uppercase(Locale.getDefault()),
99100
labelMandatoryIcon = labelMandatoryIcon,
100101
descriptionText = descriptionText,
101102
semanticDescription = semanticDescription,

app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextField.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextField.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -61,10 +61,10 @@ import com.wire.android.ui.theme.WireTheme
6161
import com.wire.android.ui.theme.wireDimensions
6262
import com.wire.android.ui.theme.wireTypography
6363
import com.wire.android.util.EMPTY
64-
import com.wire.android.util.ui.PreviewMultipleThemes
64+
import com.wire.android.util.PreviewMultipleThemes
6565

6666
@Composable
67-
internal fun WireTextField(
67+
fun WireTextField(
6868
textState: TextFieldState,
6969
modifier: Modifier = Modifier,
7070
placeholderText: String? = null,

app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldAutoFill.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldAutoFill.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldDefaults.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldDefaults.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldLayout.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldLayout.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldState.kt renamed to core/ui-common/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Wire
3-
* Copyright (C) 2024 Wire Swiss GmbH
3+
* Copyright (C) 2025 Wire Swiss GmbH
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)