Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Unified Diff: sky/shell/org/domokit/sky/shell/PlatformView.java

Issue 995613002: Implement a basic IME-aware input element (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/org/domokit/sky/shell/PlatformView.java
diff --git a/sky/shell/org/domokit/sky/shell/PlatformView.java b/sky/shell/org/domokit/sky/shell/PlatformView.java
index a4b98cd5fbf9a31a7d8794f65d87c38baa2ab5cc..ee94f3f8b223812dead6e1f95d33abf3fdbd9ce5 100644
--- a/sky/shell/org/domokit/sky/shell/PlatformView.java
+++ b/sky/shell/org/domokit/sky/shell/PlatformView.java
@@ -10,6 +10,8 @@ import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputConnection;
import org.chromium.base.JNINamespace;
import org.chromium.mojo.bindings.InterfaceRequest;
@@ -21,6 +23,7 @@ import org.chromium.mojom.sky.InputEvent;
import org.chromium.mojom.sky.PointerData;
import org.chromium.mojom.sky.PointerKind;
import org.chromium.mojom.sky.ViewportObserver;
+import org.domokit.keyboard.KeyboardServiceImpl;
/**
* A view containing Sky
@@ -68,6 +71,7 @@ public class PlatformView extends SurfaceView
getHolder().addCallback(mSurfaceCallback);
mGestureProvider = new GestureProvider(context, this);
+ KeyboardServiceImpl.setActiveView(this);
}
@Override
@@ -86,6 +90,16 @@ public class PlatformView extends SurfaceView
}
}
+ @Override
+ public boolean onCheckIsTextEditor() {
+ return true;
+ }
+
+ @Override
+ public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
+ return KeyboardServiceImpl.createInputConnection(outAttrs);
+ }
+
private int getTypeForAction(int maskedAction) {
// Primary pointer:
if (maskedAction == MotionEvent.ACTION_DOWN)
« no previous file with comments | « sky/shell/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698