Skip to content

Commit

Permalink
Merge pull request #29 from Infomaniak/transfer-type
Browse files Browse the repository at this point in the history
Add transfer types four big buttons
  • Loading branch information
LunarX authored Aug 21, 2024
2 parents fd0f1f3 + e22fb87 commit 2fa8a78
Show file tree
Hide file tree
Showing 16 changed files with 567 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.infomaniak.swisstransfer.ui.icons.illu

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound

val AppIcons.Illu.ChainTilted: ImageVector
get() {
if (_chainTilted != null) {
return _chainTilted!!
}
_chainTilted = Builder(
name = "ChainTilted",
defaultWidth = 120.0.dp,
defaultHeight = 80.0.dp,
viewportWidth = 120.0f,
viewportHeight = 80.0f
).apply {
path(
fill = null,
stroke = SolidColor(Color(0xFF3CB572)),
strokeLineWidth = 3.0f,
strokeLineCap = strokeCapRound,
strokeLineJoin = strokeJoinRound,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(47.17f, 75.82f)
lineToRelative(-4.56f, 4.56f)
arcToRelative(22.03f, 22.03f, 0.0f, true, true, -31.16f, -31.15f)
lineToRelative(23.37f, -23.37f)
arcToRelative(22.03f, 22.03f, 0.0f, false, true, 33.41f, 28.52f)
}
path(
fill = null,
stroke = SolidColor(Color(0xFF3CB572)),
strokeLineWidth = 3.0f,
strokeLineCap = strokeCapRound,
strokeLineJoin = strokeJoinRound,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(73.88f, 12.5f)
lineToRelative(3.67f, -3.67f)
arcToRelative(22.03f, 22.03f, 0.0f, false, true, 31.16f, 31.16f)
lineTo(85.34f, 63.36f)
arcToRelative(22.03f, 22.03f, 0.0f, false, true, -33.41f, -28.52f)
}
}.build()
return _chainTilted!!
}

private var _chainTilted: ImageVector? = null

@Preview
@Composable
private fun Preview() {
Box {
Image(
imageVector = AppIcons.Illu.ChainTilted,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package com.infomaniak.swisstransfer.ui.icons.illu

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound

val AppIcons.Illu.EnvelopeTilted: ImageVector
get() {
if (_envelopeTilted != null) {
return _envelopeTilted!!
}
_envelopeTilted = Builder(
name = "EnvelopeTilted",
defaultWidth = 120.0.dp,
defaultHeight = 80.0.dp,
viewportWidth = 120.0f,
viewportHeight = 80.0f
).apply {
path(
fill = null,
stroke = SolidColor(Color(0xFF014958)),
strokeLineWidth = 3.0f,
strokeLineCap = strokeCapRound,
strokeLineJoin = strokeJoinRound,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(85.95f, 4.79f)
lineTo(63.9f, 63.07f)
lineTo(2.41f, 53.02f)
}
path(
fill = null,
stroke = SolidColor(Color(0xFF014958)),
strokeLineWidth = 3.0f,
strokeLineCap = strokeCapRound,
strokeLineJoin = strokeJoinRound,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(80.94f, 5.11f)
lineTo(5.18f, 48.85f)
curveTo(2.04f, 50.66f, 1.0f, 54.73f, 2.85f, 57.94f)
lineToRelative(26.83f, 46.47f)
curveToRelative(1.85f, 3.21f, 5.9f, 4.34f, 9.03f, 2.53f)
lineToRelative(75.76f, -43.74f)
curveToRelative(3.14f, -1.81f, 4.18f, -5.88f, 2.33f, -9.09f)
lineTo(89.98f, 7.63f)
curveToRelative(-1.85f, -3.21f, -5.9f, -4.34f, -9.03f, -2.53f)
}
}.build()
return _envelopeTilted!!
}

private var _envelopeTilted: ImageVector? = null

@Preview
@Composable
private fun Preview() {
Box {
Image(
imageVector = AppIcons.Illu.EnvelopeTilted,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package com.infomaniak.swisstransfer.ui.icons.illu

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound


val AppIcons.Illu.QrCodeTilted: ImageVector
get() {
if (_qrCodeTilted != null) {
return _qrCodeTilted!!
}
_qrCodeTilted = Builder(
name = "QrCodeTilted",
defaultWidth = 120.0.dp,
defaultHeight = 80.0.dp,
viewportWidth = 120.0f,
viewportHeight = 80.0f
).apply {
path(
fill = null,
stroke = SolidColor(Color(0xFF3CB572)),
strokeLineWidth = 3.0f,
strokeLineCap = strokeCapRound,
strokeLineJoin = strokeJoinRound,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(15.56f, 56.33f)
lineTo(29.99f, 48.0f)
lineToRelative(-8.33f, -14.43f)
lineTo(7.23f, 41.9f)
close()
moveToRelative(79.69f, 21.35f)
lineToRelative(14.43f, -8.33f)
lineToRelative(-8.33f, -14.43f)
lineToRelative(-14.43f, 8.33f)
close()
moveTo(23.9f, 70.76f)
lineToRelative(28.86f, -16.67f)
lineToRelative(-4.17f, -7.22f)
moveToRelative(14.44f, -8.33f)
lineToRelative(-12.5f, -21.65f)
lineToRelative(21.65f, -12.5f)
lineToRelative(12.5f, 21.65f)
lineToRelative(-7.22f, 4.17f)
moveToRelative(-37.2f, 2.23f)
lineToRelative(-4.17f, -7.22f)
moveTo(73.6f, 90.18f)
lineTo(61.1f, 68.53f)
lineToRelative(7.22f, -4.17f)
moveToRelative(10.26f, -15.55f)
lineToRelative(14.43f, -8.33f)
}
}.build()
return _qrCodeTilted!!
}

private var _qrCodeTilted: ImageVector? = null

@Preview
@Composable
private fun Preview() {
Box {
Image(
imageVector = AppIcons.Illu.QrCodeTilted,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.infomaniak.swisstransfer.ui.icons.illu

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound


val AppIcons.Illu.WaveSignalTilted: ImageVector
get() {
if (_waveSignalTilted != null) {
return _waveSignalTilted!!
}
_waveSignalTilted = Builder(
name = "WaveSignalTilted",
defaultWidth = 120.0.dp,
defaultHeight = 80.0.dp,
viewportWidth = 120.0f,
viewportHeight = 80.0f
).apply {
path(
fill = null,
stroke = SolidColor(Color(0xFFCF9E1B)),
strokeLineWidth = 3.0f,
strokeLineCap = strokeCapRound,
strokeLineJoin = strokeJoinRound,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(93.93f, 50.48f)
arcToRelative(32.97f, 32.97f, 0.0f, false, false, -40.38f, 23.31f)
moveToRelative(46.19f, -42.81f)
arcToRelative(52.75f, 52.75f, 0.0f, false, false, -64.6f, 37.3f)
moveToRelative(66.36f, -56.51f)
arcToRelative(72.53f, 72.53f, 0.0f, false, false, -85.65f, 49.45f)
}
}.build()
return _waveSignalTilted!!
}

private var _waveSignalTilted: ImageVector? = null

@Preview
@Composable
private fun Preview() {
Box {
Image(
imageVector = AppIcons.Illu.WaveSignalTilted,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

package com.infomaniak.swisstransfer.ui.screen.newtransfer

import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
Expand All @@ -38,10 +36,10 @@ fun NewTransferNavHost(navController: NavHostController) {

NavHost(navController, NewTransferNavigation.startDestination) {
composable<ImportFilesDestination> {
ImportFilesScreen()
ImportFilesScreen(navigateToTransferTypeScreen = { navController.navigate(TransferTypeDestination) })
}
composable<TransferTypeDestination> {
TransferTypeScreen()
TransferTypeScreen(navigateToTransfer = { /*TODO*/ })
}
composable<TransferOptionsDestination> {
TransferOptionsScreen()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
import com.infomaniak.swisstransfer.ui.utils.PreviewTablet

@Composable
fun ImportFilesScreen() {
fun ImportFilesScreen(navigateToTransferTypeScreen: () -> Unit) {
var showUploadSourceChoiceBottomSheet by rememberSaveable { mutableStateOf(false) }

BottomStickyButtonScaffold(
Expand All @@ -59,7 +59,7 @@ fun ImportFilesScreen() {
LargeButton(
modifier = modifier,
titleRes = R.string.buttonNext,
onClick = { /*TODO*/ },
onClick = { navigateToTransferTypeScreen() },
)
},
) {
Expand Down Expand Up @@ -99,7 +99,7 @@ private fun UploadSourceChoiceBottomSheet(
@Composable
private fun ImportFilesScreenPreview() {
SwissTransferTheme {
ImportFilesScreen()
ImportFilesScreen {}
}
}

Expand Down
Loading

0 comments on commit 2fa8a78

Please sign in to comment.