Repository navigation
ADFA-5157 refactor(clone,connect): extract the QrSection holder into … - #413
Merged
Merged
Conversation
…a shared class ADFA-5154's Connect PR built the QR "section" — the slot (frame + code + placeholder), caption/subcaption, and the reveal-on-tap fallback — as a private Section holder inside ConnectFragment, with setQr / setFallback / applyFallbackOpen helpers beside it. The Clone (Send) redesign needs the same section, so it moves to a shared public QrSection class rather than being copied into a second fragment. QrSection holds the views + the reveal state (fbOpen) and carries setQr(ctx, ...) / setFallback(ctx, ...) as methods; it holds no Context, taking one where needed. ConnectFragment uses it for its three sections; the private class and the three helpers are gone, dead imports dropped (~80 fewer lines). The layout is untouched, so there is no visual change — a Java-only refactor. The shared section CARD layout is deliberately not extracted yet: Clone's sections differ (Wi-Fi Join has no QR; Get-app carries the amber banner), so the common markup is extracted during the Clone redesign, with both shapes concrete, rather than guessed now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADFA-5157 — extract QrSection as a shared class
Enabler for the Clone (Send) half of ADFA-5154. Java-only refactor; the layout is untouched,
so there is no visual change.
What changed
ADFA-5154's Connect PR built the QR "section" — the slot (frame + code + placeholder),
caption/subcaption, and the reveal-on-tap fallback — as a private
Sectionholder insideConnectFragment, withsetQr/setFallback/applyFallbackOpenbeside it. The Cloneredesign needs the same section, so it moves to a shared public
QrSection:QrSectionholds the views + reveal state (fbOpen) and carriessetQr(ctx, …)/setFallback(ctx, …)as methods. It holds no Context — the two methods that need one take itas a parameter — so it can be built in
onCreateViewand driven from anywhere.ConnectFragmentuses it for its three sections (Join / Open / single); the private class andthe three helpers are gone, dead imports dropped (~80 fewer lines).
Deliberately not here
The shared section card layout is not extracted yet. Clone's sections differ (Wi-Fi Join has
no QR; Get-app carries the amber banner), so the common markup is extracted during the Clone
redesign, with both shapes concrete — not guessed now. The reusable logic (this class) is what
has identical needs across both, so it is what gets shared first.
Verification
Connect is unchanged — verify by screenshot: Hotspot two-section (top + scrolled), Wi-Fi single,
and the no-system Recover state. The layout is untouched, so the bar is "no visible difference".
No behavior change, no new strings.