summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-02-25 14:17:31 +0200
committerTor Lillqvist <tml@iki.fi>2013-02-25 15:44:19 +0200
commit511b9fefe20d5a8a5ca003a7a60b0423d1d3e5be (patch)
tree4f13bfea4b87842f28f8df1a838eb85d3bfefc77 /android
parent6e18e1f54b7527e012f67a36666b7f307be4e293 (diff)
Use actual size of view instead of hardcoded 1000x600
The View size is available only after the view has been connected to the activity, it seems, so move the Bitmap creation to onDraw(). Note that the code in SvpSalFrame::SvpSalFrame() in vcl/headless/svpframe.cxx still hardcodes another (!) size, 800x600. This affcects the size of the desktop-style "top-level window" displayed by the android/experimental/desktop app. I didn't yet figure out the right way to pass the actual view size to the SvpSalFrame. And there is also a hardcoded third (!) size, 1280x750, in AndroidSalInstance::GetWorkArea(), although I don't know what that affects, if anything. Change-Id: I042bf764cd66efa7069c36601170b90d57fa174c
Diffstat (limited to 'android')
-rw-r--r--android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java b/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java
index 3bf2da9edcd2..8d5b97de03c4 100644
--- a/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java
+++ b/android/experimental/desktop/src/org/libreoffice/android/experimental/desktop/Desktop.java
@@ -153,7 +153,6 @@ public class Desktop
class MyXController
implements XController
{
-
XFrame frame;
XModel model;
@@ -297,12 +296,16 @@ public class Desktop
public BitmapView()
{
super(Desktop.this);
- mBitmap = Bitmap.createBitmap(1000, 600, Bitmap.Config.ARGB_8888);
}
- @Override protected void onDraw(Canvas canvas) {
+ @Override protected void onDraw(Canvas canvas)
+ {
// canvas.drawColor(0xFF1ABCDD);
+ if (mBitmap == null) {
+ Log.i(TAG, "calling Bitmap.createBitmap(" + getWidth() + ", " + getHeight() + ", Bitmap.Config.ARGB_8888)");
+ mBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
+ }
renderVCL(mBitmap);
canvas.drawBitmap(mBitmap, 0, 0, null);
@@ -311,4 +314,5 @@ public class Desktop
}
}
}
+
// vim:set shiftwidth=4 softtabstop=4 expandtab: