1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 01:41:01 -08:00

Update Android port

* java/org/gnu/emacs/EmacsView.java (EmacsView)
(prepareForLayout): New function.  Call this prior to mapping
the view.
(onGlobalLayout): New function.  Register as global layout
listener.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow)
(notifyContentRectPosition): New function.  Use specified
xPosition and yPosition when reporting the offsets of children
of the root window.
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow): Specify activity launch bounds if necessary.
* src/androidterm.c (handle_one_android_event): Send
MOVE_FRAME_EVENT where necessary.
This commit is contained in:
Po Lu 2023-03-18 10:54:26 +08:00
parent 773bdb15ab
commit 634e3fcc20
4 changed files with 160 additions and 63 deletions

View file

@ -22,7 +22,9 @@ package org.gnu.emacs;
import java.util.ArrayList;
import java.util.List;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
/* Code to paper over the differences in lifecycles between
@ -102,6 +104,7 @@ public final class EmacsWindowAttachmentManager
registerWindow (EmacsWindow window)
{
Intent intent;
ActivityOptions options;
Log.d (TAG, "registerWindow (maybe): " + window);
@ -128,7 +131,18 @@ public final class EmacsWindowAttachmentManager
intent.addFlags (Intent.FLAG_ACTIVITY_NEW_DOCUMENT
| Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
EmacsService.SERVICE.startActivity (intent);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
EmacsService.SERVICE.startActivity (intent);
else
{
/* Specify the desired window size. */
options = ActivityOptions.makeBasic ();
options.setLaunchBounds (window.getGeometry ());
EmacsService.SERVICE.startActivity (intent,
options.toBundle ());
}
Log.d (TAG, "registerWindow: startActivity");
}