[Libreoffice-commits] core.git: Branch 'feature/android-remote-ng' - 5 commits - android/sdremote

Artur Dryomov artur.dryomov at gmail.com
Tue Jul 16 15:47:53 PDT 2013


 android/sdremote/AndroidManifest.xml                                                       |    7 
 android/sdremote/res/drawable-hdpi/ic_action_grid.png                                      |binary
 android/sdremote/res/drawable-hdpi/ic_action_pager.png                                     |binary
 android/sdremote/res/drawable-mdpi/ic_action_grid.png                                      |binary
 android/sdremote/res/drawable-mdpi/ic_action_pager.png                                     |binary
 android/sdremote/res/drawable-nodpi/slide_unknown.png                                      |binary
 android/sdremote/res/drawable-xhdpi/ic_action_grid.png                                     |binary
 android/sdremote/res/drawable-xhdpi/ic_action_pager.png                                    |binary
 android/sdremote/res/drawable/background_grid_slide.xml                                    |   17 
 android/sdremote/res/drawable/background_pager_slide.xml                                   |   17 
 android/sdremote/res/layout/fragment_slides_grid.xml                                       |   14 
 android/sdremote/res/layout/fragment_slides_pager.xml                                      |   13 
 android/sdremote/res/layout/view_grid_slide.xml                                            |   27 +
 android/sdremote/res/layout/view_pager_slide.xml                                           |    7 
 android/sdremote/res/menu/menu_action_bar_slide_show_grid.xml                              |   10 
 android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml                             |   10 
 android/sdremote/res/values/colors.xml                                                     |    5 
 android/sdremote/res/values/dimens.xml                                                     |    9 
 android/sdremote/res/values/strings.xml                                                    |    4 
 android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java         |   10 
 android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java         |   13 
 android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java           |   10 
 android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java                  |    2 
 android/sdremote/src/org/libreoffice/impressremote/Intents.java                            |   14 
 android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java                   |   10 
 android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java                  |  104 +++++
 android/sdremote/src/org/libreoffice/impressremote/SlidesGridAdapter.java                  |  108 +++++
 android/sdremote/src/org/libreoffice/impressremote/SlidesGridFragment.java                 |  170 ++++++++
 android/sdremote/src/org/libreoffice/impressremote/SlidesPagerAdapter.java                 |   62 +++
 android/sdremote/src/org/libreoffice/impressremote/SlidesPagerFragment.java                |  189 ++++++++++
 android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java |    8 
 android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java       |   11 
 android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java            |   12 
 33 files changed, 854 insertions(+), 9 deletions(-)

New commits:
commit 1f516b07992b6d20a6349418122e3e5fa41bdab5
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Wed Jul 17 01:16:02 2013 +0300

    Add a basic slide show activity.
    
    Slides grid and pager could be switched now.
    
    Change-Id: I2c29f36b16c247f1d895773d90766828f571a375

diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml
index 72d692b..c2f9ed4 100644
--- a/android/sdremote/AndroidManifest.xml
+++ b/android/sdremote/AndroidManifest.xml
@@ -38,11 +38,16 @@
 
         <activity
             android:name=".ComputerCreationActivity"
-            android:label="Creation"
+            android:label="@string/title_creation"
             android:theme="@style/Theme.ImpressRemote.ComputerCreation">
         </activity>
 
         <activity
+            android:name=".SlideShowActivity"
+            android:label="@string/title_slide_show">
+        </activity>
+
+        <activity
             android:name=".SelectorActivity"
             android:label="@string/selector_choose_a_computer"
             android:uiOptions="splitActionBarWhenNarrow">
diff --git a/android/sdremote/res/drawable-hdpi/ic_action_grid.png b/android/sdremote/res/drawable-hdpi/ic_action_grid.png
new file mode 100755
index 0000000..6b58c2d
Binary files /dev/null and b/android/sdremote/res/drawable-hdpi/ic_action_grid.png differ
diff --git a/android/sdremote/res/drawable-hdpi/ic_action_pager.png b/android/sdremote/res/drawable-hdpi/ic_action_pager.png
new file mode 100755
index 0000000..3f93d33
Binary files /dev/null and b/android/sdremote/res/drawable-hdpi/ic_action_pager.png differ
diff --git a/android/sdremote/res/drawable-mdpi/ic_action_grid.png b/android/sdremote/res/drawable-mdpi/ic_action_grid.png
new file mode 100755
index 0000000..5b87a5f
Binary files /dev/null and b/android/sdremote/res/drawable-mdpi/ic_action_grid.png differ
diff --git a/android/sdremote/res/drawable-mdpi/ic_action_pager.png b/android/sdremote/res/drawable-mdpi/ic_action_pager.png
new file mode 100755
index 0000000..9b542d2
Binary files /dev/null and b/android/sdremote/res/drawable-mdpi/ic_action_pager.png differ
diff --git a/android/sdremote/res/drawable-xhdpi/ic_action_grid.png b/android/sdremote/res/drawable-xhdpi/ic_action_grid.png
new file mode 100755
index 0000000..4b4355c
Binary files /dev/null and b/android/sdremote/res/drawable-xhdpi/ic_action_grid.png differ
diff --git a/android/sdremote/res/drawable-xhdpi/ic_action_pager.png b/android/sdremote/res/drawable-xhdpi/ic_action_pager.png
new file mode 100755
index 0000000..6d2bfb6
Binary files /dev/null and b/android/sdremote/res/drawable-xhdpi/ic_action_pager.png differ
diff --git a/android/sdremote/res/menu/menu_action_bar_slide_show_grid.xml b/android/sdremote/res/menu/menu_action_bar_slide_show_grid.xml
new file mode 100644
index 0000000..d65c782
--- /dev/null
+++ b/android/sdremote/res/menu/menu_action_bar_slide_show_grid.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item
+        android:id="@+id/menu_slides_pager"
+        android:title="@string/menu_slides_pager"
+        android:icon="@drawable/ic_action_pager"
+        android:showAsAction="always"/>
+
+</menu>
\ No newline at end of file
diff --git a/android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml b/android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml
new file mode 100644
index 0000000..023dcd5
--- /dev/null
+++ b/android/sdremote/res/menu/menu_action_bar_slide_show_pager.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item
+        android:id="@+id/menu_slides_grid"
+        android:title="@string/menu_slides_grid"
+        android:icon="@drawable/ic_action_grid"
+        android:showAsAction="always"/>
+
+</menu>
\ No newline at end of file
diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml
index 4e7502d..42209c1 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -70,11 +70,15 @@
     <string name="title_wifi" translatable="false">WiFi</string>
     <string name="title_licenses">Open source licenses</string>
     <string name="title_connection">Connection</string>
+    <string name="title_creation">Creation</string>
+    <string name="title_slide_show">Slide Show</string>
 
     <string name="menu_licenses">Open source licenses</string>
     <string name="menu_reconnect">Reconnect</string>
     <string name="menu_add_computer">Add computer</string>
     <string name="menu_remove_computer">Remove</string>
+    <string name="menu_slides_grid">Slides grid</string>
+    <string name="menu_slides_pager">Slides pager</string>
 
     <string name="button_cancel">Cancel</string>
     <string name="button_save">Save</string>
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
index e1cc449..a9a52a1 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
@@ -184,6 +184,9 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
     }
 
     public void setUpPresentation() {
+        Intent aIntent = Intents.buildSlideShowIntent(getActivity());
+        startActivity(aIntent);
+
         getActivity().finish();
     }
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/Intents.java b/android/sdremote/src/org/libreoffice/impressremote/Intents.java
index 344175d..e517c2d 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/Intents.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/Intents.java
@@ -124,6 +124,10 @@ public final class Intents {
         return aIntent;
     }
 
+    public static Intent buildSlideShowIntent(Context aContext) {
+        return new Intent(aContext, SlideShowActivity.class);
+    }
+
     public static Intent buildLicensesIntent(Context aContext) {
         return new Intent(aContext, LicensesActivity.class);
     }
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java
new file mode 100644
index 0000000..77cf703
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java
@@ -0,0 +1,104 @@
+package org.libreoffice.impressremote;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
+
+import com.actionbarsherlock.app.SherlockFragmentActivity;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuItem;
+
+public class SlideShowActivity extends SherlockFragmentActivity {
+    private static enum Mode {
+        PAGER, GRID
+    }
+
+    private Mode mMode;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        mMode = Mode.PAGER;
+
+        setUpHomeButton();
+
+        setUpFragment();
+    }
+
+    private void setUpHomeButton() {
+        getSupportActionBar().setHomeButtonEnabled(true);
+    }
+
+    private void setUpFragment() {
+        switch (mMode) {
+            case PAGER:
+                setUpFragment(SlidesPagerFragment.newInstance());
+                break;
+
+            case GRID:
+                setUpFragment(SlidesGridFragment.newInstance());
+                break;
+
+            default:
+                setUpFragment(SlidesPagerFragment.newInstance());
+                break;
+        }
+    }
+
+    private void setUpFragment(Fragment aFragment) {
+        FragmentTransaction aTransaction = getSupportFragmentManager().beginTransaction();
+
+        aTransaction.replace(android.R.id.content, aFragment);
+
+        aTransaction.commit();
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu aMenu) {
+        getSupportMenuInflater().inflate(getActionBarMenuResourceId(), aMenu);
+
+        return true;
+    }
+
+    private int getActionBarMenuResourceId() {
+        switch (mMode) {
+            case PAGER:
+                return R.menu.menu_action_bar_slide_show_pager;
+
+            case GRID:
+                return R.menu.menu_action_bar_slide_show_grid;
+
+            default:
+                return R.menu.menu_action_bar_slide_show_pager;
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem aMenuItem) {
+        switch (aMenuItem.getItemId()) {
+            case R.id.menu_slides_grid:
+                mMode = Mode.GRID;
+
+                setUpFragment();
+                refreshActionBarMenu();
+
+                return true;
+
+            case R.id.menu_slides_pager:
+                mMode = Mode.PAGER;
+
+                setUpFragment();
+                refreshActionBarMenu();
+
+                return true;
+
+            default:
+                return super.onOptionsItemSelected(aMenuItem);
+        }
+    }
+
+    private void refreshActionBarMenu() {
+        supportInvalidateOptionsMenu();
+    }
+}
commit 745a1c4da4f1ded85a81c7a7c4bc4bf573e14713
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Wed Jul 17 00:27:04 2013 +0300

    Add a basic slides pager UI.
    
    Change-Id: I0ef53ca7bbcf5eab2bb131a88c687e302f80dc41

diff --git a/android/sdremote/res/drawable/background_grid_slide.xml b/android/sdremote/res/drawable/background_grid_slide.xml
index dc390bb..9c76602 100644
--- a/android/sdremote/res/drawable/background_grid_slide.xml
+++ b/android/sdremote/res/drawable/background_grid_slide.xml
@@ -6,7 +6,7 @@
 
     <stroke
         android:width="1dp"
-        android:color="@color/stroke_slide"/>
+        android:color="@color/stroke_grid_slide"/>
 
     <padding
         android:left="1dp"
diff --git a/android/sdremote/res/drawable/background_pager_slide.xml b/android/sdremote/res/drawable/background_pager_slide.xml
new file mode 100644
index 0000000..c65e424
--- /dev/null
+++ b/android/sdremote/res/drawable/background_pager_slide.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <solid
+        android:color="@android:color/transparent" />
+
+    <stroke
+        android:width="3dp"
+        android:color="@color/stroke_pager_slide"/>
+
+    <padding
+        android:left="0dp"
+        android:top="1dp"
+        android:right="0dp"
+        android:bottom="2dp"/>
+
+</shape>
\ No newline at end of file
diff --git a/android/sdremote/res/layout/fragment_slides_pager.xml b/android/sdremote/res/layout/fragment_slides_pager.xml
new file mode 100644
index 0000000..14e5cf1
--- /dev/null
+++ b/android/sdremote/res/layout/fragment_slides_pager.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+    <android.support.v4.view.ViewPager
+        android:id="@+id/pager_slides"
+        android:padding="@dimen/padding_slides_pager"
+        android:layout_centerInParent="true"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/height_slides_pager"/>
+
+</RelativeLayout>
diff --git a/android/sdremote/res/layout/view_pager_slide.xml b/android/sdremote/res/layout/view_pager_slide.xml
new file mode 100644
index 0000000..0ebb367
--- /dev/null
+++ b/android/sdremote/res/layout/view_pager_slide.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/image_slide_preview"
+    android:background="@drawable/background_pager_slide"
+    android:adjustViewBounds="true"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"/>
\ No newline at end of file
diff --git a/android/sdremote/res/values/colors.xml b/android/sdremote/res/values/colors.xml
index 59281e2..fbc2e44 100644
--- a/android/sdremote/res/values/colors.xml
+++ b/android/sdremote/res/values/colors.xml
@@ -5,7 +5,8 @@
     <color name="background_action_bar_divider">#55ffffff</color>
     <color name="background_slide_index">#7f000000</color>
 
-    <color name="stroke_slide">#65000000</color>
+    <color name="stroke_grid_slide">#65000000</color>
+    <color name="stroke_pager_slide">#35000000</color>
 
     <color name="orange">#EE4400</color>
     <color name="grey">#303030</color>
diff --git a/android/sdremote/res/values/dimens.xml b/android/sdremote/res/values/dimens.xml
index b026b32..b73555f 100644
--- a/android/sdremote/res/values/dimens.xml
+++ b/android/sdremote/res/values/dimens.xml
@@ -4,6 +4,7 @@
     <dimen name="padding_action_bar_button_drawable">8dp</dimen>
     <dimen name="padding_creation_layout">16dp</dimen>
     <dimen name="padding_slides_grid">4dp</dimen>
+    <dimen name="padding_slides_pager">16dp</dimen>
     <dimen name="padding_slide">4dp</dimen>
 
     <dimen name="padding_horizontal_list_item">8dp</dimen>
@@ -16,6 +17,7 @@
     <dimen name="padding_vertical_edit">8dp</dimen>
 
     <dimen name="margin_vertical_action_bar_divider">12dp</dimen>
+    <dimen name="margin_slide">8dp</dimen>
 
     <dimen name="width_action_bar_divider">0.5dp</dimen>
     <dimen name="width_slides_grid_column">90dp</dimen>
@@ -26,4 +28,6 @@
 
     <dimen name="spacing_slides_grid">4dp</dimen>
 
+    <dimen name="height_slides_pager">250dp</dimen>
+
 </resources>
\ No newline at end of file
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerAdapter.java
new file mode 100644
index 0000000..bb7065f
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerAdapter.java
@@ -0,0 +1,62 @@
+package org.libreoffice.impressremote;
+
+import android.content.Context;
+import android.support.v4.view.PagerAdapter;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import org.libreoffice.impressremote.communication.SlideShow;
+
+public class SlidesPagerAdapter extends PagerAdapter {
+    private final LayoutInflater mLayoutInflater;
+
+    private final SlideShow mSlideShow;
+
+    public SlidesPagerAdapter(Context aContext, SlideShow aSlideShow) {
+        mLayoutInflater = buildLayoutInflater(aContext);
+
+        mSlideShow = aSlideShow;
+    }
+
+    private LayoutInflater buildLayoutInflater(Context aContext) {
+        return (LayoutInflater) aContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+    }
+    @Override
+    public int getCount() {
+        return mSlideShow.getSlidesCount();
+    }
+
+    @Override
+    public Object instantiateItem(ViewGroup aViewGroup, int aPosition) {
+        ImageView aSlideView = (ImageView) getView(aViewGroup);
+
+        aSlideView.setImageBitmap(mSlideShow.getSlidePreview(aPosition));
+
+        aViewGroup.addView(aSlideView);
+
+        return aSlideView;
+    }
+
+    private View getView(ViewGroup aViewGroup) {
+        return mLayoutInflater.inflate(R.layout.view_pager_slide, aViewGroup, false);
+    }
+
+    @Override
+    public void destroyItem(ViewGroup aViewGroup, int aPosition, Object aObject) {
+        View aView = (View) aObject;
+
+        aViewGroup.removeView(aView);
+    }
+
+    @Override
+    public boolean isViewFromObject(View aView, Object aObject) {
+        return aView == aObject;
+    }
+
+    @Override
+    public int getItemPosition(Object aObject) {
+        return POSITION_NONE;
+    }
+}
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerFragment.java b/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerFragment.java
new file mode 100644
index 0000000..fd1ea3c
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerFragment.java
@@ -0,0 +1,189 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+package org.libreoffice.impressremote;
+
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.support.v4.content.LocalBroadcastManager;
+import android.support.v4.view.ViewPager;
+import android.util.TypedValue;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.actionbarsherlock.app.SherlockFragment;
+import org.libreoffice.impressremote.communication.CommunicationService;
+
+public class SlidesPagerFragment extends SherlockFragment implements ServiceConnection, ViewPager.OnPageChangeListener {
+    private CommunicationService mCommunicationService;
+    private BroadcastReceiver mIntentsReceiver;
+
+    public static SlidesPagerFragment newInstance() {
+        return new SlidesPagerFragment();
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater aInflater, ViewGroup aContainer, Bundle aSavedInstanceState) {
+        return aInflater.inflate(R.layout.fragment_slides_pager, aContainer, false);
+    }
+
+    @Override
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+
+        bindService();
+    }
+
+    private void bindService() {
+        Intent aServiceIntent = new Intent(getActivity(), CommunicationService.class);
+
+        getActivity().bindService(aServiceIntent, this, Context.BIND_AUTO_CREATE);
+    }
+
+    @Override
+    public void onServiceConnected(ComponentName aComponentName, IBinder aBinder) {
+        CommunicationService.CBinder aServiceBinder = (CommunicationService.CBinder) aBinder;
+
+        mCommunicationService = aServiceBinder.getService();
+
+        mCommunicationService.getTransmitter().startPresentation();
+
+        setUpSlidesPager();
+    }
+
+    private void setUpSlidesPager() {
+        SlidesPagerAdapter aSlidesPagerAdapter = new SlidesPagerAdapter(getActivity(),
+            mCommunicationService.getSlideShow());
+
+        getSlidesPager().setAdapter(aSlidesPagerAdapter);
+
+        getSlidesPager().setPageMargin(getSlidesMarginInPx());
+
+        getSlidesPager().setOnPageChangeListener(this);
+    }
+
+    private ViewPager getSlidesPager() {
+        return (ViewPager) getView().findViewById(R.id.pager_slides);
+    }
+
+    private int getSlidesMarginInPx() {
+        float aSlideMarginInDp = getResources().getDimension(R.dimen.margin_slide);
+
+        return (int) TypedValue
+            .applyDimension(TypedValue.COMPLEX_UNIT_PX, aSlideMarginInDp,
+                getResources().getDisplayMetrics());
+    }
+
+    @Override
+    public void onPageScrolled(int aPosition, float aPositionOffset, int aPositionOffsetPixels) {
+    }
+
+    @Override
+    public void onPageSelected(int aPosition) {
+        mCommunicationService.getTransmitter().setCurrentSlide(aPosition);
+    }
+
+    @Override
+    public void onPageScrollStateChanged(int aState) {
+    }
+
+    @Override
+    public void onServiceDisconnected(ComponentName aComponentName) {
+        mCommunicationService = null;
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        registerIntentsReceiver();
+    }
+
+    private void registerIntentsReceiver() {
+        mIntentsReceiver = new IntentsReceiver(this);
+        IntentFilter aIntentFilter = buildIntentsReceiverFilter();
+
+        getBroadcastManager().registerReceiver(mIntentsReceiver, aIntentFilter);
+    }
+
+    private static final class IntentsReceiver extends BroadcastReceiver {
+        private final SlidesPagerFragment mSlidesGridFragment;
+
+        private IntentsReceiver(SlidesPagerFragment aSlidesGridFragment) {
+            mSlidesGridFragment = aSlidesGridFragment;
+        }
+
+        @Override
+        public void onReceive(Context aContext, Intent aIntent) {
+            if (Intents.Actions.SLIDE_PREVIEW.equals(aIntent.getAction())) {
+                mSlidesGridFragment.refreshSlidesGrid();
+            }
+        }
+    }
+
+    private IntentFilter buildIntentsReceiverFilter() {
+        IntentFilter aIntentFilter = new IntentFilter();
+        aIntentFilter.addAction(Intents.Actions.SLIDE_PREVIEW);
+
+        return aIntentFilter;
+    }
+
+    private LocalBroadcastManager getBroadcastManager() {
+        Context aContext = getActivity().getApplicationContext();
+
+        return LocalBroadcastManager.getInstance(aContext);
+    }
+
+    private void refreshSlidesGrid() {
+        getSlidesPager().getAdapter().notifyDataSetChanged();
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+
+        unregisterIntentsReceiver();
+    }
+
+    private void unregisterIntentsReceiver() {
+        try {
+            getBroadcastManager().unregisterReceiver(mIntentsReceiver);
+        } catch (IllegalArgumentException e) {
+            // Receiver not registered.
+            // Fixed in Honeycomb: Android’s issue #6191.
+        }
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+
+        unbindService();
+    }
+
+    private void unbindService() {
+        if (!isServiceBound()) {
+            return;
+        }
+
+        getActivity().unbindService(this);
+    }
+
+    private boolean isServiceBound() {
+        return mCommunicationService != null;
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b468bcafdc85174fbf153f51a633a5a6902511b7
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Tue Jul 16 00:13:34 2013 +0300

    Add a basic slides grid UI.
    
    The slides adapter is using the ViewHolder pattern and view recycling to
    improve performance.
    
    Change-Id: I8f922799dc3af73e9ecaec92ca91eb38e8a784c0

diff --git a/android/sdremote/res/drawable-nodpi/slide_unknown.png b/android/sdremote/res/drawable-nodpi/slide_unknown.png
new file mode 100644
index 0000000..57df42b
Binary files /dev/null and b/android/sdremote/res/drawable-nodpi/slide_unknown.png differ
diff --git a/android/sdremote/res/drawable/background_grid_slide.xml b/android/sdremote/res/drawable/background_grid_slide.xml
new file mode 100644
index 0000000..dc390bb
--- /dev/null
+++ b/android/sdremote/res/drawable/background_grid_slide.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <solid
+        android:color="@android:color/transparent" />
+
+    <stroke
+        android:width="1dp"
+        android:color="@color/stroke_slide"/>
+
+    <padding
+        android:left="1dp"
+        android:top="1dp"
+        android:right="1dp"
+        android:bottom="1.5dp"/>
+
+</shape>
\ No newline at end of file
diff --git a/android/sdremote/res/layout/fragment_slides_grid.xml b/android/sdremote/res/layout/fragment_slides_grid.xml
new file mode 100644
index 0000000..6a09fea
--- /dev/null
+++ b/android/sdremote/res/layout/fragment_slides_grid.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<GridView xmlns:android="http://schemas.android.com/apk/res/android"
+          android:id="@+id/grid_slides"
+          android:columnWidth="@dimen/width_slides_grid_column"
+          android:horizontalSpacing="@dimen/spacing_slides_grid"
+          android:verticalSpacing="@dimen/spacing_slides_grid"
+          android:numColumns="auto_fit"
+          android:stretchMode="columnWidth"
+          android:scrollbarStyle="outsideOverlay"
+          android:gravity="center"
+          android:padding="@dimen/padding_slides_grid"
+          android:clipToPadding="false"
+          android:layout_width="match_parent"
+          android:layout_height="match_parent"/>
\ No newline at end of file
diff --git a/android/sdremote/res/layout/view_grid_slide.xml b/android/sdremote/res/layout/view_grid_slide.xml
new file mode 100644
index 0000000..2cda3bf
--- /dev/null
+++ b/android/sdremote/res/layout/view_grid_slide.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:padding="@dimen/padding_slide"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+    <ImageView
+        android:id="@+id/image_slide_preview"
+        android:scaleType="centerCrop"
+        android:adjustViewBounds="true"
+        android:background="@drawable/background_grid_slide"
+        android:layout_alignParentTop="true"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+    <TextView
+        android:id="@+id/text_slide_index"
+        android:background="@color/background_slide_index"
+        android:textColor="@android:color/white"
+        android:singleLine="true"
+        android:layout_alignParentBottom="true"
+        android:layout_width="wrap_content"
+        android:minEms="2"
+        android:gravity="center_horizontal"
+        android:layout_height="wrap_content"/>
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/android/sdremote/res/values/colors.xml b/android/sdremote/res/values/colors.xml
index f15f73b..59281e2 100644
--- a/android/sdremote/res/values/colors.xml
+++ b/android/sdremote/res/values/colors.xml
@@ -2,8 +2,10 @@
 <resources>
 
     <color name="background_action_bar">#e46f1f</color>
-
     <color name="background_action_bar_divider">#55ffffff</color>
+    <color name="background_slide_index">#7f000000</color>
+
+    <color name="stroke_slide">#65000000</color>
 
     <color name="orange">#EE4400</color>
     <color name="grey">#303030</color>
diff --git a/android/sdremote/res/values/dimens.xml b/android/sdremote/res/values/dimens.xml
index 694e02e..b026b32 100644
--- a/android/sdremote/res/values/dimens.xml
+++ b/android/sdremote/res/values/dimens.xml
@@ -3,6 +3,8 @@
 
     <dimen name="padding_action_bar_button_drawable">8dp</dimen>
     <dimen name="padding_creation_layout">16dp</dimen>
+    <dimen name="padding_slides_grid">4dp</dimen>
+    <dimen name="padding_slide">4dp</dimen>
 
     <dimen name="padding_horizontal_list_item">8dp</dimen>
     <dimen name="padding_horizontal_connection_layout">40dp</dimen>
@@ -16,9 +18,12 @@
     <dimen name="margin_vertical_action_bar_divider">12dp</dimen>
 
     <dimen name="width_action_bar_divider">0.5dp</dimen>
+    <dimen name="width_slides_grid_column">90dp</dimen>
 
     <dimen name="text_size_list_item">18sp</dimen>
     <dimen name="text_size_pin">35sp</dimen>
     <dimen name="text_size_error_title">20sp</dimen>
 
+    <dimen name="spacing_slides_grid">4dp</dimen>
+
 </resources>
\ No newline at end of file
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesGridAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/SlidesGridAdapter.java
new file mode 100644
index 0000000..3ccfb51
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/SlidesGridAdapter.java
@@ -0,0 +1,108 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+package org.libreoffice.impressremote;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import org.libreoffice.impressremote.communication.SlideShow;
+
+public class SlidesGridAdapter extends BaseAdapter {
+    private final LayoutInflater mLayoutInflater;
+
+    private final SlideShow mSlideShow;
+
+    public SlidesGridAdapter(Context aContext, SlideShow aSlideShow) {
+        mLayoutInflater = buildLayoutInflater(aContext);
+
+        mSlideShow = aSlideShow;
+    }
+
+    private LayoutInflater buildLayoutInflater(Context aContext) {
+        return (LayoutInflater) aContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+    }
+
+    @Override
+    public int getCount() {
+        return mSlideShow.getSlidesCount();
+    }
+
+    @Override
+    public Object getItem(int aPosition) {
+        return mSlideShow.getSlidePreview(aPosition);
+    }
+
+    @Override
+    public long getItemId(int aPosition) {
+        return aPosition;
+    }
+
+    @Override
+    public View getView(int aPosition, View aConvertView, ViewGroup aViewGroup) {
+        View aSlideView = getView(aConvertView, aViewGroup);
+        ViewHolder aSlideViewHolder = getViewHolder(aSlideView);
+
+        if (isSlidePreviewAvailable(aPosition)) {
+            aSlideViewHolder.aSlidePreview.setImageBitmap(mSlideShow.getSlidePreview(aPosition));
+        } else {
+            aSlideViewHolder.aSlidePreview.setImageResource(R.drawable.slide_unknown);
+        }
+
+        aSlideViewHolder.aSlideIndex.setText(buildSlideIndex(aPosition));
+
+        return aSlideView;
+    }
+
+    private View getView(View aConvertView, ViewGroup aViewGroup) {
+        if (aConvertView != null) {
+            return aConvertView;
+        }
+
+        return mLayoutInflater.inflate(R.layout.view_grid_slide, aViewGroup, false);
+    }
+
+    private ViewHolder getViewHolder(View aView) {
+        if (aView.getTag() != null) {
+            return (ViewHolder) aView.getTag();
+        }
+
+        return buildViewHolder(aView);
+    }
+
+    private static final class ViewHolder {
+        public ImageView aSlidePreview;
+        public TextView aSlideIndex;
+    }
+
+    private ViewHolder buildViewHolder(View aView) {
+        ViewHolder aViewHolder = new ViewHolder();
+
+        aViewHolder.aSlidePreview = (ImageView) aView.findViewById(R.id.image_slide_preview);
+        aViewHolder.aSlideIndex = (TextView) aView.findViewById(R.id.text_slide_index);
+
+        return aViewHolder;
+    }
+
+    private boolean isSlidePreviewAvailable(int aSlideIndex) {
+        return mSlideShow.getSlidePreview(aSlideIndex) != null;
+    }
+
+    private String buildSlideIndex(int aPosition) {
+        int aHumanSlideIndex = aPosition + 1;
+
+        return Integer.toString(aHumanSlideIndex);
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesGridFragment.java b/android/sdremote/src/org/libreoffice/impressremote/SlidesGridFragment.java
new file mode 100644
index 0000000..b16b509
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/SlidesGridFragment.java
@@ -0,0 +1,170 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+package org.libreoffice.impressremote;
+
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.support.v4.content.LocalBroadcastManager;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.GridView;
+
+import com.actionbarsherlock.app.SherlockFragment;
+import org.libreoffice.impressremote.communication.CommunicationService;
+
+public class SlidesGridFragment extends SherlockFragment implements ServiceConnection, AdapterView.OnItemClickListener {
+    private CommunicationService mCommunicationService;
+    private BroadcastReceiver mIntentsReceiver;
+
+    public static SlidesGridFragment newInstance() {
+        return new SlidesGridFragment();
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater aInflater, ViewGroup aContainer, Bundle aSavedInstanceState) {
+        return aInflater.inflate(R.layout.fragment_slides_grid, aContainer, false);
+    }
+
+    @Override
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+
+        bindService();
+    }
+
+    private void bindService() {
+        Intent aServiceIntent = new Intent(getActivity(), CommunicationService.class);
+
+        getActivity().bindService(aServiceIntent, this, Context.BIND_AUTO_CREATE);
+    }
+
+    @Override
+    public void onServiceConnected(ComponentName aComponentName, IBinder aBinder) {
+        CommunicationService.CBinder aServiceBinder = (CommunicationService.CBinder) aBinder;
+
+        mCommunicationService = aServiceBinder.getService();
+
+        mCommunicationService.getTransmitter().startPresentation();
+
+        setUpSlidesGrid();
+    }
+
+    private void setUpSlidesGrid() {
+        SlidesGridAdapter aSlidesGridAdapter = new SlidesGridAdapter(getActivity(),
+            mCommunicationService.getSlideShow());
+
+        getSlidesGrid().setAdapter(aSlidesGridAdapter);
+        getSlidesGrid().setOnItemClickListener(this);
+    }
+
+    private GridView getSlidesGrid() {
+        return (GridView) getView().findViewById(R.id.grid_slides);
+    }
+
+    @Override
+    public void onServiceDisconnected(ComponentName aComponentName) {
+        mCommunicationService = null;
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        registerIntentsReceiver();
+    }
+
+    private void registerIntentsReceiver() {
+        mIntentsReceiver = new IntentsReceiver(this);
+        IntentFilter aIntentFilter = buildIntentsReceiverFilter();
+
+        getBroadcastManager().registerReceiver(mIntentsReceiver, aIntentFilter);
+    }
+
+    @Override
+    public void onItemClick(AdapterView<?> aAdapterView, View aView, int aPosition, long aId) {
+        mCommunicationService.getTransmitter().setCurrentSlide(aPosition);
+    }
+
+    private static final class IntentsReceiver extends BroadcastReceiver {
+        private final SlidesGridFragment mSlidesGridFragment;
+
+        private IntentsReceiver(SlidesGridFragment aSlidesGridFragment) {
+            mSlidesGridFragment = aSlidesGridFragment;
+        }
+
+        @Override
+        public void onReceive(Context aContext, Intent aIntent) {
+            if (Intents.Actions.SLIDE_PREVIEW.equals(aIntent.getAction())) {
+                mSlidesGridFragment.refreshSlidesGrid();
+            }
+        }
+    }
+
+    private IntentFilter buildIntentsReceiverFilter() {
+        IntentFilter aIntentFilter = new IntentFilter();
+        aIntentFilter.addAction(Intents.Actions.SLIDE_PREVIEW);
+
+        return aIntentFilter;
+    }
+
+    private LocalBroadcastManager getBroadcastManager() {
+        Context aContext = getActivity().getApplicationContext();
+
+        return LocalBroadcastManager.getInstance(aContext);
+    }
+
+    private void refreshSlidesGrid() {
+        getSlidesGrid().invalidateViews();
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+
+        unregisterIntentsReceiver();
+    }
+
+    private void unregisterIntentsReceiver() {
+        try {
+            getBroadcastManager().unregisterReceiver(mIntentsReceiver);
+        } catch (IllegalArgumentException e) {
+            // Receiver not registered.
+            // Fixed in Honeycomb: Android’s issue #6191.
+        }
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+
+        unbindService();
+    }
+
+    private void unbindService() {
+        if (!isServiceBound()) {
+            return;
+        }
+
+        getActivity().unbindService(this);
+    }
+
+    private boolean isServiceBound() {
+        return mCommunicationService != null;
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index fa9768a..3bb00c5 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -58,6 +58,8 @@ public class CommunicationService extends Service implements Runnable, MessagesL
 
         mServersManager = new ServersManager(this);
 
+        mSlideShow = new SlideShow();
+
         mThread = new Thread(this);
         mThread.start();
     }
@@ -240,7 +242,7 @@ public class CommunicationService extends Service implements Runnable, MessagesL
 
     @Override
     public void onSlideShowStart(int aSlidesCount, int aCurrentSlideIndex) {
-        mSlideShow = new SlideShow();
+        mSlideShow.cleanUp();
         mSlideShow.setSlidesCount(aSlidesCount);
 
         Intent aIntent = Intents.buildSlideShowRunningIntent();
@@ -251,7 +253,7 @@ public class CommunicationService extends Service implements Runnable, MessagesL
 
     @Override
     public void onSlideShowFinish() {
-        mSlideShow = new SlideShow();
+        mSlideShow.cleanUp();
 
         Intent aIntent = Intents.buildSlideShowStoppedIntent();
         LocalBroadcastManager.getInstance(this).sendBroadcast(aIntent);
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
index 347a92c..f8ae6d8 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
@@ -33,7 +33,7 @@ public class SlideShow {
     }
 
     public void setSlidesCount(int aSlidesCount) {
-        this.mSlidesCount = aSlidesCount;
+        mSlidesCount = aSlidesCount;
     }
 
     public int getSlidesCount() {
@@ -41,7 +41,7 @@ public class SlideShow {
     }
 
     public void setCurrentSlideIndex(int aCurrentSlideIndex) {
-        this.mCurrentSlideIndex = aCurrentSlideIndex;
+        mCurrentSlideIndex = aCurrentSlideIndex;
     }
 
     public int getCurrentSlideIndex() {
@@ -76,6 +76,14 @@ public class SlideShow {
     public Timer getTimer() {
         return mTimer;
     }
+
+    public void cleanUp() {
+        mSlidesCount = 0;
+        mCurrentSlideIndex = 0;
+
+        mSlidePreviews.clear();
+        mSlideNotes.clear();
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 2b79bf934767c7b990fe8de66f5dd38e521b5e5f
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 14 22:47:16 2013 +0300

    Fix source files headers and footers.
    
    Change-Id: I3d5298f43efdf220fc56eee60636a94985a07360

diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java
index aa256bb..488e206 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice.impressremote;
 
 import android.os.Bundle;
@@ -49,3 +57,5 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity {
         finish();
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
index 20d8267..e1cc449 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice.impressremote;
 
 import android.content.BroadcastReceiver;
@@ -262,3 +270,5 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
         getActivity().unbindService(this);
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java
index 4311ff2..605838e 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice.impressremote;
 
 import android.app.Activity;
@@ -116,3 +124,5 @@ public class ComputerCreationActivity extends SherlockFragmentActivity implement
         finish();
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java b/android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java
index c4511e1..f9805aa 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice.impressremote;
 
 import android.content.ContentResolver;
@@ -54,3 +62,5 @@ public class LicensesActivity extends SherlockActivity {
         finish();
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
index 967ef9d..d9363d5 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
@@ -1,7 +1,16 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice.impressremote.communication;
 
 import java.util.ArrayList;
 import java.util.HashSet;
+
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -114,3 +123,5 @@ public class ServersManager {
         mBlacklistedServers.add(aServer);
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit dac3ebb00aa2fac33d784d2b254b56ad17cca450
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 14 22:44:58 2013 +0300

    Fix intent creation to use the static factory class.
    
    Change-Id: I7c9cd2ab8a0d185e7ace7d7f9c0183775b620178

diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java
index 2c294a5..20a289a 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java
@@ -293,7 +293,7 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
     }
 
     private void callComputerCreationActivity() {
-        Intent aIntent = new Intent(getActivity(), ComputerCreationActivity.class);
+        Intent aIntent = Intents.buildComputerCreationIntent(getActivity());
         startActivityForResult(aIntent, Intents.RequestCodes.CREATE_SERVER);
     }
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/Intents.java b/android/sdremote/src/org/libreoffice/impressremote/Intents.java
index 93d71cb..344175d 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/Intents.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/Intents.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice.impressremote;
 
 import android.content.Context;
@@ -120,3 +128,5 @@ public final class Intents {
         return new Intent(aContext, LicensesActivity.class);
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index 9b2f47a..fa9768a 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -14,12 +14,10 @@ import android.app.Service;
 import android.bluetooth.BluetoothAdapter;
 import android.content.Intent;
 import android.os.Binder;
-import android.os.Build;
 import android.os.IBinder;
 import android.support.v4.content.LocalBroadcastManager;
 
 import org.libreoffice.impressremote.Intents;
-import org.libreoffice.impressremote.Preferences;
 
 public class CommunicationService extends Service implements Runnable, MessagesListener {
     public static enum State {


More information about the Libreoffice-commits mailing list