Let users choose which available camera type the scanner opens with.
Keep the existing overflow camera switch temporary, while persisting
only the startup preference. Populate the setting from available
camera types and fall back to the current back-camera behavior by
default.
Both features used ?attr/colorSurface as the base layer of
a layer-list drawable set as android:windowBackground. That
attribute is resolved during drawable inflation, before the
theme is fully attached on certain GPU drivers. This is the
root cause of the rendering glitches reported since 1.73.0
in #655.
The proper fix for Material You is to reference ?attr/colorSurface
directly in the theme style, where the framework resolves it
at Activity level. But both backgrounds were layer-lists (color
and bitmap), so keeping them would have required moving the bitmaps
out of the window background and into every affected layout. Which
would have been a significant churn for purely decorative elements.
Removing them is the simpler and more correct outcome: the theme
now sets android:windowBackground to ?attr/colorSurface directly,
which works reliably everywhere and honours Material You dynamic
colours without workarounds.
On SDK < 35 the parent's fitsSystemWindows already shrinks the
FAB container above the soft keyboard, because the deprecated
systemWindowInsets include the IME there.
Adding the IME inset to the container as well lifted the FAB
twice, placing it about twice as high as needed.
Only apply the IME inset on SDK 35+, where the window is
edge-to-edge and the parent is not resized for the keyboard.
The inset listener applied the status bar padding only once,
guarded by a paddingTop == 0 check, and grew the toolbar height
incrementally. When the first callback reported wrong insets the
layout stayed stuck with stale values, so affected devices only
settled after several rotations.
Recompute the padded toolbar height from a captured bare height
on every callback and always set the nav bar padding, including
back to zero, so the layout converges on the first correct inset
pass.
Use a plain Activity for SplashActivity because it only redirects
to the camera screen and finishes immediately.
This avoids AppCompat lifecycle dispatch crashing on older Android
versions when the activity is destroyed before AndroidX moves it
out of INITIALIZED.
If we already know the data contains a tracking link we
don't need to parse the data for something else.
Unfortunately, the Deutsche Post Matrixcode stamp also
parses as an IDL (International Driver License).
Use view-local coordinates for the detector center because
its drawing, touch handling, and crop ROI math all operate
in the view's own coordinate space.
This avoids offset crop overlays when the view is not laid
out at the parent's origin.