android: register TextSelection & TextCursorLayer once at creation
Change-Id: I33471dbcdd82b50919b6c6af741101b3d4ff71cf
This commit is contained in:
committed by
Miklos Vajna
parent
8eeb6ef987
commit
656d3f9ee4
@@ -161,7 +161,10 @@ public class LibreOfficeMainActivity extends ActionBarActivity {
|
|||||||
mLayerClient = new GeckoLayerClient(this);
|
mLayerClient = new GeckoLayerClient(this);
|
||||||
mLayerClient.setZoomConstraints(new ZoomConstraints(true));
|
mLayerClient.setZoomConstraints(new ZoomConstraints(true));
|
||||||
LayerView layerView = (LayerView) findViewById(R.id.layer_view);
|
LayerView layerView = (LayerView) findViewById(R.id.layer_view);
|
||||||
|
// register TextSelection and TextCursorLayer in LayerView
|
||||||
mLayerClient.setView(layerView);
|
mLayerClient.setView(layerView);
|
||||||
|
layerView.addLayer(mTextSelection);
|
||||||
|
layerView.addLayer(mTextCursorLayer);
|
||||||
layerView.setInputConnectionHandler(new LOKitInputConnectionHandler());
|
layerView.setInputConnectionHandler(new LOKitInputConnectionHandler());
|
||||||
mLayerClient.notifyReady();
|
mLayerClient.notifyReady();
|
||||||
}
|
}
|
||||||
|
@@ -70,10 +70,6 @@ public class TextCursorLayer extends Layer {
|
|||||||
mViewLeft = 0.0f;
|
mViewLeft = 0.0f;
|
||||||
mViewTop = 0.0f;
|
mViewTop = 0.0f;
|
||||||
mViewZoom = 0.0f;
|
mViewZoom = 0.0f;
|
||||||
LayerView layerView = LOKitShell.getLayerView();
|
|
||||||
if (layerView != null) {
|
|
||||||
layerView.addLayer(TextCursorLayer.this);
|
|
||||||
}
|
|
||||||
mCursorView.showCursor();
|
mCursorView.showCursor();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -107,10 +103,6 @@ public class TextCursorLayer extends Layer {
|
|||||||
public void showSelections() {
|
public void showSelections() {
|
||||||
LOKitShell.getMainHandler().post(new Runnable() {
|
LOKitShell.getMainHandler().post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
LayerView layerView = LOKitShell.getLayerView();
|
|
||||||
if (layerView != null) {
|
|
||||||
layerView.addLayer(TextCursorLayer.this);
|
|
||||||
}
|
|
||||||
mCursorView.showSelections();
|
mCursorView.showSelections();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -94,10 +94,6 @@ public class TextSelection extends Layer {
|
|||||||
mViewLeft = 0.0f;
|
mViewLeft = 0.0f;
|
||||||
mViewTop = 0.0f;
|
mViewTop = 0.0f;
|
||||||
mViewZoom = 0.0f;
|
mViewZoom = 0.0f;
|
||||||
LayerView layerView = LOKitShell.getLayerView();
|
|
||||||
if (layerView != null) {
|
|
||||||
layerView.addLayer(TextSelection.this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user