From 1a1285035d6593c32aa3590475aed89cac6920ea Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Fri, 19 Jul 2024 13:56:21 +0200 Subject: [PATCH 1/2] Use correct strings and icon values for the bottom nav bar --- .../swisstransfer/ui/icons/AppIcons.kt | 21 +++ .../ui/icons/app/ArrowDownCircle.kt | 99 ++++++++++++++ .../ui/icons/app/ArrowUpCircle.kt | 99 ++++++++++++++ .../swisstransfer/ui/icons/app/Settings.kt | 122 ++++++++++++++++++ .../ui/navigation/NavigationItem.kt | 14 +- app/src/main/res/values-de/strings.xml | 22 ++++ app/src/main/res/values-es/strings.xml | 22 ++++ app/src/main/res/values-fr/strings.xml | 22 ++++ app/src/main/res/values-it/strings.xml | 22 ++++ app/src/main/res/values/strings.xml | 6 +- 10 files changed, 441 insertions(+), 8 deletions(-) create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/icons/AppIcons.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowDownCircle.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowUpCircle.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/Settings.kt create mode 100644 app/src/main/res/values-de/strings.xml create mode 100644 app/src/main/res/values-es/strings.xml create mode 100644 app/src/main/res/values-fr/strings.xml create mode 100644 app/src/main/res/values-it/strings.xml diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/AppIcons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/AppIcons.kt new file mode 100644 index 000000000..7ed2cf994 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/AppIcons.kt @@ -0,0 +1,21 @@ +/* + * 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 . + */ + +package com.infomaniak.swisstransfer.ui.icons + +object AppIcons diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowDownCircle.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowDownCircle.kt new file mode 100644 index 000000000..6b92552be --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowDownCircle.kt @@ -0,0 +1,99 @@ +/* + * 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 . + */ + +package com.infomaniak.swisstransfer.ui.icons.app + +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.StrokeCap +import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +import androidx.compose.ui.graphics.StrokeJoin.Companion.Round +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 + +val AppIcons.ArrowDownCircle: ImageVector + get() { + if (_arrowDownCircle != null) { + return _arrowDownCircle!! + } + _arrowDownCircle = Builder( + name = "ArrowDownCircle", + defaultWidth = 24.0.dp, + defaultHeight = 24.0.dp, + viewportWidth = 24.0f, + viewportHeight = 24.0f + ).apply { + path( + fill = null, + stroke = SolidColor(Color(0xFF9f9f9f)), + strokeLineWidth = 1.5f, + strokeLineCap = StrokeCap.Round, + strokeLineJoin = Round, + strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(12.0f, 16.5f) + verticalLineToRelative(-9.0f) + moveToRelative(3.75f, 5.25f) + lineTo(12.0f, 16.5f) + lineToRelative(-3.75f, -3.75f) + } + path( + fill = null, + stroke = SolidColor(Color(0xFF9f9f9f)), + strokeLineWidth = 1.5f, + strokeLineCap = Butt, + strokeLineJoin = Miter, + strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(12.0f, 22.5f) + curveToRelative(5.799f, 0.0f, 10.5f, -4.701f, 10.5f, -10.5f) + reflectiveCurveTo(17.799f, 1.5f, 12.0f, 1.5f) + reflectiveCurveTo(1.5f, 6.201f, 1.5f, 12.0f) + reflectiveCurveTo(6.201f, 22.5f, 12.0f, 22.5f) + close() + } + }.build() + return _arrowDownCircle!! + } + +private var _arrowDownCircle: ImageVector? = null + +@Preview +@Composable +private fun Preview() { + Box { + Image( + imageVector = AppIcons.ArrowDownCircle, + contentDescription = null, + modifier = Modifier.size(250.dp) + ) + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowUpCircle.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowUpCircle.kt new file mode 100644 index 000000000..e573fc38a --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/ArrowUpCircle.kt @@ -0,0 +1,99 @@ +/* + * 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 . + */ + +package com.infomaniak.swisstransfer.ui.icons.app + +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.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeCap.Companion.Round +import androidx.compose.ui.graphics.StrokeJoin +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +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 + +val AppIcons.ArrowUpCircle: ImageVector + get() { + if (_arrowUpCircle != null) { + return _arrowUpCircle!! + } + _arrowUpCircle = Builder( + name = "ArrowUpCircle", + defaultWidth = 24.0.dp, + defaultHeight = 24.0.dp, + viewportWidth = 24.0f, + viewportHeight = 24.0f + ).apply { + path( + fill = null, + stroke = SolidColor(Color(0xFF9f9f9f)), + strokeLineWidth = 1.5f, + strokeLineCap = Round, + strokeLineJoin = StrokeJoin.Round, + strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(12.0f, 7.5f) + verticalLineToRelative(9.0f) + moveToRelative(3.75f, -5.25f) + lineTo(12.0f, 7.5f) + lineToRelative(-3.75f, 3.75f) + } + path( + fill = null, + stroke = SolidColor(Color(0xFF9f9f9f)), + strokeLineWidth = 1.5f, + strokeLineCap = Butt, + strokeLineJoin = Miter, + strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(12.0f, 1.5f) + curveToRelative(5.799f, 0.0f, 10.5f, 4.701f, 10.5f, 10.5f) + reflectiveCurveTo(17.799f, 22.5f, 12.0f, 22.5f) + reflectiveCurveTo(1.5f, 17.799f, 1.5f, 12.0f) + reflectiveCurveTo(6.201f, 1.5f, 12.0f, 1.5f) + close() + } + }.build() + return _arrowUpCircle!! + } + +private var _arrowUpCircle: ImageVector? = null + +@Preview +@Composable +private fun Preview() { + Box { + Image( + imageVector = AppIcons.ArrowUpCircle, + contentDescription = null, + modifier = Modifier.size(250.dp) + ) + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/Settings.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/Settings.kt new file mode 100644 index 000000000..d3b95b998 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/icons/app/Settings.kt @@ -0,0 +1,122 @@ +/* + * 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 . + */ + +package com.infomaniak.swisstransfer.ui.icons.app + +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.EvenOdd +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.ImageVector.Builder +import androidx.compose.ui.graphics.vector.group +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 + +val AppIcons.Settings: ImageVector + get() { + if (_settings != null) { + return _settings!! + } + _settings = Builder( + name = "Settings", + defaultWidth = 24.0.dp, + defaultHeight = 24.0.dp, + viewportWidth = 24.0f, + viewportHeight = 24.0f + ).apply { + group { + path( + fill = SolidColor(Color(0xFF9f9f9f)), + stroke = null, + strokeLineWidth = 0.0f, + strokeLineCap = Butt, + strokeLineJoin = Miter, + strokeLineMiter = 4.0f, + pathFillType = EvenOdd + ) { + moveTo(20.17f, 0.0f) + curveToRelative(0.423f, 0.0f, 0.766f, 0.343f, 0.766f, 0.766f) + verticalLineToRelative(3.396f) + arcTo(3.83f, 3.83f, 0.0f, false, true, 24.0f, 7.915f) + arcToRelative(3.83f, 3.83f, 0.0f, false, true, -3.064f, 3.752f) + verticalLineToRelative(11.567f) + arcToRelative(0.766f, 0.766f, 0.0f, false, true, -1.532f, 0.0f) + verticalLineTo(11.667f) + arcToRelative(3.83f, 3.83f, 0.0f, false, true, -2.99f, -4.5f) + arcToRelative(3.83f, 3.83f, 0.0f, false, true, 2.99f, -3.005f) + verticalLineTo(0.766f) + curveTo(19.404f, 0.343f, 19.747f, 0.0f, 20.17f, 0.0f) + moveToRelative(-1.625f, 6.29f) + arcToRelative(2.299f, 2.299f, 0.0f, true, true, 3.251f, 3.251f) + arcToRelative(2.299f, 2.299f, 0.0f, false, true, -3.25f, -3.25f) + moveTo(3.83f, 0.0f) + curveToRelative(0.423f, 0.0f, 0.766f, 0.343f, 0.766f, 0.766f) + verticalLineToRelative(3.396f) + arcToRelative(3.83f, 3.83f, 0.0f, false, true, 0.0f, 7.505f) + verticalLineToRelative(11.567f) + arcToRelative(0.766f, 0.766f, 0.0f, false, true, -1.532f, 0.0f) + verticalLineTo(11.667f) + arcToRelative(3.83f, 3.83f, 0.0f, false, true, 0.0f, -7.505f) + verticalLineTo(0.766f) + curveTo(3.064f, 0.343f, 3.407f, 0.0f, 3.83f, 0.0f) + moveTo(2.205f, 6.29f) + arcToRelative(2.298f, 2.298f, 0.0f, true, true, 3.25f, 3.25f) + arcToRelative(2.298f, 2.298f, 0.0f, false, true, -3.25f, -3.25f) + moveTo(12.0f, 0.0f) + curveToRelative(0.423f, 0.0f, 0.766f, 0.343f, 0.766f, 0.766f) + verticalLineToRelative(11.636f) + arcToRelative(3.83f, 3.83f, 0.0f, false, true, 0.0f, 7.505f) + verticalLineToRelative(3.327f) + arcToRelative(0.766f, 0.766f, 0.0f, false, true, -1.532f, 0.0f) + verticalLineToRelative(-3.327f) + arcToRelative(3.83f, 3.83f, 0.0f, false, true, 0.0f, -7.505f) + verticalLineTo(0.766f) + curveTo(11.234f, 0.343f, 11.577f, 0.0f, 12.0f, 0.0f) + moveToRelative(-1.277f, 14.244f) + arcToRelative(2.3f, 2.3f, 0.0f, false, true, 2.043f, -0.256f) + arcToRelative(2.296f, 2.296f, 0.0f, false, true, 0.0f, 4.333f) + arcToRelative(2.298f, 2.298f, 0.0f, false, true, -2.043f, -4.077f) + } + } + }.build() + return _settings!! + } + +private var _settings: ImageVector? = null + +@Preview +@Composable +private fun Preview() { + Box { + Image( + imageVector = AppIcons.Settings, + contentDescription = null, + modifier = Modifier.size(250.dp) + ) + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationItem.kt index e3b516772..7f5857672 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationItem.kt @@ -19,14 +19,14 @@ package com.infomaniak.swisstransfer.ui.navigation import androidx.annotation.StringRes -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.filled.Send -import androidx.compose.material.icons.filled.Settings -import androidx.compose.material.icons.filled.Star import androidx.compose.material3.BottomAppBar import androidx.compose.material3.NavigationRail import androidx.compose.ui.graphics.vector.ImageVector import com.infomaniak.swisstransfer.R +import com.infomaniak.swisstransfer.ui.icons.AppIcons +import com.infomaniak.swisstransfer.ui.icons.app.ArrowDownCircle +import com.infomaniak.swisstransfer.ui.icons.app.ArrowUpCircle +import com.infomaniak.swisstransfer.ui.icons.app.Settings import com.infomaniak.swisstransfer.ui.navigation.MainNavigation.* /** @@ -40,7 +40,7 @@ enum class NavigationItem( val icon: ImageVector, val destination: MainNavigation, ) { - SENT(R.string.appName, Icons.AutoMirrored.Filled.Send, SentDestination), - RECEIVED(R.string.appName, Icons.Default.Star, ReceivedDestination), - SETTINGS(R.string.appName, Icons.Default.Settings, SettingsDestination), + SENT(R.string.sentTitle, AppIcons.ArrowUpCircle, SentDestination), + RECEIVED(R.string.receivedTitle, AppIcons.ArrowDownCircle, ReceivedDestination), + SETTINGS(R.string.settingsTitle, AppIcons.Settings, SettingsDestination), } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml new file mode 100644 index 000000000..3ed730b9a --- /dev/null +++ b/app/src/main/res/values-de/strings.xml @@ -0,0 +1,22 @@ + + + Received + Sent + Settings + diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml new file mode 100644 index 000000000..3ed730b9a --- /dev/null +++ b/app/src/main/res/values-es/strings.xml @@ -0,0 +1,22 @@ + + + Received + Sent + Settings + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml new file mode 100644 index 000000000..c9b45e348 --- /dev/null +++ b/app/src/main/res/values-fr/strings.xml @@ -0,0 +1,22 @@ + + + Recu + Envoyé + Paramètres + diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml new file mode 100644 index 000000000..3ed730b9a --- /dev/null +++ b/app/src/main/res/values-it/strings.xml @@ -0,0 +1,22 @@ + + + Received + Sent + Settings + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1e601be48..c8c90454d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,4 +1,4 @@ - - SwissTransfer + SwissTransfer Received Sent