Skip to content

Commit 9108a4f

Browse files
committed
refactor: Update icons and text in TopLevelDestination enum
1 parent 4434dc5 commit 9108a4f

File tree

5 files changed

+23
-44
lines changed

5 files changed

+23
-44
lines changed

app/src/main/kotlin/com/espressodev/gptmap/navigation/TopLevelDestination.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ enum class TopLevelDestination(
1212
@StringRes val contentDesc: Int,
1313
) {
1414
FAVOURITE(
15-
GmIcons.FavouriteFilled,
16-
GmIcons.FavouriteOutlined,
17-
AppText.favourite
15+
GmIcons.BookmarkFilled,
16+
GmIcons.BookmarkOutlined,
17+
AppText.saved
1818
),
1919
MAP(
2020
GmIcons.ExploreFilled,
2121
GmIcons.ExploreOutlined,
22-
AppText.map
22+
AppText.explore
2323
),
2424
SCREENSHOT_GALLERY(
2525
GmIcons.ScreenshotFilled,
2626
GmIcons.ScreenshotOutlined,
27-
AppText.screenshot_gallery
27+
AppText.gallery
2828
)
2929
}

core/designsystem/src/main/kotlin/com/espressodev/gptmap/core/designsystem/GmIcons.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.espressodev.gptmap.core.designsystem
22

33
import androidx.compose.material.icons.Icons
4+
import androidx.compose.material.icons.filled.Bookmark
45
import androidx.compose.material.icons.filled.Camera
56
import androidx.compose.material.icons.filled.CheckCircle
67
import androidx.compose.material.icons.filled.Clear
@@ -15,6 +16,8 @@ import androidx.compose.material.icons.filled.Search
1516
import androidx.compose.material.icons.filled.Title
1617
import androidx.compose.material.icons.outlined.AccountCircle
1718
import androidx.compose.material.icons.outlined.ArrowBack
19+
import androidx.compose.material.icons.outlined.Bookmark
20+
import androidx.compose.material.icons.outlined.BookmarkBorder
1821
import androidx.compose.material.icons.outlined.Cancel
1922
import androidx.compose.material.icons.outlined.Delete
2023
import androidx.compose.material.icons.outlined.Email
@@ -61,6 +64,7 @@ object GmIcons {
6164
val NavigateNextDefault = Icons.Outlined.NavigateNext
6265
val ExploreOutlined = Icons.Outlined.Explore
6366
val ExploreFilled = Icons.Filled.Explore
64-
val ApproveFilled = Icons.Filled.CheckCircle
6567
val DeleteOutlined = Icons.Outlined.Delete
68+
val BookmarkOutlined = Icons.Outlined.BookmarkBorder
69+
val BookmarkFilled = Icons.Filled.Bookmark
6670
}

core/designsystem/src/main/kotlin/com/espressodev/gptmap/core/designsystem/component/Button.kt

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import androidx.compose.animation.core.VectorConverter
77
import androidx.compose.animation.core.spring
88
import androidx.compose.foundation.Image
99
import androidx.compose.foundation.gestures.detectDragGestures
10-
import androidx.compose.foundation.interaction.MutableInteractionSource
1110
import androidx.compose.foundation.layout.PaddingValues
1211
import androidx.compose.foundation.layout.Spacer
1312
import androidx.compose.foundation.layout.defaultMinSize
@@ -18,18 +17,14 @@ import androidx.compose.foundation.layout.width
1817
import androidx.compose.foundation.shape.CircleShape
1918
import androidx.compose.foundation.shape.RoundedCornerShape
2019
import androidx.compose.material3.Button
21-
import androidx.compose.material3.ElevatedButton
2220
import androidx.compose.material3.ExtendedFloatingActionButton
23-
import androidx.compose.material3.FilledTonalIconButton
2421
import androidx.compose.material3.FloatingActionButton
22+
import androidx.compose.material3.FloatingActionButtonDefaults
2523
import androidx.compose.material3.Icon
26-
import androidx.compose.material3.IconButtonColors
27-
import androidx.compose.material3.IconButtonDefaults
2824
import androidx.compose.material3.MaterialTheme
2925
import androidx.compose.material3.Surface
3026
import androidx.compose.material3.Text
3127
import androidx.compose.runtime.Composable
32-
import androidx.compose.runtime.ReadOnlyComposable
3328
import androidx.compose.runtime.remember
3429
import androidx.compose.runtime.rememberCoroutineScope
3530
import androidx.compose.ui.Alignment
@@ -38,7 +33,6 @@ import androidx.compose.ui.Modifier
3833
import androidx.compose.ui.draw.clip
3934
import androidx.compose.ui.geometry.Offset
4035
import androidx.compose.ui.graphics.Color
41-
import androidx.compose.ui.graphics.Shape
4236
import androidx.compose.ui.graphics.vector.ImageVector
4337
import androidx.compose.ui.input.pointer.pointerInput
4438
import androidx.compose.ui.platform.LocalConfiguration
@@ -50,35 +44,9 @@ import androidx.compose.ui.unit.Dp
5044
import androidx.compose.ui.unit.IntOffset
5145
import androidx.compose.ui.unit.dp
5246
import androidx.compose.ui.zIndex
53-
import com.espressodev.gptmap.core.designsystem.GmIcons
5447
import com.espressodev.gptmap.core.designsystem.IconType
5548
import kotlinx.coroutines.launch
5649
import kotlin.math.roundToInt
57-
import com.espressodev.gptmap.core.designsystem.R.string as AppText
58-
59-
@OptIn(ExperimentalComposeUiApi::class)
60-
@Composable
61-
fun MapSearchButton(
62-
onClick: () -> Unit,
63-
buttonEnabledState: Boolean,
64-
modifier: Modifier = Modifier,
65-
icon: ImageVector = GmIcons.SearchDefault,
66-
shape: Shape = RoundedCornerShape(16.dp),
67-
) {
68-
val keyboardController = LocalSoftwareKeyboardController.current
69-
Button(
70-
shape = shape,
71-
enabled = buttonEnabledState,
72-
onClick = {
73-
keyboardController?.hide()
74-
onClick()
75-
},
76-
contentPadding = PaddingValues(0.dp),
77-
modifier = modifier.size(56.dp)
78-
) {
79-
Icon(icon, stringResource(id = AppText.search))
80-
}
81-
}
8250

8351
@Composable
8452
fun ExtFloActionButton(
@@ -182,9 +150,9 @@ fun GmDraggableButton(
182150
FloatingActionButton(
183151
onClick = onClick,
184152
containerColor = MaterialTheme.colorScheme.primaryContainer.copy(alpha = 0.7f),
185-
contentColor = MaterialTheme.colorScheme.onPrimaryContainer,
153+
elevation = FloatingActionButtonDefaults.elevation(0.dp, 0.dp, 0.dp, 0.dp),
186154
modifier = modifier
187-
.zIndex(4f)
155+
.zIndex(1f)
188156
.offset { IntOffset(offset.value.x.roundToInt(), offset.value.y.roundToInt()) }
189157
.pointerInput(Unit) {
190158
detectDragGestures(
@@ -235,7 +203,7 @@ fun SquareButton(
235203
contentPaddings: PaddingValues = PaddingValues(0.dp),
236204
size: Dp = 56.dp,
237205
) {
238-
ElevatedButton(
206+
Button(
239207
onClick = onClick,
240208
modifier = modifier.size(size),
241209
shape = shape,

core/designsystem/src/main/kotlin/com/espressodev/gptmap/core/designsystem/component/Dialog.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import androidx.compose.material3.Icon
66
import androidx.compose.material3.Text
77
import androidx.compose.material3.TextButton
88
import androidx.compose.runtime.Composable
9+
import androidx.compose.runtime.LaunchedEffect
910
import androidx.compose.runtime.mutableStateOf
1011
import androidx.compose.runtime.saveable.rememberSaveable
1112
import androidx.compose.ui.Modifier
@@ -19,8 +20,8 @@ fun GmAlertDialog(
1920
@StringRes title: Int,
2021
onConfirm: () -> Unit,
2122
onDismiss: () -> Unit,
22-
text: @Composable () -> Unit,
2323
modifier: Modifier = Modifier,
24+
text: @Composable (() -> Unit)? = null,
2425
icon: ImageVector? = null,
2526
) {
2627
val dialogIcon: @Composable (() -> Unit)? = when (icon) {
@@ -53,6 +54,11 @@ fun GmEditAlertDialog(
5354
) {
5455
val (text, onValueChange) = rememberSaveable { mutableStateOf("") }
5556
val (isError, setIsError) = rememberSaveable { mutableStateOf(value = false) }
57+
58+
LaunchedEffect(text.isNotEmpty()) {
59+
if (text.isNotBlank()) setIsError(false)
60+
}
61+
5662
GmAlertDialog(
5763
title = title,
5864
onConfirm = {

core/designsystem/src/main/kotlin/com/espressodev/gptmap/core/designsystem/component/TopAppBar.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ fun GmTopAppBar(
9595
IconButton(onClick = onDeleteClick) {
9696
Icon(
9797
imageVector = GmIcons.DeleteOutlined,
98-
contentDescription = stringResource(id = AppText.delete)
98+
contentDescription = stringResource(id = AppText.delete),
99+
tint = MaterialTheme.colorScheme.error
99100
)
100101
}
101102
}

0 commit comments

Comments
 (0)