feat(apk): copier renvoie a l'app d'avant, recherche prete a l'ouverture et au retour
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,14 @@ procedure TintSystemBars(ATop, ABottom: TAlphaColor);
|
||||
/// decide de la suite d'apres la reponse.
|
||||
function HideSoftKeyboard: Boolean;
|
||||
|
||||
/// Deplie le clavier pour le champ qui a le focus (la recherche). Un focus()
|
||||
/// JavaScript seul pose le curseur sans ouvrir le clavier.
|
||||
procedure ShowSoftKeyboard;
|
||||
|
||||
/// Renvoie l'application en arriere-plan : on retombe sur l'app d'ou l'on
|
||||
/// venait, prete a recevoir le collage.
|
||||
procedure MoveAppToBack;
|
||||
|
||||
implementation
|
||||
|
||||
{$IF DEFINED(ANDROID)}
|
||||
@@ -126,4 +134,44 @@ begin
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
{$IF DEFINED(ANDROID)}
|
||||
procedure ShowSoftKeyboard;
|
||||
var
|
||||
LService: JObject;
|
||||
LView: JView;
|
||||
begin
|
||||
try
|
||||
LView := TAndroidHelper.Activity.getWindow.getDecorView.findFocus;
|
||||
if LView = nil then Exit;
|
||||
LService := TAndroidHelper.Context.getSystemService(
|
||||
TJContext.JavaClass.INPUT_METHOD_SERVICE);
|
||||
if LService = nil then Exit;
|
||||
TJInputMethodManager.Wrap(LService).showSoftInput(LView, 0);
|
||||
except
|
||||
// Pas de clavier : la recherche reste a un appui.
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure MoveAppToBack;
|
||||
begin
|
||||
CallInUIThread(
|
||||
procedure
|
||||
begin
|
||||
try
|
||||
TAndroidHelper.Activity.moveTaskToBack(True);
|
||||
except
|
||||
// Reste au premier plan : on colle apres un retour manuel.
|
||||
end;
|
||||
end);
|
||||
end;
|
||||
{$ELSE}
|
||||
procedure ShowSoftKeyboard;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure MoveAppToBack;
|
||||
begin
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
||||
@@ -1877,6 +1877,15 @@ document.getElementById('back').addEventListener('click', goList);
|
||||
|
||||
// --- appele par Delphi -----------------------------------------------------
|
||||
var PM = {
|
||||
/// Recherche prete a taper : focus, texte precedent selectionne (la frappe le
|
||||
/// remplace), puis Delphi deplie le clavier - un focus() seul ne le fait pas.
|
||||
focusSearch: function () {
|
||||
if (view !== 'list') return;
|
||||
q.focus();
|
||||
q.select();
|
||||
send('kbd');
|
||||
},
|
||||
|
||||
setVault: function (json) {
|
||||
vaultOpen = true;
|
||||
var d = JSON.parse(json);
|
||||
|
||||
Reference in New Issue
Block a user