提交 c053b31d 编写于 作者: E Eric Seidel

Fix the build after the mojo roll

@abarth
上级 751267a4
...@@ -59,7 +59,7 @@ class Input extends StatefulComponent { ...@@ -59,7 +59,7 @@ class Input extends StatefulComponent {
bool focused = Focus.at(this); bool focused = Focus.at(this);
if (focused && !_keyboardHandle.attached) { if (focused && !_keyboardHandle.attached) {
_keyboardHandle = keyboard.show(_editableValue.stub); _keyboardHandle = keyboard.show(_editableValue.stub, KeyboardType_TEXT);
} else if (!focused && _keyboardHandle.attached) { } else if (!focused && _keyboardHandle.attached) {
_keyboardHandle.release(); _keyboardHandle.release();
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import 'package:mojo_services/keyboard/keyboard.mojom.dart'; import 'package:mojo_services/keyboard/keyboard.mojom.dart';
import 'package:sky/mojo/shell.dart' as shell; import 'package:sky/mojo/shell.dart' as shell;
export 'package:mojo_services/keyboard/keyboard.mojom.dart';
class _KeyboardConnection { class _KeyboardConnection {
...@@ -29,14 +30,14 @@ class Keyboard { ...@@ -29,14 +30,14 @@ class Keyboard {
KeyboardHandle _currentHandle; KeyboardHandle _currentHandle;
KeyboardHandle show(KeyboardClientStub stub) { KeyboardHandle show(KeyboardClientStub stub, int keyboardType) {
assert(stub != null); assert(stub != null);
if (_currentHandle != null) { if (_currentHandle != null) {
if (_currentHandle.stub == stub) if (_currentHandle.stub == stub)
return _currentHandle; return _currentHandle;
_currentHandle.release(); _currentHandle.release();
} }
_currentHandle = new KeyboardHandle._show(this, stub); _currentHandle = new KeyboardHandle._show(this, stub, keyboardType);
return _currentHandle; return _currentHandle;
} }
...@@ -44,8 +45,8 @@ class Keyboard { ...@@ -44,8 +45,8 @@ class Keyboard {
class KeyboardHandle { class KeyboardHandle {
KeyboardHandle._show(Keyboard keyboard, this.stub) : _keyboard = keyboard { KeyboardHandle._show(Keyboard keyboard, this.stub, int keyboardType) : _keyboard = keyboard {
_keyboard.service.show(stub); _keyboard.service.show(stub, keyboardType);
_attached = true; _attached = true;
} }
......
...@@ -6,8 +6,8 @@ homepage: https://github.com/domokit/sky_engine/tree/master/sky/packages/sky ...@@ -6,8 +6,8 @@ homepage: https://github.com/domokit/sky_engine/tree/master/sky/packages/sky
dependencies: dependencies:
cassowary: ^0.1.7 cassowary: ^0.1.7
material_design_icons: ^0.0.2 material_design_icons: ^0.0.2
mojo_services: 0.0.21 mojo_services: 0.0.22
mojo: 0.0.21 mojo: 0.0.22
newton: ^0.1.2 newton: ^0.1.2
sky_engine: ^0.0.6 sky_engine: ^0.0.6
sky_services: ^0.0.6 sky_services: ^0.0.6
......
...@@ -17,6 +17,7 @@ import android.view.inputmethod.InputConnection; ...@@ -17,6 +17,7 @@ import android.view.inputmethod.InputConnection;
import org.chromium.base.JNINamespace; import org.chromium.base.JNINamespace;
import org.chromium.mojo.bindings.InterfaceRequest; import org.chromium.mojo.bindings.InterfaceRequest;
import org.chromium.mojo.keyboard.KeyboardServiceImpl; import org.chromium.mojo.keyboard.KeyboardServiceImpl;
import org.chromium.mojo.keyboard.KeyboardServiceState;
import org.chromium.mojo.system.Core; import org.chromium.mojo.system.Core;
import org.chromium.mojo.system.Pair; import org.chromium.mojo.system.Pair;
import org.chromium.mojo.system.impl.CoreImpl; import org.chromium.mojo.system.impl.CoreImpl;
...@@ -40,6 +41,7 @@ public class PlatformViewAndroid extends SurfaceView ...@@ -40,6 +41,7 @@ public class PlatformViewAndroid extends SurfaceView
private final SurfaceHolder.Callback mSurfaceCallback; private final SurfaceHolder.Callback mSurfaceCallback;
private GestureProvider mGestureProvider; private GestureProvider mGestureProvider;
private final EdgeDims mPadding; private final EdgeDims mPadding;
private final KeyboardServiceState mKeyboardState;
/** /**
* Dimensions in each of the four cardinal directions. * Dimensions in each of the four cardinal directions.
...@@ -95,7 +97,10 @@ public class PlatformViewAndroid extends SurfaceView ...@@ -95,7 +97,10 @@ public class PlatformViewAndroid extends SurfaceView
getHolder().addCallback(mSurfaceCallback); getHolder().addCallback(mSurfaceCallback);
mGestureProvider = new GestureProvider(context, this); mGestureProvider = new GestureProvider(context, this);
KeyboardServiceImpl.setActiveView(this);
// TODO(eseidel): We need per-view services!
mKeyboardState = new KeyboardServiceState(this);
KeyboardServiceImpl.setViewState(mKeyboardState);
} }
SkyEngine getEngine() { SkyEngine getEngine() {
...@@ -125,7 +130,7 @@ public class PlatformViewAndroid extends SurfaceView ...@@ -125,7 +130,7 @@ public class PlatformViewAndroid extends SurfaceView
@Override @Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) { public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
return KeyboardServiceImpl.createInputConnection(outAttrs); return mKeyboardState.createInputConnection(outAttrs);
} }
private int getTypeForAction(int maskedAction) { private int getTypeForAction(int maskedAction) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册