android/sdremote/res/layout/fragment_presentation.xml                          
 |    8 
 android/sdremote/res/menu/actionbar_presentation.xml                           
 |   17 +
 android/sdremote/res/values/strings.xml                                        
 |    6 
 android/sdremote/src/org/libreoffice/impressremote/ActionBarManager.java       
 |   51 +++++
 android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java   
 |   16 -
 android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java   
 |   90 ++++++++--
 android/sdremote/src/org/libreoffice/impressremote/TestClient.java             
 |    1 
 android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java      
 |   10 +
 android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java 
 |    3 
 
android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java 
|   66 ++++++-
 android/sdremote/src/pl/polidea/coverflow/CoverFlow.java                       
 |    2 
 sd/source/ui/remotecontrol/ImagePreparer.cxx                                   
 |    2 
 12 files changed, 234 insertions(+), 38 deletions(-)

New commits:
commit 2c777ebfa6c6a3fea0cbad7ebc8baf4ad44ae907
Author: Andrzej J.R. Hunt <andr...@ahunt.org>
Date:   Tue Jul 24 21:24:26 2012 +0200

    Added basic actionbar code, improved cover flow scaling.
    
    Change-Id: I68dcbf2449ed61f06503442a3621cccb97f1e697

diff --git a/android/sdremote/res/layout/fragment_presentation.xml 
b/android/sdremote/res/layout/fragment_presentation.xml
index 53e7737..2d17759 100644
--- a/android/sdremote/res/layout/fragment_presentation.xml
+++ b/android/sdremote/res/layout/fragment_presentation.xml
@@ -13,10 +13,7 @@
         android:layout_marginTop="5dip"
         coverflow:imageHeight="150dip"
         coverflow:imageWidth="180dip"
-
         coverflow:withReflection="false" />
-    <!--         coverflow:imageReflectionRatio="0.2"
-                coverflow:reflectionGap="2dip" -->
 
     <ImageView
         android:id="@+id/presentation_handle"
@@ -24,7 +21,7 @@
         android:layout_height="wrap_content"
         android:layout_marginLeft="6dp"
         android:layout_marginRight="6dp"
-        android:contentDescription="TODO"
+        android:contentDescription="@string/presentation_ui_resizehandle"
         android:paddingBottom="5dp"
         android:paddingTop="5dp"
         android:scaleType="fitXY"
@@ -38,8 +35,7 @@
         <WebView
             android:id="@+id/presentation_notes"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:background="" />
+            android:layout_height="wrap_content" />
     </ScrollView>
 
 </LinearLayout>
\ No newline at end of file
diff --git a/android/sdremote/res/menu/actionbar_presentation.xml 
b/android/sdremote/res/menu/actionbar_presentation.xml
new file mode 100644
index 0000000..020fae1
--- /dev/null
+++ b/android/sdremote/res/menu/actionbar_presentation.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"; >
+    <item android:id="@+id/actionbar_presenation_thumbnail"></item>
+    <item android:id="@+id/actionbar_presentation_timer">
+        <menu>
+            <item android:id="@+id/actionbar_presentation_timer_pause"/>
+        </menu>
+    </item>
+    <item android:id="@+id/actionbar_presentation_submenu">
+        <menu>
+            <item android:id="@+id/actionbar_presentation_submenu_blank" 
android:title="@string/presentation_blank_screen"/>
+            <item android:id="@+id/actionbar_presentation_submenu_options" 
android:title="@string/options"/>
+        </menu>
+    </item>
+
+
+</menu>
\ No newline at end of file
diff --git a/android/sdremote/res/values/strings.xml 
b/android/sdremote/res/values/strings.xml
index 668d073..c677dcb 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -2,7 +2,11 @@
 <resources>
 
     <string name="app_name">LibreOffice Remote</string>
-    <string name="hello_world">Hello world!</string>
     <string name="menu_settings">Settings</string>
     <string name="title_activity_presentation">PresentationActivity</string>
+    <string name="presentation_ui_resizehandle">Handle to resize view.</string>
+    <string name="presentation_blank_screen">Blank Screen</string>
+    <string name="options">Options</string>
+    <string name="actionbar_timeformat">HH:mm</string>
+    <string name="actionbar_timerformat">h:m:ss</string>
 </resources>
\ No newline at end of file
diff --git 
a/android/sdremote/src/org/libreoffice/impressremote/ActionBarManager.java 
b/android/sdremote/src/org/libreoffice/impressremote/ActionBarManager.java
index 44ef183..33ea95c 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ActionBarManager.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ActionBarManager.java
@@ -8,11 +8,62 @@
  */
 package org.libreoffice.impressremote;
 
+import org.libreoffice.impressremote.communication.CommunicationService;
+
+import android.content.Context;
+import android.os.Handler;
+import android.text.format.DateFormat;
+import android.view.Menu;
+
 /**
  * Used to manage the action bar whenever a presentation is running.
  *
  */
 public class ActionBarManager {
 
+       private Context mContext;
+       private Menu mMenu;
+       private CommunicationService mCommunicationService;
+
+       /*
+        * True if the timer is being used as a timer, false if we are showing a
+        * clock.
+        */
+       private boolean mTimerOn = false;
+
+       public ActionBarManager(Context aContext, Menu aMenu,
+                       CommunicationService aCommunicationService) {
+               mContext = aContext;
+               mMenu = aMenu;
+               mCommunicationService = aCommunicationService;
+               timerHandler.removeCallbacks(timerUpdateThread);
+               timerHandler.postDelayed(timerUpdateThread, 50);
+       }
+
+       private Handler timerHandler = new Handler();
+
+       private Thread timerUpdateThread = new Thread() {
+
+               @Override
+               public void run() {
+                       //                      invalidateOptionsMenu();
+                       CharSequence aTimeString;
+                       long aTime = 
mCommunicationService.getSlideShow().getTimer()
+                                       .getTimeMillis();
+                       if (mTimerOn) {
+                               aTimeString = 
DateFormat.format(mContext.getResources()
+                                               
.getString(R.string.actionbar_timerformat),
+                                               aTime);
+                       } else {
+                               aTimeString = 
DateFormat.format(mContext.getResources()
+                                               
.getString(R.string.actionbar_timeformat),
+                                               System.currentTimeMillis());
+                       }
+                       // TODO: set the string
+                       timerHandler.postDelayed(this, 50);
+
+               }
+
+       };
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git 
a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java 
b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
index 8806610..05c5c4a 100644
--- 
a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
+++ 
b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
@@ -21,8 +21,9 @@ public class PresentationActivity extends Activity {
        private CommunicationService mCommunicationService;
        private boolean mIsBound = false;
        private FrameLayout mLayout;
-       ThumbnailFragment mThumbnailFragment;
-       PresentationFragment mPresentationFragment;
+       private ThumbnailFragment mThumbnailFragment;
+       private PresentationFragment mPresentationFragment;
+       private ActionBarManager mActionBarManager;
 
        @Override
        public void onCreate(Bundle savedInstanceState) {
@@ -49,16 +50,11 @@ public class PresentationActivity extends Activity {
                mIsBound = true;
        }
 
-       // @Override
-       // public boolean onCreateOptionsMenu(Menu menu) {
-       // MenuInflater inflater = getMenuInflater();
-       // inflater.inflate(R.menu.main_activity, menu);
-       // return true;
-       // }
-
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
-               getMenuInflater().inflate(R.menu.activity_presentation, menu);
+               getMenuInflater().inflate(R.menu.actionbar_presentation, menu);
+               mActionBarManager = new ActionBarManager(this, menu,
+                               mCommunicationService);
                return true;
        }
 
diff --git 
a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java 
b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
index 8cfa049..aec285b 100644
--- 
a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
+++ 
b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
@@ -47,6 +47,7 @@ public class PresentationFragment extends Fragment {
 
                String summary = "<html><body>This is just a 
test<br/><ul><li>And item</li><li>And again</li></ul>More 
text<br/>Blabla<br/>Blabla<br/>blabla<br/>Blabla</body></html>";
                mNotes.loadData(summary, "text/html", null);
+               mNotes.setBackgroundColor(Color.TRANSPARENT);
 
                //              TextView aText = new TextView();
                //              aText.setText
@@ -79,11 +80,13 @@ public class PresentationFragment extends Fragment {
                                break;
                        case MotionEvent.ACTION_MOVE:
                                LayoutParams aParams = 
mTopView.getLayoutParams();
+                               int aHeightOriginal = mTopView.getHeight();
                                int aHeight = mTopView.getHeight();
 
                                final int DRAG_MARGIN = 120;
 
                                // Set Height
+
                                aParams.height = aHeight + (int) 
(aEvent.getY());
                                int aViewSize = mLayout.getHeight();
                                if (aParams.height < DRAG_MARGIN) {
@@ -91,23 +94,24 @@ public class PresentationFragment extends Fragment {
                                } else if (aParams.height > aViewSize - 
DRAG_MARGIN) {
                                        aParams.height = aViewSize - 
DRAG_MARGIN;
                                }
+
+                               int aDiff = aParams.height - aHeightOriginal;
                                mTopView.setLayoutParams(aParams);
 
                                // Now deal with the internal height
+                               System.out.println("Before:W:" + 
mTopView.getImageWidth()
+                                               + ":H:" + 
mTopView.getImageHeight());
                                AbstractCoverFlowImageAdapter aAdapter = 
(AbstractCoverFlowImageAdapter) mTopView
                                                .getAdapter();
-                               //                              double 
adjustRatio = (mTopView.getImageHeight() + (int) (aEvent
-                               //                                              
.getY())) / mTopView.getImageHeight();
-                               aAdapter.setHeight(mTopView.getImageHeight()
-                                               + (int) (aEvent.getY()));
-                               
mTopView.setImageHeight(mTopView.getImageHeight()
-                                               + (int) (aEvent.getY()));
-
-                               //                              
aAdapter.setWidth((float) (adjustRatio * mTopView
-                               //                                              
.getImageWidth()));
-                               //                              
mTopView.setImageWidth((float) (adjustRatio * mTopView
-                               //                                              
.getImageWidth()));
+                               int aHeightNew = (int) 
(mTopView.getImageHeight() + aDiff);
+                               aAdapter.setHeight(aHeightNew);
+                               mTopView.setImageHeight(aHeightNew);
+                               int aWidthNew = aHeightNew * 180 / 150;
+                               aAdapter.setWidth(aWidthNew);
+                               mTopView.setImageWidth(aWidthNew);
                                aAdapter.notifyDataSetChanged();
+                               System.out.println("After:W:" + 
mTopView.getImageWidth()
+                                               + ":H:" + 
mTopView.getImageHeight());
                                break;
                        }
                        // TODO Auto-generated method stub
diff --git 
a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
 
b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
index 85e0c27..34cf8aa 100644
--- 
a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
+++ 
b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
@@ -58,8 +58,43 @@ public class SlideShow {
                 */
                private long aTime = 0;
 
+               private long mCountdownTime = 0;
+
                private boolean mIsRunning = false;
 
+               private boolean mIsCountdown = false;
+
+               /**
+                * Set whether this timer should be a normal or a countdown 
timer.
+                * @param aIsCountdown
+                *              Whether this should be a countdown timer.
+                */
+               public void setCountdown(boolean aIsCountdown) {
+                       mIsCountdown = aIsCountdown;
+                       if (mIsRunning) {
+                               mIsRunning = false;
+                               aTime = 0;
+                       }
+               }
+
+               /**
+                * Set the countdown time. Can be set, and isn't lost, whatever 
mode
+                * the timer is running in.
+                * @param aCountdownTime
+                *                              The countdown time.
+                */
+               public void setCountdownTime(long aCountdownTime) {
+                       mCountdownTime = aCountdownTime;
+               }
+
+               public long getCountdownTime() {
+                       return mCountdownTime;
+               }
+
+               public boolean isCountdown() {
+                       return mIsCountdown;
+               }
+
                public boolean isRunning() {
                        return mIsRunning;
                }
@@ -77,6 +112,7 @@ public class SlideShow {
                                return;
 
                        aTime = System.currentTimeMillis() - aTime;
+                       mIsRunning = true;
                }
 
                public void stopTimer() {
@@ -84,15 +120,35 @@ public class SlideShow {
                                return;
 
                        aTime = System.currentTimeMillis() - aTime;
+                       mIsRunning = false;
                }
 
+               /**
+                * Get either how long this timer has been running, or how long 
the
+                * timer still has left to run.
+                * @return
+                */
                public long getTimeMillis() {
-                       if (mIsRunning)
-                               return (System.currentTimeMillis() - aTime);
-                       else
-                               return aTime;
-               }
+                       long aTimeRunning;
+                       // Determine how long we've been going.
+                       if (mIsRunning) {
+                               aTimeRunning = System.currentTimeMillis() - 
aTime;
+                       } else {
+                               aTimeRunning = aTime;
+                       }
+                       // And give the time going, or time left
+                       if (!mIsCountdown) {
+                               return aTimeRunning;
+                       } else {
+                               long aRet = mCountdownTime - aTimeRunning;
+                               if (aRet < 0) { // We have completed!
+                                       mIsRunning = false;
+                                       aRet = 0;
+                               }
+                               return aRet;
+                       }
 
+               }
        }
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
commit 4b881c716acaa528da96a5b0ed81c5135465c7dd
Author: Andrzej J.R. Hunt <andr...@ahunt.org>
Date:   Tue Jul 24 16:52:02 2012 +0200

    Added cover-flow resizing.
    
    Change-Id: Iabe6fb8814a99a0d68376499c8a410684b075c1a

diff --git a/android/sdremote/res/layout/fragment_presentation.xml 
b/android/sdremote/res/layout/fragment_presentation.xml
index d40f517..53e7737 100644
--- a/android/sdremote/res/layout/fragment_presentation.xml
+++ b/android/sdremote/res/layout/fragment_presentation.xml
@@ -11,9 +11,8 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="5dip"
-        coverflow:imageHeight="160dip"
-
-        coverflow:imageWidth="200dip"
+        coverflow:imageHeight="150dip"
+        coverflow:imageWidth="180dip"
 
         coverflow:withReflection="false" />
     <!--         coverflow:imageReflectionRatio="0.2"
@@ -39,7 +38,8 @@
         <WebView
             android:id="@+id/presentation_notes"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content" />
+            android:layout_height="wrap_content"
+            android:background="" />
     </ScrollView>
 
 </LinearLayout>
\ 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 3c769fc..8cfa049 100644
--- 
a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
+++ 
b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
@@ -8,6 +8,10 @@ import pl.polidea.coverflow.CoverFlow;
 import android.app.Fragment;
 import android.content.Context;
 import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.RectF;
 import android.os.Bundle;
 import android.os.Message;
 import android.view.LayoutInflater;
@@ -44,7 +48,11 @@ public class PresentationFragment extends Fragment {
                String summary = "<html><body>This is just a 
test<br/><ul><li>And item</li><li>And again</li></ul>More 
text<br/>Blabla<br/>Blabla<br/>blabla<br/>Blabla</body></html>";
                mNotes.loadData(summary, "text/html", null);
 
+               //              TextView aText = new TextView();
+               //              aText.setText
+
                mTopView = (CoverFlow) 
v.findViewById(R.id.presentation_coverflow);
+
                mLayout = v.findViewById(R.id.presentation_layout);
 
                mHandle = (ImageView) v.findViewById(R.id.presentation_handle);
@@ -62,8 +70,6 @@ public class PresentationFragment extends Fragment {
                @Override
                public boolean onTouch(View aView, MotionEvent aEvent) {
 
-                       LayoutParams aParams = mTopView.getLayoutParams();
-
                        switch (aEvent.getAction()) {
                        case MotionEvent.ACTION_DOWN:
                                
mHandle.setImageResource(R.drawable.handle_light);
@@ -72,20 +78,36 @@ public class PresentationFragment extends Fragment {
                                
mHandle.setImageResource(R.drawable.handle_default);
                                break;
                        case MotionEvent.ACTION_MOVE:
+                               LayoutParams aParams = 
mTopView.getLayoutParams();
                                int aHeight = mTopView.getHeight();
-                               aParams.height = aHeight + (int) 
(aEvent.getY());
 
                                final int DRAG_MARGIN = 120;
 
-                               int aSize = mLayout.getHeight();
+                               // Set Height
+                               aParams.height = aHeight + (int) 
(aEvent.getY());
+                               int aViewSize = mLayout.getHeight();
                                if (aParams.height < DRAG_MARGIN) {
                                        aParams.height = DRAG_MARGIN;
-                               } else if (aParams.height > aSize - 
DRAG_MARGIN) {
-                                       aParams.height = aSize - DRAG_MARGIN;
+                               } else if (aParams.height > aViewSize - 
DRAG_MARGIN) {
+                                       aParams.height = aViewSize - 
DRAG_MARGIN;
                                }
-
                                mTopView.setLayoutParams(aParams);
-                               mTopView.setImageHeight(aParams.height);
+
+                               // Now deal with the internal height
+                               AbstractCoverFlowImageAdapter aAdapter = 
(AbstractCoverFlowImageAdapter) mTopView
+                                               .getAdapter();
+                               //                              double 
adjustRatio = (mTopView.getImageHeight() + (int) (aEvent
+                               //                                              
.getY())) / mTopView.getImageHeight();
+                               aAdapter.setHeight(mTopView.getImageHeight()
+                                               + (int) (aEvent.getY()));
+                               
mTopView.setImageHeight(mTopView.getImageHeight()
+                                               + (int) (aEvent.getY()));
+
+                               //                              
aAdapter.setWidth((float) (adjustRatio * mTopView
+                               //                                              
.getImageWidth()));
+                               //                              
mTopView.setImageWidth((float) (adjustRatio * mTopView
+                               //                                              
.getImageWidth()));
+                               aAdapter.notifyDataSetChanged();
                                break;
                        }
                        // TODO Auto-generated method stub
@@ -188,7 +210,27 @@ public class PresentationFragment extends Fragment {
                @Override
                protected Bitmap createBitmap(int position) {
                        Bitmap aBitmap = mSlideShow.getImage(position);
-                       return aBitmap;
+                       final int borderWidth = 8;
+
+                       Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);
+                       p.setShadowLayer(borderWidth, 0, 0, Color.BLACK);
+
+                       //                      RectF aRect = new 
RectF(borderWidth, borderWidth, borderWidth
+                       //                                      + 
aBitmap.getWidth(), borderWidth
+                       //                                      + 
aBitmap.getHeight());
+                       RectF aRect = new RectF(borderWidth, borderWidth, 
borderWidth
+                                       + aBitmap.getWidth(), borderWidth
+                                       + aBitmap.getHeight());
+                       Bitmap aOut = Bitmap.createBitmap(aBitmap.getWidth() + 2
+                                       * borderWidth, aBitmap.getHeight() + 2
+                                       * borderWidth, aBitmap.getConfig());
+                       Canvas canvas = new Canvas(aOut);
+                       canvas.drawColor(Color.TRANSPARENT);
+                       canvas.drawRect(aRect, p);
+                       //canvas.drawBitmap(aBitmap, null, aRect, null);
+                       canvas.drawBitmap(aBitmap, null, aRect, null);
+
+                       return aOut;
                }
        }
 }
diff --git a/android/sdremote/src/pl/polidea/coverflow/CoverFlow.java 
b/android/sdremote/src/pl/polidea/coverflow/CoverFlow.java
index 09da2a0..148d31c 100644
--- a/android/sdremote/src/pl/polidea/coverflow/CoverFlow.java
+++ b/android/sdremote/src/pl/polidea/coverflow/CoverFlow.java
@@ -52,7 +52,7 @@ public class CoverFlow extends Gallery {
        /**
         * The maximum zoom on the centre Child.
         */
-       private int mMaxZoom = -120;
+       private int mMaxZoom = -160;
 
        /**
         * The Centre of the Coverflow.
commit 28c6766c3f84126aeff8e2bb7c874e7555b54cd2
Author: Andrzej J.R. Hunt <andr...@ahunt.org>
Date:   Tue Jul 24 14:34:59 2012 +0200

    Enabled slide switching from cover flow, + fixes.
    
    Change-Id: I4cb520a3c014ff54a36dbab6cdb35b70a8996e8e

diff --git a/android/sdremote/res/layout/fragment_presentation.xml 
b/android/sdremote/res/layout/fragment_presentation.xml
index fb50148..d40f517 100644
--- a/android/sdremote/res/layout/fragment_presentation.xml
+++ b/android/sdremote/res/layout/fragment_presentation.xml
@@ -11,11 +11,13 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="5dip"
-        coverflow:imageHeight="150dip"
-        coverflow:imageReflectionRatio="0.2"
-        coverflow:imageWidth="100dip"
-        coverflow:reflectionGap="2dip"
-        coverflow:withReflection="true" />
+        coverflow:imageHeight="160dip"
+
+        coverflow:imageWidth="200dip"
+
+        coverflow:withReflection="false" />
+    <!--         coverflow:imageReflectionRatio="0.2"
+                coverflow:reflectionGap="2dip" -->
 
     <ImageView
         android:id="@+id/presentation_handle"
diff --git 
a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java 
b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
index 28ba8d0..3c769fc 100644
--- 
a/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
+++ 
b/android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
@@ -18,6 +18,7 @@ import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
 import android.webkit.WebView;
 import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
 import android.widget.ImageView;
 
 public class PresentationFragment extends Fragment {
@@ -49,9 +50,8 @@ public class PresentationFragment extends Fragment {
                mHandle = (ImageView) v.findViewById(R.id.presentation_handle);
                mHandle.setOnTouchListener(new SizeListener());
 
-               if (mCommunicationService != null && mSlideShow != null) {
-                       mTopView.setAdapter(new ThumbnailAdapter(mContext, 
mSlideShow));
-               }
+               // Call again to set things up if necessary.
+               setCommunicationService(mCommunicationService);
 
                return v;
        }
@@ -85,6 +85,7 @@ public class PresentationFragment extends Fragment {
                                }
 
                                mTopView.setLayoutParams(aParams);
+                               mTopView.setImageHeight(aParams.height);
                                break;
                        }
                        // TODO Auto-generated method stub
@@ -93,11 +94,18 @@ public class PresentationFragment extends Fragment {
        }
 
        // ----------------------------------------------------- CLICK LISTENER 
----
-       protected class ClickListener implements 
AdapterView.OnItemClickListener {
-               public void onItemClick(AdapterView<?> parent, View v, int 
position,
-                               long id) {
+
+       protected class ClickListener implements OnItemSelectedListener {
+
+               @Override
+               public void onItemSelected(AdapterView<?> arg0, View arg1,
+                               int aPosition, long arg3) {
                        if (mCommunicationService != null)
-                               
mCommunicationService.getTransmitter().gotoSlide(position);
+                               
mCommunicationService.getTransmitter().gotoSlide(aPosition);
+               }
+
+               @Override
+               public void onNothingSelected(AdapterView<?> arg0) {
                }
        }
 
@@ -105,10 +113,16 @@ public class PresentationFragment extends Fragment {
        public void setCommunicationService(
                        CommunicationService aCommunicationService) {
                mCommunicationService = aCommunicationService;
+               if (mCommunicationService == null)
+                       return;
+
                mSlideShow = mCommunicationService.getSlideShow();
-               if (mTopView != null) {
+               if (mTopView != null && mSlideShow != null) {
                        mTopView.setAdapter(new ThumbnailAdapter(mContext, 
mSlideShow));
+                       mTopView.setSelection(mSlideShow.getCurrentSlide(), 
true);
+                       mTopView.setOnItemSelectedListener(new ClickListener());
                }
+
        }
 
        public void handleMessage(Message aMessage) {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/TestClient.java 
b/android/sdremote/src/org/libreoffice/impressremote/TestClient.java
index 7ecabbf..5620c5b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/TestClient.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/TestClient.java
@@ -65,6 +65,7 @@ public class TestClient extends Activity {
                // TODO Auto-generated method stub
                mCommunicationService.disconnect();
                stopService(new Intent(this, CommunicationService.class));
+               finish();
                super.onBackPressed();
        }
 
diff --git 
a/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java 
b/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
index de07603..2653277 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
@@ -24,6 +24,7 @@ import android.widget.AdapterView;
 import android.widget.BaseAdapter;
 import android.widget.GridView;
 import android.widget.ImageView;
+import android.widget.ImageView.ScaleType;
 import android.widget.TextView;
 
 public class ThumbnailFragment extends Fragment {
@@ -70,6 +71,10 @@ public class ThumbnailFragment extends Fragment {
        private void setSelected(int position) {
                formatUnselected(mCurrentImage, mCurrentText);
 
+               if (mGrid == null) {
+                       return;
+               }
+
                View aV = mGrid.getChildAt(position);
                if (aV != null) {
                        mCurrentImage = (ImageView) 
aV.findViewById(R.id.sub_thumbnail);
@@ -191,6 +196,11 @@ public class ThumbnailFragment extends Fragment {
                                aImage.setImageBitmap(aBitmap);
                        }
 
+                       // Width
+                       int aWidth = (mGrid.getWidth()) / 3 - 20;
+                       aImage.setMaxWidth(aWidth);
+                       aImage.setScaleType(ScaleType.MATRIX);
+
                        aText.setText(String.valueOf(position + 1));
 
                        return v;
diff --git 
a/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
 
b/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
index 9d07833..6fd3623 100644
--- 
a/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
+++ 
b/android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java
@@ -55,6 +55,9 @@ public class Receiver {
                        if (aInstruction.equals("slide_updated")) {
 
                                int aSlideNumber = 
Integer.parseInt(aCommand.get(1));
+
+                               mSlideShow.setCurrentSlide(aSlideNumber);
+
                                Message aMessage = Message.obtain(null,
                                                
CommunicationService.MSG_SLIDE_CHANGED);
                                Bundle aData = new Bundle();
diff --git a/sd/source/ui/remotecontrol/ImagePreparer.cxx 
b/sd/source/ui/remotecontrol/ImagePreparer.cxx
index 9497f87..b81ff77 100644
--- a/sd/source/ui/remotecontrol/ImagePreparer.cxx
+++ b/sd/source/ui/remotecontrol/ImagePreparer.cxx
@@ -58,7 +58,7 @@ void ImagePreparer::execute()
 void ImagePreparer::sendPreview( sal_uInt32 aSlideNumber )
 {
     sal_uInt64 aSize;
-    uno::Sequence<sal_Int8> aImageData = preparePreview( aSlideNumber, 140, 
100,
+    uno::Sequence<sal_Int8> aImageData = preparePreview( aSlideNumber, 320, 
240,
         aSize );
     if ( !xController->isRunning() )
         return;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to