diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-14 21:00:06 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-14 21:09:28 +0200 |
commit | 03d49b2be3f60806c1fa1e1de61cf46a4fd81c86 (patch) | |
tree | b98e96379c9fb3bd412c17384937b7fcc37f211e /android | |
parent | e6ac2ad7ac9bbdae9ac226a2c8202f627dd0ba8a (diff) |
Fixed resizing for landscape view.
Change-Id: I5d0ce922efef1eea682e61c05eba3554f9263a8d
Diffstat (limited to 'android')
-rw-r--r-- | android/sdremote/res/drawable-hdpi/handle_vertical_light.9.png | bin | 202 -> 0 bytes | |||
-rw-r--r-- | android/sdremote/res/drawable-land-hdpi/handle_default.9.png (renamed from android/sdremote/res/drawable-hdpi/handle_vertical_default.9.png) | bin | 263 -> 263 bytes | |||
-rw-r--r-- | android/sdremote/res/drawable-land-hdpi/handle_light.9.png | bin | 0 -> 201 bytes | |||
-rw-r--r-- | android/sdremote/res/drawable-land-ldpi/handle_default.9.png | bin | 0 -> 263 bytes | |||
-rw-r--r-- | android/sdremote/res/drawable-land-ldpi/handle_light.9.png | bin | 0 -> 201 bytes | |||
-rw-r--r-- | android/sdremote/res/drawable-land-mdpi/handle_default.9.png | bin | 0 -> 263 bytes | |||
-rw-r--r-- | android/sdremote/res/drawable-land-mdpi/handle_light.9.png | bin | 0 -> 201 bytes | |||
-rw-r--r-- | android/sdremote/res/drawable-land/handle.xml | 9 | ||||
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java | 10 |
9 files changed, 6 insertions, 13 deletions
diff --git a/android/sdremote/res/drawable-hdpi/handle_vertical_light.9.png b/android/sdremote/res/drawable-hdpi/handle_vertical_light.9.png Binary files differdeleted file mode 100644 index 8246c398347b..000000000000 --- a/android/sdremote/res/drawable-hdpi/handle_vertical_light.9.png +++ /dev/null diff --git a/android/sdremote/res/drawable-hdpi/handle_vertical_default.9.png b/android/sdremote/res/drawable-land-hdpi/handle_default.9.png Binary files differindex 830493c1f90c..830493c1f90c 100644 --- a/android/sdremote/res/drawable-hdpi/handle_vertical_default.9.png +++ b/android/sdremote/res/drawable-land-hdpi/handle_default.9.png diff --git a/android/sdremote/res/drawable-land-hdpi/handle_light.9.png b/android/sdremote/res/drawable-land-hdpi/handle_light.9.png Binary files differnew file mode 100644 index 000000000000..1db41c1256fa --- /dev/null +++ b/android/sdremote/res/drawable-land-hdpi/handle_light.9.png diff --git a/android/sdremote/res/drawable-land-ldpi/handle_default.9.png b/android/sdremote/res/drawable-land-ldpi/handle_default.9.png Binary files differnew file mode 100644 index 000000000000..830493c1f90c --- /dev/null +++ b/android/sdremote/res/drawable-land-ldpi/handle_default.9.png diff --git a/android/sdremote/res/drawable-land-ldpi/handle_light.9.png b/android/sdremote/res/drawable-land-ldpi/handle_light.9.png Binary files differnew file mode 100644 index 000000000000..1db41c1256fa --- /dev/null +++ b/android/sdremote/res/drawable-land-ldpi/handle_light.9.png diff --git a/android/sdremote/res/drawable-land-mdpi/handle_default.9.png b/android/sdremote/res/drawable-land-mdpi/handle_default.9.png Binary files differnew file mode 100644 index 000000000000..830493c1f90c --- /dev/null +++ b/android/sdremote/res/drawable-land-mdpi/handle_default.9.png diff --git a/android/sdremote/res/drawable-land-mdpi/handle_light.9.png b/android/sdremote/res/drawable-land-mdpi/handle_light.9.png Binary files differnew file mode 100644 index 000000000000..1db41c1256fa --- /dev/null +++ b/android/sdremote/res/drawable-land-mdpi/handle_light.9.png diff --git a/android/sdremote/res/drawable-land/handle.xml b/android/sdremote/res/drawable-land/handle.xml deleted file mode 100644 index 3656e835035d..000000000000 --- 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 1f9d3ddefb74..69201a1c0654 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()); } } |