Skip to content

Conversation

@CrisBarreiro
Copy link
Contributor

@CrisBarreiro CrisBarreiro commented Dec 15, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1212227266948491/task/1210351397656377?focus=true

Description

Allow syncBarcodeView consumers to define minimum scanning area
Use remote config to allow for synamic resizing of SyncBarcodeView along with minimum scanning area

Steps to test this PR

Feature 1

  • With useNewActivityConnectSyncLayout enabled (default state), open sync settings and try to add a new device
  • Check scan view height is dynamic (takes available space between header and footer) but scanning works fine on small devices regardless of the view size

Feature 2

  • Disable useNewActivityConnectSyncLayout, open sync settings and try to add a new device
  • Notice scan view has a fixed height and QR code at the bottom is cut on smaller devices

UI changes

Before After
before after

Note

Adds a remote-toggle new Connect Sync layout and enables SyncBarcodeView consumers to set a minimum scanning area via a new attribute.

  • Feature Toggle
    • Add SyncFeature.useNewActivityConnectSyncLayout to switch between old/new Connect Sync UI.
  • UI (Connect Sync)
    • SyncConnectActivity selects layout at runtime and abstracts bindings via ConnectSyncBinding (old/new).
    • Add new layout res/layout/activity_connect_sync_new.xml with dynamic scanner area and updated QR/code UI.
  • QR Scanner (SyncBarcodeView)
    • Support app:minScanningAreaHeight attribute (declared in attrs-sync-barcode-view.xml).
    • Implement logic to expand/center scanner view when container is smaller than the minimum.
    • Update view_square_decorated_barcode.xml to wrap BarcodeView in barcodeContainer.

Written by Cursor Bugbot for commit 1d9fa71. This will update automatically on new commits. Configure here.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@CrisBarreiro CrisBarreiro changed the title \ Allow syncBarcodeView consumers to define minimum scanning area Dec 15, 2025
}

private fun setupExpandedScanningArea() {
if (minScanningAreaHeight == MIN_SCANNING_AREA_HEIGHT_NOT_SET) return
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If RC flag is off, minScanningAreaHeight will be equal to MIN_SCANNING_AREA_HEIGHT_NOT_SET, so I don't think we need to feature flag here as well

@CrisBarreiro CrisBarreiro marked this pull request as ready for review December 15, 2025 16:00
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

binding = if (syncFeature.useNewActivityConnectSyncLayout().isEnabled()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could duplicate the entire activity and navigate to one or the other based on RC if we think that's safer

@CrisBarreiro CrisBarreiro force-pushed the feature/cris/dynamic-scanning-area branch from eaeb280 to 1d9fa71 Compare December 16, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants