[Libreoffice-commits] .: android/abs-lib android/sdremote

Andrzej J.R. Hunt ajrhunt at kemper.freedesktop.org
Wed Aug 15 08:39:45 PDT 2012


 android/abs-lib/project.properties                                       |    2 
 android/sdremote/.classpath                                              |    1 
 android/sdremote/project.properties                                      |    1 
 android/sdremote/res/layout/activity_settings.xml                        |    6 -
 android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java  |    5 -
 android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java |   43 +++++-----
 android/sdremote/src/org/libreoffice/impressremote/SettingsFragment.java |   13 ---
 7 files changed, 29 insertions(+), 42 deletions(-)

New commits:
commit e25d4e7d2b7b65535d3ea3707ad8a9d5ec7ed371
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Wed Aug 15 17:24:48 2012 +0200

    Linked ABS. Migrated Settings Activity to v4 + ABS.
    
    Change-Id: I93195124aafd8472671a2cf4edddd82c37789016

diff --git a/android/abs-lib/project.properties b/android/abs-lib/project.properties
index 5ca7d62..f28bc83 100755
--- a/android/abs-lib/project.properties
+++ b/android/abs-lib/project.properties
@@ -9,4 +9,4 @@
 
 android.library=true
 # Project target.
-target=android-14
+target=android-15
diff --git a/android/sdremote/.classpath b/android/sdremote/.classpath
index 3f9691c..85fa731 100644
--- a/android/sdremote/.classpath
+++ b/android/sdremote/.classpath
@@ -4,5 +4,6 @@
 	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="gen"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/abs-lib"/>
 	<classpathentry kind="output" path="bin/classes"/>
 </classpath>
diff --git a/android/sdremote/project.properties b/android/sdremote/project.properties
index 0840b4a..5b5b60a 100644
--- a/android/sdremote/project.properties
+++ b/android/sdremote/project.properties
@@ -12,3 +12,4 @@
 
 # Project target.
 target=android-15
+android.library.reference.1=../abs-lib/
diff --git a/android/sdremote/res/layout/activity_settings.xml b/android/sdremote/res/layout/activity_settings.xml
deleted file mode 100644
index be5e645..0000000
--- a/android/sdremote/res/layout/activity_settings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<fragment xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/settings_fragment"
-    android:name="org.libreoffice.impressremote.SettingsFragment"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" />
diff --git a/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java b/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java
index 414bcd4..e01a909 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java
@@ -13,7 +13,6 @@ import java.text.MessageFormat;
 import org.libreoffice.impressremote.communication.CommunicationService;
 import org.libreoffice.impressremote.communication.CommunicationService.State;
 
-import android.app.Activity;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
@@ -25,7 +24,9 @@ import android.os.IBinder;
 import android.support.v4.content.LocalBroadcastManager;
 import android.widget.TextView;
 
-public class PairingActivity extends Activity {
+import com.actionbarsherlock.app.SherlockActivity;
+
+public class PairingActivity extends SherlockActivity {
     private CommunicationService mCommunicationService;
     private boolean mIsBound = false;
     private TextView mPinText;
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
index d0119a0..16c456e 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java
@@ -1,27 +1,30 @@
 package org.libreoffice.impressremote;
 
-import android.app.Activity;
 import android.os.Bundle;
-import android.view.MenuItem;
 
-public class SettingsActivity extends Activity {
+import com.actionbarsherlock.app.SherlockPreferenceActivity;
 
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		// TODO Auto-generated method stub
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.activity_settings);
-		getActionBar().setDisplayHomeAsUpEnabled(true);
-	}
+public class SettingsActivity extends SherlockPreferenceActivity {
 
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		switch (item.getItemId()) {
-		case android.R.id.home:
-			finish();
-			return true;
-		default:
-			return super.onOptionsItemSelected(item);
-		}
-	}
+    // We use addPreferencesFromResource as we need sdk-9 compatibility
+    @SuppressWarnings("deprecation")
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        // TODO Auto-generated method stub
+        super.onCreate(savedInstanceState);
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        addPreferencesFromResource(R.xml.preferences);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(
+                    com.actionbarsherlock.view.MenuItem item) {
+        switch (item.getItemId()) {
+        case android.R.id.home:
+            finish();
+            return true;
+        default:
+            return super.onOptionsItemSelected(item);
+        }
+    }
 }
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SettingsFragment.java b/android/sdremote/src/org/libreoffice/impressremote/SettingsFragment.java
deleted file mode 100644
index b6f02f6..0000000
--- a/android/sdremote/src/org/libreoffice/impressremote/SettingsFragment.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.libreoffice.impressremote;
-
-import android.os.Bundle;
-import android.preference.PreferenceFragment;
-
-public class SettingsFragment extends PreferenceFragment {
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-
-		addPreferencesFromResource(R.xml.preferences);
-	}
-}


More information about the Libreoffice-commits mailing list