Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/flipcash/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ dependencies {

implementation(project(":apps:flipcash:core"))
implementation(project(":apps:flipcash:shared:accesskey"))
implementation(project(":apps:flipcash:shared:bills"))
implementation(project(":apps:flipcash:shared:analytics"))
implementation(project(":apps:flipcash:shared:appsettings"))
implementation(project(":apps:flipcash:shared:appupdates"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import com.getcode.navigation.results.rememberNavResultStateRegistry
import com.getcode.navigation.scenes.ModalBottomSheetSceneStrategy
import com.getcode.navigation.scrim.LocalScrimController
import com.getcode.navigation.scrim.ScrimController
import com.flipcash.app.bills.BillOverlay
import com.getcode.navigation.scrim.ScrimOverlay
import com.getcode.theme.CodeTheme
import com.getcode.ui.biometrics.LocalBiometricsState
Expand Down Expand Up @@ -223,6 +224,11 @@ internal fun App(
}

ScrimOverlay(scrimController)

// Bills render at the app root (not inside the scanner) so a
// presented bill appears over any screen. Reads the app-scoped
// billState via LocalSessionController.
BillOverlay()
}

val emailCodeChannel = LocalEmailCodeChannel.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
Expand All @@ -25,9 +26,12 @@ import com.flipcash.app.core.ui.NavigationBar
import com.flipcash.app.core.ui.rememberNavigationBarState
import com.flipcash.app.featureflags.FeatureFlag
import com.flipcash.app.featureflags.LocalFeatureFlags
import com.flipcash.app.session.LocalSessionController
import com.getcode.manager.BottomBarManager
import com.getcode.navigation.core.CodeNavigator
import com.getcode.theme.CodeTheme
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map

/**
* The hoisted v2 navigation bar — root chrome, not owned by any screen. It renders over whichever
Expand Down Expand Up @@ -55,13 +59,20 @@ internal fun AppNavigationBar(
// while one is showing so it sits below the modal instead of floating over it.
val bottomBarMessages by BottomBarManager.messages.collectAsStateWithLifecycle()

// A bill/tip card renders at the app root above everything; hide the bar so it doesn't show
// beneath the presented bill.
val session = LocalSessionController.current
val billUp by remember(session) {
session?.billState?.map { it.bill != null } ?: flowOf(false)
}.collectAsStateWithLifecycle(initialValue = false)

Box(
modifier = Modifier
.then(modifier),
contentAlignment = Alignment.BottomCenter,
) {
AnimatedVisibility(
visible = topTab != null && bottomBarMessages.isEmpty(),
visible = topTab != null && bottomBarMessages.isEmpty() && !billUp,
enter = slideInVertically { it } + fadeIn(),
exit = slideOutVertically { it } + fadeOut(),
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.flipcash.app.scanner.internal

import android.annotation.SuppressLint
import androidx.camera.view.PreviewView
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -64,9 +63,6 @@ internal fun Scanner() {
var isPinching by remember { mutableStateOf(false) }
var zoomRatio by remember { mutableFloatStateOf(1f) }

// Exposed by CodeScanner so the tip card can snapshot the live feed for its blurred backdrop.
var previewView by remember { mutableStateOf<PreviewView?>(null) }

LaunchedEffect(biometricsState, previewing) {
if (previewing == true) {
focusManager.clearFocus()
Expand All @@ -84,7 +80,6 @@ internal fun Scanner() {
isPaused = isPaused,
isPinching = isPinching,
zoomRatio = zoomRatio,
previewView = previewView,
onAction = {
when (it) {
ScannerDecorItem.Give -> {
Expand Down Expand Up @@ -116,7 +111,6 @@ internal fun Scanner() {
cameraAvailable = true
previewing = it
},
onPreviewViewChanged = { previewView = it },
onCodeScanned = { result ->
when (result) {
is CodeScanResult.QrCode -> {
Expand Down
Loading
Loading