android/sdremote/AndroidManifest.xml | 6 ++++-- android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java | 8 ++++++++ android/sdremote/src/org/libreoffice/impressremote/communication/Client.java | 9 +++++++++ android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java | 4 ++++ android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java | 1 + 5 files changed, 26 insertions(+), 2 deletions(-)
New commits: commit 9f8cd15be96c74428296534061f1103ae392164c Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Mon Sep 17 10:15:44 2012 +0200 Add icons + device name display to pairing activity. Change-Id: If27119e3e62bac8046fcc33cb12767b116bcc991 diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml index 7ccc1f0..613e7d9 100644 --- a/android/sdremote/AndroidManifest.xml +++ b/android/sdremote/AndroidManifest.xml @@ -26,12 +26,14 @@ <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> + <activity + android:name=".PairingActivity" + android:icon="@drawable/actionbar_icon_computer" > + </activity> <service android:name=".communication.CommunicationService" > </service> - <activity android:name=".PairingActivity" > - </activity> <activity android:name=".StartPresentationActivity" > </activity> <activity diff --git a/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java b/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java index cb65c5c..495aad4 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java @@ -44,6 +44,8 @@ public class PairingActivity extends SherlockActivity { LocalBroadcastManager.getInstance(this).registerReceiver(mListener, aFilter); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } @Override @@ -69,6 +71,8 @@ public class PairingActivity extends SherlockActivity { if (mCommunicationService.getState() == State.CONNECTING) { mPinText.setText(mCommunicationService.getPairingPin()); + getSupportActionBar().setTitle( + mCommunicationService.getPairingDeviceName()); } } @@ -91,6 +95,10 @@ public class PairingActivity extends SherlockActivity { String aPin = aIntent.getStringExtra("PIN"); mPinText.setText(aPin); + if (mCommunicationService != null) + getSupportActionBar().setTitle( + mCommunicationService + .getPairingDeviceName()); // refreshLists(); } else if (aIntent.getAction().equals( CommunicationService.MSG_PAIRING_SUCCESSFUL)) { diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java b/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java index 549d9cc..148da4a 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/Client.java @@ -33,6 +33,7 @@ public abstract class Client { protected BufferedReader mReader; protected OutputStream mOutputStream; protected String mPin = ""; + protected String mName = ""; private static Client latestInstance = null; @@ -108,6 +109,14 @@ public abstract class Client { } } + public static String getName() { + if (latestInstance != null) { + return latestInstance.mName; + } else { + return ""; + } + } + /** * Send a valid command to the Server. */ diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java index 8a42f70..982dc7a 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java @@ -59,6 +59,10 @@ public class CommunicationService extends Service implements Runnable { return Client.getPin(); } + public String getPairingDeviceName() { + return Client.getName(); + } + private State mStateDesired = State.DISCONNECTED; private Server mServerDesired = null; diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java b/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java index 91b169d..c939613 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java @@ -35,6 +35,7 @@ public class NetworkClient extends Client { CommunicationService aCommunicationService) { super(aServer, aCommunicationService); try { + mName = aServer.getName(); mSocket = new Socket(aServer.getAddress(), PORT); mInputStream = mSocket.getInputStream(); mReader = new BufferedReader(new InputStreamReader(mInputStream, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits