diff --git a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt b/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt index c9af6d1a..7e3e7cdc 100644 --- a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt +++ b/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt @@ -22,18 +22,14 @@ import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.animateContentSize import androidx.compose.animation.core.LinearEasing import androidx.compose.animation.core.RepeatMode -import androidx.compose.animation.core.Spring import androidx.compose.animation.core.animateFloat import androidx.compose.animation.core.infiniteRepeatable import androidx.compose.animation.core.rememberInfiniteTransition -import androidx.compose.animation.core.spring import androidx.compose.animation.core.tween -import androidx.compose.animation.expandVertically import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.animation.scaleIn import androidx.compose.animation.scaleOut -import androidx.compose.animation.shrinkVertically import androidx.compose.animation.slideInHorizontally import androidx.compose.animation.slideOutHorizontally import androidx.compose.animation.togetherWith @@ -67,6 +63,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.TransformOrigin import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource @@ -346,14 +343,18 @@ fun MainScreen(navigateToRadar: () -> Unit = {}) { } } } - // More-menu popup panel (overlays content above the bottom bar; spring bounce) + // More-menu popup panel (slim strip anchored to the bottom-right corner) AnimatedVisibility( visible = moreExpanded, modifier = Modifier.fillMaxSize(), - enter = expandVertically( - animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy) - ) + fadeIn(), - exit = shrinkVertically() + fadeOut() + enter = scaleIn( + animationSpec = tween(150), + transformOrigin = TransformOrigin(1f, 1f) + ) + fadeIn(animationSpec = tween(150)), + exit = scaleOut( + animationSpec = tween(120), + transformOrigin = TransformOrigin(1f, 1f) + ) + fadeOut(animationSpec = tween(120)) ) { MoreMenuPopup( items = moreNavItems, diff --git a/app/src/main/java/com/rtbishop/look4sat/MoreMenuPopup.kt b/app/src/main/java/com/rtbishop/look4sat/MoreMenuPopup.kt index 8a34dc5b..cb7d556b 100644 --- a/app/src/main/java/com/rtbishop/look4sat/MoreMenuPopup.kt +++ b/app/src/main/java/com/rtbishop/look4sat/MoreMenuPopup.kt @@ -1,13 +1,13 @@ /* * MoreMenuPopup.kt - bottom-nav "More" second-level menu popup panel (4.5.1). * - * Overlays the content area (above the bottom bar, right-aligned), vertical menu items (icon+text+arrow), - * current page highlighted; tap the scrim to close, tap an item to navigate. Open/close animation is driven by the caller - * (MainScreen's AnimatedVisibility + spring). + * A slim right-aligned strip above the bottom bar, vertical menu items (icon+text+arrow), + * current page highlighted; tap outside to close, tap an item to navigate. No dimming scrim, so the + * page stays readable. Open/close animation is driven by the caller (MainScreen's AnimatedVisibility). */ package com.rtbishop.look4sat -import androidx.compose.foundation.background +import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults @@ -45,16 +46,22 @@ fun MoreMenuPopup( Box( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.scrim.copy(alpha = 0.35f)) + // Transparent catcher: taps outside the card dismiss the menu without + // dimming the page behind it. .clickable(onClick = onDismiss) ) { Card( modifier = Modifier .align(Alignment.BottomEnd) - .padding(12.dp), + .padding(12.dp) + .widthIn(max = 232.dp) + // Swallow taps on the card so they do not reach the dismiss + // catcher underneath. + .clickable(enabled = false) {}, shape = RoundedCornerShape(12.dp), + border = BorderStroke(1.dp, MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.6f)), colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceContainerHigh + containerColor = MaterialTheme.colorScheme.surfaceContainer ) ) { Column(modifier = Modifier.padding(vertical = 4.dp)) { diff --git a/feature/cw/src/main/java/com/rtbishop/look4sat/feature/cw/CwDecodeScreen.kt b/feature/cw/src/main/java/com/rtbishop/look4sat/feature/cw/CwDecodeScreen.kt index 636f109f..47679430 100644 --- a/feature/cw/src/main/java/com/rtbishop/look4sat/feature/cw/CwDecodeScreen.kt +++ b/feature/cw/src/main/java/com/rtbishop/look4sat/feature/cw/CwDecodeScreen.kt @@ -77,7 +77,7 @@ import com.rtbishop.look4sat.core.presentation.R as CoreR * 400-1200 Hz window and tracks speed on its own, so there is nothing to tune. */ @Composable -fun CwDecodeScreen(navigateUp: () -> Unit = {}) { +fun CwDecodeScreen() { val context = LocalContext.current val container = remember { (context.applicationContext as IContainerProvider).getMainContainer() } val decoder = remember { container.provideCwDecoder() } @@ -95,9 +95,7 @@ fun CwDecodeScreen(navigateUp: () -> Unit = {}) { val decodedText by decoder.decodedText.collectAsState() val historyText by decoder.historyText.collectAsState() - val estimatedPitch by decoder.estimatedPitch.collectAsState() val signalStrength by decoder.signalStrength.collectAsState() - val inferenceMs by decoder.lastInferenceMs.collectAsState() val errorMessage by decoder.errorMessage.collectAsState() val permissionLauncher = rememberLauncherForActivityResult( @@ -139,27 +137,13 @@ fun CwDecodeScreen(navigateUp: () -> Unit = {}) { .padding(horizontal = 4.dp, vertical = 2.dp), verticalAlignment = Alignment.CenterVertically ) { - IconButton(onClick = { isListening = false; navigateUp() }) { - Icon( - painter = painterResource(CoreR.drawable.ic_back), - contentDescription = stringResource(R.string.cw_back) - ) - } - Column(modifier = Modifier.weight(1f)) { - Text( - text = stringResource(CoreR.string.nav_cw), - style = MaterialTheme.typography.titleMedium - ) - Text( - text = if (estimatedPitch != null) { - stringResource(R.string.cw_status_tone, estimatedPitch!!.toInt(), inferenceMs) - } else { - stringResource(R.string.cw_status_listening) - }, - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant - ) - } + Text( + text = stringResource(CoreR.string.nav_cw), + style = MaterialTheme.typography.titleMedium, + modifier = Modifier + .weight(1f) + .padding(start = 12.dp) + ) IconButton(onClick = { isListening = !isListening }) { Icon( painter = painterResource( diff --git a/feature/cw/src/main/res/values-id/app_values.xml b/feature/cw/src/main/res/values-id/app_values.xml index 79ffa13c..6c1d91e8 100644 --- a/feature/cw/src/main/res/values-id/app_values.xml +++ b/feature/cw/src/main/res/values-id/app_values.xml @@ -1,11 +1,8 @@ - Kembali Jeda pendekodean Lanjutkan pendekodean Hapus teks hasil dekode - Mendengarkan… - %1$d Hz · %2$d ms Izin mikrofon diperlukan untuk pendekodean CW Berikan izin Buka pengaturan aplikasi diff --git a/feature/cw/src/main/res/values-in/app_values.xml b/feature/cw/src/main/res/values-in/app_values.xml index 79ffa13c..6c1d91e8 100644 --- a/feature/cw/src/main/res/values-in/app_values.xml +++ b/feature/cw/src/main/res/values-in/app_values.xml @@ -1,11 +1,8 @@ - Kembali Jeda pendekodean Lanjutkan pendekodean Hapus teks hasil dekode - Mendengarkan… - %1$d Hz · %2$d ms Izin mikrofon diperlukan untuk pendekodean CW Berikan izin Buka pengaturan aplikasi diff --git a/feature/cw/src/main/res/values-tr/app_values.xml b/feature/cw/src/main/res/values-tr/app_values.xml index 5c603610..78782bd5 100644 --- a/feature/cw/src/main/res/values-tr/app_values.xml +++ b/feature/cw/src/main/res/values-tr/app_values.xml @@ -1,11 +1,8 @@ - Geri Çözmeyi duraklat Çözmeyi sürdür Çözülen metni temizle - Dinleniyor… - %1$d Hz · %2$d ms CW çözümü için mikrofon izni gerekli İzin ver Uygulama ayarlarını aç diff --git a/feature/cw/src/main/res/values-zh/app_values.xml b/feature/cw/src/main/res/values-zh/app_values.xml index 4039395c..636a2008 100644 --- a/feature/cw/src/main/res/values-zh/app_values.xml +++ b/feature/cw/src/main/res/values-zh/app_values.xml @@ -1,11 +1,8 @@ - 返回 暂停解码 继续解码 清空解码文本 - 正在监听… - %1$d Hz · %2$d 毫秒 CW 解码需要麦克风权限 授予权限 打开应用设置 diff --git a/feature/cw/src/main/res/values/app_values.xml b/feature/cw/src/main/res/values/app_values.xml index fcadbd43..5ce264a5 100644 --- a/feature/cw/src/main/res/values/app_values.xml +++ b/feature/cw/src/main/res/values/app_values.xml @@ -1,11 +1,8 @@ - Back Pause decoding Resume decoding Clear decoded text - Listening… - %1$d Hz · %2$d ms Microphone permission is required for CW decoding Grant permission Open app settings