From 4c6376edbfabe8d7db784c04697bbbe00be85857 Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Sat, 15 Aug 2026 15:09:08 +0100 Subject: [PATCH] fix(android): the detail rows were upside down Inside a TVertScrollBox, Align=Top children stack in creation order - the opposite of a TLayout, where the last created ends up on top. The convention that is right for the unlock screen produced an inverted form here, with the 2FA code relegated to the bottom when it is the reason you pull the phone out. Co-Authored-By: Claude Opus 5 --- mainApk.pas | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/mainApk.pas b/mainApk.pas index 322f8e7..20d6f93 100644 --- a/mainApk.pas +++ b/mainApk.pas @@ -602,9 +602,24 @@ begin SetLength(FRowShown, Length(FRows)); SetLength(FRowCtls, Length(FRows)); - // A REBOURS : des controles alignes en haut s'empilent dans l'ordre inverse - // de leur creation, donc la derniere ligne se cree en premier. - for I := High(FRows) downto 0 do + // Le TOTP EN PREMIER, donc en tete d'ecran : c'est ce qu'on vient chercher + // sur un telephone. Seule ligne vivante, rafraichie chaque seconde. + if FCurrent.Totp <> '' then + begin + LRow := MakeRow(FDetBody, 'Code 2FA', FTotpValue); + SetLength(FRowCtls, Length(FRowCtls) + 1); + FRowCtls[High(FRowCtls)] := LRow; + FTotpValue.TextSettings.Font.Size := 26; + AddRowButton(LRow, 'Copier', -1, OnCopyTap); + OnTotpTick(nil); // pas d'attente d'une seconde a l'ouverture + FTotpTimer.Enabled := True; + end; + + // DANS L'ORDRE, ici : au sein d'un TVertScrollBox les enfants alignes en + // haut s'empilent dans l'ordre de creation - l'inverse d'un TLayout, ou le + // dernier cree se retrouve en tete. Se tromper de convention renvoie le + // formulaire a l'envers, sans rien casser d'autre. + for I := 0 to High(FRows) do begin LRow := MakeRow(FDetBody, FRows[I].Caption, LValue); FRowCtls[I] := LRow; @@ -621,22 +636,11 @@ begin end; // La derniere ligne affichee touche sinon le bord du defilement, ce qui la // fait passer pour tronquee alors qu'elle est juste collee. - if Length(FRowCtls) > 0 then + // La derniere ligne affichee touche sinon le bord du defilement, ce qui la + // fait passer pour tronquee alors qu'elle est juste collee. + if Length(FRows) > 0 then FRowCtls[High(FRows)].Margins.Bottom := 12; - // Le TOTP est la seule ligne vivante : creee en dernier, donc affichee en - // tete, parce que c'est ce qu'on vient chercher sur un telephone. - if FCurrent.Totp <> '' then - begin - LRow := MakeRow(FDetBody, 'Code 2FA', FTotpValue); - SetLength(FRowCtls, Length(FRowCtls) + 1); - FRowCtls[High(FRowCtls)] := LRow; - FTotpValue.TextSettings.Font.Size := 26; - AddRowButton(LRow, 'Copier', -1, OnCopyTap); - OnTotpTick(nil); // pas d'attente d'une seconde a l'ouverture - FTotpTimer.Enabled := True; - end; - FLayList.Visible := False; FLayDetail.Visible := True; end;