Skip to content

Commit 93e91b5

Browse files
committed
fix(android, navigation): glitch when change screen
1 parent fa7b312 commit 93e91b5

File tree

1 file changed

+19
-11
lines changed
  • core/shared-ui/src/commonMain/kotlin/com/neoutils/neoregex/core/sharedui/component

1 file changed

+19
-11
lines changed

core/shared-ui/src/commonMain/kotlin/com/neoutils/neoregex/core/sharedui/component/Navigation.kt

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,26 @@
1919
package com.neoutils.neoregex.core.sharedui.component
2020

2121
import androidx.compose.animation.*
22+
import androidx.compose.foundation.Image
2223
import androidx.compose.foundation.clickable
2324
import androidx.compose.foundation.layout.*
2425
import androidx.compose.foundation.shape.RoundedCornerShape
2526
import androidx.compose.material.icons.Icons
26-
import androidx.compose.material.icons.outlined.KeyboardArrowDown
27-
import androidx.compose.material3.*
27+
import androidx.compose.material.icons.rounded.KeyboardArrowDown
28+
import androidx.compose.material3.DropdownMenu
29+
import androidx.compose.material3.DropdownMenuItem
30+
import androidx.compose.material3.MaterialTheme
31+
import androidx.compose.material3.MaterialTheme.colorScheme
32+
import androidx.compose.material3.Text
2833
import androidx.compose.runtime.*
2934
import androidx.compose.ui.Alignment
3035
import androidx.compose.ui.Modifier
3136
import androidx.compose.ui.draw.clip
37+
import androidx.compose.ui.graphics.ColorFilter
3238
import androidx.compose.ui.text.TextStyle
3339
import androidx.compose.ui.unit.dp
3440
import androidx.lifecycle.compose.collectAsStateWithLifecycle
35-
import com.neoutils.neoregex.core.designsystem.theme.NeoTheme
41+
import com.neoutils.neoregex.core.designsystem.theme.NeoTheme.dimensions
3642
import com.neoutils.neoregex.core.dispatcher.model.Navigation
3743
import com.neoutils.neoregex.core.dispatcher.navigator.NavigationManager
3844
import kotlinx.coroutines.launch
@@ -68,25 +74,27 @@ fun Navigation(
6874

6975
Row(
7076
modifier = Modifier
71-
.clip(RoundedCornerShape(NeoTheme.dimensions.tiny))
72-
.clickable(canSelectScreen) { expanded.value = true }
73-
.padding(NeoTheme.dimensions.tiny),
77+
.clip(RoundedCornerShape(dimensions.tiny))
78+
.clickable(canSelectScreen) { expanded.value = true },
7479
verticalAlignment = Alignment.CenterVertically,
7580
) {
76-
7781
Text(
7882
text = stringResource(current.title),
79-
style = mergedTextStyle
83+
style = mergedTextStyle,
84+
modifier = Modifier
85+
.padding(vertical = dimensions.tiny)
86+
.padding(start = dimensions.tiny)
8087
)
8188

8289
AnimatedVisibility(
8390
visible = canSelectScreen,
8491
enter = fadeIn() + slideInHorizontally(),
8592
exit = fadeOut() + slideOutHorizontally(),
8693
) {
87-
Icon(
88-
imageVector = Icons.Outlined.KeyboardArrowDown,
89-
modifier = Modifier.size(18.dp),
94+
Image(
95+
imageVector = Icons.Rounded.KeyboardArrowDown,
96+
colorFilter = ColorFilter.tint(colorScheme.onSurface),
97+
modifier = Modifier.size(24.dp),
9098
contentDescription = null
9199
)
92100
}

0 commit comments

Comments
 (0)