[Libreoffice-commits] core.git: 43 commits - android/sdremote

Artur Dryomov artur.dryomov at gmail.com
Thu Jul 25 10:03:50 PDT 2013


 android/sdremote/AndroidManifest.xml                                                            |   78 -
 android/sdremote/res/drawable-hdpi/action_bar_tab_selected.9.png                                |binary
 android/sdremote/res/drawable-hdpi/action_bar_tab_selected_pressed.9.png                        |binary
 android/sdremote/res/drawable-hdpi/action_bar_tab_unselected.9.png                              |binary
 android/sdremote/res/drawable-hdpi/ic_action_add_computer.png                                   |binary
 android/sdremote/res/drawable-hdpi/ic_action_cancel.png                                         |binary
 android/sdremote/res/drawable-hdpi/ic_action_grid.png                                           |binary
 android/sdremote/res/drawable-hdpi/ic_action_pager.png                                          |binary
 android/sdremote/res/drawable-hdpi/ic_action_reconnect.png                                      |binary
 android/sdremote/res/drawable-hdpi/ic_action_save.png                                           |binary
 android/sdremote/res/drawable-hdpi/ic_logo.png                                                  |binary
 android/sdremote/res/drawable-land-hdpi/action_bar_tab_selected.9.png                           |binary
 android/sdremote/res/drawable-land-hdpi/action_bar_tab_selected_pressed.9.png                   |binary
 android/sdremote/res/drawable-land-hdpi/action_bar_tab_unselected.9.png                         |binary
 android/sdremote/res/drawable-land-mdpi/action_bar_tab_selected.9.png                           |binary
 android/sdremote/res/drawable-land-mdpi/action_bar_tab_selected_pressed.9.png                   |binary
 android/sdremote/res/drawable-land-mdpi/action_bar_tab_unselected.9.png                         |binary
 android/sdremote/res/drawable-land-xhdpi/action_bar_tab_selected.9.png                          |binary
 android/sdremote/res/drawable-land-xhdpi/action_bar_tab_selected_pressed.9.png                  |binary
 android/sdremote/res/drawable-land-xhdpi/action_bar_tab_unselected.9.png                        |binary
 android/sdremote/res/drawable-mdpi/action_bar_tab_selected.9.png                                |binary
 android/sdremote/res/drawable-mdpi/action_bar_tab_selected_pressed.9.png                        |binary
 android/sdremote/res/drawable-mdpi/action_bar_tab_unselected.9.png                              |binary
 android/sdremote/res/drawable-mdpi/ic_action_add_computer.png                                   |binary
 android/sdremote/res/drawable-mdpi/ic_action_cancel.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-mdpi/ic_action_reconnect.png                                      |binary
 android/sdremote/res/drawable-mdpi/ic_action_save.png                                           |binary
 android/sdremote/res/drawable-mdpi/ic_logo.png                                                  |binary
 android/sdremote/res/drawable-nodpi/slide_unknown.png                                           |binary
 android/sdremote/res/drawable-xhdpi/action_bar_tab_selected.9.png                               |binary
 android/sdremote/res/drawable-xhdpi/action_bar_tab_selected_pressed.9.png                       |binary
 android/sdremote/res/drawable-xhdpi/action_bar_tab_unselected.9.png                             |binary
 android/sdremote/res/drawable-xhdpi/ic_action_add_computer.png                                  |binary
 android/sdremote/res/drawable-xhdpi/ic_action_cancel.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-xhdpi/ic_action_reconnect.png                                     |binary
 android/sdremote/res/drawable-xhdpi/ic_action_save.png                                          |binary
 android/sdremote/res/drawable-xhdpi/ic_logo.png                                                 |binary
 android/sdremote/res/drawable/action_bar_tab.xml                                                |   26 
 android/sdremote/res/drawable/actionbar_thumbs.xml                                              |    9 
 android/sdremote/res/drawable/actionbar_toggle.xml                                              |    8 
 android/sdremote/res/drawable/background_grid_slide.xml                                         |   17 
 android/sdremote/res/drawable/background_pager_slide.xml                                        |   17 
 android/sdremote/res/drawable/clockbar_clock.xml                                                |   11 
 android/sdremote/res/drawable/clockbar_countdown.xml                                            |   11 
 android/sdremote/res/drawable/clockbar_stopwatch.xml                                            |   11 
 android/sdremote/res/drawable/handle.xml                                                        |    9 
 android/sdremote/res/drawable/rectangle_black.xml                                               |   11 
 android/sdremote/res/layout-land/fragment_blankscreen.xml                                       |   55 
 android/sdremote/res/layout-land/fragment_presentation.xml                                      |   59 -
 android/sdremote/res/layout-v11/action_bar_computer_creation.xml                                |   51 
 android/sdremote/res/layout/action_bar_computer_creation.xml                                    |   54 
 android/sdremote/res/layout/activity_computer_creation.xml                                      |   33 
 android/sdremote/res/layout/activity_computers.xml                                              |    6 
 android/sdremote/res/layout/activity_licenses.xml                                               |    5 
 android/sdremote/res/layout/activity_pairing.xml                                                |   43 
 android/sdremote/res/layout/activity_presentation.xml                                           |   14 
 android/sdremote/res/layout/activity_reconnect.xml                                              |   56 -
 android/sdremote/res/layout/activity_selector.xml                                               |   72 -
 android/sdremote/res/layout/activity_selector_sublayout_server.xml                              |   21 
 android/sdremote/res/layout/activity_startpresentation.xml                                      |   22 
 android/sdremote/res/layout/dialog_about.xml                                                    |   83 -
 android/sdremote/res/layout/dialog_addserver.xml                                                |   56 -
 android/sdremote/res/layout/fragment_blankscreen.xml                                            |   45 
 android/sdremote/res/layout/fragment_computer_connection.xml                                    |   76 +
 android/sdremote/res/layout/fragment_presentation.xml                                           |   48 
 android/sdremote/res/layout/fragment_slides_grid.xml                                            |   14 
 android/sdremote/res/layout/fragment_slides_pager.xml                                           |   13 
 android/sdremote/res/layout/fragment_thumbnail.xml                                              |   14 
 android/sdremote/res/layout/list_item.xml                                                       |    8 
 android/sdremote/res/layout/main.xml                                                            |   13 
 android/sdremote/res/layout/presentation_actionbar.xml                                          |   25 
 android/sdremote/res/layout/presentation_clockbar.xml                                           |  101 -
 android/sdremote/res/layout/slide_thumbnail.xml                                                 |   22 
 android/sdremote/res/layout/testlayout.xml                                                      |   40 
 android/sdremote/res/layout/view_grid_slide.xml                                                 |   27 
 android/sdremote/res/layout/view_pager_slide.xml                                                |    7 
 android/sdremote/res/menu/actionbar_presentation.xml                                            |   21 
 android/sdremote/res/menu/actionbar_selector.xml                                                |   18 
 android/sdremote/res/menu/menu_action_bar_computer_connection.xml                               |   10 
 android/sdremote/res/menu/menu_action_bar_computers.xml                                         |   15 
 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/menu/menu_context_computers.xml                                            |    8 
 android/sdremote/res/menu/selector_activity.xml                                                 |    6 
 android/sdremote/res/menu/selector_contextmenu.xml                                              |    4 
 android/sdremote/res/values-v10/styles.xml                                                      |   18 
 android/sdremote/res/values/attrs.xml                                                           |   10 
 android/sdremote/res/values/colors.xml                                                          |   11 
 android/sdremote/res/values/dimens.xml                                                          |   34 
 android/sdremote/res/values/strings.xml                                                         |   95 -
 android/sdremote/res/values/styles.xml                                                          |   80 -
 android/sdremote/res/values/themes.xml                                                          |   48 
 android/sdremote/res/xml/preferences.xml                                                        |   21 
 android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java                      |   61 -
 android/sdremote/src/org/libreoffice/impressremote/ActivityChangeBroadcastProcessor.java        |   66 -
 android/sdremote/src/org/libreoffice/impressremote/BlankScreenFragment.java                     |   88 -
 android/sdremote/src/org/libreoffice/impressremote/Globals.java                                 |   17 
 android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java                         |  117 --
 android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java                    |  559 ----------
 android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java                    |  310 -----
 android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java                        |  411 -------
 android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java                        |   39 
 android/sdremote/src/org/libreoffice/impressremote/StartPresentationActivity.java               |  117 --
 android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java                       |  229 ----
 android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java     |   64 +
 android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java       |  125 ++
 android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java              |  123 ++
 android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java               |   67 +
 android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java              |  269 ++++
 android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java                |   64 +
 android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java           |   52 
 android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java               |  105 +
 android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java              |   81 +
 android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java           |  106 -
 android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java           |  114 --
 android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServerConnection.java |   76 +
 android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java    |  149 ++
 android/sdremote/src/org/libreoffice/impressremote/communication/Client.java                    |  146 --
 android/sdremote/src/org/libreoffice/impressremote/communication/CommandsTransmitter.java       |   87 +
 android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java      |  386 ++----
 android/sdremote/src/org/libreoffice/impressremote/communication/MessagesListener.java          |   27 
 android/sdremote/src/org/libreoffice/impressremote/communication/MessagesReceiver.java          |  172 +++
 android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java             |  142 --
 android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java           |   79 +
 android/sdremote/src/org/libreoffice/impressremote/communication/Protocol.java                  |   96 +
 android/sdremote/src/org/libreoffice/impressremote/communication/Receiver.java                  |  122 --
 android/sdremote/src/org/libreoffice/impressremote/communication/ReconnectionActivity.java      |  108 -
 android/sdremote/src/org/libreoffice/impressremote/communication/Server.java                    |   72 -
 android/sdremote/src/org/libreoffice/impressremote/communication/ServerConnection.java          |   22 
 android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java              |  191 ---
 android/sdremote/src/org/libreoffice/impressremote/communication/ServersFinder.java             |   21 
 android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java            |  127 ++
 android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java                 |  194 ---
 android/sdremote/src/org/libreoffice/impressremote/communication/TcpServerConnection.java       |   65 +
 android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java          |  179 +++
 android/sdremote/src/org/libreoffice/impressremote/communication/Timer.java                     |  124 ++
 android/sdremote/src/org/libreoffice/impressremote/communication/Transmitter.java               |   70 -
 android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java     |  301 +++++
 android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java              |  352 ++++++
 android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java             |  171 +++
 android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java            |  192 +++
 android/sdremote/src/org/libreoffice/impressremote/util/Intents.java                            |  144 ++
 android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java                        |   59 +
 android/sdremote/src/pl/polidea/coverflow/AbstractCoverFlowImageAdapter.java                    |  120 --
 android/sdremote/src/pl/polidea/coverflow/CoverFlow.java                                        |  387 ------
 android/sdremote/src/pl/polidea/coverflow/ReflectingImageAdapter.java                           |  145 --
 android/sdremote/src/pl/polidea/coverflow/ResourceImageAdapter.java                             |  109 -
 dev/null                                                                                        |binary
 152 files changed, 4199 insertions(+), 5330 deletions(-)

New commits:
commit e43a151549b7f87cb1c1c1165b9777697fd9c1d7
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 21 20:43:41 2013 +0300

    Improve the SlideShowActivity.
    
    * Enable up navigation.
    * Show the current slide index properly.
    * Show thumbnail if slide was not loaded yet.
    
    Change-Id: I234dc1e583c8549b6a1c069d7e2294726d5e29d1

diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml
index 072c406..5bc0298 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -32,4 +32,6 @@
     <string name="hint_ip_address">IP address</string>
     <string name="hint_name">Name</string>
 
+    <string name="mask_slide_show_progress">Slide %1$d from %2$d</string>
+
 </resources>
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
index 87c4a94..7de2ee4 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
@@ -8,24 +8,38 @@
  */
 package org.libreoffice.impressremote.activity;
 
+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.app.Fragment;
 import android.support.v4.app.FragmentTransaction;
+import android.support.v4.content.LocalBroadcastManager;
 
 import com.actionbarsherlock.app.SherlockFragmentActivity;
 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuItem;
 import org.libreoffice.impressremote.R;
+import org.libreoffice.impressremote.communication.CommunicationService;
+import org.libreoffice.impressremote.communication.SlideShow;
 import org.libreoffice.impressremote.fragment.SlidesGridFragment;
 import org.libreoffice.impressremote.fragment.SlidesPagerFragment;
+import org.libreoffice.impressremote.util.Intents;
 
-public class SlideShowActivity extends SherlockFragmentActivity {
+public class SlideShowActivity extends SherlockFragmentActivity implements ServiceConnection {
     private static enum Mode {
         PAGER, GRID
     }
 
     private Mode mMode;
 
+    private CommunicationService mCommunicationService;
+    private IntentsReceiver mIntentsReceiver;
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -33,8 +47,9 @@ public class SlideShowActivity extends SherlockFragmentActivity {
         mMode = Mode.PAGER;
 
         setUpHomeButton();
-
         setUpFragment();
+
+        bindService();
     }
 
     private void setUpHomeButton() {
@@ -42,29 +57,117 @@ public class SlideShowActivity extends SherlockFragmentActivity {
     }
 
     private void setUpFragment() {
+        setUpFragment(buildFragment());
+    }
+
+    private Fragment buildFragment() {
         switch (mMode) {
             case PAGER:
-                setUpFragment(SlidesPagerFragment.newInstance());
-                break;
+                return SlidesPagerFragment.newInstance();
 
             case GRID:
-                setUpFragment(SlidesGridFragment.newInstance());
-                break;
+                return SlidesGridFragment.newInstance();
 
             default:
-                setUpFragment(SlidesPagerFragment.newInstance());
-                break;
+                return SlidesPagerFragment.newInstance();
         }
     }
 
     private void setUpFragment(Fragment aFragment) {
         FragmentTransaction aTransaction = getSupportFragmentManager().beginTransaction();
+        aTransaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
 
         aTransaction.replace(android.R.id.content, aFragment);
 
         aTransaction.commit();
     }
 
+    private void bindService() {
+        Intent aIntent = Intents.buildCommunicationServiceIntent(this);
+        bindService(aIntent, this, Context.BIND_AUTO_CREATE);
+    }
+
+    @Override
+    public void onServiceConnected(ComponentName mComponentName, IBinder aBinder) {
+        CommunicationService.CBinder aServiceBinder = (CommunicationService.CBinder) aBinder;
+        mCommunicationService = aServiceBinder.getService();
+
+        startSlideShow();
+    }
+
+    private void startSlideShow() {
+        mCommunicationService.getTransmitter().startPresentation();
+    }
+
+    @Override
+    protected void onStart() {
+        super.onStart();
+
+        registerIntentsReceiver();
+    }
+
+    private void registerIntentsReceiver() {
+        mIntentsReceiver = new IntentsReceiver(this);
+        IntentFilter aIntentFilter = buildIntentsReceiverFilter();
+
+        getBroadcastManager().registerReceiver(mIntentsReceiver, aIntentFilter);
+    }
+
+    private static final class IntentsReceiver extends BroadcastReceiver {
+        private final SlideShowActivity mSlideShowActivity;
+
+        private IntentsReceiver(SlideShowActivity aSlideShowActivity) {
+            mSlideShowActivity = aSlideShowActivity;
+        }
+
+        @Override
+        public void onReceive(Context aContext, Intent aIntent) {
+            if (Intents.Actions.SLIDE_CHANGED.equals(aIntent.getAction())) {
+                mSlideShowActivity.setUpSlideShowInformation();
+            }
+        }
+    }
+
+    private IntentFilter buildIntentsReceiverFilter() {
+        IntentFilter aIntentFilter = new IntentFilter();
+        aIntentFilter.addAction(Intents.Actions.SLIDE_CHANGED);
+
+        return aIntentFilter;
+    }
+
+    private LocalBroadcastManager getBroadcastManager() {
+        return LocalBroadcastManager.getInstance(getApplicationContext());
+    }
+
+    private void setUpSlideShowInformation() {
+        if (!isServiceBound()) {
+            return;
+        }
+
+        getSupportActionBar().setTitle(buildSlideShowProgress());
+        getSupportActionBar().setSubtitle(buildSlideShowTimerProgress());
+    }
+
+    private String buildSlideShowProgress() {
+        SlideShow aSlideShow = mCommunicationService.getSlideShow();
+
+        int aCurrentSlideIndex = aSlideShow.getHumanCurrentSlideIndex();
+        int aSlidesCount = aSlideShow.getSlidesCount();
+
+        return getString(R.string.mask_slide_show_progress, aCurrentSlideIndex, aSlidesCount);
+    }
+
+    private String buildSlideShowTimerProgress() {
+        return null;
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+
+        setUpSlideShowInformation();
+    }
+
     @Override
     public boolean onCreateOptionsMenu(Menu aMenu) {
         getSupportMenuInflater().inflate(getActionBarMenuResourceId(), aMenu);
@@ -104,6 +207,11 @@ public class SlideShowActivity extends SherlockFragmentActivity {
 
                 return true;
 
+            case android.R.id.home:
+                navigateUp();
+
+                return true;
+
             default:
                 return super.onOptionsItemSelected(aMenuItem);
         }
@@ -112,6 +220,50 @@ public class SlideShowActivity extends SherlockFragmentActivity {
     private void refreshActionBarMenu() {
         supportInvalidateOptionsMenu();
     }
+
+    private void navigateUp() {
+        finish();
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+
+        unregisterIntentsReceiver();
+    }
+
+    private void unregisterIntentsReceiver() {
+        try {
+            getBroadcastManager().unregisterReceiver(mIntentsReceiver);
+        } catch (IllegalArgumentException e) {
+            // Receiver not registered.
+            // Fixed in Honeycomb: Android’s issue #6191.
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+
+        unbindService();
+    }
+
+    private void unbindService() {
+        if (!isServiceBound()) {
+            return;
+        }
+
+        unbindService(this);
+    }
+
+    private boolean isServiceBound() {
+        return mCommunicationService != null;
+    }
+
+    @Override
+    public void onServiceDisconnected(ComponentName aComponentName) {
+        mCommunicationService = null;
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java
index ea9010a..9f16976 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java
@@ -26,8 +26,7 @@ public class ComputersAdapter extends ArrayAdapter<Server> {
     public ComputersAdapter(Context aContext) {
         super(aContext, R.layout.list_item);
 
-        mLayoutInflater = (LayoutInflater) aContext
-            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        mLayoutInflater = LayoutInflater.from(aContext);
     }
 
     @Override
@@ -44,8 +43,7 @@ public class ComputersAdapter extends ArrayAdapter<Server> {
             return aConvertView;
         }
 
-        return mLayoutInflater
-            .inflate(R.layout.list_item, aParentViewGroup, false);
+        return mLayoutInflater.inflate(R.layout.list_item, aParentViewGroup, false);
     }
 
     private String buildListItemText(int aPosition) {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java
index 5a4ddaa..4a15ab3 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.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.adapter;
 
 import android.support.v4.app.Fragment;
@@ -40,3 +48,5 @@ public class ComputersPagerAdapter extends FragmentPagerAdapter {
         return PAGER_SIZE;
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java
index 45ccb55..f7f7a01 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java
@@ -25,15 +25,11 @@ public class SlidesGridAdapter extends BaseAdapter {
     private final SlideShow mSlideShow;
 
     public SlidesGridAdapter(Context aContext, SlideShow aSlideShow) {
-        mLayoutInflater = buildLayoutInflater(aContext);
+        mLayoutInflater = LayoutInflater.from(aContext);
 
         mSlideShow = aSlideShow;
     }
 
-    private LayoutInflater buildLayoutInflater(Context aContext) {
-        return (LayoutInflater) aContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    }
-
     @Override
     public int getCount() {
         return mSlideShow.getSlidesCount();
@@ -57,8 +53,7 @@ public class SlidesGridAdapter extends BaseAdapter {
         if (isSlidePreviewAvailable(aPosition)) {
             aSlideViewHolder.aSlidePreview.setImageBitmap(mSlideShow.getSlidePreview(aPosition));
         } else {
-            aSlideViewHolder.aSlidePreview.setImageResource(
-                R.drawable.slide_unknown);
+            aSlideViewHolder.aSlidePreview.setImageResource(R.drawable.slide_unknown);
         }
 
         aSlideViewHolder.aSlideIndex.setText(buildSlideIndex(aPosition));
diff --git a/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
index 9aec981..352e7a8 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
@@ -24,14 +24,11 @@ public class SlidesPagerAdapter extends PagerAdapter {
     private final SlideShow mSlideShow;
 
     public SlidesPagerAdapter(Context aContext, SlideShow aSlideShow) {
-        mLayoutInflater = buildLayoutInflater(aContext);
+        mLayoutInflater = LayoutInflater.from(aContext);
 
         mSlideShow = aSlideShow;
     }
 
-    private LayoutInflater buildLayoutInflater(Context aContext) {
-        return (LayoutInflater) aContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    }
     @Override
     public int getCount() {
         return mSlideShow.getSlidesCount();
@@ -41,7 +38,12 @@ public class SlidesPagerAdapter extends PagerAdapter {
     public Object instantiateItem(ViewGroup aViewGroup, int aPosition) {
         ImageView aSlideView = (ImageView) getView(aViewGroup);
 
-        aSlideView.setImageBitmap(mSlideShow.getSlidePreview(aPosition));
+        if (isSlidePreviewAvailable(aPosition)) {
+            aSlideView.setImageBitmap(mSlideShow.getSlidePreview(aPosition));
+        }
+        else {
+            aSlideView.setImageResource(R.drawable.slide_unknown);
+        }
 
         aViewGroup.addView(aSlideView);
 
@@ -52,6 +54,10 @@ public class SlidesPagerAdapter extends PagerAdapter {
         return mLayoutInflater.inflate(R.layout.view_pager_slide, aViewGroup, false);
     }
 
+    private boolean isSlidePreviewAvailable(int aSlideIndex) {
+        return mSlideShow.getSlidePreview(aSlideIndex) != null;
+    }
+
     @Override
     public void destroyItem(ViewGroup aViewGroup, int aPosition, Object aObject) {
         View aView = (View) aObject;
@@ -66,6 +72,8 @@ public class SlidesPagerAdapter extends PagerAdapter {
 
     @Override
     public int getItemPosition(Object aObject) {
+        // TODO: think about it, seems like a hack
+
         return POSITION_NONE;
     }
 }
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
index f8ae6d8..79852c5 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
@@ -48,6 +48,10 @@ public class SlideShow {
         return mCurrentSlideIndex;
     }
 
+    public int getHumanCurrentSlideIndex() {
+        return getCurrentSlideIndex() + 1;
+    }
+
     public void setSlidePreview(int aSlideIndex, byte[] aSlidePreviewBytes) {
         Bitmap aSlidePreview = BitmapFactory
             .decodeByteArray(aSlidePreviewBytes, 0, aSlidePreviewBytes.length);
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java
index 6c0fe87..ebc9a24 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java
@@ -61,8 +61,6 @@ public class SlidesGridFragment extends SherlockFragment implements ServiceConne
 
         mCommunicationService = aServiceBinder.getService();
 
-        mCommunicationService.getTransmitter().startPresentation();
-
         setUpSlidesGrid();
     }
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java
index c3ebb2c..cb9872f 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java
@@ -61,8 +61,6 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn
 
         mCommunicationService = aServiceBinder.getService();
 
-        mCommunicationService.getTransmitter().startPresentation();
-
         setUpSlidesPager();
     }
 
@@ -72,6 +70,8 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn
 
         getSlidesPager().setAdapter(aSlidesPagerAdapter);
 
+        getSlidesPager().setCurrentItem(mCommunicationService.getSlideShow().getCurrentSlideIndex());
+
         getSlidesPager().setPageMargin(getSlidesMarginInPx());
 
         getSlidesPager().setOnPageChangeListener(this);
commit f01c976a1def48a11e95e36b747f55dfbc8647c8
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 21 03:59:00 2013 +0300

    Improve the ComputerConnectionFragment.
    
    Show reconnection action bar button only when it is necessary, i. e.
    when there is a connection error.
    
    Change-Id: Iecb86f7a1bf0b094f2fffbe12c03bea474774417

diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
index ee9c75b..c70599e 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
@@ -82,8 +82,7 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
     }
 
     private void bindService() {
-        Intent aServiceIntent = new Intent(getActivity(), CommunicationService.class);
-
+        Intent aServiceIntent = Intents.buildCommunicationServiceIntent(getActivity());
         getActivity().bindService(aServiceIntent, this, Context.BIND_AUTO_CREATE);
     }
 
@@ -140,18 +139,21 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
                 String aPin = aIntent.getStringExtra(Intents.Extras.PIN);
 
                 mComputerConnectionFragment.setUpPinValidationInstructions(aPin);
+                mComputerConnectionFragment.refreshActionBarMenu();
 
                 return;
             }
 
             if (Intents.Actions.PAIRING_SUCCESSFUL.equals(aIntent.getAction())) {
                 mComputerConnectionFragment.setUpPresentation();
+                mComputerConnectionFragment.refreshActionBarMenu();
 
                 return;
             }
 
             if (Intents.Actions.CONNECTION_FAILED.equals(aIntent.getAction())) {
                 mComputerConnectionFragment.setUpErrorMessage();
+                mComputerConnectionFragment.refreshActionBarMenu();
             }
         }
     }
@@ -219,17 +221,37 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
         aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aMessageLayout));
     }
 
+    private void refreshActionBarMenu() {
+        getSherlockActivity().supportInvalidateOptionsMenu();
+    }
+
     @Override
     public void onCreateOptionsMenu(Menu aMenu, MenuInflater aMenuInflater) {
+        if (!shouldActionBarMenuBeDisplayed()) {
+            aMenu.clear();
+            return;
+        }
+
         aMenuInflater.inflate(R.menu.menu_action_bar_computer_connection, aMenu);
     }
 
+    private boolean shouldActionBarMenuBeDisplayed() {
+        if (getView() == null) {
+            return false;
+        }
+
+        ViewAnimator aViewAnimator = (ViewAnimator) getView().findViewById(R.id.view_animator);
+
+        return aViewAnimator.getCurrentView().getId() == R.id.layout_error_message;
+    }
+
     @Override
     public boolean onOptionsItemSelected(MenuItem aMenuItem) {
         switch (aMenuItem.getItemId()) {
             case R.id.menu_reconnect:
                 showProgressBar();
                 connectToComputer();
+                refreshActionBarMenu();
                 return true;
 
             default:
commit 001552cc8a01ddc724856a905017937e735eee73
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 21 03:37:09 2013 +0300

    Improve the ComputerCreationActivity.
    
    * Allow using IP address as a name.
    * Provide proper keyboards for typing name and address.
    
    Change-Id: I86ca58282c81eb0705d6bc82b98b2aab94fbf676

diff --git a/android/sdremote/res/layout/activity_computer_creation.xml b/android/sdremote/res/layout/activity_computer_creation.xml
index be1f313..4ef3f86 100644
--- a/android/sdremote/res/layout/activity_computer_creation.xml
+++ b/android/sdremote/res/layout/activity_computer_creation.xml
@@ -8,7 +8,7 @@
     <EditText
         android:id="@+id/edit_ip_address"
         android:singleLine="true"
-        android:inputType="text"
+        android:inputType="phone"
         android:hint="@string/hint_ip_address"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"/>
@@ -16,10 +16,18 @@
     <EditText
         android:id="@+id/edit_name"
         android:singleLine="true"
-        android:inputType="text"
+        android:inputType="text|textCapSentences"
         android:hint="@string/hint_name"
         android:paddingTop="@dimen/padding_vertical_edit"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"/>
 
+    <TextView
+        style="?textAppearanceSmall"
+        android:text="@string/message_name_notice"
+        android:gravity="center_horizontal"
+        android:paddingTop="@dimen/padding_vertical_notice"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"/>
+
 </LinearLayout>
\ No newline at end of file
diff --git a/android/sdremote/res/values/dimens.xml b/android/sdremote/res/values/dimens.xml
index b73555f..d4c2e5b 100644
--- a/android/sdremote/res/values/dimens.xml
+++ b/android/sdremote/res/values/dimens.xml
@@ -15,6 +15,7 @@
     <dimen name="padding_vertical_pin">10dp</dimen>
     <dimen name="padding_vertical_error_message">10dp</dimen>
     <dimen name="padding_vertical_edit">8dp</dimen>
+    <dimen name="padding_vertical_notice">16dp</dimen>
 
     <dimen name="margin_vertical_action_bar_divider">12dp</dimen>
     <dimen name="margin_slide">8dp</dimen>
diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml
index 38252bb..072c406 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -27,7 +27,7 @@
     <string name="message_impress_wifi_enabling">You should enable experimental features at “Tools → Options → LibreOffice → Advanced” as well.</string>
     <string name="message_impress_pairing_check">If you have Bluetooth pairing issues check instructions related to your desktop OS.</string>
     <string name="message_ip_address_validation">You should type a valid IP address.</string>
-    <string name="message_name_validation">Name should not be empty.</string>
+    <string name="message_name_notice">Name is optional — IP address would be used instead if you wish.</string>
 
     <string name="hint_ip_address">IP address</string>
     <string name="hint_name">Name</string>
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
index 76f33c6..372e49b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
@@ -68,11 +68,9 @@ public class ComputerCreationActivity extends SherlockFragmentActivity implement
     public void onClick(View aView) {
         if (aView.equals(getCancelButton())) {
             cancelCreation();
-
             return;
         }
 
-
         if (aView.equals(getSaveButton())) {
             saveServer();
         }
@@ -88,13 +86,13 @@ public class ComputerCreationActivity extends SherlockFragmentActivity implement
 
         if (!isIpAddressValid(aIpAddress)) {
             getIpAddressEdit().setError(getText(R.string.message_ip_address_validation));
+            return;
         }
 
         if (TextUtils.isEmpty(aName)) {
-            getNameEdit().setError(getText(R.string.message_name_validation));
+            finish(aIpAddress, aIpAddress);
         }
-
-        if (isServerInformationValid(aIpAddress, aName)) {
+        else {
             finish(aIpAddress, aName);
         }
     }
@@ -111,10 +109,6 @@ public class ComputerCreationActivity extends SherlockFragmentActivity implement
         return (EditText) findViewById(R.id.edit_name);
     }
 
-    private boolean isServerInformationValid(String aIpAddress, String aName) {
-        return isIpAddressValid(aIpAddress) && !TextUtils.isEmpty(aName);
-    }
-
     private boolean isIpAddressValid(String aIpAddress) {
         return Patterns.IP_ADDRESS.matcher(aIpAddress).matches();
     }
commit ac546de39e59c8ecd18759a9f6b6bd02e4bcd02e
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 21 03:01:08 2013 +0300

    Change the logo to a new one.
    
    * The new logo is a flat version of the launcher icon. It follows the
      Google Play store application style.
    * All base densities are available now.
    
    Change-Id: Ieb4cfb7f762421ac1b7a6edeece44788f26dd7d5

diff --git a/android/sdremote/res/drawable-hdpi/ic_logo.png b/android/sdremote/res/drawable-hdpi/ic_logo.png
new file mode 100644
index 0000000..9bef30e
Binary files /dev/null and b/android/sdremote/res/drawable-hdpi/ic_logo.png differ
diff --git a/android/sdremote/res/drawable-mdpi/ic_logo.png b/android/sdremote/res/drawable-mdpi/ic_logo.png
new file mode 100644
index 0000000..abf3401
Binary files /dev/null and b/android/sdremote/res/drawable-mdpi/ic_logo.png differ
diff --git a/android/sdremote/res/drawable-xhdpi/ic_logo.png b/android/sdremote/res/drawable-xhdpi/ic_logo.png
new file mode 100644
index 0000000..cc1f02f
Binary files /dev/null and b/android/sdremote/res/drawable-xhdpi/ic_logo.png differ
diff --git a/android/sdremote/res/drawable/ic_logo.png b/android/sdremote/res/drawable/ic_logo.png
deleted file mode 100644
index ce76471..0000000
Binary files a/android/sdremote/res/drawable/ic_logo.png and /dev/null differ
commit 173638b9a4c1d039aeae350765d7fbf8330d91e1
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 21 02:11:37 2013 +0300

    Change ComputersActivity to use swipe tabs.
    
    Such method even remembers a current tab on orientation changes.
    
    Change-Id: Iad14af060b41a4b8d225e83af450cdff0a6e78e0

diff --git a/android/sdremote/res/layout/activity_computers.xml b/android/sdremote/res/layout/activity_computers.xml
new file mode 100644
index 0000000..6e5332d
--- /dev/null
+++ b/android/sdremote/res/layout/activity_computers.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v4.view.ViewPager
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/pager_computers"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"/>
\ No newline at end of file
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
index 14ace70..3a5bbb6 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
@@ -10,23 +10,26 @@ package org.libreoffice.impressremote.activity;
 
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
+import android.support.v4.view.PagerAdapter;
+import android.support.v4.view.ViewPager;
 
 import com.actionbarsherlock.app.ActionBar;
 import com.actionbarsherlock.app.SherlockFragmentActivity;
 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuItem;
-import org.libreoffice.impressremote.util.ActionBarTabListener;
-import org.libreoffice.impressremote.fragment.ComputersFragment;
+import org.libreoffice.impressremote.adapter.ComputersPagerAdapter;
 import org.libreoffice.impressremote.util.Intents;
 import org.libreoffice.impressremote.R;
 
-public class ComputersActivity extends SherlockFragmentActivity {
+public class ComputersActivity extends SherlockFragmentActivity implements ActionBar.TabListener, ViewPager.OnPageChangeListener {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_computers);
 
         setUpTabs();
+        setUpComputersPager();
     }
 
     private void setUpTabs() {
@@ -37,26 +40,59 @@ public class ComputersActivity extends SherlockFragmentActivity {
     }
 
     private ActionBar.Tab buildBluetoothServersTab() {
-        ComputersFragment aFragment = ComputersFragment.newInstance(
-            ComputersFragment.Type.BLUETOOTH);
-
-        return buildActionBarTab(aFragment, R.string.title_bluetooth);
+        return buildActionBarTab(R.string.title_bluetooth);
     }
 
-    private ActionBar.Tab buildActionBarTab(Fragment aFragment, int aTitleResourceId) {
+    private ActionBar.Tab buildActionBarTab(int aTitleResourceId) {
         ActionBar.Tab aTab = getSupportActionBar().newTab();
 
-        aTab.setTabListener(new ActionBarTabListener(aFragment));
+        aTab.setTabListener(this);
         aTab.setText(aTitleResourceId);
 
         return aTab;
     }
 
+    @Override
+    public void onTabSelected(ActionBar.Tab aTab, FragmentTransaction aTransaction) {
+        getComputersPager().setCurrentItem(aTab.getPosition());
+    }
+
+    private ViewPager getComputersPager() {
+        return (ViewPager) findViewById(R.id.pager_computers);
+    }
+
+    @Override
+    public void onTabUnselected(ActionBar.Tab aTab, FragmentTransaction aTransaction) {
+    }
+
+    @Override
+    public void onTabReselected(ActionBar.Tab aTab, FragmentTransaction aTransaction) {
+    }
+
     private ActionBar.Tab buildWiFiServersTab() {
-        ComputersFragment aFragment = ComputersFragment.newInstance(
-            ComputersFragment.Type.WIFI);
+        return buildActionBarTab(R.string.title_wifi);
+    }
+
+    private void setUpComputersPager() {
+        getComputersPager().setAdapter(buildComputersPagerAdapter());
+        getComputersPager().setOnPageChangeListener(this);
+    }
+
+    private PagerAdapter buildComputersPagerAdapter() {
+        return new ComputersPagerAdapter(getSupportFragmentManager());
+    }
+
+    @Override
+    public void onPageSelected(int aPosition) {
+        getSupportActionBar().setSelectedNavigationItem(aPosition);
+    }
+
+    @Override
+    public void onPageScrolled(int aPosition, float aPositionOffset, int aPositionOffsetPixels) {
+    }
 
-        return buildActionBarTab(aFragment, R.string.title_wifi);
+    @Override
+    public void onPageScrollStateChanged(int aPosition) {
     }
 
     @Override
diff --git a/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java
new file mode 100644
index 0000000..5a4ddaa
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java
@@ -0,0 +1,42 @@
+package org.libreoffice.impressremote.adapter;
+
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+
+import org.libreoffice.impressremote.fragment.ComputersFragment;
+
+public class ComputersPagerAdapter extends FragmentPagerAdapter {
+    private static final int PAGER_SIZE = 2;
+
+    private static final class PagerPositions {
+        private PagerPositions() {
+        }
+
+        public static final int BLUETOOTH = 0;
+        public static final int WIFI = 1;
+    }
+
+    public ComputersPagerAdapter(FragmentManager aFragmentManager) {
+        super(aFragmentManager);
+    }
+
+    @Override
+    public Fragment getItem(int aPosition) {
+        switch (aPosition) {
+            case PagerPositions.BLUETOOTH:
+                return ComputersFragment.newInstance(ComputersFragment.Type.BLUETOOTH);
+
+            case PagerPositions.WIFI:
+                return ComputersFragment.newInstance(ComputersFragment.Type.WIFI);
+
+            default:
+                return null;
+        }
+    }
+
+    @Override
+    public int getCount() {
+        return PAGER_SIZE;
+    }
+}
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
index 18491d6..fffd1cf 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
@@ -97,10 +97,6 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
     }
 
     private void loadComputers() {
-        if (!isAdded()) {
-            return;
-        }
-
         if (!isServiceBound()) {
             return;
         }
@@ -196,6 +192,8 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
         super.onResume();
 
         registerIntentsReceiver();
+
+        loadComputers();
     }
 
     private void registerIntentsReceiver() {
@@ -277,6 +275,12 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
 
     @Override
     public boolean onContextItemSelected(android.view.MenuItem aMenuItem) {
+        if (!getUserVisibleHint()) {
+            // Wrong context menu could be dispatched.
+            // Android’s issue #20065.
+            return false;
+        }
+
         int aComputerPosition = getListItemPosition(aMenuItem);
         Server aComputer = getComputersAdapter().getItem(aComputerPosition);
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/ActionBarTabListener.java b/android/sdremote/src/org/libreoffice/impressremote/util/ActionBarTabListener.java
deleted file mode 100644
index e21911a..0000000
--- a/android/sdremote/src/org/libreoffice/impressremote/util/ActionBarTabListener.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- 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.util;
-
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
-
-import com.actionbarsherlock.app.ActionBar;
-
-public class ActionBarTabListener implements ActionBar.TabListener {
-    private final Fragment mTabFragment;
-
-    public ActionBarTabListener(Fragment aTabFragment) {
-        mTabFragment = aTabFragment;
-    }
-
-    @Override
-    public void onTabSelected(ActionBar.Tab aTab, FragmentTransaction aFragmentTransaction) {
-        if (mTabFragment.isDetached()) {
-            aFragmentTransaction.attach(mTabFragment);
-        }
-
-        aFragmentTransaction.replace(android.R.id.content, mTabFragment);
-    }
-
-    @Override
-    public void onTabUnselected(ActionBar.Tab aTab, FragmentTransaction aFragmentTransaction) {
-        if (mTabFragment.isDetached()) {
-            return;
-        }
-
-        aFragmentTransaction.detach(mTabFragment);
-    }
-
-    @Override
-    public void onTabReselected(ActionBar.Tab aTab, FragmentTransaction aFragmentTransaction) {
-    }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 15081f45820a858f84c96189bbf53f8d3ea72f64
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Sun Jul 21 00:06:49 2013 +0300

    Improve ComputersFragment.
    
    * Load saved computers better.
    * Handle removing and adding computers properly.
    
    Change-Id: I12027ad96f06cfeccbc249f453ccff588ccd79c6

diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
index 11d2896..18491d6 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
@@ -81,8 +81,7 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
     }
 
     private void bindService() {
-        Intent aServiceIntent = new Intent(getActivity(), CommunicationService.class);
-
+        Intent aServiceIntent = Intents.buildCommunicationServiceIntent(getActivity());
         getActivity().bindService(aServiceIntent, this, Context.BIND_AUTO_CREATE);
     }
 
@@ -93,6 +92,83 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
         mCommunicationService = aServiceBinder.getService();
 
         mCommunicationService.startSearch();
+
+        loadComputers();
+    }
+
+    private void loadComputers() {
+        if (!isAdded()) {
+            return;
+        }
+
+        if (!isServiceBound()) {
+            return;
+        }
+
+        if (getComputers().isEmpty()) {
+            hideComputersList();
+        }
+        else {
+            showComputersList();
+        }
+    }
+
+    private boolean isServiceBound() {
+        return mCommunicationService != null;
+    }
+
+    private void hideComputersList() {
+        setListAdapter(null);
+
+        setListShown(false);
+    }
+
+    private void showComputersList() {
+        if (!isComputersAdapterExist()) {
+            setUpComputersAdapter();
+        }
+
+        getComputersAdapter().clear();
+        getComputersAdapter().add(getComputers());
+
+        setListShown(true);
+    }
+
+    private boolean isComputersAdapterExist() {
+        return getComputersAdapter() != null;
+    }
+
+    private ComputersAdapter getComputersAdapter() {
+        return (ComputersAdapter) getListAdapter();
+    }
+
+    private void setUpComputersAdapter() {
+        setListAdapter(new ComputersAdapter(getActivity()));
+    }
+
+    private List<Server> getComputers() {
+        List<Server> aComputers = new ArrayList<Server>();
+
+        for (Server aServer : mCommunicationService.getServers()) {
+            if (isComputerSupportsRequiredType(aServer)) {
+                aComputers.add(aServer);
+            }
+        }
+
+        return aComputers;
+    }
+
+    private boolean isComputerSupportsRequiredType(Server aServer) {
+        switch (mType) {
+            case WIFI:
+                return aServer.getProtocol() == Server.Protocol.TCP;
+
+            case BLUETOOTH:
+                return aServer.getProtocol() == Server.Protocol.BLUETOOTH;
+
+            default:
+                return false;
+        }
     }
 
     @Override
@@ -110,10 +186,6 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
         getActivity().unbindService(this);
     }
 
-    private boolean isServiceBound() {
-        return mCommunicationService != null;
-    }
-
     @Override
     public void onServiceDisconnected(ComponentName aComponentName) {
         mCommunicationService = null;
@@ -123,8 +195,6 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
     public void onResume() {
         super.onResume();
 
-        loadComputers();
-
         registerIntentsReceiver();
     }
 
@@ -163,60 +233,6 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
         return LocalBroadcastManager.getInstance(aContext);
     }
 
-    private void loadComputers() {
-        if (!isServiceBound()) {
-            return;
-        }
-
-        if (getComputers().isEmpty()) {
-            return;
-        }
-
-        if (!isComputersAdapterExist()) {
-            setUpComputersAdapter();
-        }
-
-        getComputersAdapter().clear();
-        getComputersAdapter().add(getComputers());
-    }
-
-    private boolean isComputersAdapterExist() {
-        return getComputersAdapter() != null;
-    }
-
-    private ComputersAdapter getComputersAdapter() {
-        return (ComputersAdapter) getListAdapter();
-    }
-
-    private void setUpComputersAdapter() {
-        setListAdapter(new ComputersAdapter(getActivity()));
-    }
-
-    private List<Server> getComputers() {
-        List<Server> aComputers = new ArrayList<Server>();
-
-        for (Server aServer : mCommunicationService.getServers()) {
-            if (isComputerSupportsRequiredType(aServer)) {
-                aComputers.add(aServer);
-            }
-        }
-
-        return aComputers;
-    }
-
-    private boolean isComputerSupportsRequiredType(Server aServer) {
-        switch (mType) {
-            case WIFI:
-                return aServer.getProtocol() == Server.Protocol.TCP;
-
-            case BLUETOOTH:
-                return aServer.getProtocol() == Server.Protocol.BLUETOOTH;
-
-            default:
-                return false;
-        }
-    }
-
     @Override
     public void onPause() {
         super.onPause();
@@ -264,9 +280,14 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
         int aComputerPosition = getListItemPosition(aMenuItem);
         Server aComputer = getComputersAdapter().getItem(aComputerPosition);
 
-        removeComputer(aComputer);
+        switch (aMenuItem.getItemId()) {
+            case R.id.menu_remove_computer:
+                removeComputer(aComputer);
+                return true;
 
-        return true;
+            default:
+                return super.onContextItemSelected(aMenuItem);
+        }
     }
 
     private int getListItemPosition(android.view.MenuItem aMenuItem) {
@@ -312,10 +333,11 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
         String aServerAddress = aIntent.getStringExtra(Intents.Extras.SERVER_ADDRESS);
         String aServerName = aIntent.getStringExtra(Intents.Extras.SERVER_NAME);
 
-        addServer(aServerAddress, aServerName);
+        addComputer(aServerAddress, aServerName);
+        loadComputers();
     }
 
-    private void addServer(String aAddress, String aName) {
+    private void addComputer(String aAddress, String aName) {
         mCommunicationService.addServer(aAddress, aName);
 
         Intent aIntent = Intents.buildServersListChangedIntent();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
index 0491345..ad7cfc1 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
@@ -15,6 +15,7 @@ import org.libreoffice.impressremote.activity.ComputerConnectionActivity;
 import org.libreoffice.impressremote.activity.ComputerCreationActivity;
 import org.libreoffice.impressremote.activity.LicensesActivity;
 import org.libreoffice.impressremote.activity.SlideShowActivity;
+import org.libreoffice.impressremote.communication.CommunicationService;
 import org.libreoffice.impressremote.communication.Server;
 
 public final class Intents {
@@ -134,6 +135,10 @@ public final class Intents {
     public static Intent buildLicensesIntent(Context aContext) {
         return new Intent(aContext, LicensesActivity.class);
     }
+
+    public static Intent buildCommunicationServiceIntent(Context aContext) {
+        return new Intent(aContext, CommunicationService.class);
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 359751db77aa296d6bf63768696b1cc0fafd50d9
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Wed Jul 17 04:18:31 2013 +0300

    Clean up the codebase.
    
    * Fix licenses headers and footers once again.
    * Fix inspection warnings.
    * Fix typos.
    * Rename resources to follow the same style everywhere.
    
    Change-Id: I3ee60f4761446322bd34323f404354096292a086

diff --git a/android/sdremote/res/drawable-hdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-hdpi/action_bar_tab_selected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-hdpi/actionbar_tab_selected.9.png
rename to android/sdremote/res/drawable-hdpi/action_bar_tab_selected.9.png
diff --git a/android/sdremote/res/drawable-hdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-hdpi/action_bar_tab_selected_pressed.9.png
similarity index 100%
rename from android/sdremote/res/drawable-hdpi/actionbar_tab_selected_pressed.9.png
rename to android/sdremote/res/drawable-hdpi/action_bar_tab_selected_pressed.9.png
diff --git a/android/sdremote/res/drawable-hdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-hdpi/action_bar_tab_unselected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-hdpi/actionbar_tab_unselected.9.png
rename to android/sdremote/res/drawable-hdpi/action_bar_tab_unselected.9.png
diff --git a/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-land-hdpi/action_bar_tab_selected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected.9.png
rename to android/sdremote/res/drawable-land-hdpi/action_bar_tab_selected.9.png
diff --git a/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-land-hdpi/action_bar_tab_selected_pressed.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected_pressed.9.png
rename to android/sdremote/res/drawable-land-hdpi/action_bar_tab_selected_pressed.9.png
diff --git a/android/sdremote/res/drawable-land-hdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-land-hdpi/action_bar_tab_unselected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-hdpi/actionbar_tab_unselected.9.png
rename to android/sdremote/res/drawable-land-hdpi/action_bar_tab_unselected.9.png
diff --git a/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-land-mdpi/action_bar_tab_selected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected.9.png
rename to android/sdremote/res/drawable-land-mdpi/action_bar_tab_selected.9.png
diff --git a/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-land-mdpi/action_bar_tab_selected_pressed.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected_pressed.9.png
rename to android/sdremote/res/drawable-land-mdpi/action_bar_tab_selected_pressed.9.png
diff --git a/android/sdremote/res/drawable-land-mdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-land-mdpi/action_bar_tab_unselected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-mdpi/actionbar_tab_unselected.9.png
rename to android/sdremote/res/drawable-land-mdpi/action_bar_tab_unselected.9.png
diff --git a/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-land-xhdpi/action_bar_tab_selected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected.9.png
rename to android/sdremote/res/drawable-land-xhdpi/action_bar_tab_selected.9.png
diff --git a/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-land-xhdpi/action_bar_tab_selected_pressed.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected_pressed.9.png
rename to android/sdremote/res/drawable-land-xhdpi/action_bar_tab_selected_pressed.9.png
diff --git a/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-land-xhdpi/action_bar_tab_unselected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-land-xhdpi/actionbar_tab_unselected.9.png
rename to android/sdremote/res/drawable-land-xhdpi/action_bar_tab_unselected.9.png
diff --git a/android/sdremote/res/drawable-mdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-mdpi/action_bar_tab_selected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-mdpi/actionbar_tab_selected.9.png
rename to android/sdremote/res/drawable-mdpi/action_bar_tab_selected.9.png
diff --git a/android/sdremote/res/drawable-mdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-mdpi/action_bar_tab_selected_pressed.9.png
similarity index 100%
rename from android/sdremote/res/drawable-mdpi/actionbar_tab_selected_pressed.9.png
rename to android/sdremote/res/drawable-mdpi/action_bar_tab_selected_pressed.9.png
diff --git a/android/sdremote/res/drawable-mdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-mdpi/action_bar_tab_unselected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-mdpi/actionbar_tab_unselected.9.png
rename to android/sdremote/res/drawable-mdpi/action_bar_tab_unselected.9.png
diff --git a/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-xhdpi/action_bar_tab_selected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-xhdpi/actionbar_tab_selected.9.png
rename to android/sdremote/res/drawable-xhdpi/action_bar_tab_selected.9.png
diff --git a/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-xhdpi/action_bar_tab_selected_pressed.9.png
similarity index 100%
rename from android/sdremote/res/drawable-xhdpi/actionbar_tab_selected_pressed.9.png
rename to android/sdremote/res/drawable-xhdpi/action_bar_tab_selected_pressed.9.png
diff --git a/android/sdremote/res/drawable-xhdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-xhdpi/action_bar_tab_unselected.9.png
similarity index 100%
rename from android/sdremote/res/drawable-xhdpi/actionbar_tab_unselected.9.png
rename to android/sdremote/res/drawable-xhdpi/action_bar_tab_unselected.9.png
diff --git a/android/sdremote/res/drawable/actionbar_tab.xml b/android/sdremote/res/drawable/action_bar_tab.xml
similarity index 65%
rename from android/sdremote/res/drawable/actionbar_tab.xml
rename to android/sdremote/res/drawable/action_bar_tab.xml
index db9ef14..45b26dd 100644
--- a/android/sdremote/res/drawable/actionbar_tab.xml
+++ b/android/sdremote/res/drawable/action_bar_tab.xml
@@ -5,22 +5,22 @@
         android:state_focused="false"
         android:state_selected="false"
         android:state_pressed="false"
-        android:drawable="@drawable/actionbar_tab_unselected"/>
+        android:drawable="@drawable/action_bar_tab_unselected"/>
 
     <item
         android:state_focused="false"
         android:state_selected="true"
         android:state_pressed="false"
-        android:drawable="@drawable/actionbar_tab_selected"/>
+        android:drawable="@drawable/action_bar_tab_selected"/>
 
     <item
         android:state_selected="false"
         android:state_pressed="true"
-        android:drawable="@drawable/actionbar_tab_selected_pressed"/>
+        android:drawable="@drawable/action_bar_tab_selected_pressed"/>
 
     <item
         android:state_selected="true"
         android:state_pressed="true"
-        android:drawable="@drawable/actionbar_tab_selected_pressed"/>
+        android:drawable="@drawable/action_bar_tab_selected_pressed"/>
 
 </selector>
\ No newline at end of file
diff --git a/android/sdremote/res/layout-v11/action_bar_computer_creation.xml b/android/sdremote/res/layout-v11/action_bar_computer_creation.xml
index 0c7c5c8..20f1e29 100644
--- a/android/sdremote/res/layout-v11/action_bar_computer_creation.xml
+++ b/android/sdremote/res/layout-v11/action_bar_computer_creation.xml
@@ -4,6 +4,7 @@
               android:divider="?android:attr/dividerVertical"
               android:showDividers="middle"
               android:dividerPadding="@dimen/padding_horizontal_action_bar_divider"
+              android:baselineAligned="false"
               android:layout_width="match_parent"
               android:layout_height="match_parent">
 
diff --git a/android/sdremote/res/values/themes.xml b/android/sdremote/res/values/themes.xml
index a7e9ad5..da70aa8 100644
--- a/android/sdremote/res/values/themes.xml
+++ b/android/sdremote/res/values/themes.xml
@@ -18,8 +18,8 @@
     </style>
 
     <style name="Theme.ImpressRemote.ActionBar.Tab" parent="Widget.Sherlock.Light.ActionBar.TabView.Inverse">
-        <item name="android:background">@drawable/actionbar_tab</item>
-        <item name="background">@drawable/actionbar_tab</item>
+        <item name="android:background">@drawable/action_bar_tab</item>
+        <item name="background">@drawable/action_bar_tab</item>
     </style>
 
     <style name="Theme.ImpressRemote.Computers" parent="Theme.ImpressRemote">
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
index a1c371b..87c4a94 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.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.activity;
 
 import android.os.Bundle;
@@ -105,3 +113,5 @@ public class SlideShowActivity extends SherlockFragmentActivity {
         supportInvalidateOptionsMenu();
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
index 658e4fa..9aec981 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.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.adapter;
 
 import android.content.Context;
@@ -61,3 +69,5 @@ public class SlidesPagerAdapter extends PagerAdapter {
         return POSITION_NONE;
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServerConnection.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServerConnection.java
index baf75e5..6ecaabe 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServerConnection.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServerConnection.java
@@ -17,7 +17,7 @@ import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothDevice;
 import android.bluetooth.BluetoothSocket;
 
-public class BluetoothServerConnection implements ServerConnection {
+class BluetoothServerConnection implements ServerConnection {
     // Standard UUID for the Serial Port Profile.
     // https://www.bluetooth.org/en-us/specification/assigned-numbers-overview/service-discovery
     private static final String STANDARD_SPP_UUID = "00001101-0000-1000-8000-00805F9B34FB";
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
index a95573b..60cf3df 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
@@ -25,7 +25,7 @@ import android.support.v4.content.LocalBroadcastManager;
 import org.libreoffice.impressremote.util.Intents;
 import org.libreoffice.impressremote.communication.Server.Protocol;
 
-public class BluetoothServersFinder extends BroadcastReceiver implements ServersFinder, Runnable {
+class BluetoothServersFinder extends BroadcastReceiver implements ServersFinder, Runnable {
     private static final int SEARCH_DELAY_IN_MILLISECONDS = 1000 * 10;
 
     private final Context mContext;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommandsTransmitter.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommandsTransmitter.java
index 1947021..ebe417c 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommandsTransmitter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommandsTransmitter.java
@@ -59,7 +59,7 @@ public class CommandsTransmitter {
 
     public void setCurrentSlide(int slideIndex) {
         writeCommand(Protocol.Commands
-            .prepareCommand(Protocol.Commands.GOTO_SLIDE,
+            .prepareCommand(Protocol.Commands.GO_TO_SLIDE,
                 Integer.toString(slideIndex)));
     }
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index 3e92091..2e32813 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -213,11 +213,6 @@ public class CommunicationService extends Service implements Runnable, MessagesL
         return mSlideShow;
     }
 
-    @Deprecated
-    public void addServer(String aAddress, String aName, boolean aRemember) {
-        mServersManager.addTcpServer(aAddress, aName);
-    }
-
     public void addServer(String aAddress, String aName) {
         mServersManager.addTcpServer(aAddress, aName);
     }
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesListener.java b/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesListener.java
index ffad6b9..a8f9237 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesListener.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesListener.java
@@ -8,7 +8,7 @@
  */
 package org.libreoffice.impressremote.communication;
 
-public interface MessagesListener {
+interface MessagesListener {
     public void onPinValidation();
 
     public void onSuccessfulPairing();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesReceiver.java b/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesReceiver.java
index ab65dd4..4d226d8 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesReceiver.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/MessagesReceiver.java
@@ -19,7 +19,7 @@ import java.util.List;
 import android.text.TextUtils;
 import android.util.Base64;
 
-public class MessagesReceiver implements Runnable {
+class MessagesReceiver implements Runnable {
     private final BufferedReader mMessagesReader;
 
     private final MessagesListener mMessagesListener;
@@ -108,7 +108,7 @@ public class MessagesReceiver implements Runnable {
             return;
         }
 
-        if (Protocol.Messages.SLIDESHOW_STARTED.equals(aMessageType)) {
+        if (Protocol.Messages.SLIDE_SHOW_STARTED.equals(aMessageType)) {
             int aSlidesCount = parseSlidesCount(aMessage, 1);
             int aCurrentSlideIndex = parseSlideIndex(aMessage, 2);
 
@@ -116,7 +116,7 @@ public class MessagesReceiver implements Runnable {
             return;
         }
 
-        if (Protocol.Messages.SLIDESHOW_FINISHED.equals(aMessageType)) {
+        if (Protocol.Messages.SLIDE_SHOW_FINISHED.equals(aMessageType)) {
             mMessagesListener.onSlideShowFinish();
             return;
         }
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java b/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
index 9ab6646..7329fd2 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.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.communication;
 
 import android.bluetooth.BluetoothAdapter;
@@ -6,8 +14,8 @@ import android.os.Build;
 
 import org.libreoffice.impressremote.util.Preferences;
 
-public final class PairingProvider {
-    private Context mContext;
+final class PairingProvider {
+    private final Context mContext;
 
     private PairingProvider(Context aContext) {
         mContext = aContext;
@@ -55,7 +63,7 @@ public final class PairingProvider {
         return new PairingProvider(aContext).getPairingDeviceName();
     }
 
-    public String getPairingDeviceName() {
+    private String getPairingDeviceName() {
         if (BluetoothAdapter.getDefaultAdapter() == null) {
             return Build.MODEL;
         }
@@ -67,3 +75,5 @@ public final class PairingProvider {
         return BluetoothAdapter.getDefaultAdapter().getName();
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Protocol.java b/android/sdremote/src/org/libreoffice/impressremote/communication/Protocol.java
index c276ec9..daaeac7 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/Protocol.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Protocol.java
@@ -56,8 +56,8 @@ final class Protocol {
         public static final String VALIDATING = "LO_SERVER_VALIDATING_PIN";
         public static final String ADVERTISE = "LOREMOTE_ADVERTISE";
 
-        public static final String SLIDESHOW_STARTED = "slideshow_started";
-        public static final String SLIDESHOW_FINISHED = "slideshow_finished";
+        public static final String SLIDE_SHOW_STARTED = "slideshow_started";
+        public static final String SLIDE_SHOW_FINISHED = "slideshow_finished";
         public static final String SLIDE_UPDATED = "slide_updated";
         public static final String SLIDE_PREVIEW = "slide_preview";
         public static final String SLIDE_NOTES = "slide_notes";
@@ -72,7 +72,7 @@ final class Protocol {
 
         public static final String TRANSITION_NEXT = "transition_next";
         public static final String TRANSITION_PREVIOUS = "transition_previous";
-        public static final String GOTO_SLIDE = "goto_slide";
+        public static final String GO_TO_SLIDE = "goto_slide";
         public static final String PRESENTATION_BLANK_SCREEN = "presentation_blank_screen";
         public static final String PRESENTATION_RESUME = "presentation_resume";
         public static final String PRESENTATION_START = "presentation_start";
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
index a96ee42..bc11d92 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Server.java
@@ -21,26 +21,11 @@ public class Server implements Parcelable {
     private final Protocol mProtocol;
     private final String mAddress;
     private final String mName;
-    private final long mTimeDiscovered;
-
-    /**
-     * Signifies a Server that shouldn't be automatically removed from the list.
-     * Used e.g. for the emulator.
-     */
-    protected boolean mNoTimeout = false;
-
-    protected Server(Protocol aProtocol, String aAddress, String aName, long aTimeDiscovered) {
-        this.mProtocol = aProtocol;
-        this.mAddress = aAddress;
-        this.mName = aName;
-        this.mTimeDiscovered = aTimeDiscovered;
-    }
 
     public Server(Protocol aProtocol, String aAddress, String aName) {
         this.mProtocol = aProtocol;
         this.mAddress = aAddress;
         this.mName = aName;
-        this.mTimeDiscovered = System.currentTimeMillis();
     }
 
     public static Server newTcpInstance(String aAddress, String aName) {
@@ -59,43 +44,32 @@ public class Server implements Parcelable {
         return mName;
     }
 
-    public long getTimeDiscovered() {
-        return mTimeDiscovered;
-    }
-
-    public String toString() {
-        return getClass().getName() + '@' + Integer
-            .toHexString(hashCode()) + ":{" + mAddress + "," + mName + "}";
-    }
-
     @Override
     public int describeContents() {
         return SPECIAL_PARCELABLE_OBJECTS_BITMASK;
     }
 
     @Override
-    public void writeToParcel(Parcel parcel, int flags) {
-        parcel.writeString(mAddress);
-        parcel.writeString(mName);
-        parcel.writeString(mProtocol.name());
-        parcel.writeLong(mTimeDiscovered);
+    public void writeToParcel(Parcel aParcel, int aFlags) {
+        aParcel.writeString(mAddress);
+        aParcel.writeString(mName);
+        aParcel.writeString(mProtocol.name());
     }
 
     public static final Parcelable.Creator<Server> CREATOR = new Parcelable.Creator<Server>() {
-        public Server createFromParcel(Parcel parcel) {
-            return new Server(parcel);
+        public Server createFromParcel(Parcel aParcel) {
+            return new Server(aParcel);
         }
 
-        public Server[] newArray(int size) {
-            return new Server[size];
+        public Server[] newArray(int aSize) {
+            return new Server[aSize];
         }
     };
 
-    private Server(Parcel parcel) {
-        this.mAddress = parcel.readString();
-        this.mName = parcel.readString();
-        this.mProtocol = Protocol.valueOf(parcel.readString());
-        this.mTimeDiscovered = parcel.readLong();
+    private Server(Parcel aParcel) {
+        this.mAddress = aParcel.readString();
+        this.mName = aParcel.readString();
+        this.mProtocol = Protocol.valueOf(aParcel.readString());
     }
 }
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerConnection.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerConnection.java
index fced5a0..e0bb49d 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerConnection.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerConnection.java
@@ -11,7 +11,7 @@ package org.libreoffice.impressremote.communication;
 import java.io.InputStream;
 import java.io.OutputStream;
 
-public interface ServerConnection {
+interface ServerConnection {
     public InputStream buildMessagesStream();
 
     public OutputStream buildCommandsStream();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersFinder.java
index aba82ab..52a3182 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersFinder.java
@@ -10,7 +10,7 @@ package org.libreoffice.impressremote.communication;
 
 import java.util.List;
 
-public interface ServersFinder {
+interface ServersFinder {
     public void startSearch();
 
     public void stopSearch();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
index 7f20943..388f48c 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
@@ -19,7 +19,7 @@ import android.content.Context;
 
 import org.libreoffice.impressremote.util.Preferences;
 
-public class ServersManager {
+class ServersManager {
     private final Context mContext;
 
     private final ServersFinder mBluetoothServersFinder;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServerConnection.java b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServerConnection.java
index a559a50..a37d353 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServerConnection.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServerConnection.java
@@ -14,7 +14,7 @@ import java.io.OutputStream;
 import java.net.Socket;
 import java.net.UnknownHostException;
 
-public class TcpServerConnection implements ServerConnection {
+class TcpServerConnection implements ServerConnection {
     private final Socket mServerConnection;
 
     public TcpServerConnection(Server aServer) {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
index ac0b9f1..9f50fc1 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
@@ -31,7 +31,7 @@ import android.text.TextUtils;
 
 import org.libreoffice.impressremote.util.Intents;
 
-public class TcpServersFinder implements ServersFinder, Runnable {
+class TcpServersFinder implements ServersFinder, Runnable {
     private static final int SEARCH_DELAY_IN_SECONDS = 10;
     private static final int BLOCKING_TIMEOUT_IN_MILLISECONDS = 1000 * 10;
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
index 0f1c89e..ee9c75b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
@@ -171,7 +171,7 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
         return LocalBroadcastManager.getInstance(aContext);
     }
 
-    public void setUpPinValidationInstructions(String aPin) {
+    private void setUpPinValidationInstructions(String aPin) {
         TextView aPinTextView = (TextView) getView().findViewById(R.id.text_pin);
         aPinTextView.setText(aPin);
 
@@ -185,14 +185,14 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
         aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aValidationLayout));
     }
 
-    public void setUpPresentation() {
+    private void setUpPresentation() {
         Intent aIntent = Intents.buildSlideShowIntent(getActivity());
         startActivity(aIntent);
 
         getActivity().finish();
     }
 
-    public void setUpErrorMessage() {
+    private void setUpErrorMessage() {
         TextView aSecondaryMessageTextView = (TextView) getView().findViewById(R.id.text_secondary_error_message);
         aSecondaryMessageTextView.setText(buildSecondaryErrorMessage());
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
index 084e27c..11d2896 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
@@ -163,7 +163,7 @@ public class ComputersFragment extends SherlockListFragment implements ServiceCo
         return LocalBroadcastManager.getInstance(aContext);
     }
 
-    public void loadComputers() {
+    private void loadComputers() {
         if (!isServiceBound()) {
             return;
         }
diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
index e834968..0491345 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
@@ -32,7 +32,6 @@ public final class Intents {
 
         public static final String CONNECTION_FAILED = "CONNECTION_FAILED";
 
-        public static final String SLIDE_SHOW_STARTED = "SLIDE_SHOW_STARTED";
         public static final String SLIDE_SHOW_RUNNING = "SLIDE_SHOW_RUNNING";
         public static final String SLIDE_SHOW_STOPPED = "SLIDE_SHOW_STOPPED";
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java b/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
index b23e3b6..749d3ab 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
@@ -25,10 +25,6 @@ public final class Preferences {
     private Preferences() {
     }
 
-    public static boolean doContain(Context aContext, String aLocation, String aKey) {
-        return getPreferences(aContext, aLocation).contains(aKey);
-    }
-
     private static SharedPreferences getPreferences(Context aContext, String aLocation) {
         return aContext.getSharedPreferences(aLocation, Context.MODE_PRIVATE);
     }
commit 927711bf0fff6c3bda4c68c508a8a7fd022c0fbc
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Wed Jul 17 03:27:57 2013 +0300

    Change the source code structure a bit.
    
    * Follow usual Android project structure.
    * Make the structure more clean.
    
    Change-Id: Ia5b115fe2b8a6417e6d9cfaae46c859c9e4c3c1a

diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml
index 4a6a1d1..73f3c23 100644
--- a/android/sdremote/AndroidManifest.xml
+++ b/android/sdremote/AndroidManifest.xml
@@ -20,7 +20,7 @@
         android:theme="@style/Theme.ImpressRemote">
 
         <activity
-            android:name=".ComputersActivity"
+            android:name=".activity.ComputersActivity"
             android:label="@string/title_computers"
             android:theme="@style/Theme.ImpressRemote.Computers">
 
@@ -32,23 +32,23 @@
         </activity>
 
         <activity
-            android:name=".ComputerConnectionActivity"
+            android:name=".activity.ComputerConnectionActivity"
             android:label="@string/title_connection">
         </activity>
 
         <activity
-            android:name=".ComputerCreationActivity"
+            android:name=".activity.ComputerCreationActivity"
             android:label="@string/title_creation"
             android:theme="@style/Theme.ImpressRemote.ComputerCreation">
         </activity>
 
         <activity
-            android:name=".SlideShowActivity"
+            android:name=".activity.SlideShowActivity"
             android:label="@string/title_slide_show">
         </activity>
 
         <activity
-            android:name=".LicensesActivity"
+            android:name=".activity.LicensesActivity"
             android:label="@string/title_licenses">
         </activity>
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java
similarity index 88%
rename from android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java
rename to android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java
index 488e206..279eaae 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java
@@ -6,13 +6,15 @@
  * 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;
+package org.libreoffice.impressremote.activity;
 
 import android.os.Bundle;
 import android.support.v4.app.FragmentTransaction;
 
 import com.actionbarsherlock.app.SherlockFragmentActivity;
 import com.actionbarsherlock.view.MenuItem;
+import org.libreoffice.impressremote.fragment.ComputerConnectionFragment;
+import org.libreoffice.impressremote.util.Intents;
 import org.libreoffice.impressremote.communication.Server;
 
 public class ComputerConnectionActivity extends SherlockFragmentActivity {
@@ -32,7 +34,8 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity {
     private void setUpComputerConnectionFragment(Server aComputer) {
         FragmentTransaction aTransaction = getSupportFragmentManager().beginTransaction();
 
-        aTransaction.replace(android.R.id.content, ComputerConnectionFragment.newInstance(aComputer));
+        aTransaction.replace(android.R.id.content, ComputerConnectionFragment
+            .newInstance(aComputer));
 
         aTransaction.commit();
     }
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
similarity index 94%
rename from android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java
rename to android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
index 605838e..76f33c6 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputerCreationActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.activity;
 
 import android.app.Activity;
 import android.content.Context;
@@ -21,6 +21,8 @@ import android.widget.EditText;
 
 import com.actionbarsherlock.app.ActionBar;
 import com.actionbarsherlock.app.SherlockFragmentActivity;
+import org.libreoffice.impressremote.util.Intents;
+import org.libreoffice.impressremote.R;
 
 public class ComputerCreationActivity extends SherlockFragmentActivity implements View.OnClickListener {
     @Override
@@ -118,7 +120,8 @@ public class ComputerCreationActivity extends SherlockFragmentActivity implement
     }
 
     private void finish(String aIpAddress, String aName) {
-        Intent aIntent = Intents.buildComputerCreationResultIntent(aIpAddress, aName);
+        Intent aIntent = Intents
+            .buildComputerCreationResultIntent(aIpAddress, aName);
         setResult(Activity.RESULT_OK, aIntent);
 
         finish();
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputersActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
similarity index 90%
rename from android/sdremote/src/org/libreoffice/impressremote/ComputersActivity.java
rename to android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
index c337c94..14ace70 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputersActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.activity;
 
 import android.content.Intent;
 import android.os.Bundle;
@@ -16,6 +16,10 @@ import com.actionbarsherlock.app.ActionBar;
 import com.actionbarsherlock.app.SherlockFragmentActivity;
 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuItem;
+import org.libreoffice.impressremote.util.ActionBarTabListener;
+import org.libreoffice.impressremote.fragment.ComputersFragment;
+import org.libreoffice.impressremote.util.Intents;
+import org.libreoffice.impressremote.R;
 
 public class ComputersActivity extends SherlockFragmentActivity {
     @Override
diff --git a/android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java
similarity index 95%
rename from android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java
rename to android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java
index f9805aa..5b74de3 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/LicensesActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/LicensesActivity.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.activity;
 
 import android.content.ContentResolver;
 import android.os.Bundle;
@@ -14,6 +14,7 @@ import android.webkit.WebView;
 
 import com.actionbarsherlock.app.SherlockActivity;
 import com.actionbarsherlock.view.MenuItem;
+import org.libreoffice.impressremote.R;
 
 public class LicensesActivity extends SherlockActivity {
     private static final String SCHEME = ContentResolver.SCHEME_FILE;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
similarity index 92%
rename from android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java
rename to android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
index 77cf703..a1c371b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SlideShowActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java
@@ -1,4 +1,4 @@
-package org.libreoffice.impressremote;
+package org.libreoffice.impressremote.activity;
 
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
@@ -7,6 +7,9 @@ import android.support.v4.app.FragmentTransaction;
 import com.actionbarsherlock.app.SherlockFragmentActivity;
 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuItem;
+import org.libreoffice.impressremote.R;
+import org.libreoffice.impressremote.fragment.SlidesGridFragment;
+import org.libreoffice.impressremote.fragment.SlidesPagerFragment;
 
 public class SlideShowActivity extends SherlockFragmentActivity {
     private static enum Mode {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputersAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java
similarity index 95%
rename from android/sdremote/src/org/libreoffice/impressremote/ComputersAdapter.java
rename to android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java
index f3080f1..ea9010a 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputersAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersAdapter.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.adapter;
 
 import java.util.List;
 
@@ -17,6 +17,7 @@ import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
 import android.widget.TextView;
 
+import org.libreoffice.impressremote.R;
 import org.libreoffice.impressremote.communication.Server;
 
 public class ComputersAdapter extends ArrayAdapter<Server> {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesGridAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java
similarity index 94%
rename from android/sdremote/src/org/libreoffice/impressremote/SlidesGridAdapter.java
rename to android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java
index 3ccfb51..45ccb55 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SlidesGridAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesGridAdapter.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.adapter;
 
 import android.content.Context;
 import android.view.LayoutInflater;
@@ -16,6 +16,7 @@ import android.widget.BaseAdapter;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import org.libreoffice.impressremote.R;
 import org.libreoffice.impressremote.communication.SlideShow;
 
 public class SlidesGridAdapter extends BaseAdapter {
@@ -56,7 +57,8 @@ public class SlidesGridAdapter extends BaseAdapter {
         if (isSlidePreviewAvailable(aPosition)) {
             aSlideViewHolder.aSlidePreview.setImageBitmap(mSlideShow.getSlidePreview(aPosition));
         } else {
-            aSlideViewHolder.aSlidePreview.setImageResource(R.drawable.slide_unknown);
+            aSlideViewHolder.aSlidePreview.setImageResource(
+                R.drawable.slide_unknown);
         }
 
         aSlideViewHolder.aSlideIndex.setText(buildSlideIndex(aPosition));
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
similarity index 95%
rename from android/sdremote/src/org/libreoffice/impressremote/SlidesPagerAdapter.java
rename to android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
index bb7065f..658e4fa 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/SlidesPagerAdapter.java
@@ -1,4 +1,4 @@
-package org.libreoffice.impressremote;
+package org.libreoffice.impressremote.adapter;
 
 import android.content.Context;
 import android.support.v4.view.PagerAdapter;
@@ -7,6 +7,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 
+import org.libreoffice.impressremote.R;
 import org.libreoffice.impressremote.communication.SlideShow;
 
 public class SlidesPagerAdapter extends PagerAdapter {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
index 7828197..a95573b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
@@ -22,7 +22,7 @@ import android.content.IntentFilter;
 import android.os.Handler;
 import android.support.v4.content.LocalBroadcastManager;
 
-import org.libreoffice.impressremote.Intents;
+import org.libreoffice.impressremote.util.Intents;
 import org.libreoffice.impressremote.communication.Server.Protocol;
 
 public class BluetoothServersFinder extends BroadcastReceiver implements ServersFinder, Runnable {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index 3bb00c5..3e92091 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -17,7 +17,7 @@ import android.os.Binder;
 import android.os.IBinder;
 import android.support.v4.content.LocalBroadcastManager;
 
-import org.libreoffice.impressremote.Intents;
+import org.libreoffice.impressremote.util.Intents;
 
 public class CommunicationService extends Service implements Runnable, MessagesListener {
     public static enum State {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java b/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
index e6550fb..9ab6646 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/PairingProvider.java
@@ -4,7 +4,7 @@ import android.bluetooth.BluetoothAdapter;
 import android.content.Context;
 import android.os.Build;
 
-import org.libreoffice.impressremote.Preferences;
+import org.libreoffice.impressremote.util.Preferences;
 
 public final class PairingProvider {
     private Context mContext;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
index d9363d5..7f20943 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServersManager.java
@@ -17,7 +17,7 @@ import java.util.Set;
 
 import android.content.Context;
 
-import org.libreoffice.impressremote.Preferences;
+import org.libreoffice.impressremote.util.Preferences;
 
 public class ServersManager {
     private final Context mContext;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
index ef8f607..ac0b9f1 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
@@ -29,7 +29,7 @@ import android.content.Intent;
 import android.support.v4.content.LocalBroadcastManager;
 import android.text.TextUtils;
 
-import org.libreoffice.impressremote.Intents;
+import org.libreoffice.impressremote.util.Intents;
 
 public class TcpServersFinder implements ServersFinder, Runnable {
     private static final int SEARCH_DELAY_IN_SECONDS = 10;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
similarity index 98%
rename from android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
rename to android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
index a9a52a1..0f1c89e 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputerConnectionFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.fragment;
 
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
@@ -29,6 +29,8 @@ import com.actionbarsherlock.app.SherlockFragment;
 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuInflater;
 import com.actionbarsherlock.view.MenuItem;
+import org.libreoffice.impressremote.util.Intents;
+import org.libreoffice.impressremote.R;
 import org.libreoffice.impressremote.communication.CommunicationService;
 import org.libreoffice.impressremote.communication.Server;
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
similarity index 97%
rename from android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java
rename to android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
index 20a289a..084e27c 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputersFragment.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.fragment;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -27,8 +27,10 @@ import android.widget.AdapterView;
 import android.widget.ListView;
 
 import com.actionbarsherlock.app.SherlockListFragment;
-import com.actionbarsherlock.internal.view.menu.ActionMenu;
 import com.actionbarsherlock.view.MenuItem;
+import org.libreoffice.impressremote.adapter.ComputersAdapter;
+import org.libreoffice.impressremote.util.Intents;
+import org.libreoffice.impressremote.R;
 import org.libreoffice.impressremote.communication.CommunicationService;
 import org.libreoffice.impressremote.communication.Server;
 
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesGridFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java
similarity index 96%
rename from android/sdremote/src/org/libreoffice/impressremote/SlidesGridFragment.java
rename to android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java
index b16b509..6c0fe87 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SlidesGridFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesGridFragment.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.fragment;
 
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
@@ -24,6 +24,9 @@ import android.widget.AdapterView;
 import android.widget.GridView;
 
 import com.actionbarsherlock.app.SherlockFragment;
+import org.libreoffice.impressremote.util.Intents;
+import org.libreoffice.impressremote.R;
+import org.libreoffice.impressremote.adapter.SlidesGridAdapter;
 import org.libreoffice.impressremote.communication.CommunicationService;
 
 public class SlidesGridFragment extends SherlockFragment implements ServiceConnection, AdapterView.OnItemClickListener {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java
similarity index 96%
rename from android/sdremote/src/org/libreoffice/impressremote/SlidesPagerFragment.java
rename to android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java
index fd1ea3c..c3ebb2c 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SlidesPagerFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/SlidesPagerFragment.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.fragment;
 
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
@@ -24,6 +24,9 @@ import android.view.View;
 import android.view.ViewGroup;
 
 import com.actionbarsherlock.app.SherlockFragment;
+import org.libreoffice.impressremote.util.Intents;
+import org.libreoffice.impressremote.R;
+import org.libreoffice.impressremote.adapter.SlidesPagerAdapter;
 import org.libreoffice.impressremote.communication.CommunicationService;
 
 public class SlidesPagerFragment extends SherlockFragment implements ServiceConnection, ViewPager.OnPageChangeListener {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/ActionBarTabListener.java b/android/sdremote/src/org/libreoffice/impressremote/util/ActionBarTabListener.java
similarity index 96%
rename from android/sdremote/src/org/libreoffice/impressremote/ActionBarTabListener.java
rename to android/sdremote/src/org/libreoffice/impressremote/util/ActionBarTabListener.java
index 66e15b9..e21911a 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/ActionBarTabListener.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/ActionBarTabListener.java
@@ -6,7 +6,7 @@
  * 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;
+package org.libreoffice.impressremote.util;
 
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentTransaction;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/Intents.java b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
similarity index 93%
rename from android/sdremote/src/org/libreoffice/impressremote/Intents.java
rename to android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
index e517c2d..e834968 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/Intents.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java
@@ -6,11 +6,15 @@
  * 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;
+package org.libreoffice.impressremote.util;
 
 import android.content.Context;
 import android.content.Intent;
 
+import org.libreoffice.impressremote.activity.ComputerConnectionActivity;
+import org.libreoffice.impressremote.activity.ComputerCreationActivity;
+import org.libreoffice.impressremote.activity.LicensesActivity;
+import org.libreoffice.impressremote.activity.SlideShowActivity;
 import org.libreoffice.impressremote.communication.Server;
 
 public final class Intents {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/Preferences.java b/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
similarity index 97%
rename from android/sdremote/src/org/libreoffice/impressremote/Preferences.java
rename to android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
index 937d706..b23e3b6 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/Preferences.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
@@ -6,7 +6,7 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list