Skip to content

Commit

Permalink
Merge pull request #228 from Infomaniak/header
Browse files Browse the repository at this point in the history
refactor: Add missing file header
  • Loading branch information
KevinBoulongne authored Dec 4, 2024
2 parents 3b319e7 + c66e233 commit 7df7ed4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import com.infomaniak.swisstransfer.ui.theme.CustomShapes
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewLightAndDark


/**
* Most basic and customizable button component.
*
Expand Down Expand Up @@ -127,7 +126,6 @@ enum class ButtonType(val buttonColors: @Composable () -> ButtonColors) {
}),
}


@PreviewLightAndDark
@Composable
private fun Preview() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ fun TransferFilePreview(file: FileUi? = null, remainingFilesCount: Int? = null)
)
}
} else {
// TODO: Temporary code to be able to test the view, while waiting real Transfers data
// AsyncImage(
// model = ImageRequest.Builder(LocalContext.current)
// .data(randomTestImageUrl()) // TODO: Use the `fileUi.localPath` (probably?) to generate file's preview instead of this hard-coded value
// .crossfade(true)
// .build(),
// contentDescription = null,
// contentScale = ContentScale.Crop,
// onError = {}, // TODO ?
// modifier = Modifier
// .size(Margin.Giant)
// .clip(CustomShapes.SMALL)
// .background(SwissTransferTheme.colors.transferFilePreviewOverflow),
// )
SmallFileItem(file = file, smallFileTileSize = SmallFileTileSize.SMALL)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ private fun TransferDetailsScreen(
BottomBarItem.PASSWORD -> showPasswordBottomSheet = true
BottomBarItem.DOWNLOAD -> {
// TODO: Move the multiselect elsewhere, and implement this feature
isMultiselectOn = true
// isMultiselectOn = true // Disabled for now because it's not the correct spot to do this
}
BottomBarItem.MULTISELECT_DOWNLOAD -> {
// TODO: Move the multiselect elsewhere, and implement this feature
clearCheckedFiles()
isMultiselectOn = false
// clearCheckedFiles() // Disabled for now because it's not the correct spot to do this
// isMultiselectOn = false // Disabled for now because it's not the correct spot to do this
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ImportFilesViewModel @Inject constructor(
initialValue = emptyList(),
)

val failedFiles = importationFilesManager.failedFiles
val failedFiles = importationFilesManager.failedFiles // TODO ? (unused)
val filesToImportCount = importationFilesManager.filesToImportCount
val currentSessionFilesCount = importationFilesManager.currentSessionFilesCount

Expand Down Expand Up @@ -240,18 +240,16 @@ class ImportFilesViewModel @Inject constructor(
}
//endregion

//region Password
private var transferPassword by mutableStateOf("")

private val isPasswordValid by derivedStateOf { transferPassword.length in PASSWORD_MIN_LENGTH..PASSWORD_MAX_LENGTH }
//endregion


//region Transfer Message
private var _transferMessage by mutableStateOf("")
val transferMessage = GetSetCallbacks(get = { _transferMessage }, set = { _transferMessage = it })
//endregion

//region Password
private var transferPassword by mutableStateOf("")
private val isPasswordValid by derivedStateOf { transferPassword.length in PASSWORD_MIN_LENGTH..PASSWORD_MAX_LENGTH }
//endregion

sealed class SendActionResult {
data class Success(val totalSize: Long) : SendActionResult()
data object Failure : SendActionResult()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,13 @@ private fun ColumnScope.EmailAddressesTextFields(selectedTransferType: () -> Tra
SwissTransferTextField(
modifier = Modifier.fillMaxWidth(),
label = stringResource(R.string.transferSenderAddressPlaceholder),
onValueChange = { /* TODO */ },
)
Spacer(Modifier.height(Margin.Medium))
SwissTransferTextField(
modifier = Modifier.fillMaxWidth(),
label = stringResource(R.string.transferRecipientAddressPlaceholder),
onValueChange = { /* TODO */ },
)
Spacer(Modifier.height(Margin.Medium))
}
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/splashscreen_legacy.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!--
~ Infomaniak SwissTransfer - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ 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/>.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/splashscreen_gradient_legacy" />
Expand Down

0 comments on commit 7df7ed4

Please sign in to comment.