[Libreoffice-commits] core.git: 8 commits - android/sdremote
Artur Dryomov
artur.dryomov at gmail.com
Tue Sep 3 02:23:22 PDT 2013
android/sdremote/res/drawable-hdpi/ic_launcher.png |binary
android/sdremote/res/drawable-mdpi/ic_launcher.png |binary
android/sdremote/res/drawable-xhdpi/ic_launcher.png |binary
android/sdremote/res/drawable-xxhdpi/ic_launcher.png |binary
android/sdremote/res/values/strings.xml | 2
android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java | 15 +
android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java | 20 ++
android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java | 4
android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java | 2
android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java | 2
android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java | 85 ++++++++--
android/sdremote/src/org/libreoffice/impressremote/fragment/TimerEditingDialog.java | 52 +-----
android/sdremote/src/org/libreoffice/impressremote/fragment/TimerSettingDialog.java | 5
android/sdremote/src/org/libreoffice/impressremote/util/Fragments.java | 23 ++
android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java | 7
android/sdremote/src/org/libreoffice/impressremote/util/SavedStates.java | 16 +
16 files changed, 166 insertions(+), 67 deletions(-)
New commits:
commit d07bb04d2f5dd138ece932c887a514e3d4eb1764
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Tue Sep 3 02:40:22 2013 +0300
Remove cancel buttons from timer dialogs.
The cancel button just duplicates back button on Android devices.
Change-Id: Ic0647e4e74d2009b21807467acb63184847a1e25
diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml
index d6d4f3b..0aaa46f 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -24,7 +24,7 @@
<string name="button_cancel">Cancel</string>
<string name="button_save">Save</string>
<string name="button_start">Start</string>
- <string name="button_reset">Reset</string>
+ <string name="button_remove">Remove</string>
<string name="message_impress_pin_validation">Go to âSlide Show â Impress Remoteâ in LibreOffice Impress and enter the code.</string>
<string name="message_connection_failed_title">Connection failed</string>
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerEditingDialog.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerEditingDialog.java
index ed7c853..dd09f4b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerEditingDialog.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerEditingDialog.java
@@ -16,14 +16,13 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
-import android.view.View;
import android.widget.TimePicker;
import com.actionbarsherlock.app.SherlockDialogFragment;
import org.libreoffice.impressremote.R;
import org.libreoffice.impressremote.util.Intents;
-public class TimerEditingDialog extends SherlockDialogFragment implements TimePickerDialog.OnTimeSetListener, DialogInterface.OnClickListener, DialogInterface.OnShowListener, View.OnClickListener {
+public class TimerEditingDialog extends SherlockDialogFragment implements TimePickerDialog.OnTimeSetListener, DialogInterface.OnClickListener {
public static final String TAG = "TIMER_EDITING";
private static final boolean IS_24_HOUR_VIEW = true;
@@ -61,10 +60,7 @@ public class TimerEditingDialog extends SherlockDialogFragment implements TimePi
aDialog.setTitle(R.string.title_timer);
aDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.button_save), this);
- aDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.button_cancel), this);
- aDialog.setButton(DialogInterface.BUTTON_NEUTRAL, getString(R.string.button_reset), this);
-
- aDialog.setOnShowListener(this);
+ aDialog.setButton(DialogInterface.BUTTON_NEUTRAL, getString(R.string.button_remove), this);
return aDialog;
}
@@ -90,27 +86,19 @@ public class TimerEditingDialog extends SherlockDialogFragment implements TimePi
public void onClick(DialogInterface aDialogInterface, int aButtonId) {
getTimePickerDialog().onClick(aDialogInterface, aButtonId);
- switch (aButtonId) {
- case DialogInterface.BUTTON_NEGATIVE:
- resumeTimer();
- break;
-
- case DialogInterface.BUTTON_POSITIVE:
- changeTimer();
- break;
-
- default:
- break;
+ if (aButtonId == DialogInterface.BUTTON_NEUTRAL) {
+ resetTime();
}
+
+ changeTimer();
}
private TimePickerDialog getTimePickerDialog() {
return (TimePickerDialog) getDialog();
}
- private void resumeTimer() {
- Intent aIntent = Intents.buildTimerResumedIntent();
- LocalBroadcastManager.getInstance(getActivity()).sendBroadcast(aIntent);
+ private void resetTime() {
+ mMinutes = 0;
}
private void changeTimer() {
@@ -119,27 +107,15 @@ public class TimerEditingDialog extends SherlockDialogFragment implements TimePi
}
@Override
- public void onShow(DialogInterface dialogInterface) {
- setUpNeutralButton();
- }
-
- private void setUpNeutralButton() {
- TimePickerDialog aDialog = (TimePickerDialog) getDialog();
+ public void onCancel(DialogInterface dialog) {
+ super.onCancel(dialog);
- aDialog.getButton(DialogInterface.BUTTON_NEUTRAL).setOnClickListener(this);
+ resumeTimer();
}
- @Override
- public void onClick(View aView) {
- // Requires the additional listener to not close the dialog.
-
- resetTime();
- }
-
- private void resetTime() {
- TimePickerDialog aDialog = (TimePickerDialog) getDialog();
-
- aDialog.updateTime(0, 0);
+ private void resumeTimer() {
+ Intent aIntent = Intents.buildTimerResumedIntent();
+ LocalBroadcastManager.getInstance(getActivity()).sendBroadcast(aIntent);
}
}
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerSettingDialog.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerSettingDialog.java
index 5375de8..294a370 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerSettingDialog.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/TimerSettingDialog.java
@@ -44,7 +44,6 @@ public class TimerSettingDialog extends SherlockDialogFragment implements TimePi
aDialog.setTitle(R.string.title_timer);
aDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.button_start), this);
- aDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.button_cancel), this);
return aDialog;
}
@@ -62,10 +61,6 @@ public class TimerSettingDialog extends SherlockDialogFragment implements TimePi
public void onClick(DialogInterface aDialogInterface, int aButtonId) {
getTimePickerDialog().onClick(aDialogInterface, aButtonId);
- if (aButtonId != DialogInterface.BUTTON_POSITIVE) {
- return;
- }
-
startTimer();
}
commit 20eb1462b69d5d3d3ea04c14cdcf21fdbf205b3d
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Sun Sep 1 21:10:14 2013 +0300
Change saving computer connnection fragment state.
* Do it more proper way.
* Do not reconnect on orientation changes without user actions.
Change-Id: Ib5dcb7ef05096b9ee2899d3508961fc52f706729
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
index 2779370..acd9e60 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
@@ -29,10 +29,12 @@ 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.Fragments;
import org.libreoffice.impressremote.util.Intents;
import org.libreoffice.impressremote.R;
import org.libreoffice.impressremote.communication.CommunicationService;
import org.libreoffice.impressremote.communication.Server;
+import org.libreoffice.impressremote.util.SavedStates;
public class ComputerConnectionFragment extends SherlockFragment implements ServiceConnection {
private Server mComputer;
@@ -51,7 +53,7 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
private static Bundle buildArguments(Server aComputer) {
Bundle aArguments = new Bundle();
- aArguments.putParcelable("COMPUTER", aComputer);
+ aArguments.putParcelable(Fragments.Arguments.COMPUTER, aComputer);
return aArguments;
}
@@ -60,7 +62,7 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
public void onCreate(Bundle aSavedInstance) {
super.onCreate(aSavedInstance);
- mComputer = getArguments().getParcelable("COMPUTER");
+ mComputer = getArguments().getParcelable(Fragments.Arguments.COMPUTER);
setUpActionBarMenu();
}
@@ -83,10 +85,12 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
}
loadLayout(aSavedInstanceState);
+ loadPin(aSavedInstanceState);
+ loadErrorMessage(aSavedInstanceState);
}
private void loadLayout(Bundle aSavedInstanceState) {
- int aLayoutIndex = aSavedInstanceState.getInt("LAYOUT");
+ int aLayoutIndex = aSavedInstanceState.getInt(SavedStates.Keys.LAYOUT_INDEX);
getViewAnimator().setDisplayedChild(aLayoutIndex);
}
@@ -95,6 +99,26 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
return (ViewAnimator) getView().findViewById(R.id.view_animator);
}
+ private void loadPin(Bundle aSavedInstanceState) {
+ String aPin = aSavedInstanceState.getString(SavedStates.Keys.PIN);
+
+ getPinTextView().setText(aPin);
+ }
+
+ private TextView getPinTextView() {
+ return (TextView) getView().findViewById(R.id.text_pin);
+ }
+
+ private void loadErrorMessage(Bundle aSavedInstanceState) {
+ String aErrorMessage = aSavedInstanceState.getString(SavedStates.Keys.ERROR_MESSAGE);
+
+ getSecondaryErrorMessageTextView().setText(aErrorMessage);
+ }
+
+ private TextView getSecondaryErrorMessageTextView() {
+ return (TextView) getView().findViewById(R.id.text_secondary_error_message);
+ }
+
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
@@ -120,6 +144,10 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
return;
}
+ if (!isComputerConnectionRequired()) {
+ return;
+ }
+
mCommunicationService.connectTo(mComputer);
}
@@ -127,6 +155,14 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
return mCommunicationService != null;
}
+ private boolean isComputerConnectionRequired() {
+ return getViewAnimator().getDisplayedChild() == getViewAnimator().indexOfChild(getProgressBar());
+ }
+
+ private ProgressBar getProgressBar() {
+ return (ProgressBar) getView().findViewById(R.id.progress_bar);
+ }
+
@Override
public void onServiceDisconnected(ComponentName aComponentName) {
mCommunicationService = null;
@@ -194,19 +230,22 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
}
private void setUpPinValidationInstructions(String aPin) {
- TextView aPinTextView = (TextView) getView().findViewById(R.id.text_pin);
- aPinTextView.setText(aPin);
+ getPinTextView().setText(aPin);
showPinValidationLayout();
}
private void showPinValidationLayout() {
ViewAnimator aViewAnimator = getViewAnimator();
- LinearLayout aValidationLayout = (LinearLayout) getView().findViewById(R.id.layout_pin_validation);
+ LinearLayout aValidationLayout = getPinValidationLayout();
aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aValidationLayout));
}
+ private LinearLayout getPinValidationLayout() {
+ return (LinearLayout) getView().findViewById(R.id.layout_pin_validation);
+ }
+
private void setUpPresentation() {
Intent aIntent = Intents.buildSlideShowIntent(getActivity());
startActivity(aIntent);
@@ -215,7 +254,7 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
}
private void setUpErrorMessage() {
- TextView aSecondaryMessageTextView = (TextView) getView().findViewById(R.id.text_secondary_error_message);
+ TextView aSecondaryMessageTextView = getSecondaryErrorMessageTextView();
aSecondaryMessageTextView.setText(buildSecondaryErrorMessage());
showErrorMessageLayout();
@@ -236,11 +275,15 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
private void showErrorMessageLayout() {
ViewAnimator aViewAnimator = getViewAnimator();
- LinearLayout aMessageLayout = (LinearLayout) getView().findViewById(R.id.layout_error_message);
+ LinearLayout aMessageLayout = getErrorMessageLayout();
aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aMessageLayout));
}
+ private LinearLayout getErrorMessageLayout() {
+ return (LinearLayout) getView().findViewById(R.id.layout_error_message);
+ }
+
private void refreshActionBarMenu() {
getSherlockActivity().supportInvalidateOptionsMenu();
}
@@ -279,7 +322,7 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
private void showProgressBar() {
ViewAnimator aViewAnimator = getViewAnimator();
- ProgressBar aProgressBar = (ProgressBar) getView().findViewById(R.id.progress_bar);
+ ProgressBar aProgressBar = getProgressBar();
aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aProgressBar));
}
@@ -305,12 +348,26 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
super.onSaveInstanceState(aOutState);
saveLayout(aOutState);
+ savePin(aOutState);
+ saveErrorMessage(aOutState);
}
private void saveLayout(Bundle aOutState) {
int aLayoutIndex = getViewAnimator().getDisplayedChild();
- aOutState.putInt("LAYOUT", aLayoutIndex);
+ aOutState.putInt(SavedStates.Keys.LAYOUT_INDEX, aLayoutIndex);
+ }
+
+ private void savePin(Bundle aOutState) {
+ String aPin = getPinTextView().getText().toString();
+
+ aOutState.putString(SavedStates.Keys.PIN, aPin);
+ }
+
+ private void saveErrorMessage(Bundle aOutState) {
+ String aErrorMessage = getSecondaryErrorMessageTextView().getText().toString();
+
+ aOutState.putString(SavedStates.Keys.ERROR_MESSAGE, aErrorMessage);
}
@Override
diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/Fragments.java b/android/sdremote/src/org/libreoffice/impressremote/util/Fragments.java
new file mode 100644
index 0000000..b7dbe6d
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/Fragments.java
@@ -0,0 +1,23 @@
+/* -*- 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;
+
+public final class Fragments {
+ private Fragments() {
+ }
+
+ public static final class Arguments {
+ private Arguments() {
+ }
+
+ public static final String COMPUTER = "COMPUTER";
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/SavedStates.java b/android/sdremote/src/org/libreoffice/impressremote/util/SavedStates.java
new file mode 100644
index 0000000..0b7a1bb
--- /dev/null
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/SavedStates.java
@@ -0,0 +1,16 @@
+package org.libreoffice.impressremote.util;
+
+public final class SavedStates {
+ private SavedStates() {
+ }
+
+ public static final class Keys {
+ private Keys() {
+ }
+
+ public static final String LAYOUT_INDEX = "LAYOUT_INDEX";
+
+ public static final String PIN = "PIN";
+ public static final String ERROR_MESSAGE = "ERROR_MESSAGE";
+ }
+}
commit 7b6720c3f1c4e5407b1fc9151ea09341973e2038
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Sun Sep 1 20:03:10 2013 +0300
Add preferences keys single source.
Should help avoiding type errors.
Change-Id: I5b15d7e21e3adcff0fd1fe11d5a14c121fbd486b
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
index 6249e22..90003ef 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
@@ -145,7 +145,7 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio
}
private int loadTabIndex() {
- return Preferences.getApplicationStatesInstance(this).getInt("saved_tab");
+ return Preferences.getApplicationStatesInstance(this).getInt(Preferences.Keys.SELECTED_COMPUTERS_TAB_INDEX);
}
private void setUpComputersList() {
@@ -211,7 +211,7 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio
private void saveTabIndex() {
int aTabIndex = getSupportActionBar().getSelectedNavigationIndex();
- Preferences.getApplicationStatesInstance(this).setInt("saved_tab", aTabIndex);
+ Preferences.getApplicationStatesInstance(this).setInt(Preferences.Keys.SELECTED_COMPUTERS_TAB_INDEX, aTabIndex);
}
}
diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java b/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
index e39b31a..4b22c29 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/util/Preferences.java
@@ -23,6 +23,13 @@ public final class Preferences {
public static final String APPLICATION_STATES = "application_states";
}
+ public static final class Keys {
+ private Keys() {
+ }
+
+ public static final String SELECTED_COMPUTERS_TAB_INDEX = "selected_computers_tab_index";
+ }
+
private final SharedPreferences mPreferences;
public static Preferences getAuthorizedServersInstance(Context aContext) {
commit b6f6147c9cf835a44a51baa9ea3d78718eb1f297
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Sun Sep 1 19:25:36 2013 +0300
Add saving computer information on keyboard actions.
Change-Id: I84844a004d2d07809f024ed2e84abcbbba80fb99
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
index 5ff79ac..822d6e1 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerCreationActivity.java
@@ -14,23 +14,27 @@ import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Patterns;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
+import android.widget.TextView;
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 {
+public class ComputerCreationActivity extends SherlockFragmentActivity implements View.OnClickListener, TextView.OnEditorActionListener {
@Override
protected void onCreate(Bundle aSavedInstanceState) {
super.onCreate(aSavedInstanceState);
setContentView(R.layout.activity_computer_creation);
setUpActionBar();
+ setUpKeyboard();
}
private void setUpActionBar() {
@@ -85,6 +89,7 @@ public class ComputerCreationActivity extends SherlockFragmentActivity implement
if (!isIpAddressValid(aIpAddress)) {
getIpAddressEdit().setError(getText(R.string.message_ip_address_validation));
+ getIpAddressEdit().requestFocus();
return;
}
@@ -117,6 +122,19 @@ public class ComputerCreationActivity extends SherlockFragmentActivity implement
finish();
}
+
+ private void setUpKeyboard() {
+ getNameEdit().setOnEditorActionListener(this);
+ }
+
+ @Override
+ public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
+ if (actionId == EditorInfo.IME_ACTION_DONE) {
+ saveServer();
+ }
+
+ return false;
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 837d6e5024897391a3b4351608f626d0b952e0da
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Sun Sep 1 18:52:29 2013 +0300
Change search delay from 10 seconds to 5.
Should be better for UI interaction feelings.
Change-Id: I68322ed71878ec520676d68d821f64041476b800
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
index 2152cef..605e0a9 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothServersFinder.java
@@ -27,7 +27,7 @@ import org.libreoffice.impressremote.util.BluetoothOperator;
import org.libreoffice.impressremote.util.Intents;
class BluetoothServersFinder extends BroadcastReceiver implements ServersFinder, Runnable {
- private static final int SEARCH_DELAY_IN_SECONDS = 10;
+ private static final int SEARCH_DELAY_IN_SECONDS = 5;
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 f3280eb..b31e4f6 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
@@ -32,7 +32,7 @@ import android.text.TextUtils;
import org.libreoffice.impressremote.util.Intents;
class TcpServersFinder implements ServersFinder, Runnable {
- private static final int SEARCH_DELAY_IN_SECONDS = 10;
+ private static final int SEARCH_DELAY_IN_SECONDS = 5;
private static final int BLOCKING_TIMEOUT_IN_SECONDS = 10;
private static final int SEARCH_RESULT_BUFFER_SIZE = 1024;
commit 920370f7d89a6f310c3e98457ed844425de09392
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Sun Sep 1 18:39:47 2013 +0300
Add computer name as a subtitle to the connection activity.
Change-Id: I3df33faef2004107cd2a806e536efb63517a18c7
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java
index 377f596..7a5281d 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputerConnectionActivity.java
@@ -24,6 +24,7 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity {
super.onCreate(savedInstanceState);
setUpHomeButton();
+ setUpTitle();
setUpFragment();
}
@@ -31,17 +32,23 @@ public class ComputerConnectionActivity extends SherlockFragmentActivity {
getSupportActionBar().setHomeButtonEnabled(true);
}
- private void setUpFragment() {
- Server aComputer = extractReceivedComputer();
- Fragment aFragment = ComputerConnectionFragment.newInstance(aComputer);
+ private void setUpTitle() {
+ String aComputerName = extractReceivedComputer().getName();
- FragmentOperator.addFragment(this, aFragment);
+ getSupportActionBar().setSubtitle(aComputerName);
}
private Server extractReceivedComputer() {
return getIntent().getParcelableExtra(Intents.Extras.SERVER);
}
+ private void setUpFragment() {
+ Server aComputer = extractReceivedComputer();
+ Fragment aFragment = ComputerConnectionFragment.newInstance(aComputer);
+
+ FragmentOperator.addFragment(this, aFragment);
+ }
+
@Override
public boolean onOptionsItemSelected(MenuItem aMenuItem) {
switch (aMenuItem.getItemId()) {
commit cfe24b09a5684909b0a84dcad47e14b7d5de8409
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Sun Sep 1 18:32:50 2013 +0300
Change time of intents filter reginstration.
A Bluetooth pairing dialog somehow sets the connection fragment on pause
so old registration would cause loosing messages from service.
Change-Id: Ie4f6bef96b89a0c2aa86ec00da478831b572e191
diff --git a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
index 05172b5..2779370 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/fragment/ComputerConnectionFragment.java
@@ -133,8 +133,8 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
}
@Override
- public void onResume() {
- super.onResume();
+ public void onStart() {
+ super.onStart();
registerIntentsReceiver();
}
@@ -285,8 +285,8 @@ public class ComputerConnectionFragment extends SherlockFragment implements Serv
}
@Override
- public void onPause() {
- super.onPause();
+ public void onStop() {
+ super.onStop();
unregisterIntentsReceiver();
}
commit ff0ab3bd21ce6fb9ed43b37535878f8ef1d76890
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date: Mon Aug 19 22:13:26 2013 +0200
Update the launcher icon.
Change-Id: I63808fc96fd235fdb483f95b75d3a13d4402c867
diff --git a/android/sdremote/res/drawable-hdpi/ic_launcher.png b/android/sdremote/res/drawable-hdpi/ic_launcher.png
index c1c8f58..9ebe318 100644
Binary files a/android/sdremote/res/drawable-hdpi/ic_launcher.png and b/android/sdremote/res/drawable-hdpi/ic_launcher.png differ
diff --git a/android/sdremote/res/drawable-mdpi/ic_launcher.png b/android/sdremote/res/drawable-mdpi/ic_launcher.png
index f2440d4..2620d77 100644
Binary files a/android/sdremote/res/drawable-mdpi/ic_launcher.png and b/android/sdremote/res/drawable-mdpi/ic_launcher.png differ
diff --git a/android/sdremote/res/drawable-xhdpi/ic_launcher.png b/android/sdremote/res/drawable-xhdpi/ic_launcher.png
index 3de2dcc..3109fa0 100644
Binary files a/android/sdremote/res/drawable-xhdpi/ic_launcher.png and b/android/sdremote/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/android/sdremote/res/drawable-xxhdpi/ic_launcher.png b/android/sdremote/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..5e05e32
Binary files /dev/null and b/android/sdremote/res/drawable-xxhdpi/ic_launcher.png differ
More information about the Libreoffice-commits
mailing list