diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-31 15:40:03 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:04 +0200 |
commit | 656d3f9ee46366809ca47636ae2f42d2d51b656d (patch) | |
tree | 9463a43d84273b50eb42a6f9c64760c8dcdd6840 /android | |
parent | 8eeb6ef98703bf411a0ee402f647472ddeec057c (diff) |
android: register TextSelection & TextCursorLayer once at creation
Change-Id: I33471dbcdd82b50919b6c6af741101b3d4ff71cf
Diffstat (limited to 'android')
3 files changed, 3 insertions, 12 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java index c169d8e619a4..9b1426572f47 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java @@ -161,7 +161,10 @@ public class LibreOfficeMainActivity extends ActionBarActivity { mLayerClient = new GeckoLayerClient(this); mLayerClient.setZoomConstraints(new ZoomConstraints(true)); LayerView layerView = (LayerView) findViewById(R.id.layer_view); + // register TextSelection and TextCursorLayer in LayerView mLayerClient.setView(layerView); + layerView.addLayer(mTextSelection); + layerView.addLayer(mTextCursorLayer); layerView.setInputConnectionHandler(new LOKitInputConnectionHandler()); mLayerClient.notifyReady(); } diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorLayer.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorLayer.java index dc7650bdee5c..2429ad3662a9 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorLayer.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorLayer.java @@ -70,10 +70,6 @@ public class TextCursorLayer extends Layer { mViewLeft = 0.0f; mViewTop = 0.0f; mViewZoom = 0.0f; - LayerView layerView = LOKitShell.getLayerView(); - if (layerView != null) { - layerView.addLayer(TextCursorLayer.this); - } mCursorView.showCursor(); } }); @@ -107,10 +103,6 @@ public class TextCursorLayer extends Layer { public void showSelections() { LOKitShell.getMainHandler().post(new Runnable() { public void run() { - LayerView layerView = LOKitShell.getLayerView(); - if (layerView != null) { - layerView.addLayer(TextCursorLayer.this); - } mCursorView.showSelections(); } }); diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java index 7a07742239e0..359b7dd51a0f 100644 --- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java +++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java @@ -94,10 +94,6 @@ public class TextSelection extends Layer { mViewLeft = 0.0f; mViewTop = 0.0f; mViewZoom = 0.0f; - LayerView layerView = LOKitShell.getLayerView(); - if (layerView != null) { - layerView.addLayer(TextSelection.this); - } } }); } |