Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.getcode.ui.components.CircularIconButton
import dev.chrisbanes.haze.HazeState

/**
* The Scan tab's gallery entry point, in the scanner's top-right corner.
* The Scan tab's gallery entry point, in the scanner's bottom-right corner.
*
* `PickVisualMedia` runs out of process, so tapping this never asks for a permission -- which is
* what lets the glyph be a plain static icon rather than a permission prompt with an icon on it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.net.Uri
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand All @@ -17,6 +16,7 @@ import androidx.compose.ui.platform.LocalResources
import androidx.compose.ui.platform.testTag
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.flipcash.app.core.android.extensions.launchAppSettings
import com.flipcash.app.core.navigation.LocalTabBarPadding
import com.flipcash.app.scanner.internal.GalleryScanButton
import com.flipcash.app.session.LocalSessionController
import com.flipcash.app.updates.LocalAppUpdater
Expand All @@ -37,7 +37,7 @@ import dev.chrisbanes.haze.rememberHazeState
* The scanner surface: the camera preview (via [scannerView]) and its permission states. Bills are
* not drawn here — a presented bill renders at the app root
* ([com.flipcash.app.bills.BillOverlay]) so it can appear over any screen. The only in-screen
* chrome is the gallery button in the top-right corner; the tab bar is hoisted to the app root.
* chrome is the gallery button in the bottom-right corner; the tab bar is hoisted to the app root.
*/
@Composable
internal fun ScannableContainer(
Expand Down Expand Up @@ -132,13 +132,19 @@ internal fun ScannableContainer(
GalleryScanButton(
onImagePicked = onImagePicked,
hazeState = hazeState,
// Top-right, clear of the status bar. This corner rather than the bottom because
// the bottom belongs to the hoisted tab bar, and a control down there has to be
// positioned around a bar this screen does not own.
// Bottom-right, its end edge on the tab bar's. The bar is hoisted to the app root
// and this screen does not own it, so both numbers are read off the bar rather than
// chosen here: `AppNavigationBar` insets the bar by `grid.x8` horizontally, which is
// what "aligned with the bar's end" means; the clearance above it is the bar's
// measured height, handed down per tab-home entry as `LocalTabBarPadding` by
// `NavTabBarInsetEntryDecorator`, plus the same gap the bar leaves below itself.
modifier = Modifier
.align(Alignment.TopEnd)
.statusBarsPadding()
.padding(CodeTheme.dimens.inset)
.align(Alignment.BottomEnd)
.padding(
end = CodeTheme.dimens.grid.x8,
bottom = LocalTabBarPadding.current.calculateBottomPadding() +
CodeTheme.dimens.grid.x3,
)
)
}
}
Expand Down
Loading