summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-07-26 16:11:51 +0200
committerMichael Meeks <michael.meeks@suse.com>2012-08-06 10:23:04 +0100
commit6e2106cdfa83ed7d90dedd2c4f0f392d4865ab4f (patch)
tree5d7c8e437654ef1c64d270919e8db5d24d058e89 /android
parentf30a4efd7482b97a52e45bdd02ae0ac27439a3c7 (diff)
Coverflow resize saved when fragment hidden.
Change-Id: I892d309b824ad607b073d44e9c864bc3f910c119
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
index ed6e86f699dc..1793696681a3 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
@@ -41,6 +41,9 @@ public class PresentationFragment extends Fragment {
private float mOriginalCoverflowWidth;
private float mOriginalCoverflowHeight;
+ private float mNewCoverflowWidth = 0;
+ private float mNewCoverflowHeight = 0;
+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mContext = container.getContext();
@@ -72,6 +75,18 @@ public class PresentationFragment extends Fragment {
// Save the height/width for future reference
mOriginalCoverflowHeight = mTopView.getImageHeight();
mOriginalCoverflowWidth = mTopView.getImageWidth();
+
+ if (mNewCoverflowHeight != 0) {
+ ThumbnailAdapter aAdapter = (ThumbnailAdapter) mTopView
+ .getAdapter();
+ aAdapter.setHeight(mNewCoverflowHeight);
+ mTopView.setImageHeight(mNewCoverflowHeight);
+ aAdapter.setWidth(mNewCoverflowWidth);
+ mTopView.setImageWidth(mNewCoverflowWidth);
+
+ // We need to update the view now
+ aAdapter.notifyDataSetChanged();
+ }
return v;
}
@@ -127,6 +142,9 @@ public class PresentationFragment extends Fragment {
// aParams.height += aDiff;
// mTopView.setLayoutParams(aParams);
+ mNewCoverflowHeight = aHeightNew;
+ mNewCoverflowWidth = aWidthNew;
+
aAdapter.setHeight(aHeightNew);
mTopView.setImageHeight(aHeightNew);
aAdapter.setWidth(aWidthNew);