mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-08 23:40:24 -08:00
Android compatibility fixes
* doc/emacs/android.texi (Android Windowing): Document restrictions on number of windows under Android 4.4 and earlier. * java/AndroidManifest.xml.in <EmacsActivity> <EmacsOpenActivity, EmacsMultitaskActivity>: Assign each class of activity a unique task affinity. * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Remove redundant priority assignment. * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Handle file URIs when processing attachments from a mailto URI, and check for KitKat before opening content ones. * java/org/gnu/emacs/EmacsWindow.java <pointerMap> (figureChange): Replace coordinate HashMap with a SparseArray. * java/org/gnu/emacs/EmacsWindowAttachmentManager.java (registerWindow): Don't specify FLAG_ACTIVITY_NEW_DOCUMENT on systems where it is absent.
This commit is contained in:
parent
0df28dc00e
commit
ad0492c5a9
6 changed files with 70 additions and 30 deletions
|
|
@ -23,7 +23,6 @@ import java.lang.IllegalStateException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -50,6 +49,7 @@ import android.view.View;
|
|||
import android.view.ViewManager;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import android.util.SparseArray;
|
||||
import android.util.Log;
|
||||
|
||||
import android.os.Build;
|
||||
|
|
@ -109,7 +109,7 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
|
||||
/* Map between pointer identifiers and last known position. Used to
|
||||
compute which pointer changed upon a touch event. */
|
||||
private HashMap<Integer, Coordinate> pointerMap;
|
||||
private SparseArray<Coordinate> pointerMap;
|
||||
|
||||
/* The window consumer currently attached, if it exists. */
|
||||
private EmacsWindowAttachmentManager.WindowConsumer attached;
|
||||
|
|
@ -166,7 +166,7 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
super (handle);
|
||||
|
||||
rect = new Rect (x, y, x + width, y + height);
|
||||
pointerMap = new HashMap<Integer, Coordinate> ();
|
||||
pointerMap = new SparseArray<Coordinate> ();
|
||||
|
||||
/* Create the view from the context's UI thread. The window is
|
||||
unmapped, so the view is GONE. */
|
||||
|
|
@ -1001,7 +1001,8 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
case MotionEvent.ACTION_CANCEL:
|
||||
/* Primary pointer released with index 0. */
|
||||
pointerID = event.getPointerId (0);
|
||||
coordinate = pointerMap.remove (pointerID);
|
||||
coordinate = pointerMap.get (pointerID);
|
||||
pointerMap.delete (pointerID);
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
|
|
@ -1020,7 +1021,8 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
/* Pointer removed. Remove it from the map. */
|
||||
pointerIndex = event.getActionIndex ();
|
||||
pointerID = event.getPointerId (pointerIndex);
|
||||
coordinate = pointerMap.remove (pointerID);
|
||||
coordinate = pointerMap.get (pointerID);
|
||||
pointerMap.delete (pointerID);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue