update BottomNavigationBar styling, animations, and icons

This commit is contained in:
jonasgaudian
2026-02-16 23:38:40 +01:00
parent 0c54d6f9c5
commit dc629a54ef
2 changed files with 10 additions and 8 deletions

View File

@@ -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

View File

@@ -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<Screen> {
val items = mutableListOf<Screen>()
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()