Skip to content

Commit

Permalink
Simplification of Images usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Sep 3, 2024
1 parent f58452c commit bad2679
Show file tree
Hide file tree
Showing 42 changed files with 178 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Camera
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Camera
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.illu.LogoInfomaniak
import com.infomaniak.swisstransfer.ui.icons.illu.LogoSwissTransfer
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus
import com.infomaniak.swisstransfer.ui.images.illus.LogoInfomaniak
import com.infomaniak.swisstransfer.ui.images.illus.LogoSwissTransfer
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
Expand All @@ -46,11 +46,11 @@ fun BrandTobAppBar() {
),
title = {
Row(verticalAlignment = Alignment.CenterVertically) {
Image(imageVector = AppIcons.Illu.LogoInfomaniak, contentDescription = null)
Image(imageVector = AppIllus.LogoInfomaniak, contentDescription = null)
Spacer(modifier = Modifier.width(Margin.Medium))
VerticalDivider(modifier = Modifier.height(Margin.Large), color = SwissTransferTheme.colors.toolbarTextColor)
Spacer(modifier = Modifier.width(Margin.Medium))
Image(imageVector = AppIcons.Illu.LogoSwissTransfer, contentDescription = null)
Image(imageVector = AppIllus.LogoSwissTransfer, contentDescription = null)
Spacer(modifier = Modifier.width(Margin.Small))
Text(text = stringResource(id = R.string.appName), color = SwissTransferTheme.colors.toolbarTextColor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Add
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Add
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.Shapes
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.illu.ArrowCurvedDownright
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus
import com.infomaniak.swisstransfer.ui.images.illus.ArrowCurvedDownright
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

Expand Down Expand Up @@ -115,7 +115,7 @@ private fun BottomSheetDefaultsPreview() {
SwissTransferTheme {
Surface {
BottomSheetContent(
imageVector = AppIcons.Illu.ArrowCurvedDownright,
imageVector = AppIllus.ArrowCurvedDownright,
titleRes = R.string.appName,
descriptionRes = R.string.sentEmptyTitle,
content = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Add
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Add
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.Shapes
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Add
import com.infomaniak.swisstransfer.ui.icons.app.ArrowLeft
import com.infomaniak.swisstransfer.ui.icons.app.Cross
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Add
import com.infomaniak.swisstransfer.ui.images.icons.ArrowLeft
import com.infomaniak.swisstransfer.ui.images.icons.Cross
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
import com.infomaniak.swisstransfer.ui.utils.PreviewTablet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.swisstransfer.ui.icons
package com.infomaniak.swisstransfer.ui.images

import androidx.compose.ui.unit.dp

object AppIcons {
object Illu
object AppImages {
object AppIcons
object AppIllus

val previewSize = 250.dp
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -16,7 +16,8 @@ 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
import com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.Add: ImageVector
get() {
Expand Down Expand Up @@ -59,7 +60,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Add,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -34,7 +34,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.ArrowDownCircle: ImageVector
get() {
Expand Down Expand Up @@ -93,7 +94,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.ArrowDownCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -15,7 +15,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.ArrowLeft: ImageVector
get() {
Expand Down Expand Up @@ -58,7 +59,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.ArrowLeft,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -34,7 +34,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.ArrowUpCircle: ImageVector
get() {
Expand Down Expand Up @@ -93,7 +94,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.ArrowUpCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -13,7 +13,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound

Expand Down Expand Up @@ -66,7 +67,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Bell,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -17,7 +17,8 @@ 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
import com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.BlackAndWhiteCircle: ImageVector
get() {
Expand Down Expand Up @@ -100,7 +101,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.BlackAndWhiteCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -15,7 +15,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.BlackCircle: ImageVector
get() {
Expand Down Expand Up @@ -60,7 +61,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.BlackCircle,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -15,7 +15,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.Camera: ImageVector
get() {
Expand Down Expand Up @@ -116,7 +117,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Camera,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -13,7 +13,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound

Expand Down Expand Up @@ -56,7 +57,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Checkmark,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -13,7 +13,8 @@ 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 com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound

Expand Down Expand Up @@ -58,7 +59,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.ChevronRightSmall,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -14,7 +14,8 @@ 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
import com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import androidx.compose.ui.graphics.StrokeCap.Companion.Round as strokeCapRound
import androidx.compose.ui.graphics.StrokeJoin.Companion.Round as strokeJoinRound

Expand Down Expand Up @@ -63,7 +64,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Clock,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize),
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Loading

0 comments on commit bad2679

Please sign in to comment.