summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-15 17:24:48 +0200
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-15 17:39:34 +0200
commite25d4e7d2b7b65535d3ea3707ad8a9d5ec7ed371 (patch)
treeb3a5210d0e81e94e15926f6249571fea48ea16eb /android
parentRelated fdo#44989: Bin (Un)LockRegion functions (diff)
downloadcore-e25d4e7d2b7b65535d3ea3707ad8a9d5ec7ed371.tar.gz
core-e25d4e7d2b7b65535d3ea3707ad8a9d5ec7ed371.zip
Linked ABS. Migrated Settings Activity to v4 + ABS.
Change-Id: I93195124aafd8472671a2cf4edddd82c37789016
Diffstat (limited to 'android')
-rwxr-xr-xandroid/abs-lib/project.properties2
-rw-r--r--android/sdremote/.classpath1
-rw-r--r--android/sdremote/project.properties1
-rw-r--r--android/sdremote/res/layout/activity_settings.xml6
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/PairingActivity.java5
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/SettingsActivity.java43
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/SettingsFragment.java13
7 files changed, 29 insertions, 42 deletions
diff --git a/android/abs-lib/project.properties b/android/abs-lib/project.properties
index 5ca7d6247a65..f28bc833e15e 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 3f9691c5dda2..85fa7318d670 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 0840b4a05983..5b5b60a0256b 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 be5e64506c8e..000000000000
--- 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 414bcd479f0d..e01a9093e46d 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 d0119a0d874f..16c456e63d00 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 b6f02f6dcc9d..000000000000
--- 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);
- }
-}