[Libreoffice-commits] .: android/sdremote
Andrzej J.R. Hunt
ajrhunt at kemper.freedesktop.org
Tue Aug 14 12:09:51 PDT 2012
android/sdremote/res/drawable-land-hdpi/handle_default.9.png |binary
android/sdremote/res/drawable-land-hdpi/handle_light.9.png |binary
android/sdremote/res/drawable-land-ldpi/handle_default.9.png |binary
android/sdremote/res/drawable-land-ldpi/handle_light.9.png |binary
android/sdremote/res/drawable-land-mdpi/handle_default.9.png |binary
android/sdremote/res/drawable-land-mdpi/handle_light.9.png |binary
android/sdremote/res/drawable-land/handle.xml | 9 ---------
android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java | 10 ++++++----
dev/null |binary
9 files changed, 6 insertions(+), 13 deletions(-)
New commits:
commit 03d49b2be3f60806c1fa1e1de61cf46a4fd81c86
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Tue Aug 14 21:00:06 2012 +0200
Fixed resizing for landscape view.
Change-Id: I5d0ce922efef1eea682e61c05eba3554f9263a8d
diff --git a/android/sdremote/res/drawable-hdpi/handle_vertical_default.9.png b/android/sdremote/res/drawable-hdpi/handle_vertical_default.9.png
deleted file mode 100644
index 830493c..0000000
Binary files a/android/sdremote/res/drawable-hdpi/handle_vertical_default.9.png and /dev/null differ
diff --git a/android/sdremote/res/drawable-hdpi/handle_vertical_light.9.png b/android/sdremote/res/drawable-hdpi/handle_vertical_light.9.png
deleted file mode 100644
index 8246c39..0000000
Binary files a/android/sdremote/res/drawable-hdpi/handle_vertical_light.9.png and /dev/null differ
diff --git a/android/sdremote/res/drawable-land-hdpi/handle_default.9.png b/android/sdremote/res/drawable-land-hdpi/handle_default.9.png
new file mode 100644
index 0000000..830493c
Binary files /dev/null and b/android/sdremote/res/drawable-land-hdpi/handle_default.9.png differ
diff --git a/android/sdremote/res/drawable-land-hdpi/handle_light.9.png b/android/sdremote/res/drawable-land-hdpi/handle_light.9.png
new file mode 100644
index 0000000..1db41c1
Binary files /dev/null and b/android/sdremote/res/drawable-land-hdpi/handle_light.9.png differ
diff --git a/android/sdremote/res/drawable-land-ldpi/handle_default.9.png b/android/sdremote/res/drawable-land-ldpi/handle_default.9.png
new file mode 100644
index 0000000..830493c
Binary files /dev/null and b/android/sdremote/res/drawable-land-ldpi/handle_default.9.png differ
diff --git a/android/sdremote/res/drawable-land-ldpi/handle_light.9.png b/android/sdremote/res/drawable-land-ldpi/handle_light.9.png
new file mode 100644
index 0000000..1db41c1
Binary files /dev/null and b/android/sdremote/res/drawable-land-ldpi/handle_light.9.png differ
diff --git a/android/sdremote/res/drawable-land-mdpi/handle_default.9.png b/android/sdremote/res/drawable-land-mdpi/handle_default.9.png
new file mode 100644
index 0000000..830493c
Binary files /dev/null and b/android/sdremote/res/drawable-land-mdpi/handle_default.9.png differ
diff --git a/android/sdremote/res/drawable-land-mdpi/handle_light.9.png b/android/sdremote/res/drawable-land-mdpi/handle_light.9.png
new file mode 100644
index 0000000..1db41c1
Binary files /dev/null and b/android/sdremote/res/drawable-land-mdpi/handle_light.9.png differ
diff --git a/android/sdremote/res/drawable-land/handle.xml b/android/sdremote/res/drawable-land/handle.xml
deleted file mode 100644
index 3656e83..0000000
--- a/android/sdremote/res/drawable-land/handle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <item android:drawable="@drawable/handle_vertical_light" android:state_activated="true"/>
- <item android:drawable="@drawable/handle_vertical_light" android:state_pressed="true"/>
- <item android:drawable="@drawable/handle_vertical_light" android:state_focused="true"/>
- <item android:drawable="@drawable/handle_vertical_default"/>
-
-</selector>
\ No newline at end of file
diff --git a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
index 1f9d3dd..69201a1 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
@@ -134,8 +134,10 @@ public class PresentationFragment extends Fragment {
boolean aPortrait = (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
- int aFlowSize = mTopView.getHeight();
- int aViewSize = mLayout.getHeight();
+ int aFlowSize = aPortrait ? mTopView.getHeight() : mTopView
+ .getWidth();
+ int aViewSize = aPortrait ? mLayout.getHeight() : mLayout
+ .getWidth();
// Calculate height change, taking limits into account
int aDiff = (int) (aPortrait ? aEvent.getY() : aEvent.getX());
@@ -163,12 +165,12 @@ public class PresentationFragment extends Fragment {
aDiff = (int) (aHeightNew - mTopView.getImageHeight());
}
} else {
- aWidthNew = mTopView.getImageWidth();
+ aWidthNew = mTopView.getImageWidth() + aDiff;
aHeightNew = (float) (aWidthNew / aRatio);
// Too High -- so scale down
if (aHeightNew > mLayout.getHeight() - 50) {
aHeightNew = mLayout.getHeight() - 50;
- aWidthNew = (float) (aHeightNew / aRatio);
+ aWidthNew = (float) (aHeightNew * aRatio);
aDiff = (int) (aWidthNew - mTopView.getImageWidth());
}
}
More information about the Libreoffice-commits
mailing list