From dc629a54ef64017eed60dcfef31ef74b7f7eab49 Mon Sep 17 00:00:00 2001 From: jonasgaudian <43753916+jonasgaudian@users.noreply.github.com> Date: Mon, 16 Feb 2026 23:38:40 +0100 Subject: [PATCH] update `BottomNavigationBar` styling, animations, and icons --- .../translator/view/composable/AppIcons.kt | 2 ++ .../view/composable/BottomNavigationBar.kt | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/gaudian/translator/view/composable/AppIcons.kt b/app/src/main/java/eu/gaudian/translator/view/composable/AppIcons.kt index 9ac5e15..99c0ee2 100644 --- a/app/src/main/java/eu/gaudian/translator/view/composable/AppIcons.kt +++ b/app/src/main/java/eu/gaudian/translator/view/composable/AppIcons.kt @@ -81,6 +81,7 @@ import androidx.compose.material.icons.filled.MenuBook import androidx.compose.material.icons.filled.Merge import androidx.compose.material.icons.filled.ModelTraining import androidx.compose.material.icons.filled.MonitorHeart +import androidx.compose.material.icons.filled.MoreHoriz import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material.icons.filled.NoteAdd import androidx.compose.material.icons.filled.PlayArrow @@ -202,6 +203,7 @@ object AppIcons { val Merge = Icons.Filled.Merge val ModelTraining = Icons.Filled.ModelTraining val More = Default.MoreVert + val MoreHorizontal = Icons.Filled.MoreHoriz val MoreVert = Default.MoreVert val MoveTo = Icons.AutoMirrored.Filled.DriveFileMove val Paste = Default.ContentPaste diff --git a/app/src/main/java/eu/gaudian/translator/view/composable/BottomNavigationBar.kt b/app/src/main/java/eu/gaudian/translator/view/composable/BottomNavigationBar.kt index 6ab222f..f634357 100644 --- a/app/src/main/java/eu/gaudian/translator/view/composable/BottomNavigationBar.kt +++ b/app/src/main/java/eu/gaudian/translator/view/composable/BottomNavigationBar.kt @@ -76,7 +76,7 @@ sealed class Screen( object Library : Screen("library", R.string.label_library, AppIcons.VocabularyFilled, AppIcons.VocabularyOutlined) object Vocabulary : Screen("vocabulary", R.string.label_legacy_vocabulary, AppIcons.VocabularyFilled, AppIcons.VocabularyOutlined) object Settings : Screen("settings", R.string.title_settings, AppIcons.SettingsFilled, AppIcons.SettingsOutlined) - object More : Screen("more", R.string.label_more, AppIcons.MoreVert, AppIcons.MoreVert) + object More : Screen("more", R.string.label_more, AppIcons.MoreVert, AppIcons.MoreHorizontal) object Dictionary : Screen("dictionary", R.string.label_dictionary, AppIcons.DictionaryFilled, AppIcons.DictionaryOutlined) object Exercises : Screen("exercises", R.string.label_exercises, AppIcons.DictionaryFilled, AppIcons.DictionaryOutlined) @@ -88,7 +88,7 @@ sealed class Screen( fun getMoreMenuItems(showExperimental: Boolean = false): List { val items = mutableListOf() items.add(Translation) - items.add(Vocabulary) // Legacy vocabulary moved to More + items.add(Vocabulary) items.add(Dictionary) items.add(Settings) if (showExperimental) { @@ -128,20 +128,20 @@ fun BottomNavigationBar( // Configuration for the play button val playButtonSize = 56.dp - val glowPadding = 32.dp // Total extra space for the glow (16dp on each side) + val glowPadding = 12.dp // Total extra space for the glow (16dp on each side) // This dictates how far up the button shifts. // Setting it to around half the button size centers it on the top border. - val upwardOffset = 28.dp + val upwardOffset = 16.dp AnimatedVisibility( visible = isVisible, enter = slideInVertically( - animationSpec = spring(stiffness = Spring.StiffnessMediumLow), + animationSpec = spring(stiffness = Spring.StiffnessHigh), initialOffsetY = { it } ), exit = slideOutVertically( - animationSpec = spring(stiffness = Spring.StiffnessMediumLow), + animationSpec = spring(stiffness = Spring.StiffnessHigh), targetOffsetY = { it } ) ) { @@ -260,7 +260,7 @@ fun BottomNavigationBar( .background( brush = Brush.radialGradient( colors = listOf( - Color(0xFF3B82F6).copy(alpha = 0.5f), + MaterialTheme.colorScheme.primary.copy(alpha = 0.5f), Color.Transparent ) ), @@ -273,7 +273,7 @@ fun BottomNavigationBar( modifier = Modifier .size(playButtonSize) .clip(CircleShape) - .background(Color(0xFF3B82F6)) + .background(MaterialTheme.colorScheme.primaryContainer) .clickable { haptic.performHapticFeedback(HapticFeedbackType.LongPress) onPlayClicked()